1 / 35

LC Detector Simulation with SLIC and LCDD

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

kaipo
Download Presentation

LC Detector Simulation with SLIC and LCDD

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. LC Detector Simulation with SLIC and LCDD Jeremy McCormick, Ron Cassell for SLAC Simulations Group LCSim Workshop IV Jeremy McCormick, SLAC

  2. Geometry Requirements • Framework Diagram and Outline • GDML/LCDD geometry system • LCDD XML format examples • Compact XML format example • LCDD Visualizations • SLIC simulations package • Diagnostic Histograms • Installation • Plans • Resources Talk Overview LCSim Workshop IV Jeremy McCormick, SLAC

  3. 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. Geometry System Requirements LCSim Workshop IV Jeremy McCormick, SLAC

  4. Xerces CLHEP Not all connections shown. LCD Simulations Framework Diagram uses org.lcsim GDML Geant4 LCPhys reads Compact XML LCDD SLIC LCIO reads / writes reads reads reads LCIO Events LCDD XML Stdhep Events writes Geom Converter LCSim Workshop IV Jeremy McCormick, SLAC

  5. Packages LCSim Workshop IV Jeremy McCormick, SLAC • LCIO – widely adopted ILC IO package • StdHep – binary event format read by Willy Langeveld’s lStdHep interface

  6. 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 Benefits of an XML-Based System LCSim Workshop IV Jeremy McCormick, SLAC

  7. 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 GDML LCSim Workshop IV Jeremy McCormick, SLAC

  8. 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 LCDD LCSim Workshop IV Jeremy McCormick, SLAC

  9. LCDD XML Structure <lcdd> <header> … </header> <iddict> … </iddict> <sensitive_detectors> … </sensitive_detectors> <regions> … </regions> <display> … </display> <gdml> … </gdml> <fields> … </fields> </lcdd> LCSim Workshop IV Jeremy McCormick, SLAC

  10. 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. 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> LCSim Workshop IV Jeremy McCormick, SLAC

  11. 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 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> LCSim Workshop IV Jeremy McCormick, SLAC

  12. Example • 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 Regions <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> LCSim Workshop IV Jeremy McCormick, SLAC

  13. Example • 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 Visualization <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> LCSim Workshop IV Jeremy McCormick, SLAC

  14. Example • 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 Fields <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> LCSim Workshop IV Jeremy McCormick, SLAC

  15. Example • “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. Extended GDML volume Element <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> LCSim Workshop IV Jeremy McCormick, SLAC

  16. 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 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> LCSim Workshop IV Jeremy McCormick, SLAC

  17. 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! Example Geometries LCSim Workshop IV Jeremy McCormick, SLAC

  18. SDJan03 Reprise LCSim Workshop IV Jeremy 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 Hcal Muon trackers Ecal Coil LCSim Workshop IV Jeremy McCormick, SLAC

  20. 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. Octagonal Calorimeter Barrel LCSim Workshop IV Jeremy McCormick, SLAC

  21. 2 GeV pion • geometry similar to Mokka’s TB03 model • store_secondaries is ON for viewing detailed shower structure. Testbeam LCSim Workshop IV Jeremy McCormick, SLAC

  22. MDI - BDS Machine Detector Interface and Beam Delivery System polycones boolean solids Visualized with dawn and dawncut. LCSim Workshop IV Jeremy McCormick, SLAC

  23. 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 SLIC LCSim Workshop IV Jeremy McCormick, SLAC

  24. 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) 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 LCSim Workshop IV Jeremy McCormick, SLAC

  25. 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. Example 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 LCSim Workshop IV Jeremy McCormick, SLAC

  26. 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. HEPEVT Record MCParticle Handling Overview Initial LCIO MCParticle G4PrimaryParticle G4Track G4TrackInformation Trajectory Final LCIO MCParticle LCSim Workshop IV Jeremy McCormick, SLAC

  27. 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 Diagnostic Histograms LCSim Workshop IV Jeremy McCormick, SLAC

  28. R vs. Z [histo] LCSim Workshop IV Jeremy McCormick, SLAC

  29. MCParticles: EM Energy [histo] 10k Zpole hadronic (plot cutoff at 100k MCParticles) LCSim Workshop IV Jeremy McCormick, SLAC

  30. MCParticles: Charged Had E [histo] LCSim Workshop IV Jeremy McCormick, SLAC

  31. MCParticles: Neutral Had E [histo] LCSim Workshop IV Jeremy McCormick, SLAC

  32. Status Codes • CreatedInSimulation • Backscatter • VtxNotEndpOfParent • DecayedInTracker • DecayedInCal • LeftDetector • Stopped 6 LCIO Hit Status Codes [histo] 5 1 3 7 2 4 LCSim Workshop IV Jeremy McCormick, SLAC

  33. first install… • CLHEP • Geant4 • LCIO • Xerces • keep env vars: G4INSTALL, CLHEP_BASE_DIR, LCIO, XERCESCROOT, etc. • install SLIC… • export CVSROOT=:pserver:anonymous@cvs.freehep.org:/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! Framework Installation LCSim Workshop IV Jeremy McCormick, SLAC

  34. 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 Plans LCSim Workshop IV Jeremy McCormick, SLAC

  35. 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 Resources LCSim Workshop IV Jeremy McCormick, SLAC

More Related