Exemplo n.º 1
0
#!/usr/bin/env python

from Gaudi.Configuration import *

from Configurables import k4DataSvc
dsvc = k4DataSvc("EventDataSvc")

from Configurables import PlcioWriteAlg
alg = PlcioWriteAlg("PlcioWriteAlg")
alg.HeaderCol.Path = "EventHeader"
alg.OutputCol.Path = "MCParticle"

from Configurables import PodioOutput
out = PodioOutput("out")
out.filename = "test.root"
out.outputCommands = ["keep *"]

# ApplicationMgr
from Configurables import ApplicationMgr
ApplicationMgr(TopAlg=[alg, out],
               EvtSel='NONE',
               EvtMax=10,
               ExtSvc=[dsvc],
               OutputLevel=DEBUG)
from Gaudi.Configuration import *

from Configurables import k4DataSvc, TestE4H2L, EDM4hep2LcioTool, Lcio2EDM4hepTool

algList = []

END_TAG = "END_TAG"

evtsvc = k4DataSvc('EventDataSvc')

# EDM4hep2lcio Tool
edmConvTool = EDM4hep2LcioTool("EDM4hep2lcio")
edmConvTool.Parameters = [
    "CalorimeterHit", "E4H_CaloHitCollection", "LCIO_CaloHitCollection",
    "RawCalorimeterHit", "E4H_RawCaloHitCollection", "LCIO_RawCaloHitCollection",
    "TPCHit", "E4H_TPCHitCollection", "LCIO_TPCHitCollection",
    "Track", "E4H_TrackCollection", "LCIO_TrackCollection",
    "SimTrackerHit", "E4H_SimTrackerHitCollection", "LCIO_SimTrackerHitCollection",
    "TrackerHit", "E4H_TrackerHitCollection", "LCIO_TrackerHitCollection",
    "MCParticle", "E4H_MCParticleCollection", "LCIO_MCParticleCollection",
    "SimCalorimeterHit", "E4H_SimCaloHitCollection", "LCIO_SimCaloHitCollection"
]

