example_calodigi.py 2.21 KB
Newer Older
Whitney Armstrong's avatar
JugDigi  
Whitney Armstrong committed
1
2
from Gaudi.Configuration import *

3
from GaudiKernel.DataObjectHandleBase import DataObjectHandleBase
4
from Configurables import ApplicationMgr, EICDataSvc, PodioOutput, GeoSvc
5

6
geo_service  = GeoSvc("GeoSvc")#detectors=["topside/vertex_tracker.xml"])
Whitney Armstrong's avatar
JugDigi  
Whitney Armstrong committed
7
8
9
10
podioevent   = EICDataSvc("EventDataSvc", inputs=["derp.root"], OutputLevel=DEBUG)

from Configurables import PodioInput
from Configurables import Jug__Digi__ExampleCaloDigi as ExampleCaloDigi
11
#from Configurables import Jug__Digi__ExampleCaloDigiFunc as ExampleCaloDigiFunc
12
from Configurables import Jug__Digi__UFSDTrackerDigi as UFSDTrackerDigi
13
from Configurables import Jug__Reco__TrackerHitReconstruction as TrackerHitReconstruction
14
podioinput = PodioInput("PodioReader", collections=["mcparticles","LAEC_PrShHits","LAEC_ShHits","FAEC_PrShHits","FAEC_ShHits","GEMTrackerHits"], OutputLevel=DEBUG)
15
caldigi = ExampleCaloDigi(inputHitCollection="FAEC_ShHits",outputHitCollection="RawFAECShowerHits")
16
ufsd_digi = UFSDTrackerDigi(inputHitCollection="GEMTrackerHits",outputHitCollection="GEMRawHits")
17
18
#caldigifunc = ExampleCaloDigiFunc(InputData="FAEC_ShHits",OutputData="DERP")
trackerhit = TrackerHitReconstruction(inputHitCollection="GEMRawHits",outputHitCollection="GEMTrackHits")
19
20
21
22
23
24
25
26

types = []

# this printout is useful to check that the type information is passed to python correctly
print("---------------------------------------\n")
print("---\n# List of input and output types by class")
for configurable in sorted([
        PodioInput, EICDataSvc, PodioOutput,
27
        ExampleCaloDigi,ExampleCaloDigi, UFSDTrackerDigi ],
28
29
30
31
32
33
34
35
36
37
                           key=lambda c: c.getType()):
    print("\"{}\":".format(configurable.getType()))
    props = configurable.getDefaultProperties()
    for propname, prop in sorted(props.items()):
        print(" prop name: {}".format(propname))
        if isinstance(prop, DataObjectHandleBase):
            types.append(prop.type())
            print("  {}: \"{}\"".format(propname, prop.type()))
print("---")

Whitney Armstrong's avatar
JugDigi  
Whitney Armstrong committed
38
39
40
41

out = PodioOutput("out", filename="test.root")
out.outputCommands = ["keep *"]

42

Whitney Armstrong's avatar
JugDigi  
Whitney Armstrong committed
43
ApplicationMgr(
44
    TopAlg = [podioinput, caldigi,ufsd_digi,trackerhit, out
Whitney Armstrong's avatar
JugDigi  
Whitney Armstrong committed
45
46
47
48
49
50
51
              ],
    EvtSel = 'NONE',
    EvtMax   = 5,
    ExtSvc = [podioevent],
    OutputLevel=DEBUG
 )