35
3/17/05 LCSim Workshop IV Jeremy McCormick, SLAC 1 Jeremy McCormick, Ron Cassell for SLAC Simulations Group LC Detector Simulation with SLIC and LCDD

LC Detector Simulation with SLIC and LCDD

  • Upload
    kaipo

  • View
    53

  • Download
    0

Embed Size (px)

DESCRIPTION

LC Detector Simulation with SLIC and LCDD. Jeremy McCormick, Ron Cassell for SLAC Simulations Group. Geometry Requirements Framework Diagram and Outline GDML/LCDD geometry system LCDD XML format examples Compact XML format example LCDD Visualizations SLIC simulations package - PowerPoint PPT Presentation

Citation preview

Page 1: LC Detector Simulation with SLIC and LCDD

3/17/05 LCSim Workshop IVJeremy McCormick, SLAC

1

Jeremy McCormick, Ron Cassell

for SLAC Simulations Group

LC Detector Simulation with SLIC and LCDD

Page 2: LC Detector Simulation with SLIC and LCDD

3/17/05 LCSim Workshop IVJeremy McCormick, SLAC

2

Talk Overview1. Geometry Requirements

2. Framework Diagram and Outline

3. GDML/LCDD geometry system

4. LCDD XML format examples

5. Compact XML format example

6. LCDD Visualizations

7. SLIC simulations package

8. Diagnostic Histograms

9. Installation

10. Plans

11. Resources

Page 3: LC Detector Simulation with SLIC and LCDD

3/17/05 LCSim Workshop IVJeremy McCormick, SLAC

3

Geometry System Requirements• represent all current detector designs including testbeams and full detectors

• ideal format

• human-readable and editable

• machine friendly

• encapsulate the core Geant4 geometry classes

• solids, materials, logical volumes, physical volumes

• include other essential Geant4 classes for DD

• regions, sensitive detectors, visualization, fields

• volume readout

• unique volume identification using bit-packed IDs

• virtual volume segmentation, i.e. “cells”, for calorimeters

• avoid C++ “hard coding” of geometries or DD formats with only partial Geant4 support

• package a separate geometry subsystem from the simulator with minimal dependencies

• System should be easy to use, yet flexible and powerful.

Page 4: LC Detector Simulation with SLIC and LCDD

3/17/05 LCSim Workshop IVJeremy McCormick, SLAC

4

LCD Simulations Framework Diagram

LCDD SLIC LCIO

GDML

LCIO Events

Geant4

Stdhep Events

LCDD XML

reads reads reads / writes

LCPhys

Xerces CLHEP

GeomConverter

writes

CompactXML

uses

reads

org.lcsim

reads

Not all connections shown.

Page 5: LC Detector Simulation with SLIC and LCDD

3/17/05 LCSim Workshop IVJeremy McCormick, SLAC

5

PackagesPackage Version DescriptionCLHEP 1.8.x or 1.9.x HEP class libraries

Geant4 7.x HEP simulation toolkit

LCPhys CVS head Geant4 physics list for ILC

GDML 2.1 RC (CVS head) XML binding to core Geant4 geometry classes

Xerces 2.6.0 XML Parser

LCIO 1.4 (CVS head) Linear Collider I/O Toolkit

LCDD CVS head XML extensions to GDML for DD

SLIC CVS head Simulator Command & Control, “Hub” Application

Page 6: LC Detector Simulation with SLIC and LCDD

3/17/05 LCSim Workshop IVJeremy McCormick, SLAC

6

Benefits of an XML-Based System• human readable and editable: comparable to HTML and other markups

• quick development cycle

• no recompilation for geometry changes

• constant values easily “tweaked”

• validating parser quickly identifies errors

• highly structured: enforces consistency across disparate data sources

• portable: easy to import/export/exchange

• transformable: map to/from databases, flat files, Excel spreadsheets, etc.

• high quality, standardized tools in C++ and Java

• self-descriptive with schemas (XSD)

• natural representation of structured hierarchies, i.e. detector geometries

• Internet access not required to utilize

• editing/display tools relatively easy to implement

