Exemple #1
0
import os

from GaudiKernel import SystemOfUnits as units

from Gaudi.Configuration import *

from Configurables import FCCDataSvc
podioevent   = FCCDataSvc("EventDataSvc")

## create DD4hep geometry
path_to_detector = os.environ.get("FCC_DETECTORS", "")

from Configurables import GeoSvc
geoservice = GeoSvc()
geoservice.detectors = ['file:' + os.path.join(path_to_detector, 'Detector/DetFCChhHCalTile/compact/standalone.xml'),]
geoservice.OutputLevel = INFO

from Configurables import SimG4ConstantMagneticFieldTool
field = SimG4ConstantMagneticFieldTool()
field.FieldOn = False
field.IntegratorStepper = "G4ExactHelixStepper"

from Configurables import ConstPtParticleGun
pgun_tool = ConstPtParticleGun(PdgCodes=[13], EtaMin=0.0000, EtaMax=0.0000001, PhiMin=0.0, PhiMax=1.57, PtMin=10000, PtMax=10000)

from Configurables import FlatSmearVertex
smeartool = FlatSmearVertex()
smeartool.xVertexMin =  0*units.mm
smeartool.xVertexMax = 0*units.mm
smeartool.yVertexMin = 0*units.mm
smeartool.yVertexMax =  0*units.mm
hepmc_converter = HepMCToEDMConverter()
hepmc_converter.hepmc.Path="hepmc"
hepmc_converter.GenParticles.Path="GenParticles"

################## Simulation setup
# Detector geometry
from Configurables import GeoSvc
geoservice = GeoSvc("GeoSvc")
# if FCC_DETECTORS is empty, this should use relative path to working directory
path_to_detector = os.environ.get("FCCDETECTORS", "")
detectors_to_use=[
                    'Detector/DetFCCeeIDEA-LAr/compact/FCCee_DectMaster.xml',
                  ]
# prefix all xmls with path_to_detector
geoservice.detectors = [os.path.join(path_to_detector, _det) for _det in detectors_to_use]
geoservice.OutputLevel = WARNING

# Geant4 service
# Configures the Geant simulation: geometry, physics list and user actions
from Configurables import SimG4Svc
geantservice = SimG4Svc("SimG4Svc", detector='SimG4DD4hepDetector', physicslist="SimG4FtfpBert", actions="SimG4FullSimActions")

# Range cut
geantservice.g4PreInitCommands += ["/run/setCut 0.1 mm"]

# Magnetic field
from Configurables import SimG4ConstantMagneticFieldTool
if magneticField == 1:
    field = SimG4ConstantMagneticFieldTool("SimG4ConstantMagneticFieldTool", FieldComponentZ=-2*tesla, FieldOn=True,IntegratorStepper="ClassicalRK4")
else:
    field = SimG4ConstantMagneticFieldTool("SimG4ConstantMagneticFieldTool",FieldOn=False)
Exemple #3
0
from Gaudi.Configuration import *

from Configurables import FCCDataSvc
podioevent = FCCDataSvc("EventDataSvc")

## create DD4hep geometry
path_to_detector = os.environ.get("FCC_DETECTORS", "")

from Configurables import GeoSvc
geoservice = GeoSvc()
geoservice.detectors = [
    'file:' + os.path.join(path_to_detector,
                           'Detector/DetFCChhHCalTile/compact/standalone.xml'),
]
geoservice.OutputLevel = INFO

from Configurables import SimG4ConstantMagneticFieldTool
field = SimG4ConstantMagneticFieldTool()
field.FieldOn = False
field.IntegratorStepper = "G4ExactHelixStepper"

from Configurables import ConstPtParticleGun
pgun_tool = ConstPtParticleGun(PdgCodes=[13],
                               EtaMin=0.0000,
                               EtaMax=0.0000001,
                               PhiMin=0.0,
                               PhiMax=1.57,
                               PtMin=10000,
                               PtMax=10000)