Skip to content
Snippets Groups Projects
  • Whitney Armstrong's avatar
    8bb1464d
    Added input collection copiers · 8bb1464d
    Whitney Armstrong authored
    - Removed env variables in rich script:
    - removed the momentum/angle env variables from the script.
    - This is to avoid abusing this mechanism.  We really only want to
    change the detector and # of events. The benchmarks themselves should be
    static between comparisons otherwise they don't make a good benchmark
    for comparison.
    - Adding the rich to the master CI
    - fixed up scripts and file names
    8bb1464d
    History
    Added input collection copiers
    Whitney Armstrong authored
    - Removed env variables in rich script:
    - removed the momentum/angle env variables from the script.
    - This is to avoid abusing this mechanism.  We really only want to
    change the detector and # of events. The benchmarks themselves should be
    static between comparisons otherwise they don't make a good benchmark
    for comparison.
    - Adding the rich to the master CI
    - fixed up scripts and file names
rich_reco.py 2.53 KiB
from Gaudi.Configuration import *
from GaudiKernel import SystemOfUnits as units

from GaudiKernel.DataObjectHandleBase import DataObjectHandleBase
from Configurables import ApplicationMgr, EICDataSvc, PodioOutput, GeoSvc

detector_name = "topside"
if "JUGGLER_DETECTOR" in os.environ :
  detector_name = str(os.environ["JUGGLER_DETECTOR"])

# todo add checks
input_sim_file  = str(os.environ["JUGGLER_SIM_FILE"])
output_rec_file = str(os.environ["JUGGLER_REC_FILE"])
n_events = str(os.environ["JUGGLER_N_EVENTS"])

geo_service  = GeoSvc("GeoSvc", detectors=["{}.xml".format(detector_name)])
podioevent   = EICDataSvc("EventDataSvc", inputs=[input_sim_file], OutputLevel=DEBUG)

from Configurables import PodioInput
from Configurables import Jug__Digi__PhotoMultiplierDigi as PhotoMultiplierDigi
from Configurables import Jug__Reco__PhotoMultiplierReco as PhotoMultiplierReco
from Configurables import Jug__Reco__PhotoRingClusters as PhotoRingClusters

from Configurables import Jug__Base__InputCopier_dd4pod__Geant4ParticleCollection_dd4pod__Geant4ParticleCollection_ as MCCopier
from Configurables import Jug__Base__InputCopier_dd4pod__PhotoMultiplierHitCollection_dd4pod__PhotoMultiplierHitCollection_ as PMTCopier

qe_data = [(1.0, 0.25), (7.5, 0.25),]
podioinput = PodioInput("PodioReader", collections=["mcparticles", "ForwardRICHHits"], OutputLevel=DEBUG)
## copiers to get around input --> output copy bug. Note the "2" appended to the output collection.
# copy these inputs to the output (a bug work around for now...). Note the the output name has a "2" at the end. 
copier = MCCopier("MCCopier", inputCollection="mcparticles", outputCollection="mcparticles2",OutputLevel=DEBUG) 
pmtcopier = PMTCopier("PMTCopier", inputCollection="ForwardRICHHits", outputCollection="ForwardRICHHits2",OutputLevel=DEBUG) 

pmtdigi = PhotoMultiplierDigi(inputHitCollection="ForwardRICHHits", outputHitCollection="DigiForwardRICHHits",
                              quantumEfficiency=[(a*units.eV, b) for a, b in qe_data])
pmtreco = PhotoMultiplierReco(inputHitCollection="DigiForwardRICHHits", outputHitCollection="RecoForwardRICHHits")
richcluster = PhotoRingClusters(inputHitCollection="RecoForwardRICHHits", #inputTrackCollection="mcparticles",
                                outputClusterCollection="RICHClusters")

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

ApplicationMgr(
    TopAlg = [podioinput, copier, pmtcopier, pmtdigi, pmtreco, richcluster, out],
    EvtSel = 'NONE',
    EvtMax = n_events,
    ExtSvc = [podioevent],
    OutputLevel=DEBUG
 )