Presentation is loading. Please wait.

Presentation is loading. Please wait.

LHCb-Italian Software Tutorial

Similar presentations


Presentation on theme: "LHCb-Italian Software Tutorial"— Presentation transcript:

1 LHCb-Italian Software Tutorial
Updated on 13 July 2007 Detector Simulation Gloria Corti CERN Gauss Tutorial

2 Outline Overview of (Physics) Detector Simulation Purpose: reminder
Interaction with (use of) Geant4 Job options Detectors Physics processes Input to and Output from Geant4 Output Data Software Tutorial - Gauss - Last update: 10 October 2007

3 Purpose: a reminder For Detector Simulation phase of Gauss
tracking of particles in the detector and interactions with the material production of “hits" when particles cross sensitive detectors Data produced can be studied directly or in further processing MCTruth as seen by the (LHCb) experimental setup MCParticles and MCVertices MCHits (Velo, PuVeto, TT, IT, OT, Muon system), MCRichHits and MCCaloHits Output (.sim ) can be processed by Boole for digitization Software Tutorial - Gauss - Last update: 10 October 2007

4 Simulation phase reading generator event
Options are available in Gauss to run the simulation phase reading in the generator event from a file previously produced (although not really necessary from the CPU point of view) ../slc3_ia32_gcc323/Gauss.exe $GAUSSOPTS/v SimPhase.opts // // Phases to be executed: ApplicationMgr.TopAlg += { “GaudiSequencer/Simulation” }; // Generator Phase #include "$GAUSSOPTS/Generator.opts“ Generator.MeasureTime = true; #include "$GAUSSOPTS/GenStandAlone.opts“ // Simulation Phase // #include "$GAUSSOPTS/Simulation.opts" // Simulation.MeasureTime = true; Software Tutorial - Gauss - Last update: 10 October 2007

5 Simulation phase reading generator event
Pythia, EvtGen JobOpts Interface Initialize JobOpts HepMC MCParticle MCVertex MCHits POOL LHCb Event model Exchange model GiGa Geant4 Init HepMC Monitor Cnv Cnv Cnv POOL Geometry Event Generation primary event generator specialized decay package pile-up generation Detector Simulation geometry of the detector (LHCb  Geant4) tracking through materials (Geant4) hit creation and MC truth information (Geant4  LHCb) Software Tutorial - Gauss - Last update: 10 October 2007

6 Geant4 Gauss uses GEANT4 for transporting particles in the experimental setup and simulating the physics processes that can occur. Navigation in EM fields Physics processes for a variety of particles at different energies GEANT4 is the successor of GEANT3, the world-standard toolkit for HEP detector simulation GEANT4 is a C++ toolkit developed in the Physics community International Collaboration ~ 10 year old used in HEP, nuclear physics, heavy ion physics, cosmic ray physics, astrophysics, space science and medical applications GEANT4 coverage of physics comes from mixture of theory-driven, parameterized, and empirical formulae. Both cross-sections and models (final state generation) can be combined in arbitrary manners as necessary. Standard and Low energy EM processes, Hadronic processes, Optical photon processes, Decay processes, etc. Documentation from web: Gauss → Geant4 → Geant4 6 Software Tutorial - Gauss - Last update: 10 October 2007

7 GiGa Gauss uses a dedicated Gaudi service to interact and communicate with Geant4 minimizes the couplings to Geant4 GIGA = GEANT4 Interface for Gaudi Applications or Gaudi Interface to GEANT4 Applications GEANT4 callable and controllable from within GAUDI environment common detector geometry source used by other applications (reconstruction, visualisation) use of Gaudi features as algorithms, tools, services use of common services (ex. RandomNumberSvc, MagneticFieldSvc, DetectorDataSvc, etc.) access to internal Geant4 event loop via GiGaRunManager allows loading external physics lists instantiates (using Abstract Factory pattern) different “actions” (makes them to be plugable components) Documentation on the web from Gauss web page 6 Software Tutorial - Gauss - Last update: 10 October 2007