Page 7: LC Detector Simulation with SLIC and LCDD

3/17/05 LCSim Workshop IVJeremy McCormick, SLAC

7

GDML• C++ binding to Geant4

• constants

• materials

• solids

• structure: logical and physical volumes

• XML technology

• SAX parsing: fast! parsing/loading of 15k line LCDD file in ~1.5 seconds

• XML Schema (XSD): extensable types

• currently supported by…

• Geant4: primary binding

• GraXML Viewer : no constants, only doubles

• ROOT : VMC, import/export

• org.lcsim reco framework : geometry converter from compact to LCDD format

• LCDD : reads

• Momo : writes

Page 8: LC Detector Simulation with SLIC and LCDD

3/17/05 LCSim Workshop IVJeremy McCormick, SLAC

8

LCDD• extension of GDML package to complete Geant4 binding for DD: “GDML++”

• GDML volume element has additional elements but no additional changes to format except this.

• LCDDParser / LCDDDetectorConstruction: usable in any Geant4 simulator

• additional elements

• header / meta info

• ID dictionary

• physical volume identifiers

• mapping of individual volume IDs and segmentations to full, 32 / 64-bit IDs

• sensitive detectors

• calorimeter / tracker types

• virtual segmentation of volumes for readout

• reference to an IDing scheme

• regions

• visualization attributes

• fields

• embedded GDML element for geometry description

Page 9: LC Detector Simulation with SLIC and LCDD

3/17/05 LCSim Workshop IVJeremy McCormick, SLAC

9

LCDD XML Structure<lcdd>

<header> … </header>

<iddict> … </iddict>

<sensitive_detectors> … </sensitive_detectors>

<regions> … </regions>

<display> … </display>

<gdml> … </gdml>

<fields> … </fields>

</lcdd>

Page 10: LC Detector Simulation with SLIC and LCDD

3/17/05 LCSim Workshop IVJeremy McCormick, SLAC

10

Sensitive Detectors

<sensitive_detectors> <calorimeter name="EcalBarrSD" hits_collection="EcalBarrHits" ecut="0.0" eunit="MeV" verbose="0"> <idspecref ref="CalId" /> <projective_cylinder ntheta="840" nphi="1680" /> </calorimeter> <tracker name="VtxBarrSD" hits_collection="VtxBarrHits" ecut="0.0" eunit="MeV" verbose="0"> <idspecref ref="TrkId" /> </tracker></sensitive_detectors>

Example• Sensitive detectors can be of type calorimeter or tracker, which determines type of LCIO hit.

• hits_collection is name of LCIO collection.

• cut on energy with ecut

• set verbose level

• idspecref for the ID scheme (none is okay)

• Specific type of segmentation, e.g. projective_cylinder, divides the associated volume into virtual cells using ntheta and nphi as parameters.

Page 11: LC Detector Simulation with SLIC and LCDD

3/17/05 LCSim Workshop IVJeremy McCormick, SLAC

11

ID Dictionary

<iddict> <idspec name="CalId" length="64">

<!-- lowest level vol id --> <idfield label="layer" start="0" length="7" signed="false" />

<!-- subdet level ids --> <idfield label="sys" start="7" length="3" signed="false" /> <!-- more ids here --></iddict>

Example• IDs for calorimeter and tracker hits contained in iddict

• idfield defines a single, logical ID such as a layer number.

• label can reference a named physvolid or a segmentation field

• signed or unsigned

• creates a vector which is packed into the LCIO hit

• named idspec referenced in the sensitive_detector element to assign an ID scheme to a specific SD

Page 12: LC Detector Simulation with SLIC and LCDD

3/17/05 LCSim Workshop IVJeremy McCormick, SLAC

12

RegionsExample

<regions> <region name="EcalRegion" store_secondaries="false" cut="1.0" lunit="mm" threshold="0.0" eunit="MeV" /> <region name="TrackingRegion" store_secondaries="true" cut="10.0" lunit="mm" threshold="1.0" eunit="MeV" /></regions>

• corresponds to G4Region and G4UserRegionInformation

