Esempio n. 1
0
from Configurables import FCCDataSvc
#### Data service
podioevent = FCCDataSvc("EventDataSvc")

from Configurables import ConstPileUp, HepMCFileReader, GaussSmearVertex

smeartool = GaussSmearVertex(xVertexMean=0. * units.mm,
                             xVertexSigma=0.5 * units.mm,
                             yVertexMean=0 * units.mm,
                             yVertexSigma=0.5 * units.mm,
                             zVertexMean=0 * units.mm,
                             zVertexSigma=70 * units.mm,
                             tVertexMean=0 * units.picosecond,
                             tVertexSigma=30 * units.picosecond)

pileuptool = ConstPileUp(numPileUpEvents=2)
pileupreader = HepMCFileReader(
    Filename="/eos/project/f/fccsw-web/testsamples/FCC_minbias_100TeV.dat")

from Configurables import PythiaInterface, GenAlg
### PYTHIA algorithm
pythia8gentool = PythiaInterface("Pythia8Interface", Filename=pythiafile)
pythia8gen = GenAlg("Pythia8",
                    SignalProvider=pythia8gentool,
                    PileUpProvider=pileupreader,
                    VertexSmearingTool=smeartool)
pythia8gen.PileUpTool = pileuptool
pythia8gen.hepmc.Path = "hepmcevent"

from Configurables import HepMCToEDMConverter
### Reads an HepMC::GenEvent from the data service and writes a collection of EDM Particles
Esempio n. 2
0
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")
hepmc_converter.hepmc.Path = "hepmc"
hepmc_converter.genparticles.Path = "allGenParticles"
hepmc_converter.genvertices.Path = "allGenVertices"

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

