Esempio n. 1
0
from Gaudi.Configuration import *

from Configurables import ApplicationMgr, FCCDataSvc, PodioOutput

podioevent = FCCDataSvc("EventDataSvc")

# reads HepMC text file and write the HepMC::GenEvent to the data service
from Configurables import HepMCReader, HepMCDumper, PoissonPileUp, HepMCFileReader
genpileup = PoissonPileUp(
    name="ConstPileUp",
    Filename="/eos/project/f/fccsw-web/testsamples/example_MyPythia.dat",
    numPileUpEvents=1)
reader = HepMCReader(
    "Reader",
    Filename="/eos/project/f/fccsw-web/testsamples/example_MyPythia.dat",
    PileUpTool=genpileup)
# have a look at the source code of HepMCReader, in Generation/src/HepMCReader
# In the following line,
#   reader.DataOutputs.YYY.Path = "ZZZ"
# YYY matches the string passed to declareOutput in the constructor of the algorithm
# XXX declares a name for the product (the HepMC::GenEvent)
reader.DataOutputs.hepmc.Path = "hepmc"

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

# reads an HepMC::GenEvent from the data service and writes
# a collection of EDM Particles
from Configurables import HepMCConverter
hepmc_converter = HepMCConverter("Converter")
# the input product name matches the output product name of the previous module
Esempio n. 2
0
from Gaudi.Configuration import *

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

# reads HepMC text file and write the HepMC::GenEvent to the data service
from Configurables import HepMCReader, HepMCDumper, PoissonPileUp, HepMCFileReader
genpileup = PoissonPileUp(
    name="ConstPileUp",
    Filename="/afs/cern.ch/exp/fcc/sw/0.6/testsamples/example_MyPythia.dat",
    numPileUpEvents=1)
reader = HepMCReader(
    "Reader",
    Filename="/afs/cern.ch/exp/fcc/sw/0.6/testsamples/example_MyPythia.dat",
    PileUpTool=genpileup)
# have a look at the source code of HepMCReader, in Generation/src/HepMCReader
# In the following line,
#   reader.DataOutputs.YYY.Path = "XXX"
# YYY matches the string passed to declareOutput in the constructor of the algorithm (here "hepmc")
# XXX declares a name for the product (here the product is HepMC::GenEvent: "hepmcevent")
reader.DataOutputs.hepmc.Path = "hepmcevent"

# reads an HepMC::GenEvent from the data service and writes a collection of EDM Particles
from Configurables import HepMCConverter
hepmc_converter = HepMCConverter("Converter")
# the input product name matches the output product name of the previous module
hepmc_converter.DataInputs.hepmc.Path = "hepmcevent"
# giving a meaningful name for the output product
hepmc_converter.DataOutputs.genparticles.Path = "all_genparticles"
hepmc_converter.DataOutputs.genvertices.Path = "all_genvertices"
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",
                SignalProvider=readertool,
                PileUpProvider=readertool_pileup,
                PileUpTool=genpileup,
                HepMCMergeTool=mergetool,
                VertexSmearingTool=smeartool)
apply_paths(jetSaveTool, out_names["jets"])

fatjetSaveTool = DelphesSaveJets("fatjets", delphesArrayName="FatJetFinder/jets", saveSubstructure=True)
apply_paths(fatjetSaveTool, out_names["fatjets"])

metSaveTool = DelphesSaveMet("met", delphesMETArrayName="MissingET/momentum", delphesSHTArrayName="ScalarHT/energy")
apply_paths(metSaveTool, out_names["met"])

#### Pythia generator
from Configurables import PythiaInterface
from Configurables import PoissonPileUp
from Configurables import HepMCFullMerge

pythia8gentool = PythiaInterface(Filename=pythiaConfFile, OutputLevel=messageLevelPythia)
mergetool = HepMCFullMerge()
pileuptool = PoissonPileUp(numPileUpEvents=140)
## Write the HepMC::GenEvent to the data service
from Configurables import GenAlg
pythia8gen = GenAlg("Pythia8", SignalProvider=pythia8gentool, PileUpProvider=pythia8gentool, PileUpTool=pileuptool, HepMCMergeTool=mergetool)
pythia8gen.hepmc.Path = "hepmc"

