from Configurables import HepMCFileReader, GenAlg readertool = HepMCFileReader( "ReaderTool", Filename="/eos/project/f/fccsw-web/testsamples/FCC_minbias_100TeV.dat") reader = GenAlg("Reader", SignalProvider=readertool) # In the following line, # reader.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.hepmc.Path = "hepmcevent" from Configurables import HepMCDumper ## dumps the HepMC::GenEvent dumper = HepMCDumper("Dumper") # the input product name matches the output product name of the previous module ("hepmcevent") # the string "hepmc" is passed in the constructor of HepMCDumper in DeclareProperty method # note that it is only by coincidence the same as in HepMCReader dumper.hepmc.Path = "hepmcevent" from Configurables import CreateSampleJet, PodioOutput ## dummy algorithm creating a sample jet podiowrite = CreateSampleJet("SampleJet", OutputLevel=DEBUG) podiowrite.podioJets.Path = "podioJets" from Configurables import PodioOutput ## PODIO algorithm out = PodioOutput("out", OutputLevel=DEBUG) from Configurables import ApplicationMgr
from Gaudi.Configuration import * from Configurables import HepMCReader reader = HepMCReader( "Reader", Filename="/afs/cern.ch/exp/fcc/sw/0.7/testsamples/testHepMCrandom.dat") reader.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" from Configurables import HepMCDumper hepmc_dump = HepMCDumper("hepmc") hepmc_dump.DataInputs.hepmc.Path = "hepmc" from Configurables import GeoSvc geoservice = GeoSvc("GeoSvc", detectors=['file:../data/TestBoxCaloSD_volumes.xml']) from Configurables import SimG4Svc geantservice = SimG4Svc("SimG4Svc", detector='SimG4DD4hepDetector', physicslist='SimG4TestPhysicsList', actions='SimG4FullSimActions') from Configurables import SimG4Alg, SimG4SaveCalHits savecaltool = SimG4SaveCalHits("saveECalHits", readoutNames=["ECalHits"]) savecaltool.DataOutputs.positionedCaloHits.Path = "positionedCaloHits"
# 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" out = PodioOutput("out", OutputLevel=DEBUG) out.outputCommands = ["keep *"]