• set whether secondaries are stored with store_secondaries

• set Geant4 range cut using cut

• set energy threshhold for secondary storage with threshhold

• provides the concept of a tracking region, which is crucial to our method for creating and processing the MCParticles

Page 13: LC Detector Simulation with SLIC and LCDD

3/17/05 LCSim Workshop IVJeremy McCormick, SLAC

13

VisualizationExample

<display> <vis_attributes name="EcalVis" visible="true" show_daughters="true" line_style="unbroken" drawing_style="wireframe"> <color R="0.0" G="1.0" B="1.0" alpha="1.0" /> </vis_attributes></display>

• vis_attributes element implements all settings in class G4VisAttributes.

• attached to a logical volume via a reference

• settable

• visibility

• daughters visible

• line style

• wireframe or solid

• color

Page 14: LC Detector Simulation with SLIC and LCDD

3/17/05 LCSim Workshop IVJeremy McCormick, SLAC

14

FieldsExample

<fields> <solenoid name="GlobalSolenoid" inner_field="solenoid_inner_field" outer_field="solenoid_outer_field" zmin="solenoid_zmin" zmax="solenoid_zmax" inner_radius="solenoid_rmin" outer_radius="solenoid_rmax" funit="tesla" lunit="mm"/> <global_field> <fieldref ref="GlobalSolenoid" /> </global_field></fields>

• solenoid implements the virtual type field

• similar to LCDG4’s handling of fields

• global_field defines the top level field handler for the application using a fieldref.

• can use constants from gdml’s define block

• plan to allow fields maps

Page 15: LC Detector Simulation with SLIC and LCDD

3/17/05 LCSim Workshop IVJeremy McCormick, SLAC

15

Extended GDML volume ElementExample

<volume name="ecal_barr"> <materialref ref="Air" /> <solidref ref="ecal_barr_tube" />

<physvol> <volumeref ref="ecal_barr_lay0" /> <positionref ref="identity_pos" /> <rotationref ref="identity_rot" /> <physvolid name=“layer” value=“0” </physvol>

<sdref ref=“EcalSD” /> <regionref ref="EcalRegion" /> <vis_attributesref ref="EcalVis"/></volume>

• “It all comes together here.”

• Red elements extend the GDML volume type.

• Any number of physvolid elements are allowed on the physvol child tag.

• sdref is a named sensitive detector from the sensitive_detectors section.

• regionref points to a named region within regions.

• vis_attributesref is a named vis_attributes element from display.

• Note: This example is contrived to show all extension elements.

Page 16: LC Detector Simulation with SLIC and LCDD

3/17/05 LCSim Workshop IVJeremy McCormick, SLAC

16

Compact Description

<detector id="2" name="EMBarrel" type="CylindricalCalorimeter" readout="EcalBarrHits"> <dimensions inner_r = "127.0*cm" outer_z = "179.25*cm" /> <layer repeat="30"> <slice material = "Tungsten" width = "0.25*cm" /> <slice material = "G10" width = "0.068*cm" /> <slice material = "Silicon" width = "0.032*cm" sensitive = "yes" /> <slice material = "Air" width = "0.025*cm" /> </layer></detector>

Example• Verbosity of GDML means hand coding can be tedious (but certainly possible!).

• Compact XML description provides higher level format for conversion to LCDD.

• detector systemmatics

• package GeomConverter in SLAC CVS

• also used in lcsim.org reconstruction package

• “gross parameters” rather than individual volumes, etc.

• detectors, layers, slices

• dimensions: inner, outer radii

Page 17: LC Detector Simulation with SLIC and LCDD

3/17/05 LCSim Workshop IVJeremy McCormick, SLAC

17

Example Geometries• all found in $SLIC_BASE/examples

• subsequent paths relative to this

• run macros for them in $SLIC_BASE/macros

• Geant4 visualization system

• DAWN, OpenGL, WIRED/HepRep

• No custom C++ code for any of the geometries!

Page 18: LC Detector Simulation with SLIC and LCDD

3/17/05 LCSim Workshop IVJeremy McCormick, SLAC

18

SDJan03 Reprise