## Delphes simulator -> define objects to be written out
from Configurables import DelphesSimulation
delphessim = DelphesSimulation(DelphesCard=delphesCard,
                               ROOTOutputFile=delphesRootOutFile,
                               ApplyGenFilter=True,
                               OutputLevel=messageLevelDelphes,
                               outputs=["DelphesSaveChargedParticles/muons",
                                        "DelphesSaveChargedParticles/electrons",
                                        "DelphesSaveNeutralParticles/photons",
                                        "DelphesSaveChargedParticles/pfcharged",
Esempio n. 5
0
from Gaudi.Configuration import *

from Configurables import ApplicationMgr, FCCDataSvc, PodioOutput

podioevent   = FCCDataSvc("EventDataSvc")

# reads HepMC text file and write the HepMC::GenEvent to the data service
from Configurables import GenAlg, HepMCDumper, PoissonPileUp, HepMCFileReader
genpileup = PoissonPileUp(name="ConstPileUp", numPileUpEvents=1)
readertool = HepMCFileReader("ReaderTool", Filename="/eos/project/f/fccsw-web/testsamples/example_MyPythia.dat")
readertool_pileup = HepMCFileReader("ReaderToolPileup", Filename="/eos/project/f/fccsw-web/testsamples/example_MyPythia.dat")
reader = GenAlg("Reader", SignalProvider=readertool, PileUpProvider=readertool_pileup, PileUpTool=genpileup)
# have a look at the source code of GenAlg, in Generation/src/components/GenAlg.cpp
# In the following line,
#   reader.YYY.Path = "ZZZ"
# YYY matches the string passed to declareOutput in the constructor of the algorithm
# XXX declares a name for the product (the HepMC::GenEvent)
reader.hepmc.Path = "hepmc"


dumper = HepMCDumper()
dumper.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")
# the input product name matches the output product name of the previous module
hepmc_converter.hepmc.Path="hepmc"
hepmc_converter.genparticles.Path="all_genparticles"
hepmc_converter.genvertices.Path="all_genvertices"
Esempio n. 6
0
from Configurables import HepMCReader, HepMCDumper, PoissonPileUp, HepMCFileReader, FlatSmearVertex, HepMCFullMerge

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",
    Filename="/afs/cern.ch/exp/fcc/sw/0.7/testsamples/FCC_minbias_100TeV.dat",
    numPileUpEvents=pileupconf['numPileUpEvents'])

mergetool = HepMCFullMerge()

reader = HepMCReader(
    "Reader",
    Filename="/afs/cern.ch/exp/fcc/sw/0.7/testsamples/FCC_minbias_100TeV.dat",
    PileUpTool=genpileup,
    HepMCMergeTool=mergetool,
    VertexSmearingTool=smeartool)
reader.DataOutputs.hepmc.Path = "hepmc"

dumper = HepMCDumper()
dumper.DataInputs.hepmc.Path = "hepmc"
Esempio n. 7
0
#pythiafile="options/Pythia_LHEinput.cmd"

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

## N-events
from FWCore.joboptions import parse_standard_job_options
args = parse_standard_job_options()
nEvents=1
if args.nevents is not None:
    nEvents = args.nevents

from Configurables import PoissonPileUp

pileuptool = PoissonPileUp(numPileUpEvents=pileupconf['numPileUpEvents'], Filename="Generation/data/Pythia_minbias_pp_100TeV.cmd")

from Configurables import PythiaInterface
### PYTHIA algorithm
pythia8gen = PythiaInterface("Pythia8Interface", Filename="Generation/data/Pythia_minbias_pp_100TeV.cmd")
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. 8
0
from FCCPileupScenarios import FCCPhase1PileupConf as pileupconf

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

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",
    Filename="/eos/project/f/fccsw-web/testsamples/FCC_minbias_100TeV.dat",
    numPileUpEvents=pileupconf['numPileUpEvents'])

mergetool = HepMCFullMerge()

reader = HepMCReader(
    "Reader",
    Filename="/eos/project/f/fccsw-web/testsamples/FCC_minbias_100TeV.dat",
    PileUpTool=genpileup,
    HepMCMergeTool=mergetool,
    VertexSmearingTool=smeartool)
reader.DataOutputs.hepmc.Path = "hepmc"

dumper = HepMCDumper()
dumper.DataInputs.hepmc.Path = "hepmc"
Esempio n. 9
0
import os
from GaudiKernel import SystemOfUnits as units
from GaudiKernel import PhysicalConstants as constants
from Gaudi.Configuration import *

from Configurables import FCCDataSvc
podioevent = FCCDataSvc("EventDataSvc")
from Configurables import PodioInput

from Configurables import GenAlg, MomentumRangeParticleGun, PoissonPileUp
pileuptool = PoissonPileUp("PileUp", numPileUpEvents=12)
pgun_tool = MomentumRangeParticleGun(PdgCodes=[13],
                                     PhiMin=0.,
                                     PhiMax=constants.pi * 0.5,
                                     ThetaMin=constants.pi / 2.,
                                     ThetaMax=constants.pi * 0.9,
                                     MomentumMin=10000,
                                     MomentumMax=100000)
pgun_tool2 = MomentumRangeParticleGun(PdgCodes=[13],
                                      PhiMin=0.,
                                      PhiMax=constants.pi * 0.5,
                                      ThetaMin=constants.pi / 2.,
                                      ThetaMax=constants.pi * 0.9,
                                      MomentumMin=10000,
                                      MomentumMax=100000)
gen = GenAlg("ParticleGun",
             SignalProvider=pgun_tool,
             PileUpProvider=pgun_tool2,
             PileUpTool=pileuptool)
gen.hepmc.Path = "hepmc"