# LCIO2EDM4hep Tool
lcioConvTool = Lcio2EDM4hepTool("Lcio2EDM4hep")
lcioConvTool.Parameters = [
    "CalorimeterHit", "LCIO_CaloHitCollection", "E4H_CaloHitCollection_conv",
    # "TrackerHit", "LCIO_TrackerHitCollection", "E4H_TrackerHitCollection_conv",
    "SimTrackerHit", "LCIO_SimTrackerHitCollection", "E4H_SimTrackerHitCollection_conv",
    "Track", "LCIO_TrackCollection", "E4H_TrackCollection_conv",
    "MCParticle", "LCIO_MCParticleCollection", "E4H_MCParticleCollection_conv",
Exemplo n.º 3
0
from Gaudi.Configuration import *

from Configurables import k4DataSvc
podioevent = k4DataSvc("EventDataSvc")

from Configurables import TestAlgorithmWithTFile
producer = TestAlgorithmWithTFile()

from Configurables import PodioOutput
out = PodioOutput("out")
out.filename = "output_TestAlgorithmWithTFile_framework.root"
out.outputCommands = ["keep *"]

from Configurables import ApplicationMgr
ApplicationMgr(
    TopAlg=[producer, out],
    EvtSel="NONE",
    EvtMax=100,
    ExtSvc=[podioevent],
    OutputLevel=INFO,
    StopOnSignal=True,
)
Exemplo n.º 4
0
#!/usr/bin/env python

from Gaudi.Configuration import *

from Configurables import k4DataSvc
dsvc = k4DataSvc("EventDataSvc", input="test.root")

from Configurables import PlcioReadAlg
alg = PlcioReadAlg("PlcioReadAlg")
alg.HeaderCol.Path = "EventHeader"
alg.InputCol.Path = "MCParticle"

from Configurables import PodioInput
podioinput = PodioInput("PodioReader", collections=[
    "EventHeader",
    "MCParticle"
    ])

# ApplicationMgr
from Configurables import ApplicationMgr
ApplicationMgr( TopAlg = [podioinput, alg],
                EvtSel = 'NONE',
                EvtMax = 10,
                ExtSvc = [dsvc],
                OutputLevel=DEBUG
)
Exemplo n.º 5
0
from Gaudi.Configuration import *
from Configurables import ApplicationMgr

from Configurables import k4DataSvc
dataservice = k4DataSvc("EventDataSvc", input="digi.root")

from Configurables import PodioInput
podioinput = PodioInput("PodioInput",
  collections = [
    "DigiCalorimeterHits",
    "DigiWaveforms",
    "RawTimeStructs",
    "RawCalorimeterHits",
    "SimCalorimeterHits",
    "RawWavlenStructs",
    "GenParticles",
    "Leakages"
  ],
  OutputLevel = DEBUG
)

from Configurables import GeoSvc
geoservice = GeoSvc(
    "GeoSvc",
    detectors = [
        'file:share/compact/DRcalo.xml'
    ]
)

from Configurables import DRcalib2D
calib2d = DRcalib2D("DRcalib2D", OutputLevel=DEBUG)
Exemplo n.º 6
0
from Gaudi.Configuration import *
from Configurables import ApplicationMgr

from Configurables import k4DataSvc
dataservice = k4DataSvc("EventDataSvc", input="sim.root")

from Configurables import PodioInput
podioinput = PodioInput("PodioInput", collections = ["RawTimeStructs", "RawCalorimeterHits", "SimCalorimeterHits", "RawWavlenStructs", "GenParticles", "Leakages"], OutputLevel = DEBUG)

from Configurables import DigiSiPM
digi = DigiSiPM("DigiSiPM", OutputLevel=DEBUG)

from Configurables import PodioOutput
podiooutput = PodioOutput("PodioOutput", filename = "digi.root", OutputLevel = DEBUG)
podiooutput.outputCommands = ["keep *"]

ApplicationMgr(
    TopAlg = [
        podioinput,
        digi,
        podiooutput
    ],
    EvtSel = 'NONE',
    EvtMax = 10,
    ExtSvc = [dataservice]
)
Exemplo n.º 7
0
from Gaudi.Configuration import *
from Configurables import ApplicationMgr
from GaudiKernel import SystemOfUnits as units

from Configurables import k4DataSvc
dataservice = k4DataSvc("EventDataSvc")

from Configurables import GenAlg, MomentumRangeParticleGun
pgun = MomentumRangeParticleGun(
    "PGun",
    PdgCodes=[11],  # electron
    MomentumMin=20. * units.GeV,  # GeV
    MomentumMax=20. * units.GeV,  # GeV
    ThetaMin=1.5335,  # rad
    ThetaMax=1.5335,  # rad
    PhiMin=0.01745,  # rad
    PhiMax=0.01745  # rad
)

from Configurables import FlatSmearVertex
smearTool = FlatSmearVertex(
    "VertexSmearingTool",
    yVertexMin=-36.42,  # mm
    yVertexMax=-26.42,  # mm
    zVertexMin=-52.135,  # mm
    zVertexMax=-42.135,  # mm
    beamDirection=0  # 1, 0, -1
)

from Configurables import HepMCToEDMConverter
hepmc2edm = HepMCToEDMConverter("Converter")
Exemplo n.º 8
0
geometry_path = os.path.join(os.getenv("DETCEPCV4ROOT"), "compact",
                             geometry_option)
if not os.path.exists(geometry_path):
    print("Can't find the compact geometry file: %s" % geometry_path)
    sys.exit(-1)

from Configurables import GeomSvc
geosvc = GeomSvc("GeomSvc")
geosvc.compact = geometry_path

##############################################################################
# Event Data Svc
##############################################################################

from Configurables import k4DataSvc
dsvc = k4DataSvc("EventDataSvc", input="test-detsim10.root")

##############################################################################
# NTuple Svc
##############################################################################

from Configurables import NTupleSvc
ntsvc = NTupleSvc("NTupleSvc")
ntsvc.Output = ["MyTuples DATAFILE='result.root' OPT='NEW' TYP='ROOT'"]

##############################################################################
# DumpAlg
##############################################################################

from Configurables import DumpIDAlg
alg = DumpIDAlg("DumpAlg")