thetaMin = 80. thetaMax = 100. magneticField = False from Gaudi.Configuration import * from Configurables import FCCDataSvc podioevent = FCCDataSvc("EventDataSvc") ################## 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"
from Gaudi.Configuration import * from Configurables import ApplicationMgr, HepMCDumper from Configurables import MomentumRangeParticleGun from GaudiKernel import PhysicalConstants as constants guntool = MomentumRangeParticleGun() guntool.ThetaMin = 0 guntool.ThetaMax = 2 * constants.pi guntool.PdgCodes = [11] guntool.MomentumMin = 500 guntool.MomentumMax = 1000 from Configurables import FlatSmearVertex vertexsmeartool = FlatSmearVertex() vertexsmeartool.xVertexMin = -25. vertexsmeartool.xVertexMax = 25. vertexsmeartool.yVertexMin = -25. vertexsmeartool.yVertexMax = 25. vertexsmeartool.zVertexMin = -25. vertexsmeartool.zVertexMax = 25. from Configurables import GenAlg gen = GenAlg() gen.SignalProvider = guntool gen.VertexSmearingTool = vertexsmeartool gen.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 Gaudi.Configuration import * from Configurables import FCCDataSvc podioevent = FCCDataSvc("EventDataSvc") ############################################### Particle Gun setup ### To consistently get particles in both the barrel and the endcap, ### use a double particle gun - one electron in the forward region, one pion in the barrel region _pi = 3.14159 from Configurables import MomentumRangeParticleGun pgun1_electron = MomentumRangeParticleGun("ParticleGun1_Electron") pgun1_electron.PdgCodes = [11] pgun1_electron.MomentumMin = 50 * GeV pgun1_electron.MomentumMax = 50 * GeV pgun1_electron.PhiMin = 0 pgun1_electron.PhiMax = 2 * _pi # corresponds to 4.7 < eta < 5.4 pgun1_electron.ThetaMin = 0.5 * _pi / 180. pgun1_electron.ThetaMax = 1.5 * _pi / 180. from Configurables import MomentumRangeParticleGun pgun2_pion = MomentumRangeParticleGun("ParticleGun2_Pion") 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
from Gaudi.Configuration import * from GaudiKernel import SystemOfUnits as units from GaudiKernel import PhysicalConstants as constants from Configurables import MomentumRangeParticleGun guntool = MomentumRangeParticleGun() guntool.ThetaMin = 0 guntool.ThetaMax = 2 * constants.pi guntool.MomentumMin = 100*units.GeV guntool.MomentumMax = 100*units.GeV guntool.PdgCodes = [11] from Configurables import GenAlg gen = GenAlg() gen.SignalProvider=guntool gen.hepmc.Path = "hepmc" ApplicationMgr().TopAlg += [gen] from Configurables import HepMCToEDMConverter ## reads an HepMC::GenEvent from the data service and writes a collection of EDM Particles hepmc_converter = HepMCToEDMConverter("Converter") hepmc_converter.hepmc.Path="hepmc" hepmc_converter.GenParticles.Path="GenParticles" ApplicationMgr().TopAlg += [hepmc_converter]
ApplicationMgr().OutputLevel = INFO ApplicationMgr().StopOnSignal = True ApplicationMgr().ExtSvc += ['RndmGenSvc'] from Configurables import FCCDataSvc ## Data service podioevent = FCCDataSvc("EventDataSvc") ApplicationMgr().ExtSvc += [podioevent] from Configurables import MomentumRangeParticleGun guntool = MomentumRangeParticleGun() guntool.ThetaMin = 45 * constants.pi / 180. guntool.ThetaMax = 135 * constants.pi / 180. guntool.PhiMin = 0. guntool.PhiMax = 2. * constants.pi guntool.MomentumMin = 1. *units.GeV guntool.MomentumMax = 1. *units.GeV guntool.PdgCodes = [11] # 11 electron, 13 muon, 22 photon, 111 pi0, 211 pi+ from Configurables import GenAlg gen = GenAlg() gen.SignalProvider=guntool gen.hepmc.Path = "hepmc" ApplicationMgr().TopAlg += [gen] from Configurables import HepMCToEDMConverter ## reads an HepMC::GenEvent from the data service and writes a collection of EDM Particles hepmc_converter = HepMCToEDMConverter("Converter") hepmc_converter.hepmc.Path="hepmc" hepmc_converter.GenParticles.Path="GenParticles" ApplicationMgr().TopAlg += [hepmc_converter]