# theta from 80 to 100 degrees corresponds to -0.17 < eta < 0.17 
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"
Example #2
0
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',
Example #3
0
particleType = "e-"

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
Example #4
0
from Gaudi.Configuration import *
from Configurables import ApplicationMgr, HepMCDumper

from Configurables import MomentumRangeParticleGun
from GaudiKernel import PhysicalConstants as constants
guntool = MomentumRangeParticleGun("Gun2")
guntool.ThetaMin = 0
guntool.ThetaMax = 2 * constants.pi
guntool.PdgCodes = [11]
guntool2 = MomentumRangeParticleGun("Gun1")
guntool2.ThetaMin = 0
guntool2.ThetaMax = 2 * constants.pi
guntool2.PdgCodes = [11]
from Configurables import ConstPileUp
pileuptool = ConstPileUp()
pileuptool.numPileUpEvents = 10
from Configurables import GenAlg
gen = GenAlg()
gen.SignalProvider = guntool
gen.PileUpProvider = guntool2
gen.PileUpTool = pileuptool
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"

dumper = HepMCDumper("Dumper")
dumper.hepmc.Path = "hepmc"
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]