Example #1
0
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
gun = GenAlg()
gun.hepmc.Path = "hepmc"

from Configurables import HepMCToEDMConverter
hepmc_converter = HepMCToEDMConverter("Converter")
### | reading events from a HepMC file | load pileup configuration from external python dict | smear Vertices        | dump `HepMC::GenEvent`                | write the EDM output to ROOT file using PODIO   |

from Gaudi.Configuration import *

from Configurables import ApplicationMgr
from FCCPileupScenarios import FCCPhase1PileupConf as pileupconf

from Configurables import HepMCDumper, PoissonPileUp, HepMCFileReader, FlatSmearVertex, HepMCFullMerge, GenAlg

from Configurables import FCCDataSvc

albersevent = FCCDataSvc("EventDataSvc")

smeartool = FlatSmearVertex(xVertexMin=pileupconf['xVertexMin'],
                            xVertexMax=pileupconf['xVertexMax'],
                            yVertexMin=pileupconf['yVertexMin'],
                            yVertexMax=pileupconf['yVertexMax'],
                            zVertexMin=pileupconf['zVertexMin'],
                            zVertexMax=pileupconf['zVertexMax'])

genpileup = PoissonPileUp(name="Pileup",
                          numPileUpEvents=pileupconf['numPileUpEvents'])

mergetool = HepMCFullMerge()

readertool = HepMCFileReader(
    "ReaderTool",
    Filename="/eos/project/f/fccsw-web/testsamples/FCC_minbias_100TeV.dat")
readertool_pileup = HepMCFileReader(
    "ReaderToolPileup",
    Filename="/eos/project/f/fccsw-web/testsamples/FCC_minbias_100TeV.dat")
reader = GenAlg("Reader",
Example #3
0
from Gaudi.Configuration import *

from Configurables import ApplicationMgr, FCCDataSvc

albersevent   = FCCDataSvc("EventDataSvc")
# reads HepMC text file and write the HepMC::GenEvent to the data service
from Configurables import HepMCReader, HepMCDumper, PoissonPileUp, HepMCFileReader, FlatSmearVertex

# assuming mm
smeartool = FlatSmearVertex(
    xVertexMin = -0.5,
    xVertexMax = 0.5,
    yVertexMin = -0.5,
    yVertexMax = 0.5,
    zVertexMin = -35,
    zVertexMax = 35 )

genpileup = PoissonPileUp(name="Pileup", 
    Filename="/afs/cern.ch/exp/fcc/sw/0.6/testsamples/example_MyPythia.dat",
    numPileUpEvents=2)
reader = HepMCReader("Reader", 
    Filename="/afs/cern.ch/exp/fcc/sw/0.6/testsamples/example_MyPythia.dat",
    PileUpTool=genpileup,
    VertexSmearingTool = smeartool)
reader.DataOutputs.hepmc.Path = "hepmc"

# printout of the hepmc stuff
dumper = HepMCDumper()
dumper.DataInputs.hepmc.Path="hepmc"

ApplicationMgr(
Example #4
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 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"

# 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"
Example #5
0
pgun = MomentumRangeParticleGun(
    "PGun",
    PdgCodes=[11],  # electron
    MomentumMin=20. * units.GeV,  # GeV
    MomentumMax=20. * units.GeV,  # GeV
    ThetaMin=1.5335,  # rad
    ThetaMax=1.5335,  # rad
    PhiMin=0.01745,  # rad
    PhiMax=0.01745  # rad
)

from Configurables import FlatSmearVertex
smearTool = FlatSmearVertex(
    "VertexSmearingTool",
    yVertexMin=-36.42,  # mm
    yVertexMax=-26.42,  # mm
    zVertexMin=-52.135,  # mm
    zVertexMax=-42.135,  # mm
    beamDirection=0  # 1, 0, -1
)

from Configurables import HepMCToEDMConverter
hepmc2edm = HepMCToEDMConverter("Converter")

gen = GenAlg("ParticleGun", SignalProvider=pgun, VertexSmearingTool=smearTool)

from Configurables import GeoSvc
geoservice = GeoSvc("GeoSvc", detectors=['file:share/compact/DRcalo.xml'])

from Configurables import SimG4Svc, SimG4FastSimPhysicsList, SimG4FastSimOpFiberRegion, SimG4OpticalPhysicsList
regionTool = SimG4FastSimOpFiberRegion("fastfiber")
opticalPhysicsTool = SimG4OpticalPhysicsList("opticalPhysics",
Example #6
0
File: gun.py Project: lbrl/sctau
dumper = HepMCDumper("Dumper")
dumper.hepmc.Path = "hepmc"

writer = HepMCFileWriter("MyHepMCFileWriter")
writer.hepmc.Path = "hepmc"

DATAPATH = '/ceph/groups/sctau/SCTauFW/Generation/data'

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

guntool = ParticleGun("SignalProvider", PdgCodes=[-211])
#guntool2 = ParticleGun("PileUpProvider", PdgCodes=[11])

smeartool = FlatSmearVertex("VertexSmearingTool")
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)

gun = GenAlg()
gun.hepmc.Path = "hepmc"

hepmc_converter = HepMCToEDMConverter("Converter")
hepmc_converter.hepmc.Path = "hepmc"
hepmc_converter.genparticles.Path = "allGenParticles"