Ejemplo n.º 1
0
### \file
### \ingroup SimulationTests
### | **input (alg)**                 | other algorithms                   |                                     |                          |                                    | **output (alg)**                                |
### | ------------------------------- | ---------------------------------- | ----------------------------------- | ------------------------ | ---------------------------------- | ----------------------------------------------- |
### | read events from a HepMC file   | convert `HepMC::GenEvent` to EDM   | geometry taken from TestTracker.xml | FTFP_BERT physics list   | save Tracker and HCAL hits         | write the EDM output to ROOT file using PODIO   |

from Gaudi.Configuration import *
from Configurables import ApplicationMgr, HepMCReader, HepMCDumper, FCCDataSvc

podioevent = FCCDataSvc("EventDataSvc")

reader = HepMCReader(
    "Reader",
    Filename="/eos/project/f/fccsw-web/testsamples/FCC_minbias_100TeV.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 GeoSvc
geoservice = GeoSvc(
    "GeoSvc",
    detectors=[
        'file:../../../Detector/DetFCChhBaseline1/compact/FCChh_DectEmptyMaster.xml',
        'file:../../../Detector/DetFCChhTrackerSimple/compact/Tracker.xml'
    ],
    OutputLevel=DEBUG)
Ejemplo n.º 2
0
from Gaudi.Configuration import *
from Configurables import ApplicationMgr, HepMCReader, HepMCDumper, HepMCJetClustering
from Configurables import HepMCHistograms, JetHistograms

# reads HepMC text file and write the HepMC::GenEvent to the data service
reader = HepMCReader("Reader", Filename="example_MyPythia.dat")
reader.DataOutputs.hepmc.Path = "hepmc"

# dumps the HepMC::GenEvent
dumper = HepMCDumper("Dumper")
dumper.DataInputs.hepmc.Path = "hepmc"

# creates histograms for HepMC
genHisto = HepMCHistograms("GenHistograms")
genHisto.DataInputs.hepmc.Path = "hepmc"

# runs sample jet clustering algorithm
jets = HepMCJetClustering("ktCluster")
jets.JetAlgorithm = "kt"
jets.RecominbationScheme = "E"
jets.ConeRadius = 0.7
jets.PtMin = 1
jets.DataInputs.hepmc.Path = "hepmc"
jets.DataOutputs.jets.Path = "ktJets"

# creates histograms for jets
jetHisto = JetHistograms("JetHistograms")
jetHisto.DataInputs.jets.Path = "ktJets"

# save all histograms
THistSvc().Output = [
Ejemplo n.º 3
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
reader = HepMCReader("Reader", Filename="/afs/cern.ch/exp/fcc/sw/0.7/testsamples/FCC_minbias_100TeV.dat")
reader.DataOutputs.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")
hepmc_converter.DataInputs.hepmc.Path="hepmc"
hepmc_converter.DataOutputs.genparticles.Path="allGenParticles"
hepmc_converter.DataOutputs.genvertices.Path="allGenVertices"

# DD4hep geometry service
# Parses the given xml file
from Configurables import GeoSvc
geoservice = GeoSvc("GeoSvc", detectors=['file:Detector/DetFCChhBaseline1/compact/FCChh_DectEmptyMaster.xml',
                                         'file:Detector/DetCommon/compact/TrackerAir.xml'])

# Geant4 service
# Configures the Geant simulation: geometry, physics list and user actions
from Configurables import SimG4Svc, SimG4FastSimPhysicsList, SimG4FastSimActions, SimG4ParticleSmearRootFile
from GaudiKernel.SystemOfUnits import GeV
# create particle smearing tool, used for smearing in the tracker
smeartool = SimG4ParticleSmearRootFile("Smear", detectorNames=["TrackerEnvelopeBarrel"], filename="/afs/cern.ch/exp/fcc/sw/0.7/testsamples/tkLayout_example_resolutions.root", minP = 5*GeV, maxP = 1000*GeV, maxEta=6)
# create actions initialization tool
Ejemplo n.º 4
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"
Ejemplo n.º 5
0
from Gaudi.Configuration import *
from Configurables import ApplicationMgr, HepMCReader, HepMCDumper

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"

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

from Configurables import GeoSvc

geoservice = GeoSvc(
    "GeoSvc",
    detectors=['file:Test/TestGeometry/data/TestBoxCaloSD_3readouts.xml'],
    OutputLevel=DEBUG)

from Configurables import SimG4Svc

geantservice = SimG4Svc("SimG4Svc", physicslist='SimG4TestPhysicsList')

from Configurables import SimG4Alg, SimG4SaveCalHits, InspectHitsCollectionsTool
Ejemplo n.º 6
0
from Gaudi.Configuration import *

from Configurables import HepMCReader
reader = HepMCReader(
    "Reader",
    Filename="/eos/project/f/fccsw-web/testsamples/testHepMCborders.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_segmentation.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"
Ejemplo n.º 7
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
Ejemplo n.º 8
0
from Gaudi.Configuration import *
from Configurables import ApplicationMgr, HepMCReader, HepMCDumper, HepMCJetClustering
from Configurables import HepMCHistograms, JetHistograms

reader = HepMCReader("Reader", Filename="pythia.dat")
reader.Outputs.hepmc.Path = "hepmc"

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

genHisto = HepMCHistograms("GenHistograms")
genHisto.Inputs.hepmc.Path="hepmc"

jets = HepMCJetClustering("ktCluster")
jets.JetAlgorithm = "kt"
jets.RecominbationScheme = "E"
jets.ConeRadius = 0.7
jets.PtMin = 1
jets.Inputs.hepmc.Path="hepmc"
jets.Outputs.jets.Path="ktJets"

jetHisto = JetHistograms("JetHistograms")
jetHisto.Inputs.jets.Path="ktJets"

THistSvc().Output = ["rec DATAFILE='GenHistograms.root' TYP='ROOT' OPT='RECREATE'"]
THistSvc().PrintAll=True
THistSvc().AutoSave=True
THistSvc().AutoFlush=True
THistSvc().OutputLevel=VERBOSE

ApplicationMgr(EvtSel='NONE',
Ejemplo n.º 9
0
                            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"

ApplicationMgr(
    TopAlg=[reader, dumper],
    EvtSel='NONE',
    EvtMax=1,
    ExtSvc=[albersevent],
)
Ejemplo n.º 10
0
                            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"

ApplicationMgr(
    TopAlg=[reader, dumper],
    EvtSel='NONE',
    EvtMax=1,
    ExtSvc=[albersevent],
)