################## Particle gun setup _pi = 3.14159 from Configurables import MomentumRangeParticleGun pgun = MomentumRangeParticleGun("ParticleGun_Electron") pgun.PdgCodes = [11] pgun.MomentumMin = momentum * GeV pgun.MomentumMax = momentum * GeV pgun.PhiMin = 0 pgun.PhiMax = 2 * _pi pgun.ThetaMin = thetaMin * _pi / 180. pgun.ThetaMax = thetaMax * _pi / 180. from Configurables import GenAlg genalg_pgun = GenAlg() genalg_pgun.SignalProvider = pgun genalg_pgun.hepmc.Path = "hepmc" from Configurables import HepMCToEDMConverter 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',
from Configurables import GaussSmearVertex smeartool = GaussSmearVertex() smeartool.xVertexSigma = 0.5 * units.mm smeartool.yVertexSigma = 0.5 * units.mm smeartool.zVertexSigma = 40.0 * units.mm smeartool.tVertexSigma = 180.0 * units.picosecond from Configurables import ConstPtParticleGun pgun_tool = ConstPtParticleGun() pgun_tool.PdgCodes = [13] pgun_tool.PhiMin = 0.0 pgun_tool.PhiMax = constants.twopi from Configurables import GenAlg genalg_pgun = GenAlg() genalg_pgun.SignalProvider = ConstPtParticleGun('ToolSvc.ConstPtParticleGun') genalg_pgun.VertexSmearingTool = smeartool genalg_pgun.hepmc.Path = "hepmc" ApplicationMgr().TopAlg += [genalg_pgun] from Configurables import HepMCToEDMConverter hepmc_converter = HepMCToEDMConverter() hepmc_converter.hepmc.Path = "hepmc" hepmc_converter.genparticles.Path = "GenParticlesAll" hepmc_converter.genvertices.Path = "GenVertices" ApplicationMgr().TopAlg += [hepmc_converter] from Configurables import GenParticleFilter ### Filters generated particles # accept is a list of particle statuses that should be accepted genfilter = GenParticleFilter("StableParticleFilter")
from Gaudi.Configuration import * # Data service from Configurables import FCCDataSvc podioevent = FCCDataSvc("EventDataSvc") from Configurables import MomentumRangeParticleGun from GaudiKernel import PhysicalConstants as constants guntool = MomentumRangeParticleGun() guntool.ThetaMin = 0 guntool.ThetaMax = 2 * constants.pi guntool.PdgCodes = [11] from Configurables import GenAlg gen = GenAlg() gen.SignalProvider = guntool gen.hepmc.Path = "hepmc" # reads an HepMC::GenEvent from the data service and writes a collection of EDM Particles from Configurables import HepMCToEDMConverter hepmc_converter = HepMCToEDMConverter("Converter") hepmc_converter.hepmc.Path = "hepmc" hepmc_converter.genparticles.Path = "allGenParticles" hepmc_converter.genvertices.Path = "allGenVertices" # DD4hep geometry service # Parses the given xml file from Configurables import GeoSvc geoservice = GeoSvc( "GeoSvc", detectors=[ 'file:Detector/DetFCChhBaseline1/compact/FCChh_DectEmptyMaster.xml',
from Gaudi.Configuration import * from Configurables import HepMCFileReader, GenAlg readertool = HepMCFileReader("ReaderTool") readertool.Filename = "Test/TestGeometry/data/testHepMCrandom.dat" reader = GenAlg("Reader") reader.SignalProvider = readertool reader.hepmc.Path = "hepmc" from Configurables import HepMCToEDMConverter hepmc_converter = HepMCToEDMConverter("Converter") hepmc_converter.hepmc.Path = "hepmc" hepmc_converter.genparticles.Path = "allGenParticles" hepmc_converter.genvertices.Path = "allGenVertices" from Configurables import HepMCDumper hepmc_dump = HepMCDumper("hepmc") hepmc_dump.hepmc.Path = "hepmc" from Configurables import GeoSvc geoservice = GeoSvc( "GeoSvc", detectors=['file:Test/TestGeometry/data/TestBoxCaloSD_volumes.xml']) from Configurables import SimG4Svc geantservice = SimG4Svc("SimG4Svc",
podioEvent = FCCDataSvc("EventDataSvc") ApplicationMgr().ExtSvc += [podioEvent] ApplicationMgr().OutputLevel = INFO # Pythia generator from Configurables import PythiaInterface pythia8gentool = PythiaInterface() pythia8gentool.Filename = "Pythia_ee_ZH_Htautau.cmd" # Write the HepMC::GenEvent to the data service from Configurables import GenAlg pythia8gen = GenAlg() pythia8gen.SignalProvider = pythia8gentool pythia8gen.hepmc.Path = "hepmc" ApplicationMgr().TopAlg += [pythia8gen] # Reads an HepMC::GenEvent from the data service and writes a collection of EDM Particles from Configurables import HepMCToEDMConverter hepmc_converter = HepMCToEDMConverter("Converter") hepmc_converter.hepmc.Path = "hepmc" hepmc_converter.hepmcStatusList = [] # convert particles with all statuses hepmc_converter.genparticles.Path = "genParticles" hepmc_converter.genvertices.Path = "genVertices" ApplicationMgr().TopAlg += [hepmc_converter] # FCC event-data model output -> define objects to be written out from Configurables import PodioOutput
pgun2_pion.PdgCodes = [211] pgun2_pion.MomentumMin = 20 * GeV pgun2_pion.MomentumMax = 20 * GeV pgun2_pion.PhiMin = 0 pgun2_pion.PhiMax = 2 * _pi # corresponds to -0.17 < eta < 0.17 pgun2_pion.ThetaMin = 80 * _pi / 180. pgun2_pion.ThetaMax = 100 * _pi / 180. from Configurables import ConstPileUp pileuptool = ConstPileUp() pileuptool.numPileUpEvents = 1 from Configurables import GenAlg genalg_pgun = GenAlg() genalg_pgun.SignalProvider = pgun1_electron genalg_pgun.PileUpProvider = pgun2_pion genalg_pgun.hepmc.Path = "hepmc" genalg_pgun.PileUpTool = pileuptool from Configurables import HepMCToEDMConverter hepmc_converter = HepMCToEDMConverter() hepmc_converter.hepmc.Path = "hepmc" hepmc_converter.genparticles.Path = "GenParticles" hepmc_converter.genvertices.Path = "GenVertices" ###################################################### Simulation setup from Configurables import GeoSvc geoservice = GeoSvc( "GeoSvc",