Page 19: LC Detector Simulation with SLIC and LCDD

3/17/05 LCSim Workshop IVJeremy McCormick, SLAC

19

SiDFeb05 Detector Envelopes• ./sid/SiDEnvelope.lcdd

• toy example without real materials or layer structure

• polyhedra for calorimeter envelopes

• illustrates possibility of modelling realistic detector designs with “corners”

• add trapezoid-shaped readout modules with box layers

Muon

Coil

Hcal

trackers

Ecal

Page 20: LC Detector Simulation with SLIC and LCDD

3/17/05 LCSim Workshop IVJeremy McCormick, SLAC

20

Octagonal Calorimeter Barrel• 2 GeV pion

• storing calorimeter-type hits in a region where secondaries are created

• magnetic field

• Geant4 range cut settable by region, especially useful for tweaking secondary / shower physics.

• Range cut is 10 mm here vs. Geant4’s 1 mm default.

Page 21: LC Detector Simulation with SLIC and LCDD

3/17/05 LCSim Workshop IVJeremy McCormick, SLAC

21

Testbeam• 2 GeV pion

• geometry similar to Mokka’s TB03 model

• store_secondaries is ON for viewing detailed shower structure.

Page 22: LC Detector Simulation with SLIC and LCDD

3/17/05 LCSim Workshop IVJeremy McCormick, SLAC

22

MDI - BDS

boolean solids

polycones

Visualized with dawn and dawncut.

Machine Detector Interface and Beam Delivery System

Page 23: LC Detector Simulation with SLIC and LCDD

3/17/05 LCSim Workshop IVJeremy McCormick, SLAC

23

SLIC• authored by Jeremy McCormick and Ron Cassell • simulator “hub” package

• Geant4 • LCDD for the geometry description• LCIO for IO

• command interface• full command line interface maps to…• macro command set (G4UIcommands)• tweak LCIO behavior / flags with macros

• MCParticle handling• based on refactored LCS

• ideas and code from LCDG4 (LcioHelper), Mokka (PhysicsListFactory), LCS

(EndOfEventAction): Thanks, guys!• additional resource directories

• analysis code in analysis/• geometry examples in LCDD format within examples/• scripts/ and macros/ with helpful utilities

Page 24: LC Detector Simulation with SLIC and LCDD

3/17/05 LCSim Workshop IVJeremy McCormick, SLAC

24

Geant4 Macro Interface

/lcdd/setURI ./examples/sdjan03/SDJan03.lcdd

/physics_list/select LHEP

/stdhep/setFile stdhep_inputfile

/lcio/path lcio_files

/lcio/filename output_file

/control/execute user_settings.mac

/stdhep/skipEvents 100

/run/initialize

/run/beamOn

/control/interactive

Example• aims for simplicity and completeness

• LCDD has its own command directory created in that package.

• commands for LCIO customization

• Example does not show all possible commands.

• execute in several ways…

• slic macro_name (like Mokka)

• slic –m mac1 –m mac2 …

• slic –n (interactive mode)

Page 25: LC Detector Simulation with SLIC and LCDD

3/17/05 LCSim Workshop IVJeremy McCormick, SLAC

25

Command Line Interface

slic -g ./examples/sdjan03/SDJan03.lcdd -l LHEP -i stdhep_inputfile -p lcio_files -o output_file -m user_settings.mac -s 100 -z -r 1 -n

Example• macro-based commandline interface

• Each switch maps to a Geant4/SLIC/LCDD macro command for consistency.

• arguments

• input and output files

• macro exec with switch -m

• run # events

• skip # events

• interactive mode

• initialize

• Ordering can be important, e.g. simulator initialization and multiple macro execution.

Page 26: LC Detector Simulation with SLIC and LCDD

3/17/05 LCSim Workshop IVJeremy McCormick, SLAC

26

MCParticle Handling OverviewHEPEVT Record

Initial LCIO MCParticle

G4PrimaryParticle

G4Track

G4TrackInformation

Trajectory

Final LCIO MCParticle

• based on refactored EndOfEventAction from LCS

