# DD4hep geometry service # Parses the given xml file from Configurables import GeoSvc geoservice = GeoSvc( "GeoSvc", detectors=[ 'file:../../../Detector/DetFCChhBaseline1/compact/FCChh_DectEmptyMaster.xml', 'file:../../../Detector/DetCommon/compact/TrackerAir.xml' ]) # Geant4 service # Configures the Geant simulation: geometry, physics list and user actions from Configurables import SimG4Svc, SimG4FastSimPhysicsList, SimG4FastSimTrackerRegion ## create region and a parametrisation model with a default smearing (sigma=const=0.01) regiontool = SimG4FastSimTrackerRegion("model", volumeNames=["TrackerEnvelopeBarrel"]) # create overlay on top of FTFP_BERT physics list, attaching fast sim/parametrization process physicslisttool = SimG4FastSimPhysicsList("Physics", fullphysics="SimG4FtfpBert") # attach those tools to the G4 service geantservice = SimG4Svc("SimG4Svc", physicslist=physicslisttool, regions=["SimG4FastSimTrackerRegion/model"]) # Geant4 algorithm # Translates EDM to G4Event, passes the event to G4, writes out outputs via tools from Configurables import SimG4Alg, SimG4SaveSmearedParticles, SimG4PrimariesFromEdmTool # first, create a tool that saves the smeared particles # Name of that tool in GAUDI is "XX/YY" where XX is the tool class name ("SimG4SaveSmearedParticles") # and YY is the given name ("saveSmearedParticles") saveparticlestool = SimG4SaveSmearedParticles("saveSmearedParticles")
## parse the given xml file geoservice = GeoSvc( "GeoSvc", detectors=[ 'file:Detector/DetFCChhBaseline1/compact/FCChh_DectEmptyMaster.xml', 'file:Detector/DetFCChhBaseline1/compact/FCChh_TrackerAir.xml', 'file:Detector/DetFCChhECalSimple/compact/FCChh_ECalBarrel_Gflash.xml' ]) # Geant4 service # Configures the Geant simulation: geometry, physics list and user actions from Configurables import SimG4Svc, SimG4FastSimPhysicsList, SimG4ParticleSmearFormula, SimG4FastSimTrackerRegion, SimG4GflashSamplingCalo, SimG4FastSimCalorimeterRegion ## create particle smearing tool, used for smearing in the tracker smeartool = SimG4ParticleSmearFormula("smear", resolutionMomentum="0.013") ## create region and a parametrisation model, pass smearing tool regiontooltracker = SimG4FastSimTrackerRegion( "modelTracker", volumeNames=["TrackerEnvelopeBarrel"], smearing=smeartool) ## create parametrisation of the calorimeter gflash = SimG4GflashSamplingCalo("gflash", materialActive="G4_lAr", materialPassive="G4_Pb", thicknessActive=4, thicknessPassive=2) regiontoolcalo = SimG4FastSimCalorimeterRegion("modelCalo", volumeNames=["ECalBarrel"], parametrisation=gflash) ## create overlay on top of FTFP_BERT physics list, attaching fast sim/parametrization process physicslisttool = SimG4FastSimPhysicsList("Physics", fullphysics="SimG4FtfpBert") ## attach those tools to the G4 service geantservice = SimG4Svc("SimG4Svc", physicslist=physicslisttool,
'file:Detector/DetFCChhBaseline1/compact/FCChh_DectEmptyMaster.xml', 'file:Detector/DetFCChhBaseline1/compact/FCChh_TrackerAir.xml' ], OutputLevel=INFO) # Geant4 service # Configures the Geant simulation: geometry, physics list and user actions from Configurables import SimG4Svc, SimG4FastSimPhysicsList, SimG4ParticleSmearRootFile, SimG4FastSimTrackerRegion from GaudiKernel.SystemOfUnits import GeV, TeV # create particle smearing tool, used for smearing in the tracker smeartool = SimG4ParticleSmearRootFile("Smear") smeartool.filename = "http://fccsw.web.cern.ch/fccsw/testsamples/tkLayout_example_resolutions.root" ## create region and a parametrisation model, pass smearing tool regiontool = SimG4FastSimTrackerRegion("model", volumeNames=["TrackerEnvelopeBarrel"], minMomentum=5 * GeV, maxMomentum=10 * TeV, maxEta=6, smearing=smeartool) # create overlay on top of FTFP_BERT physics list, attaching fast sim/parametrization process physicslisttool = SimG4FastSimPhysicsList("Physics", fullphysics="SimG4FtfpBert") # attach those tools to the G4 service geantservice = SimG4Svc("SimG4Svc", physicslist=physicslisttool, regions=["SimG4FastSimTrackerRegion/model"]) # Geant4 algorithm # Translates EDM to G4Event, passes the event to G4, writes out outputs via tools from Configurables import SimG4Alg, SimG4SaveSmearedParticles, SimG4PrimariesFromEdmTool # first, create a tool that saves the smeared particles # Name of that tool in GAUDI is "XX/YY" where XX is the tool class name ("SimG4SaveSmearedParticles")
path_to_detectors, 'Detector/DetFCChhECalSimple/compact/FCChh_ECalBarrel_Gflash.xml'), ] geoservice.OutputLevel = INFO ApplicationMgr().ExtSvc += [geoservice] # Geant4 service # Configures the Geant simulation: geometry, physics list and user actions from Configurables import SimG4ParticleSmearFormula ## create particle smearing tool, used for smearing in the tracker smeartool = SimG4ParticleSmearFormula("smear") smeartool.resolutionMomentum = "0.013" from Configurables import SimG4FastSimTrackerRegion ## create region and a parametrisation model, pass smearing tool regiontooltracker = SimG4FastSimTrackerRegion("modelTracker") regiontooltracker.volumeNames = ["TrackerEnvelopeBarrel"] regiontooltracker.smearing = smeartool from Configurables import SimG4GflashSamplingCalo ## create parametrisation of the calorimeter gflash = SimG4GflashSamplingCalo("gflash") gflash.materialActive = "G4_lAr" gflash.materialPassive = "G4_Pb" gflash.thicknessActive = 4 gflash.thicknessPassive = 2 from Configurables import SimG4FastSimCalorimeterRegion regiontoolcalo = SimG4FastSimCalorimeterRegion("modelCalo") regiontoolcalo.volumeNames = ["ECalBarrel"] regiontoolcalo.parametrisation = gflash