from Gaudi.Configuration import *
from GaudiKernel import SystemOfUnits as units

from Configurables import ApplicationMgr, THistSvc, Gaudi__ParticlePropertySvc
from Configurables import HepMCDumper, ParticleGunAlg, MomentumRangeParticleGun, HepMCHistograms, FlatSmearVertex

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



particlePropertySvc = Gaudi__ParticlePropertySvc("ParticlePropertySvc",
    ParticlePropertiesFile='Generation/data/ParticleTable.txt')
guntool = MomentumRangeParticleGun(PdgCodes=[-211, 211, -11, -13,  13, 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

gun = ParticleGunAlg("gun", ParticleGunTool = guntool, VertexSmearingToolPGun=smeartool)
gun.DataOutputs.hepmc.Path = "hepmc"




from Configurables import HepMCConverter
hepmc_converter = HepMCConverter("Converter")
Example #2
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")
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(
### | 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 #5
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 #6
0
from Configurables import GeoSvc
geoservice = GeoSvc()
geoservice.detectors = ['file:' + os.path.join(path_to_detector, 'Detector/DetFCChhHCalTile/compact/standalone.xml'),]
geoservice.OutputLevel = INFO

from Configurables import SimG4ConstantMagneticFieldTool
field = SimG4ConstantMagneticFieldTool()
field.FieldOn = False
field.IntegratorStepper = "G4ExactHelixStepper"

from Configurables import ConstPtParticleGun
pgun_tool = ConstPtParticleGun(PdgCodes=[13], EtaMin=0.0000, EtaMax=0.0000001, PhiMin=0.0, PhiMax=1.57, PtMin=10000, PtMax=10000)

from Configurables import FlatSmearVertex
smeartool = FlatSmearVertex()
smeartool.xVertexMin =  0*units.mm
smeartool.xVertexMax = 0*units.mm
smeartool.yVertexMin = 0*units.mm
smeartool.yVertexMax =  0*units.mm
smeartool.zVertexMin = -300*units.mm
smeartool.zVertexMax = 300*units.mm

from Configurables import GenAlg
gen = GenAlg("ParticleGun", SignalProvider=pgun_tool, VertexSmearingTool=smeartool)
gen.hepmc.Path = "hepmc"

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"
Example #7
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 #8
0
from Configurables import SimG4ConstantMagneticFieldTool
field = SimG4ConstantMagneticFieldTool()
field.FieldOn = False
field.IntegratorStepper = "G4ExactHelixStepper"

from Configurables import ConstPtParticleGun
pgun_tool = ConstPtParticleGun(PdgCodes=[13],
                               EtaMin=0.0000,
                               EtaMax=0.0000001,
                               PhiMin=0.0,
                               PhiMax=1.57,
                               PtMin=10000,
                               PtMax=10000)

from Configurables import FlatSmearVertex
smeartool = FlatSmearVertex()
smeartool.xVertexMin = 0 * units.mm
smeartool.xVertexMax = 0 * units.mm
smeartool.yVertexMin = 0 * units.mm
smeartool.yVertexMax = 0 * units.mm
smeartool.zVertexMin = -300 * units.mm
smeartool.zVertexMax = 300 * units.mm

from Configurables import GenAlg
gen = GenAlg("ParticleGun",
             SignalProvider=pgun_tool,
             VertexSmearingTool=smeartool)
gen.hepmc.Path = "hepmc"

from Configurables import HepMCToEDMConverter
## Reads an HepMC::GenEvent from the data service and writes a collection of EDM Particles
Example #9
0
from Gaudi.Configuration import *
from Configurables import ApplicationMgr, THistSvc, Gaudi__ParticlePropertySvc
from Configurables import HepMCDumper, ParticleGunAlg, MomentumRangeParticleGun, HepMCHistograms, FlatSmearVertex

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



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

smeartool = FlatSmearVertex("smeartoolname")
# FCCSW standard unit of length: [mm]
smeartool.xVertexMin = -10
smeartool.xVertexMax = 10
smeartool.yVertexMin = -10
smeartool.yVertexMax = 10
smeartool.zVertexMin = -30
smeartool.zVertexMax = 30

gun = ParticleGunAlg("gun", ParticleGunTool = guntool, VertexSmearingToolPGun=smeartool)
gun.DataOutputs.hepmc.Path = "hepmc"




from Configurables import HepMCConverter
hepmc_converter = HepMCConverter("Converter")
hepmc_converter.DataInputs.hepmc.Path="hepmc"
Example #10
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"
Example #11
0
from Gaudi.Configuration import *
from Configurables import ApplicationMgr, THistSvc, Gaudi__ParticlePropertySvc
from Configurables import HepMCDumper, ParticleGunAlg, MomentumRangeParticleGun, HepMCHistograms, FlatSmearVertex

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

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

smeartool = FlatSmearVertex("smeartoolname")
# FCCSW standard unit of length: [mm]
smeartool.xVertexMin = -10
smeartool.xVertexMax = 10
smeartool.yVertexMin = -10
smeartool.yVertexMax = 10
smeartool.zVertexMin = -30
smeartool.zVertexMax = 30

gun = ParticleGunAlg("gun",
                     ParticleGunTool=guntool,
                     VertexSmearingToolPGun=smeartool)
gun.DataOutputs.hepmc.Path = "hepmc"

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"