8 Encapsulation of Geant4 in Gauss via GiGa
Single point of connection to Geant4 Convertion of transient objects to/from Geant4 representation Detector geometry converted from same source as other applications Data Files Persistency Service G4 Kine G4 Hits Transient Event Store Kine Conversion (Algorithms) Geant4 Hits Conversion (Algorithms) GiGa Service Gaudi GiGa Transient Detector Store GiGaGeom Conversion Service G4 Geom Event Loop controlled by Gaudi Action Action Embedded Geant4, Geant4 control and Configuration Persistency Service Data Files Software Tutorial - Gauss - Last update: 10 October 2007

9 Control of simulation phase via JopOptions (1)
Simulation.opts is the steering options file configuration of algorithms in Simulation phase // Pass HepMCEvents to Geant4 Simulation.Members += { "GeneratorToG4" }; // Perform the Geant4 simulation Simulation.Members += { "GiGaFlushAlgorithm" }; // Check the G4Event processing status Simulation.Members += { "GiGaCheckEventStatus" }; // Populate the MCParticles/MCVertices in the TES Simulation.Members += { "G4HepMCToMCTruth" }; // Populate sensitive hits in the TES Simulation.Members += { "GaudiSequencer/DetectorsHits" }; DetectorsHits.Members += { "GetTrackerHitsAlg/GetVeloHits" }; DetectorsHits.Members += { "GetTrackerHitsAlg/GetTTHits" }; ... DetectorsHits.Members += { "GetCaloHitsAlg/GetSpdHits" }; DetectorsHits.Members += { "GetCaloHitsAlg/GetEcalHits" }; DetectorsHits.Members += { "GetMCRichHitsAlg" }; #include “$GAUSSTRACKERROOT/options/TrackersHits.opts” Software Tutorial - Gauss - Last update: 10 October 2007

10 Control of simulation phase via JopOptions (2)
configuration of GiGa to control Geant4 actions // Mandatory run action GiGa.RunAction = "GiGaRunActionSequence/RunSeq"; GiGa.RunSeq.Members += { "TrCutsRunAction/TrCuts"}; GiGa.RunSeq.Members += { "GiGaRunActionCommand/RunCommand" }; GiGa.RunSeq.RunCommand.BeginOfRunCommands = { "/tracking/verbose 0", "/tracking/storeTrajectory 1", "/process/eLoss/verbose -1", }; //GiGa.RunSeq.RunCommand.BeginOfRunCommands += { "/process/list" }; // Mandatory event action GiGa.EventAction = "GiGaEventActionSequence/EventSeq"; GiGa.EventSeq.Members += { "GaussEventActionHepMC/HepMCEvent" }; setting cuts MC truth internal in G4 Software Tutorial - Gauss - Last update: 10 October 2007

11 GetTrackerHits configuration for TT
Detector simulation GiGaSensDetTracker creates G4TrackerHits GetTrackerHitsAlg ProcessHit() Geant4 world converts to: invoked when particle passed through the sensitive volume lvVolume as in XmlDDDB MCHits in TES /Event/MC/OT/Hits Gaudi world <logvol material “Silicon” name="lvLadder1" sensdet="GiGaSensDetTracker/TTSDet"> GetTrackerHits configuration for TT GetTTHits.CollectionName = “TTDSet/Hits”; GetTTHits.MCHitsLocation = “/Event/MC/TT/Hits”; GetTTHits.MCHitsLocation = “/dd/Structure/LHCb/BeforeMagnetRegion/TT”; 9 Software Tutorial - Gauss - Last update: 10 October 2007

12 Control of Detector simulation
In SimGeometry.opts included from Simulation.opts uses a special GiGa component list of detectors to simulate Can give different list: switch off some detectors, add some new, Test Beam setup Just need the sensdet Keyword in the XML Detector Description Simulation.Members += { "GiGaInputStream/Geo" }; #include "$GAUSSOPTS/SimGeometry.opts" Geo.ConversionSvcName = "GiGaGeo" ; Geo.DataProviderSvcName = "DetectorDataSvc" ; Geo.StreamItems += {"/dd/Structure/LHCb/BeforeMagnetRegion/Velo"}; Geo.StreamItems += {"/dd/Structure/LHCb/BeforeMagnetRegion/Velo2Rich1"}; Geo.StreamItems += {"/dd/Structure/LHCb/BeforeMagnetRegion/Rich1"}; Geo.StreamItems += {"/dd/Geometry/BeforeMagnetRegion/Rich1/Rich1Surfaces"}; ... // Geo.StreamItems += {"/dd/Structure/LHCb/DownstreamRegion/Hcal"}; // Geo.StreamItems += {"/dd/Structure/LHCb/DownstreamRegion/Muon"}; Software Tutorial - Gauss - Last update: 10 October 2007

