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 hepmc_converter = HepMCToEDMConverter("Converter") hepmc_converter.hepmc.Path = "hepmcevent" hepmc_converter.hepmcStatusList = [] # convert particles with all statuses hepmc_converter.genparticles.Path = "all_genparticles" hepmc_converter.genvertices.Path = "all_genvertices"
from Gaudi.Configuration import * from Configurables import ApplicationMgr, FCCDataSvc #example of pythia configuration file to generate events pythiafile = "config/Pythia_standard.cmd" #example of pythia configuration file to read LH event file #pythiafile="config/Pythia_LHEinput.cmd" albersevent = FCCDataSvc("EventDataSvc") from Configurables import PythiaInterface # PythiaInterface parameter #pythia8gen = PythiaInterface("Pythia8Interface",Filename="main03.cmnd") pythia8gen = PythiaInterface(Filename=pythiafile) # write the HepMC::GenEvent to the data service pythia8gen.Outputs.hepmc.Path = "hepmc" from Configurables import HepMCConverter # reads an HepMC::GenEvent from the data service and writes # a collection of EDM Particles hepmc_converter = HepMCConverter("Converter") # the input product name matches the output product name of the previous module hepmc_converter.Inputs.hepmc.Path = "hepmc" hepmc_converter.Outputs.genparticles.Path = "all_genparticles" from Configurables import GenParticleFilter genfilter = GenParticleFilter("StableParticles") genfilter.Inputs.genparticles.Path = "all_genparticles" genfilter.Outputs.genparticles.Path = "genparticles"
if simargs.singlePart: pgun_tool = ConstPtParticleGun(PdgCodes=[pdg], PhiMin=phiMin, PhiMax=phiMax, EtaMin=etaMin, EtaMax=etaMax, PtList=ptList) genalg = GenAlg("Pythia8", SignalProvider=pgun_tool, VertexSmearingTool=smeartool) genalg.hepmc.Path = "hepmc" else: from Configurables import PythiaInterface, GenAlg, GaussSmearVertex pythia8gentool = PythiaInterface("Pythia8", Filename=card) genalg = GenAlg("Pythia8", SignalProvider=pythia8gentool, VertexSmearingTool=smeartool) genalg.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 = "GenVertices" from Configurables import GenParticleFilter ### Filters generated particles # accept is a list of particle statuses that should be accepted genfilter = GenParticleFilter("StableParticles", accept=[1], OutputLevel=DEBUG) genfilter.allGenParticles.Path = "allGenParticles"
genJetSaveTool = DelphesSaveGenJets("genJets", delphesArrayName="GenJetFinder/jets") apply_paths(genJetSaveTool, out_names["genJets"]) jetSaveTool = DelphesSaveJets("jets", delphesArrayName="JetEnergyScale/jets") apply_paths(jetSaveTool, out_names["jets"]) metSaveTool = DelphesSaveMet("met", delphesMETArrayName="MissingET/momentum", delphesSHTArrayName="ScalarHT/energy") apply_paths(metSaveTool, out_names["met"]) ## Pythia generator from Configurables import PythiaInterface pythia8gen = PythiaInterface(Filename=pythiaConfFile, OutputLevel=messageLevelPythia) ## Write the HepMC::GenEvent to the data service pythia8gen.DataOutputs.hepmc.Path = "hepmc" ## Delphes simulator -> define objects to be written out from Configurables import DelphesSimulation delphessim = DelphesSimulation(DelphesCard=delphesCard, ROOTOutputFile=delphesRootOutFile, OutputLevel=messageLevelDelphes, outputs=[ "DelphesSaveChargedParticles/muons", "DelphesSaveChargedParticles/electrons", "DelphesSaveChargedParticles/charged", "DelphesSaveNeutralParticles/photons", "DelphesSaveNeutralParticles/neutral", "DelphesSaveGenJets/genJets",
ApplicationMgr().ExtSvc += ["RndmGenSvc"] #### Data service from Configurables import k4DataSvc podioevent = k4DataSvc("EventDataSvc") ApplicationMgr().ExtSvc += [podioevent] from Configurables import GaussSmearVertex smeartool = GaussSmearVertex() smeartool.xVertexSigma = 0.5 * units.mm smeartool.yVertexSigma = 0.5 * units.mm smeartool.zVertexSigma = 40.0 * units.mm smeartool.tVertexSigma = 180.0 * units.picosecond from Configurables import PythiaInterface pythia8gentool = PythiaInterface() ### Example of pythia configuration file to generate events # take from $K4GEN if defined, locally if not path_to_pythiafile = os.environ.get("K4GEN", "") pythiafilename = "Pythia_standard.cmd" pythia8gentool.pythiacard = os.path.join(path_to_pythiafile, pythiafilename) pythia8gentool.doEvtGenDecays = False pythia8gentool.printPythiaStatistics = True from Configurables import GenAlg pythia8gen = GenAlg("Pythia8") pythia8gen.SignalProvider = pythia8gentool pythia8gen.VertexSmearingTool = smeartool pythia8gen.hepmc.Path = "hepmc" ApplicationMgr().TopAlg += [pythia8gen]
from Configurables import ApplicationMgr ApplicationMgr().EvtSel = 'NONE' ApplicationMgr().EvtMax = 100 # Data event model based on Podio from Configurables import FCCDataSvc podioEvent = FCCDataSvc("EventDataSvc") ApplicationMgr().ExtSvc += [podioEvent] ApplicationMgr().OutputLevel = INFO # Pythia generator from Configurables import PythiaInterface pythia8gentool = PythiaInterface() pythia8gentool.Filename = "Pythia_ee_ZH_Htautau.cmd" # Write the HepMC::GenEvent to the data service from Configurables import GenAlg pythia8gen = GenAlg() pythia8gen.SignalProvider = pythia8gentool pythia8gen.hepmc.Path = "hepmc" ApplicationMgr().TopAlg += [pythia8gen] # 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"
ApplicationMgr().OutputLevel = INFO #### Data service from Configurables import FCCDataSvc podioevent = FCCDataSvc("EventDataSvc") ApplicationMgr().ExtSvc += [podioevent] from Configurables import GaussSmearVertex smeartool = GaussSmearVertex() smeartool.xVertexSigma = 0.5*units.mm smeartool.yVertexSigma = 0.5*units.mm smeartool.zVertexSigma = 40.0*units.mm smeartool.tVertexSigma = 180.0*units.picosecond from Configurables import PythiaInterface pythia8gentool = PythiaInterface() ### Example of pythia configuration file to generate events pythiafilename = "Generation/data/Pythia_standard.cmd" path_to_pythiafile = os.environ.get("FCCSW_SHARE_DIR", "") pythiafile = os.path.join(path_to_pythiafile, pythiafilename) # Example of pythia configuration file to read LH event file #pythiafile="options/Pythia_LHEinput.cmd" pythia8gentool.Filename = pythiafile pythia8gentool.doEvtGenDecays = False pythia8gentool.printPythiaStatistics = True from Configurables import GenAlg pythia8gen = GenAlg("Pythia8") pythia8gen.SignalProvider = pythia8gentool pythia8gen.VertexSmearingTool = smeartool pythia8gen.hepmc.Path = "hepmc"
### 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" from Configurables import GenParticleFilter ### Filters generated particles genfilter = GenParticleFilter("StableParticles") genfilter.DataInputs.genparticles.Path = "all_genparticles"
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" from Configurables import GenParticleFilter ### Filters generated particles genfilter = GenParticleFilter("StableParticles") genfilter.DataInputs.genparticles.Path = "all_genparticles"
from Gaudi.Configuration import * # Workflow Steering from Configurables import ApplicationMgr ApplicationMgr().EvtSel = 'NONE' ApplicationMgr().EvtMax = 100 ## Data event model based on Podio from Configurables import FCCDataSvc podioEvent = FCCDataSvc("EventDataSvc") ApplicationMgr().ExtSvc += [podioEvent] ApplicationMgr().OutputLevel = INFO ## Pythia generator from Configurables import PythiaInterface pythia8gentool = PythiaInterface() pythia8gentool.Filename = os.path.join(os.environ.get("FCCSWSHAREDIR", ""),"Generation/data/Pythia_ttbar.cmd") ## Write the HepMC::GenEvent to the data service from Configurables import GenAlg pythia8gen = GenAlg() pythia8gen.SignalProvider = pythia8gentool pythia8gen.hepmc.Path = "hepmc" ApplicationMgr().TopAlg += [pythia8gen] ### 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 = "genParticles" hepmc_converter.genvertices.Path = "genVertices"
delphesRootOutFile = "DelphesOutput.root" #delphesRootOutFile="" ## Data event model based on Albers albersEvent = FCCDataSvc("EventDataSvc") ############################################################ # # Configure individual modules (algorithms) # ############################################################ ## Pythia generator from Configurables import PythiaInterface pythia8gen = PythiaInterface(Filename=pythiaConfFile, OutputLevel=INFO) ## Write the HepMC::GenEvent to the data service pythia8gen.Outputs.hepmc.Path = "hepmc" ## Delphes simulator from Configurables import DelphesSimulation delphessim = DelphesSimulation(DelphesCard=delphesCard, OutputCollections=delphesOutCol, HepMCInputFile=delphesHepMCInFile, ROOTOutputFile=delphesRootOutFile, OutputLevel=DEBUG) delphessim.Inputs.hepmc.Path = "hepmc" delphessim.Outputs.allParticles.Path = "allParticles" delphessim.Outputs.genPartons.Path = "genPartons" delphessim.Outputs.genStableParticles.Path = "genStableParticles"
from GaudiKernel import SystemOfUnits as units from Gaudi.Configuration import * #### Data service from Configurables import FCCDataSvc podioevent = FCCDataSvc("EventDataSvc") from Configurables import GaussSmearVertex smeartool = GaussSmearVertex() smeartool.xVertexSigma = 0.5 * units.mm smeartool.yVertexSigma = 0.5 * units.mm smeartool.zVertexSigma = 40.0 * units.mm smeartool.tVertexSigma = 180.0 * units.picosecond from Configurables import PythiaInterface pythia8gentool = PythiaInterface() ### 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" pythia8gentool.Filename = pythiafile #pythia8gentool.printPythiaStatistics = True from Configurables import GenAlg pythia8gen = GenAlg("Pythia8") pythia8gen.SignalProvider = pythia8gentool pythia8gen.VertexSmearingTool = smeartool pythia8gen.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()
ApplicationMgr().ExtSvc += ["RndmGenSvc"] #### Data service from Configurables import k4DataSvc podioevent = k4DataSvc("EventDataSvc") ApplicationMgr().ExtSvc += [podioevent] from Configurables import GaussSmearVertex smeartool = GaussSmearVertex() smeartool.xVertexSigma = 0.5 * units.mm smeartool.yVertexSigma = 0.5 * units.mm smeartool.zVertexSigma = 40.0 * units.mm smeartool.tVertexSigma = 180.0 * units.picosecond from Configurables import PythiaInterface pythia8gentool = PythiaInterface() ### Example of pythia configuration file to generate events # take from $K4GEN if defined, locally if not path_to_pythiafile = os.environ.get("K4GEN", "") pythiafilename = "Pythia_standard.cmd" pythiafile = os.path.join(path_to_pythiafile, pythiafilename) # Example of pythia configuration file to read LH event file #pythiafile="options/Pythia_LHEinput.cmd" pythia8gentool.pythiacard = pythiafile pythia8gentool.doEvtGenDecays = False pythia8gentool.printPythiaStatistics = True pythia8gentool.pythiaExtraSettings = [""] from Configurables import GenAlg pythia8gen = GenAlg("Pythia8") pythia8gen.SignalProvider = pythia8gentool
""" to run example > export PYTHIA8_XML=/afs/cern.ch/sw/lcg/releases/LCG_68/MCGenerators/pythia8/186/x86_64-slc6-gcc48-opt/xmldoc > ./run gaudirun.py simple_pythia.py """ from Gaudi.Configuration import * from Configurables import ApplicationMgr, FCCDataSvc albersevent = FCCDataSvc("EventDataSvc") from Configurables import PythiaInterface # PythiaInterface parameter #pythia8gen = PythiaInterface("Pythia8Interface",Filename="main03.cmnd") pythia8gen = PythiaInterface(Filename="main03.cmnd") # write the HepMC::GenEvent to the data service pythia8gen.Outputs.hepmc.Path = "hepmc" from Configurables import HepMCConverter # reads an HepMC::GenEvent from the data service and writes # a collection of EDM Particles hepmc_converter = HepMCConverter("Converter") # the input product name matches the output product name of the previous module hepmc_converter.Inputs.hepmc.Path = "hepmc" hepmc_converter.Outputs.genparticles.Path = "all_genparticles" from Configurables import GenParticleFilter genfilter = GenParticleFilter("StableParticles") genfilter.Inputs.genparticles.Path = "all_genparticles" genfilter.Outputs.genparticles.Path = "genparticles"
apply_paths(jetSaveTool, out_names["jets"]) metSaveTool = DelphesSaveMet("met", delphesMETArrayName="MissingET/momentum", delphesSHTArrayName="ScalarHT/energy") apply_paths(metSaveTool, out_names["met"]) ## Pythia generator from Configurables import PoissonPileUp pileup = pileupconf['numPileUpEvents'] pileup = 180 pileuptool = PoissonPileUp(numPileUpEvents=pileup, Filename="Generation/data/Pythia_minbias_pp_100TeV.cmd") from Configurables import PythiaInterface ### PYTHIA algorithm pythia8gen = PythiaInterface(Filename=pythiaConfFile, OutputLevel=messageLevelPythia) pythia8gen.PileUpTool = pileuptool pythia8gen.DataOutputs.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", "DelphesSaveNeutralParticles/pfphotons", "DelphesSaveNeutralParticles/pfneutrals",