THistSvc().Output = [
Esempio n. 3
0
### | generate Pythia events and save them to HepMC file   | convert `HepMC::GenEvent` to EDM   | filter MC Particles   | use sample jet clustering algorithm   | write the EDM output to ROOT file using PODIO   |

from Gaudi.Configuration import *

### Example of pythia configuration file to generate events
pythiafile="Generation/data/Pythia_standard.cmd"
# Example of pythia configuration file to read LH event file
#pythiafile="options/Pythia_LHEinput.cmd"

from Configurables import FCCDataSvc
#### Data service
podioevent = FCCDataSvc("EventDataSvc")

from Configurables import ConstPileUp

pileuptool = ConstPileUp(numPileUpEvents=2, Filename="Generation/data/Pythia_minbias_pp_100TeV.cmd")

from Configurables import PythiaInterface
### PYTHIA algorithm
pythia8gen = PythiaInterface("Pythia8Interface", Filename=pythiafile)
pythia8gen.PileUpTool = pileuptool
pythia8gen.DataOutputs.hepmc.Path = "hepmcevent"


from Configurables import HepMCConverter
### Reads an HepMC::GenEvent from the data service and writes a collection of EDM Particles
hepmc_converter = HepMCConverter("Converter")
hepmc_converter.DataInputs.hepmc.Path="hepmcevent"
hepmc_converter.DataOutputs.genparticles.Path="all_genparticles"
hepmc_converter.DataOutputs.genvertices.Path="all_genvertices"
Esempio n. 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"
Esempio n. 5
0
  from Configurables import PileupTrackHitMergeTool
  trackhitsmergetool = PileupTrackHitMergeTool("PileupTrackHitMergeTool")
  # branchnames for the pileup
  trackhitsmergetool.pileupHitsBranch = "TrackerHits"
  trackhitsmergetool.pileupPositionedHitsBranch = "TrackerPositionedHits"
  # branchnames for the signal
  trackhitsmergetool.signalHits = "TrackerHits"
  trackhitsmergetool.signalPositionedHits = "TrackerPositionedHits"
  # branchnames for the output
  trackhitsmergetool.mergedHits = "mergedTrackerHits"
  trackhitsmergetool.mergedPositionedHits = "mergedTrackerPositionedHits"

  # use the pileuptool to specify the number of pileup
  from Configurables import ConstPileUp
  pileuptool = ConstPileUp("ConstPileUp", numPileUpEvents=args.npileup)

  # algorithm for the overlay
  from Configurables import PileupOverlayAlg
  overlay = PileupOverlayAlg()
  overlay.pileupFilenames = pileupFilenames
  overlay.randomizePileup = False
  overlay.noSignal = args.noSignal
  overlay.mergeTools = [particlemergetool, simparticlemergetool, trackhitsmergetool]
  overlay.PileUpTool = pileuptool
  overlay.AuditExecute = True
  algList += [overlay]

from Configurables import FCCDataSvc
podioevent   = FCCDataSvc("EventDataSvc", input=args.inputfile)
Esempio n. 6
0
# edm data from simulation: hits and positioned hits
hcalfwdmergetool = PileupCaloHitMergeTool("HCalFwdHitMerge")
hcalfwdmergetool.pileupHitsBranch = prefix + "HCalFwdCells"
hcalfwdmergetool.signalHits = "HCalFwdCells"
hcalfwdmergetool.mergedHits = "pileupHCalFwdCells"

# edm data from simulation: hits and positioned hits
hcalfwdmergetool = PileupCaloHitMergeTool("HCalEndcapHitMerge")
hcalfwdmergetool.pileupHitsBranch = prefix + "HCalEndcapCells"
hcalfwdmergetool.signalHits = "HCalEndcapCells"
hcalfwdmergetool.mergedHits = "pileupHCalEndcapCells"

# use the pileuptool to specify the number of pileup
from Configurables import ConstPileUp
pileuptool = ConstPileUp("MyPileupTool", numPileUpEvents=pileup)

# algorithm for the overlay
from Configurables import PileupOverlayAlg
overlay = PileupOverlayAlg()
overlay.pileupFilenames = pileupFilenames
overlay.doShuffleInputFiles = True
overlay.randomizePileup = True
overlay.mergeTools = [
    "PileupCaloHitMergeTool/ECalBarrelHitMerge",
    "PileupCaloHitMergeTool/HCalBarrelHitMerge",
]

if not rebase:
    overlay.mergeTools += [
        "PileupCaloHitMergeTool/ECalEndcapHitMerge",
Esempio n. 7
0
# edm data from simulation: hits and positioned hits
hcalfwdmergetool = PileupCaloHitMergeTool("HCalFwdHitMerge")
hcalfwdmergetool.pileupHitsBranch = "HCalFwdCells"
hcalfwdmergetool.signalHits = "HCalFwdCells"
hcalfwdmergetool.mergedHits = "pileupHCalFwdCells"

# edm data from simulation: hits and positioned hits
hcalfwdmergetool = PileupCaloHitMergeTool("HCalEndcapHitMerge")
hcalfwdmergetool.pileupHitsBranch = "HCalEndcapCells"
hcalfwdmergetool.signalHits = "HCalEndcapCells"
hcalfwdmergetool.mergedHits = "pileupHCalEndcapCells"

# use the pileuptool to specify the number of pileup
from Configurables import ConstPileUp
pileuptool = ConstPileUp("MyPileupTool", numPileUpEvents=simargs.pileup)

# algorithm for the overlay
from Configurables import PileupOverlayAlg
overlay = PileupOverlayAlg()
overlay.pileupFilenames = pileupFilenames
overlay.randomizePileup = True
overlay.mergeTools = [
    "PileupParticlesMergeTool/ParticlesMerge",
    "PileupCaloHitMergeTool/ECalBarrelHitMerge",
    "PileupCaloHitMergeTool/ECalEndcapHitMerge",
    "PileupCaloHitMergeTool/ECalFwdHitMerge",
    "PileupCaloHitMergeTool/HCalBarrelHitMerge",
    "PileupCaloHitMergeTool/HCalExtBarrelHitMerge",
    "PileupCaloHitMergeTool/HCalEndcapHitMerge",
    "PileupCaloHitMergeTool/HCalFwdHitMerge"