Exemple #1
0
from Configurables import FCCDataSvc
## Data service

podioevent = FCCDataSvc("EventDataSvc")
from Configurables import ApplicationMgr, THistSvc, Gaudi__ParticlePropertySvc
from Configurables import HepMCDumper, MomentumRangeParticleGun, HepMCHistograms, FlatSmearVertex, ConstPileUp

dumper = HepMCDumper("Dumper")
dumper.hepmc.Path = "hepmc"

from Configurables import HepMCFileWriter
writer = HepMCFileWriter("MyHepMCFileWriter")
writer.hepmc.Path = "hepmc"

particlePropertySvc = Gaudi__ParticlePropertySvc(
    "ParticlePropertySvc",
    ParticlePropertiesFile='Generation/data/ParticleTable.txt')
guntool = MomentumRangeParticleGun("SignalProvider", PdgCodes=[-211])
guntool2 = MomentumRangeParticleGun("PileUpProvider", PdgCodes=[11])

smeartool = FlatSmearVertex("smeartoolname")
smeartool.xVertexMin = -10 * units.mm
smeartool.xVertexMax = 10 * units.mm
smeartool.yVertexMin = -10 * units.mm
smeartool.yVertexMax = 10 * units.mm
smeartool.zVertexMin = -30 * units.mm
smeartool.zVertexMax = 30 * units.mm

pileuptool = ConstPileUp("MyPileUpConfig", numPileUpEvents=1)

from Configurables import GenAlg
from GaudiKernel import SystemOfUnits as units

from Configurables import HepMCFileReader
from Configurables import ParticleGun, GenAlg

from Configurables import HepMCToEDMConverter

from Configurables import PodioOutput

from Configurables import ApplicationMgr, Gaudi__ParticlePropertySvc

# DATAPATH = '/home/vvorob/ctau/GaudiCTau/Generation/data'
DATAPATH = '/home/razuvaev/sctau5/SCTauFW/Generation/data'

particlePropertySvc = Gaudi__ParticlePropertySvc(
    "ParticlePropertySvc",
    ParticlePropertiesFile=DATAPATH + '/ParticleTable.txt')

### Example of pythia configuration file to generate events
#pythiafile="Test/TestGeneration/data/ee_ZH_Zmumu_Hbb.txt"

#### Data service
podioevent = FCCDataSvc("EventDataSvc")

### PYTHIA algorithm
#pythia8gentool = PythiaInterface("Pythia8Interface", Filename=pythiafile)
#pythia8gen = GenAlg("Pythia8", SignalProvider=pythia8gentool)
#pythia8gen.hepmc.Path = "hepmcevent"
# guntool = ParticleGun("SignalProvider", PdgCodes=[211, 22, 11, -13, 2112, 2212])
guntool = ParticleGun("SignalProvider", PdgCodes=[11])
gun = GenAlg('ParticleGunAlg', SignalProvider=guntool)
Exemple #3
0
from Gaudi.Configuration import *

from Configurables import ParticleGunAlg, MomentumRangeParticleGun, Gaudi__ParticlePropertySvc
pgun = MomentumRangeParticleGun(
    "PGun",
    PdgCodes=[11],  # electron
    MomentumMin=10,  # GeV
    MomentumMax=10,  # GeV
    ThetaMin=-0.45,  # rad
    ThetaMax=-0.45,  # rad
    PhiMin=1.6,  # rad
    PhiMax=1.6)  # rad
gen = ParticleGunAlg("ParticleGun", ParticleGunTool=pgun)
gen.DataOutputs.hepmc.Path = "hepmc"
ppservice = Gaudi__ParticlePropertySvc(
    "ParticlePropertySvc",
    ParticlePropertiesFile="../../../Generation/data/ParticleTable.txt")

from Configurables import HepMCConverter
hepmc_converter = HepMCConverter("Converter")
hepmc_converter.DataInputs.hepmc.Path = "hepmc"
hepmc_converter.DataOutputs.genparticles.Path = "allGenParticles"
hepmc_converter.DataOutputs.genvertices.Path = "allGenVertices"

from Configurables import HepMCDumper
hepmc_dump = HepMCDumper("hepmc")
hepmc_dump.DataInputs.hepmc.Path = "hepmc"

from Configurables import GeoSvc
geoservice = GeoSvc("GeoSvc",
                    detectors=['file:compact/Box_dd4hepCaloSD.xml'],
Exemple #4
0
from Gaudi.Configuration import *
from Configurables import ApplicationMgr, THistSvc, Gaudi__ParticlePropertySvc
from Configurables import HepMCDumper, ParticleGunAlg, MomentumRangeParticleGun, HepMCHistograms, FlatSmearVertex

dumper = HepMCDumper("Dumper")
dumper.Inputs.hepmc.Path = "hepmc"

particlePropertySvc = Gaudi__ParticlePropertySvc("ParticlePropertySvc")

guntool = MomentumRangeParticleGun()

gun = ParticleGunAlg("gun",
                     ParticleGunTool="MomentumRangeParticleGun",
                     VertexSmearingTool="FlatSmearVertex")
gun.Outputs.hepmc.Path = "hepmc"

gun.addTool(FlatSmearVertex, name="FlatSmearVertex")

gun.FlatSmearVertex.xVertexMin = -10
gun.FlatSmearVertex.xVertexMax = 10
gun.FlatSmearVertex.yVertexMin = -10
gun.FlatSmearVertex.yVertexMax = 10
gun.FlatSmearVertex.zVertexMin = -30
gun.FlatSmearVertex.zVertexMax = 30

histo = HepMCHistograms("GenHistograms")
histo.Inputs.hepmc.Path = "hepmc"

THistSvc().Output = [
    "rec DATAFILE='GenHistograms.root' TYP='ROOT' OPT='RECREATE'"
]