• use track information and then trajectories to keep the track parentage intact during the simulation

• The actual construction of the MCParticle tree is done in post event processing using the trajectory object where possible and also information from the initial, input MCParticles and associated G4PrimaryParticles.

• Track ID is the main unique identifier.

• Current LCIO status codes are all fully implemented and have been certified against single and complex event inputs.

Page 27: LC Detector Simulation with SLIC and LCDD

3/17/05 LCSim Workshop IVJeremy McCormick, SLAC

27

Diagnostic Histograms• Java analysis codes in $SLIC_BASE/analysis

• authored by Ron Cassell

• JAS3, AIDA, LCIO

• All use the LCDD reimplementation of SDJan03 (LCDG4, LCS).

• MCParticle plots

• Zpole

• hadronic

• 10k events

• 1 entry / MCParticle to show hit associations

• sampling fractions

• Ecal: 1.2%

• Hcal: 6%

• Status Code and R vs. Z plots

• Muons

• 1-10 GeV, 2-176 theta, all phi

Page 28: LC Detector Simulation with SLIC and LCDD

3/17/05 LCSim Workshop IVJeremy McCormick, SLAC

28

R vs. Z [histo]

Page 29: LC Detector Simulation with SLIC and LCDD

3/17/05 LCSim Workshop IVJeremy McCormick, SLAC

29

MCParticles: EM Energy [histo]

10k Zpole hadronic(plot cutoff at 100k MCParticles)

Page 30: LC Detector Simulation with SLIC and LCDD

3/17/05 LCSim Workshop IVJeremy McCormick, SLAC

30

MCParticles: Charged Had E [histo]

Page 31: LC Detector Simulation with SLIC and LCDD

3/17/05 LCSim Workshop IVJeremy McCormick, SLAC

31

MCParticles: Neutral Had E [histo]

Page 32: LC Detector Simulation with SLIC and LCDD

3/17/05 LCSim Workshop IVJeremy McCormick, SLAC

32

LCIO Hit Status Codes [histo]

7

6

5

4

3

2

1

Status Codes

1. CreatedInSimulation

2. Backscatter

3. VtxNotEndpOfParent

4. DecayedInTracker

5. DecayedInCal

6. LeftDetector

7. Stopped

Page 33: LC Detector Simulation with SLIC and LCDD

3/17/05 LCSim Workshop IVJeremy McCormick, SLAC

33

Framework Installation• first install…

• CLHEP

• Geant4

• LCIO

• Xerces

• keep env vars: G4INSTALL, CLHEP_BASE_DIR, LCIO, XERCESCROOT, etc.

• install SLIC…

export CVSROOT=:pserver:[email protected]:/cvs/lcd

cvs co slic

cd slic

export SLIC_BASE=`pwd`

./scripts/build.sh

• The script walks user through setup of GDML, LCDD, LCPhys and SLIC.

• Please let me know if it works for you!

Page 34: LC Detector Simulation with SLIC and LCDD

3/17/05 LCSim Workshop IVJeremy McCormick, SLAC

34

Plans• remaining items on the LCDD / SLIC TODO list ($SLIC_BASE/doc/sim_TODO.rtf)

• event samples

• comparison and mutual certification of LCIO output with Mokka and LCDG4

• promote SLIC at ILC simulation sites

• assistance for setup and usage

• user feedback for feature requests

• materials library

• compact converter: support realistic models

• possible LCDD detector-based full detectors: SiD, D09, GLD/LDC, …

• LCDD geometry navigator in Java

• geometry construction tools: editor, viewer

• contribute to GDML project

Page 35: LC Detector Simulation with SLIC and LCDD

3/17/05 LCSim Workshop IVJeremy McCormick, SLAC

35

Resources• SLIC Homepage

http://www.lcsim.org/software/slic

• LCDD Homepage

http://www.lcsim.org/software/lcdd

• GDML Homepage

http://gdml.web.cern.ch/GDML/

• LinearCollider.org forum

http://forum.linearcollider.org/

• ILC Confluence Wiki

http://confluence.slac.stanford.edu/display/ilc/Home