Ejemplo n.º 1
0
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
pgun2_pion.ThetaMin = 80 * _pi / 180.
pgun2_pion.ThetaMax = 100 * _pi / 180.
Ejemplo n.º 2
0
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"

################## Simulation setup
Ejemplo n.º 3
0
ApplicationMgr().EvtSel = 'NONE' 
ApplicationMgr().EvtMax = 2
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"