Skip to content
Snippets Groups Projects
CaloRecAlgsConfig.py 1.68 KiB
Newer Older
""" Define methods used to instantiate configured Calorimeter Calibration reconstruction tools and algorithms
Copyright (C) 2022 CERN for the benefit of the FASER collaboration
Eric Torrence's avatar
Eric Torrence committed
"""
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from AthenaConfiguration.ComponentFactory import CompFactory
from IOVDbSvc.IOVDbSvcConfig import addFolders
Eric Torrence's avatar
Eric Torrence committed
from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg

from CaloRecTools.CaloRecToolConfig import CaloRecToolCfg
Eric Torrence's avatar
Eric Torrence committed

# One stop shopping for normal FASER data
def CalorimeterReconstructionCfg(flags, **kwargs):
    """ Return all algorithms and tools for Waveform reconstruction """
    acc = ComponentAccumulator()

    kwargs.setdefault("CaloWaveHitContainerKey", "CaloWaveformHits")
    kwargs.setdefault("PreshowerWaveHitContainerKey", "PreshowerWaveformHits")
    kwargs.setdefault("CaloHitContainerKey", "CaloHits")
    kwargs.setdefault("PreshowerHitContainerKey", "PreshowerHits")
    acc.merge(CaloRecToolCfg(flags, **kwargs))
    kwargs.pop("MC_calibTag")  # Remove this if it is specified so it does not get pased to CaloRecAlg
    recoAlg = CompFactory.CaloRecAlg("CaloRecAlg", isMC = flags.Input.isMC, **kwargs)
    acc.addEventAlgo(recoAlg)
Eric Torrence's avatar
Eric Torrence committed
    return acc

def CalorimeterReconstructionOutputCfg(flags, **kwargs):
    """ Return ComponentAccumulator with output for Calorimeter Reco"""
    acc = ComponentAccumulator()
    ItemList = [
        "xAOD::CalorimeterHitContainer#*"
        , "xAOD::CalorimeterHitAuxContainer#*"
    ]
    acc.merge(OutputStreamCfg(flags, "xAOD", ItemList))
    # ostream = acc.getEventAlgo("OutputStreamRDO")
    # ostream.TakeItemsFromInput = True # Don't know what this does
    return acc