Ejemplo n.º 1
0
              'Detector/DetFCChhBaseline1/compact/FCChh_TrackerAir.xml',
              ]
geoservice.detectors = [ os.path.join(path_to_detectors, d) for d in detectors ]
ApplicationMgr().ExtSvc += [geoservice]

# Geant4 service
# Configures the Geant simulation: geometry, physics list and user actions
from Configurables import  SimG4UserLimitRegion
## create region and a parametrisation model, pass smearing tool
regiontool = SimG4UserLimitRegion("limits")
regiontool.volumeNames = ["TrackerEnvelopeBarrel"]
regiontool.maxStep = 1*mm

from Configurables import SimG4UserLimitPhysicsList
# create overlay on top of FTFP_BERT physics list, attaching fast sim/parametrization process
physicslisttool = SimG4UserLimitPhysicsList("Physics")
physicslisttool.fullphysics = "SimG4FtfpBert"

# attach those tools to the G4 service
from Configurables import SimG4Svc
geantservice = SimG4Svc("SimG4Svc")
geantservice.physicslist = physicslisttool
geantservice.regions = [regiontool]
ApplicationMgr().ExtSvc += [geantservice]

# Geant4 algorithm
# Translates EDM to G4Event, passes the event to G4, writes out outputs via tools
from Configurables import SimG4Alg
# next, create the G4 algorithm, giving the list of names of tools ("XX/YY")
geantsim = SimG4Alg("SimG4Alg")
from Configurables import SimG4PrimariesFromEdmTool
Ejemplo n.º 2
0
    detectors=[
        '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, SimG4UserLimitPhysicsList, SimG4UserLimitRegion
from GaudiKernel.SystemOfUnits import mm
## create region and a parametrisation model, pass smearing tool
regiontool = SimG4UserLimitRegion("limits",
                                  volumeNames=["TrackerEnvelopeBarrel"],
                                  maxStep=1 * mm)
# create overlay on top of FTFP_BERT physics list, attaching fast sim/parametrization process
physicslisttool = SimG4UserLimitPhysicsList("Physics",
                                            fullphysics="SimG4FtfpBert")
# attach those tools to the G4 service
geantservice = SimG4Svc("SimG4Svc",
                        physicslist=physicslisttool,
                        regions=[regiontool])

# Geant4 algorithm
# Translates EDM to G4Event, passes the event to G4, writes out outputs via tools
from Configurables import SimG4Alg, SimG4PrimariesFromEdmTool
# next, create the G4 algorithm, giving the list of names of tools ("XX/YY")
particle_converter = SimG4PrimariesFromEdmTool("EdmConverter")
particle_converter.genParticles.Path = "allGenParticles"
geantsim = SimG4Alg("SimG4Alg", eventProvider=particle_converter)

# PODIO algorithm
from Configurables import PodioOutput
Ejemplo n.º 3
0
actions.enableHistory=True

# Magnetic field
from Configurables import SimG4ConstantMagneticFieldTool
if magnetic_field:
    field = SimG4ConstantMagneticFieldTool("bField", FieldOn=True, FieldZMax=20*units.m, IntegratorStepper="ClassicalRK4")
else:
    field = SimG4ConstantMagneticFieldTool("bField", FieldOn=False)

from Configurables import SimG4Svc
if simargs.geantinos:
  from Configurables import SimG4UserLimitRegion, SimG4UserLimitPhysicsList, SimG4GeantinoPhysicsList
  regiontool = SimG4UserLimitRegion("limits", volumeNames=["world"],
                                                     maxStep = 0.1*units.mm)
  
  physicslist = SimG4UserLimitPhysicsList("Physics", fullphysics="SimG4GeantinoPhysicsList")
  regions = [regiontool]
  #physicslist = SimG4GeantinoPhysicsList()
  #regions = []
else:
  from Configurables import SimG4UserLimitRegion, SimG4UserLimitPhysicsList
  regiontool = SimG4UserLimitRegion("limits", volumeNames=["world"],
                                                     maxStep = 0.1*units.mm)
  physicslist = SimG4UserLimitPhysicsList("Physics", fullphysics="SimG4FtfpBert")
  regions = [regiontool]
  



geantservice = SimG4Svc("SimG4Svc", detector='SimG4DD4hepDetector', physicslist=physicslist, regions=regions, actions=actions, magneticField=field)
# range cut