13 Physics processes and lists
Geant4 has a big variety of processes that can be combined as necessary in Physics Lists: crucial part of the whole simulation program most of the stuff already implemented in Geant4 some specific processes needed implementation for RICH: photoelectric process (creation of photoelectrons in HPDs), energy loss in the silicon of HPDs GiGa modular physics lists allows dynamic loading (via jobOptions) of particular physics “sublists” expected to increase flexibility and to make changes easier 10 Software Tutorial - Gauss - Last update: 10 October 2007

14 Configuration of Physics lists to use
Defined as list of options that can be changed In MuonLowEnergy.opts for example: GiGa.ModularPL.PhysicsConstructors += { "GiGaExtPhysics<GeneralPhysics>/GeneralPhysics" } ; { "GiGaExtPhysics<EMPhysics>/EMPhysics" } ; { "GiGaExtPhysics<MuonPhysics>/MuonPhysics" } ; { "GiGaExtPhysics<HadronPhysicsLHEP>/LHEPPhysics" } ; { "GiGaExtPhysics<IonPhysics>/IonPhysics" } ; { "GiGaPhysConstructorOp" } ; { "GiGaPhysConstructorHpd" } ; LHCb RICH processes set a different hadronic physics list with neutrons to thermal energy GiGa.ModularPL.PhysicsConstructors -= { "GiGaExtPhysics<HadronPhysicsLHEP>/LHEPPhysics" } ; GiGa.ModularPL.PhysicsConstructors += { "GiGaExtPhysics<HadronPhysicsQGSP_BERT_HP>/QGSP_BERT_HPPhysics" }; Software Tutorial - Gauss - Last update: 10 October 2007

15 Geant4 production thresholds
Geant4 has production thresholds for EM processes Specify range (which is converted to energy for each material) at which continuous loss begins, track primary down to zero range Create secondaries only above specified range, or add to continuous loss of primary for secondaries of less energetic than travelling the required range in the current material Energy cut = 450 KeV Range cut 1.5 mm (450 KeV in liq.Ar, 2 MeV in Pb) liq.Ar Pb liq.Ar Pb Software Tutorial - Gauss - Last update: 10 October 2007

16 Energy threshold below which the particle is not tracked.
LHCb tracking cuts Introduce tracking cuts on Ekin of particles of all type (special Gauss stepping actions) Track particle until cut-off energy is reached, stop it at that point Possible also to set cuts per region For new geometry for example to turn on delta rays in RICH1 Aerogel (set in Simulation.xml) GiGa.RunSeq.Members += { "TrCutsRunAction/TrCuts"}; Effect of cut value for ECAL with 30 GeV electron particle gun Processing time Energy threshold below which the particle is not tracked. Software Tutorial - Gauss - Last update: 10 October 2007

17 Control of cuts (1) In job options for overall cuts
// Default production cuts for whole detector GiGa.ModularPL.CutForElectron = * mm; GiGa.ModularPL.CutForPositron = 5.0 * mm; GiGa.ModularPL.CutForGamma = 10.0 * mm; // Default tracking cuts for whole detector GiGa.RunSeq.TrCuts.MuonTrCut = 10.0*MeV; GiGa.RunSeq.TrCuts.pKpiCut = 10.0*MeV; GiGa.RunSeq.TrCuts.NeutrinoTrCut = 0.0*MeV; GiGa.RunSeq.TrCuts.NeutronTrCut = 10.0*MeV; GiGa.RunSeq.TrCuts.GammaTrCut = 1.0*MeV; GiGa.RunSeq.TrCuts.ElectronTrCut = 1.0*MeV; GiGa.RunSeq.TrCuts.OtherTrCut = 0.0*MeV; Production cuts Tracking cuts Software Tutorial - Gauss - Last update: 10 October 2007

