Document 7288312
Download
Report
Transcript Document 7288312
LHCb-Italian Software Tutorial
Updated on 13 July 2007
Detector Simulation
Gloria Corti
CERN
Gauss Tutorial
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
Detector Simulation - Page 2
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
Detector Simulation - Page 3
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/v200601-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
Detector Simulation - Page 4
Simulation phase reading generator event
JobOpts
JobOpts
Initialize
Interface
HepMC
Cnv
Pythia,
EvtGen
…
Geant4
primary event generator
specialized decay package
pile-up generation
HepMC
MCParticle
MCVertex
MCHits
Monitor
Cnv
POOL
Event Generation
Cnv
Init
GiGa
Geometry
POOL
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
Detector Simulation - Page 5
Geant4
Gauss uses GEANT4 for transporting particles in the experimental
setup and simulating the physics processes that can occur.
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 theorydriven, parameterized, and empirical formulae. Both crosssections and models (final state generation) can be combined in
arbitrary manners as necessary.
Navigation in EM fields
Physics processes for a variety of particles at different energies
Standard and Low energy EM processes, Hadronic processes,
Optical photon processes, Decay processes, etc.
Documentation from web: Gauss → Geant4 → Geant4
Software Tutorial - Gauss - Last update: 10 October 2007
6
Detector Simulation - Page 6
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
Software Tutorial - Gauss - Last update: 10 October 2007
6
Detector Simulation - Page 7
Encapsulation of Geant4 in Gauss via GiGa
Single point of connection
to Geant4
GiGa
Convertion of transient
objects to/from Geant4
representation
Detector geometry
converted from same
source as other
applications
Persistency
Service
Transient
Event
Store
G4 Kine
G4 Hits
Kine
Conversion
(Algorithms)
Hits
Conversion
(Algorithms)
Gaudi
Event Loop
controlled by
Gaudi
Data
Files
GiGa
Service
GiGa
Geant4
Transient
Detector
Store
Persistency
Service
GiGaGeom
Conversion
Service
Data
Files
Software Tutorial - Gauss - Last update: 10 October 2007
G4 Geom
Action
Action
Embedded Geant4,
Geant4 control and
Configuration
Detector Simulation - Page 8
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
Detector Simulation - Page 9
Control of simulation phase via JopOptions (2)
configuration of GiGa to control Geant4 actions
// Mandatory run action
setting cuts
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" };
MC truth
internal in G4
Software Tutorial - Gauss - Last update: 10 October 2007
Detector Simulation - Page 10
Detector simulation
GiGaSensDetTracker
ProcessHit()
creates
G4TrackerHits
invoked when particle passed
through the sensitive volume
lvVolume
as in XmlDDDB
Gaudi
world
GetTrackerHitsAlg
Geant4
world
converts
to:
MCHits in TES
/Event/MC/OT/Hits
<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”;
Software Tutorial - Gauss - Last update: 10 October 2007
9
Detector Simulation - Page 11
Control of Detector simulation
In SimGeometry.opts
included from Simulation.opts
Simulation.Members += { "GiGaInputStream/Geo" };
#include "$GAUSSOPTS/SimGeometry.opts"
uses a special GiGa component
Geo.ConversionSvcName
Geo.DataProviderSvcName
list of detectors to simulate
Geo.StreamItems +=
Geo.StreamItems +=
Geo.StreamItems +=
Geo.StreamItems +=
...
// Geo.StreamItems
// Geo.StreamItems
= "GiGaGeo" ;
= "DetectorDataSvc" ;
{"/dd/Structure/LHCb/BeforeMagnetRegion/Velo"};
{"/dd/Structure/LHCb/BeforeMagnetRegion/Velo2Rich1"};
{"/dd/Structure/LHCb/BeforeMagnetRegion/Rich1"};
{"/dd/Geometry/BeforeMagnetRegion/Rich1/Rich1Surfaces"};
+= {"/dd/Structure/LHCb/DownstreamRegion/Hcal"};
+= {"/dd/Structure/LHCb/DownstreamRegion/Muon"};
Can give different list: switch off some detectors, add some new, Test
Beam setup
Just need the sensdet Keyword in the XML Detector Description
Software Tutorial - Gauss - Last update: 10 October 2007
Detector Simulation - Page 12
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
Software Tutorial - Gauss - Last update: 10 October 2007
10
Detector Simulation - Page 13
Configuration of Physics lists to use
Defined as list of options that can be changed
GiGa.ModularPL.PhysicsConstructors +=
{ "GiGaExtPhysics<GeneralPhysics>/GeneralPhysics"
GiGa.ModularPL.PhysicsConstructors +=
{ "GiGaExtPhysics<EMPhysics>/EMPhysics"
GiGa.ModularPL.PhysicsConstructors +=
{ "GiGaExtPhysics<MuonPhysics>/MuonPhysics"
GiGa.ModularPL.PhysicsConstructors +=
{ "GiGaExtPhysics<HadronPhysicsLHEP>/LHEPPhysics"
GiGa.ModularPL.PhysicsConstructors +=
{ "GiGaExtPhysics<IonPhysics>/IonPhysics"
GiGa.ModularPL.PhysicsConstructors +=
{ "GiGaPhysConstructorOp"
GiGa.ModularPL.PhysicsConstructors +=
{ "GiGaPhysConstructorHpd"
In MuonLowEnergy.opts for example:
} ;
} ;
} ;
} ;
} ;
} ;
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
Detector Simulation - Page 14
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
Range cut 1.5 mm
(450 KeV in liq.Ar, 2 MeV in Pb)
Energy cut = 450 KeV
liq.Ar
Pb
liq.Ar
Pb
Software Tutorial - Gauss - Last update: 10 October 2007
liq.Ar
Pb
liq.Ar
Pb
Detector Simulation - Page 15
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
+= { "TrCutsRunAction/TrCuts"};
Processing time
GiGa.RunSeq.Members
Effect of cut value for
ECAL with 30 GeV electron
particle gun
Energy threshold below which the particle is not tracked.
Possible also to set cuts per region
For new geometry for example to turn on delta rays in RICH1 Aerogel
(set in Simulation.xml)
Software Tutorial - Gauss - Last update: 10 October 2007
Detector Simulation - Page 16
Control of cuts (1)
In job options for overall cuts
// Default production cuts for whole detector
GiGa.ModularPL.CutForElectron = 10000. * mm;
GiGa.ModularPL.CutForPositron = 5.0 * mm;
Production cuts
GiGa.ModularPL.CutForGamma
= 10.0 * mm;
// Default tracking cuts for whole
GiGa.RunSeq.TrCuts.MuonTrCut
=
GiGa.RunSeq.TrCuts.pKpiCut
=
GiGa.RunSeq.TrCuts.NeutrinoTrCut =
GiGa.RunSeq.TrCuts.NeutronTrCut =
GiGa.RunSeq.TrCuts.GammaTrCut
=
GiGa.RunSeq.TrCuts.ElectronTrCut =
GiGa.RunSeq.TrCuts.OtherTrCut
=
Software Tutorial - Gauss - Last update: 10 October 2007
detector
10.0*MeV;
10.0*MeV;
0.0*MeV; Tracking cuts
10.0*MeV;
1.0*MeV;
1.0*MeV;
0.0*MeV;
Detector Simulation - Page 17
Control of cuts (2)
In Simulation-v200412.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
Detector Simulation - Page 18
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;
pp collision
GiGa.TrackSeq.PostTrack.StoreForcedDecays = true;
GiGa.TrackSeq.PostTrack.StoreMarkedTracks = true ;
by detectors
// The following only for z=12280mm (i.e.PRS/SPD)
GiGa.TrackSeq.PostTrack.StoreByOwnEnergy
= true;
with E > threshold
GiGa.TrackSeq.PostTrack.OwnEnergyThreshold = 100.0 * MeV;
GiGa.TrackSeq.PostTrack.StoreByChildProcess = true; producing Cerenkov
GiGa.TrackSeq.PostTrack.StoredChildProcesses = {"RichG4Cerenkov"};
GiGa.TrackSeq.PostTrack.StoreByOwnProcess = true;
GiGa.TrackSeq.PostTrack.StoredOwnProcesses = {“Decay”};from decay in
detector
Software Tutorial - Gauss - Last update: 10 October 2007
Detector Simulation - Page 19
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
Detector Simulation - Page 20
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
Detector Simulation - Page 21
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
Detector Simulation - Page 22