18 Control of cuts (2) In Simulation-v xml for detector specific cuts <SimAtt name="SimAttrMuFilt" minEkine=“500.0*MeV"/> <SimAtt name="SimAttrMuon" minEkine="10.0*MeV"/> <Item name="/dd/Geometry/DownstreamRegion/Muon/lvMuFilter1"> <Cut particle="0" attr="SimAttrMuFilt"/> <Cut particle="13" attr="SimAttrMuon"/> <Cut particle="-13" attr="SimAttrMuon"/> </Item> Software Tutorial - Gauss - Last update: 10 October 2007

19 Understanding the simulation as a whole
To understand in depth the simulation, the information about the history of what happened in the detector is very important (trajectories and processes originating them) MC truth filled at the end of an event processing by Geant4 Necessary to decide a priori what to store when a particle is created, when it is being processed, when it stops being “tracked” Set of criteria can be changed in job options GiGa.TrackSeq.PostTrack.StoreAll = false; GiGa.TrackSeq.PostTrack.StorePrimaries = true; GiGa.TrackSeq.PostTrack.StoreForcedDecays = true; GiGa.TrackSeq.PostTrack.StoreMarkedTracks = true; // The following only for z=12280mm (i.e.PRS/SPD) GiGa.TrackSeq.PostTrack.StoreByOwnEnergy = true; GiGa.TrackSeq.PostTrack.OwnEnergyThreshold = * MeV; GiGa.TrackSeq.PostTrack.StoreByChildProcess = true; GiGa.TrackSeq.PostTrack.StoredChildProcesses = {"RichG4Cerenkov"}; GiGa.TrackSeq.PostTrack.StoreByOwnProcess = true; GiGa.TrackSeq.PostTrack.StoredOwnProcesses = {“Decay”}; pp collision by detectors with E > threshold producing Cerenkov from decay in detector Software Tutorial - Gauss - Last update: 10 October 2007

20 History information after simulation
History of particles traveling trough detector in dedicated LHCb event data classes: MCParticles and MCVertices Derive from basic LHCb event data class: KeyedObject Container support Transient and Persistent support Link from other classes ( MCHits for example, but also possibility to associate them to reconstructed Tracks, physics Particles) Relationship between them holds the tree structure An MCParticle has a SmartRef<MCVertex> originVertex() and SmartRefVector<MCVertex> endVertices() more than one end vertex (Bremsstrahlung) An MCVertex has a SmartRef<MCParticle> mother and SmartRefVector<MCParticles> products a primary vertex does not have a mother MCParticle Keep originating process identifier in MCVertex These classes are written out by the simulation and accessed in a variety of ways in successive processing Software Tutorial - Gauss - Last update: 10 October 2007

21 Output Files and extra information
List of output data objects in normal production can be found in GaussTape.opts Sometimes necessary to have additional information for special studies: ex. RICH extended info To get the extra information and write it to tape uncomment $GAUSSOPTS/RichExtendedInfo.opts in Simulation.opts DetectorsHits.Members +={ "GetMCRichOpticalPhotonsAlg“, “GetMCRichSegmentsAlg”, “GetMCRichTracksAlg” }; #include "$GAUSSRICHROOT/options/RichExtendedInfo.opts" GaussTape.OptItemList += { “/Event/MC/Rich/OpticalPhotons#1” ,”/Event/MC/Rich/Tracks#1” ,”/Event/MC/Rich/Segments#1” }; Software Tutorial - Gauss - Last update: 10 October 2007

22 Exercises You will get familiar with some controls of the simulation
Don’t forget you can always read a file you produced Guidelines for the exercises on the web from the tutorial agenda Packages used: Sim/Gauss v25r12 – Mandatory Tutorial/Simulation v2r0 – Optional exercises/README.txt + exerciseN.txt solutions/exerciseN/ Advanced exercises also available Software Tutorial - Gauss - Last update: 10 October 2007


Download ppt "LHCb-Italian Software Tutorial"

Similar presentations


Ads by Google