Exemple #1
0
def MdtOverlayAlgCfg(flags, name="MdtOverlay", **kwargs):
    """Return a ComponentAccumulator for MDTOverlay algorithm"""
    acc = ComponentAccumulator()

    kwargs.setdefault("BkgInputKey", flags.Overlay.BkgPrefix + "MDT_DIGITS")
    kwargs.setdefault("SignalInputKey", flags.Overlay.SigPrefix + "MDT_DIGITS")
    kwargs.setdefault("OutputKey", "MDT_DIGITS")

    kwargs.setdefault("IntegrationWindow", 20) # in ns

    # Do MDT overlay
    MdtOverlay = CompFactory.MdtOverlay
    alg = MdtOverlay(name, **kwargs)
    acc.addEventAlgo(alg)

    # Setup output
    if flags.Output.doWriteRDO:
        from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
        acc.merge(OutputStreamCfg(flags, "RDO", ItemList=[
            "MdtCsmContainer#MDTCSM"
        ]))

    if flags.Output.doWriteRDO_SGNL:
        from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
        acc.merge(OutputStreamCfg(flags, "RDO_SGNL", ItemList=[
            "MdtCsmContainer#" + flags.Overlay.SigPrefix + "MDTCSM"
        ]))

    return acc
Exemple #2
0
def MdtTruthOverlayCfg(flags, name="MdtTruthOverlay", **kwargs):
    """Return a ComponentAccumulator for the MDT SDO overlay algorithm"""
    acc = ComponentAccumulator()

    # We do not need background MDT SDOs
    if flags.Overlay.DataOverlay:
        kwargs.setdefault("BkgInputKey", "")
    else:
        kwargs.setdefault("BkgInputKey",
                          flags.Overlay.BkgPrefix + "MDT_SDO")

    kwargs.setdefault("SignalInputKey",
                      flags.Overlay.SigPrefix + "MDT_SDO")
    kwargs.setdefault("OutputKey", "MDT_SDO")

    # Do MDT truth overlay
    MuonSimDataOverlay = CompFactory.MuonSimDataOverlay
    alg = MuonSimDataOverlay(name, **kwargs)
    acc.addEventAlgo(alg)

    # Setup output
    if flags.Output.doWriteRDO:
        from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
        acc.merge(OutputStreamCfg(flags, "RDO", ItemList=[
            "MuonSimDataCollection#MDT_SDO"
        ]))

    if flags.Output.doWriteRDO_SGNL:
        from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
        acc.merge(OutputStreamCfg(flags, "RDO_SGNL", ItemList=[
            "MuonSimDataCollection#" + flags.Overlay.SigPrefix + "MDT_SDO"
        ]))

    return acc
Exemple #3
0
def SCTTruthOverlayCfg(flags, name="SCTSDOOverlay", **kwargs):
    """Return a ComponentAccumulator for the SCT SDO overlay algorithm"""
    acc = ComponentAccumulator()

    # We do not need background SCT SDOs
    kwargs.setdefault("BkgInputKey", "")

    kwargs.setdefault("SignalInputKey",
                      flags.Overlay.SigPrefix + "SCT_SDO_Map")
    kwargs.setdefault("OutputKey", "SCT_SDO_Map")

    # Do SCT truth overlay
    InDetSDOOverlay = CompFactory.InDetSDOOverlay
    alg = InDetSDOOverlay(name, **kwargs)
    acc.addEventAlgo(alg)

    # Setup output
    if flags.Output.doWriteRDO:
        from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
        acc.merge(
            OutputStreamCfg(flags,
                            "RDO",
                            ItemList=["InDetSimDataCollection#SCT_SDO_Map"]))

    if flags.Output.doWriteRDO_SGNL:
        from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
        acc.merge(
            OutputStreamCfg(flags,
                            "RDO_SGNL",
                            ItemList=[
                                "InDetSimDataCollection#" +
                                flags.Overlay.SigPrefix + "SCT_SDO_Map"
                            ]))

    return acc
Exemple #4
0
def SCTOverlayAlgCfg(flags, name="SCTOverlay", **kwargs):
    """Return a ComponentAccumulator for SCTOverlay algorithm"""
    acc = ComponentAccumulator()

    kwargs.setdefault("BkgInputKey", flags.Overlay.BkgPrefix + "SCT_RDOs")
    kwargs.setdefault("SignalInputKey", flags.Overlay.SigPrefix + "SCT_RDOs")
    kwargs.setdefault("OutputKey", "SCT_RDOs")

    # Do SCT overlay
    SCTOverlay = CompFactory.SCTOverlay
    alg = SCTOverlay(name, **kwargs)
    acc.addEventAlgo(alg)

    # Setup output
    if flags.Output.doWriteRDO:
        from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
        acc.merge(
            OutputStreamCfg(flags,
                            "RDO",
                            ItemList=["SCT_RDO_Container#SCT_RDOs"]))

    if flags.Output.doWriteRDO_SGNL:
        from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
        acc.merge(
            OutputStreamCfg(flags,
                            "RDO_SGNL",
                            ItemList=[
                                "SCT_RDO_Container#" +
                                flags.Overlay.SigPrefix + "SCT_RDOs"
                            ]))

    return acc
Exemple #5
0
def RpcOverlayAlgCfg(flags, name="RpcOverlay", **kwargs):
    """Return a ComponentAccumulator for RPCOverlay algorithm"""
    acc = ComponentAccumulator()

    kwargs.setdefault("BkgInputKey", flags.Overlay.BkgPrefix + "RPC_DIGITS")
    kwargs.setdefault("SignalInputKey", flags.Overlay.SigPrefix + "RPC_DIGITS")
    kwargs.setdefault("OutputKey", "RPC_DIGITS")

    # Do RPC overlay
    RpcOverlay = CompFactory.RpcOverlay
    alg = RpcOverlay(name, **kwargs)
    acc.addEventAlgo(alg)

    # Setup output
    if flags.Output.doWriteRDO:
        from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
        acc.merge(
            OutputStreamCfg(flags, "RDO", ItemList=["RpcPadContainer#RPCPAD"]))

    if flags.Output.doWriteRDO_SGNL:
        from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
        acc.merge(
            OutputStreamCfg(flags,
                            "RDO_SGNL",
                            ItemList=[
                                "RpcPadContainer#" + flags.Overlay.SigPrefix +
                                "RPCPAD"
                            ]))

    return acc
Exemple #6
0
def TRTOverlayAlgCfg(flags, name="TRTOverlay", **kwargs):
    """Return a ComponentAccumulator for TRTOverlay algorithm"""
    acc = ComponentAccumulator()
    from TRT_GeoModel.TRT_GeoModelConfig import TRT_GeometryCfg
    acc.merge(TRT_GeometryCfg(flags))
    from InDetOverlay.TRT_ConditionsConfig import TRTStrawCondAlgCfg
    acc.merge(TRTStrawCondAlgCfg(flags))

    kwargs.setdefault("BkgInputKey", flags.Overlay.BkgPrefix + "TRT_RDOs")
    kwargs.setdefault("SignalInputKey", flags.Overlay.SigPrefix + "TRT_RDOs")
    kwargs.setdefault("SignalInputSDOKey",
                      flags.Overlay.SigPrefix + "TRT_SDO_Map")
    kwargs.setdefault("OutputKey", "TRT_RDOs")

    # HT hit correction fraction
    kwargs.setdefault("TRT_HT_OccupancyCorrectionBarrel", 0.110)
    kwargs.setdefault("TRT_HT_OccupancyCorrectionEndcap", 0.090)
    kwargs.setdefault("TRT_HT_OccupancyCorrectionBarrelNoE", 0.060)
    kwargs.setdefault("TRT_HT_OccupancyCorrectionEndcapNoE", 0.050)

    # Do TRT overlay
    TRTOverlay = CompFactory.TRTOverlay
    alg = TRTOverlay(name, **kwargs)

    from InDetOverlay.TRT_ConditionsConfig import TRT_LocalOccupancyCfg, TRT_StrawStatusSummaryToolCfg
    alg.TRT_LocalOccupancyTool = acc.popToolsAndMerge(
        TRT_LocalOccupancyCfg(flags))
    alg.TRTStrawSummaryTool = acc.popToolsAndMerge(
        TRT_StrawStatusSummaryToolCfg(flags))
    acc.addEventAlgo(alg)

    # Setup output
    if flags.Output.doWriteRDO:
        from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
        acc.merge(
            OutputStreamCfg(flags,
                            "RDO",
                            ItemList=["TRT_RDO_Container#TRT_RDOs"]))

        if flags.Overlay.DataOverlay:
            acc.merge(
                OutputStreamCfg(
                    flags,
                    "RDO",
                    ItemList=["TRT_BSErrContainer#TRT_ByteStreamErrs"]))

    if flags.Output.doWriteRDO_SGNL:
        from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
        acc.merge(
            OutputStreamCfg(flags,
                            "RDO_SGNL",
                            ItemList=[
                                "TRT_RDO_Container#" +
                                flags.Overlay.SigPrefix + "TRT_RDOs"
                            ]))

    return acc
Exemple #7
0
def TilePulseForTileMuonReceiverOutputCfg(flags, **kwargs):
    """Return component accumulator with configured Tile muon receiver algorithm and Output stream

    Arguments:
        flags  -- Athena configuration flags (ConfigFlags)
    """

    acc = TilePulseForTileMuonReceiverCfg(flags, **kwargs)
    tilePulseForMuRcv = acc.getPrimary()

    if hasattr(tilePulseForMuRcv, 'MuonReceiverDigitsContainer'):
        muRcvDigitsCnt = tilePulseForMuRcv.MuonReceiverDigitsContainer
    else:
        muRcvDigitsCnt = tilePulseForMuRcv.getDefaultProperty(
            'MuonReceiverDigitsContainer')
    muRcvDigitsCnt = muRcvDigitsCnt.split('+').pop()
    outputItemList = ['TileDigitsContainer#' + muRcvDigitsCnt]

    if not flags.Digitization.PileUpPremixing:
        if hasattr(tilePulseForMuRcv, 'MuonReceiverRawChannelContainer'):
            muRcvRawChCnt = tilePulseForMuRcv.MuonReceiverRawChannelContainer
        else:
            muRcvRawChCnt = tilePulseForMuRcv.getDefaultProperty(
                'MuonReceiverRawChannelContainer')
        muRcvRawChCnt = muRcvRawChCnt.split('+').pop()
        outputItemList += ['TileRawChannelContainer#' + muRcvRawChCnt]

    if flags.Output.doWriteRDO:
        from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
        acc.merge(
            OutputStreamCfg(flags, streamName='RDO', ItemList=outputItemList))

    return acc
Exemple #8
0
def TileTTL1OutputCfg(flags, TileHitToTTL1):

    if hasattr(TileHitToTTL1, 'TileTTL1Container'):
        tileTTL1Container = TileHitToTTL1.TileTTL1Container
    else:
        tileTTL1Container = TileHitToTTL1.getDefaultProperty(
            'TileTTL1Container')
    tileTTL1Container = tileTTL1Container.split('+').pop()
    outputItemList = ['TileTTL1Container#' + tileTTL1Container]

    if hasattr(TileHitToTTL1, 'TileMBTSTTL1Container'):
        mbtsTTL1Container = TileHitToTTL1.TileMBTSTTL1Container
    else:
        mbtsTTL1Container = TileHitToTTL1.getDefaultProperty(
            'TileMBTSTTL1Container')
    mbtsTTL1Container = mbtsTTL1Container.split('+').pop()
    outputItemList += ['TileTTL1Container#' + mbtsTTL1Container]

    acc = ComponentAccumulator()
    if flags.Output.doWriteRDO:
        if flags.Digitization.TruthOutput:
            outputItemList += ["CaloCalibrationHitContainer#*"]
            from Digitization.TruthDigitizationOutputConfig import TruthDigitizationOutputCfg
            acc.merge(TruthDigitizationOutputCfg(flags))
        from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
        acc.merge(
            OutputStreamCfg(flags, streamName='RDO', ItemList=outputItemList))

    return acc
Exemple #9
0
def TileDigitsFilterOutputCfg(flags, streamName='ESD', **kwargs):

    acc = TileDigitsFilterCfg(flags)
    tileDigitsFilter = acc.getPrimary()

    outputItemList = []

    if 'OutputDigitsContainer' in tileDigitsFilter._properties:
        digitsContainer = tileDigitsFilter._properties['OutputDigitsContainer']
    else:
        digitsContainer = tileDigitsFilter._descriptors[
            'OutputDigitsContainer'].default

    if digitsContainer != '':
        outputItemList += ['TileDigitsContainer#' + digitsContainer]

    if 'OutputRawChannelContainer' in tileDigitsFilter._properties:
        rawChannelContainer = tileDigitsFilter._properties[
            'OutputRawChannelContainer']
    else:
        rawChannelContainer = tileDigitsFilter._descriptors[
            'OutputRawChannelContainer'].default

    if rawChannelContainer != '':
        outputItemList += ['TileRawChannelContainer#' + rawChannelContainer]

    from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
    acc.merge(OutputStreamCfg(flags, streamName, ItemList=outputItemList))

    return acc
Exemple #10
0
def BTagHLTaggersCfg(inputFlags, JetCollection=[]):
    acc = ComponentAccumulator()

    # Nothing written out
    from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
    acc.merge(OutputStreamCfg(cfgFlags, "ESD", ItemList=[]))

    DeprecatedHLTaggers = ['rnnip', 'DL1']
    postTagDL2JetToTrainingMap = {
        'AntiKt4EMPFlow': [
            #'BTagging/201903/smt/antikt4empflow/network.json',
            'BTagging/201903/rnnip/antikt4empflow/network.json',
            'BTagging/201903/dl1r/antikt4empflow/network.json',
            'BTagging/201903/dl1/antikt4empflow/network.json',
            #'BTagging/201903/dl1rmu/antikt4empflow/network.json',
        ]
    }
    for jet in JetCollection:
        if jet in postTagDL2JetToTrainingMap:
            for tagger in DeprecatedHLTaggers:
                acc.merge(RenameHLTaggerCfg(jet, tagger, '_old'))
            #Track Augmenter
            acc.merge(BTagTrackAugmenterAlgCfg(cfgFlags))

            #HighLevel taggers can not be run with time stamped containers
            acc.merge(
                RunHighLevelTaggersCfg(cfgFlags, jet,
                                       'BTagTrackToJetAssociator',
                                       postTagDL2JetToTrainingMap[jet], ""))

    return acc
Exemple #11
0
def EventInfoOverlayOutputCfg(flags, **kwargs):
    """Return event info overlay output configuration"""
    acc = ComponentAccumulator()

    from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
    if flags.Output.doWriteRDO:
        acc.merge(OutputStreamCfg(flags, "RDO"))

    # Add signal output
    if flags.Output.doWriteRDO_SGNL:
        acc.merge(OutputStreamCfg(flags, "RDO_SGNL",
                                  ItemList=[
                                      "xAOD::EventInfo#Sig_EventInfo",
                                      "xAOD::EventAuxInfo#Sig_EventInfoAux."
                                  ]))

    return acc
Exemple #12
0
def MergeRecoTimingObjCfg(flags, name="MergeRecoTimingObjTool", **kwargs):
    """Return ComponentAccumulator configured for MergeRecoTimingObjTool"""
    acc = OutputStreamCfg(flags, "RDO", ["RecoTimingObj#*EVNTtoHITS_timings"])

    if flags.Digitization.DoXingByXingPileUp:
        kwargs.setdefault("FirstXing", TimingObj_FirstXing())
        kwargs.setdefault("LastXing", TimingObj_LastXing())

    kwargs.setdefault("RecoTimingObjInputKey", "EVNTtoHITS_timings")
    if flags.Digitization.PileUpPremixing:
        kwargs.setdefault("RecoTimingObjOutputKey",
                          flags.Overlay.BkgPrefix + "EVNTtoHITS_timings")
    else:
        kwargs.setdefault("RecoTimingObjOutputKey", "EVNTtoHITS_timings")
    tool = CompFactory.MergeRecoTimingObjTool(name, **kwargs)
    acc.merge(PileUpToolsCfg(flags, PileUpTools=tool))
    return acc
Exemple #13
0
def BeamEffectsAlgCfg(ConfigFlags, **kwargs):
    """Return an accumulator and algorithm for beam effects, with output"""
    acc = BeamEffectsAlgBasicCfg(ConfigFlags, **kwargs)
    # Set to write HITS pool file
    alg = acc.getPrimary()
    ItemList = ["McEventCollection#" + alg.OutputMcEventCollection]
    from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
    acc.merge(OutputStreamCfg(ConfigFlags, "HITS", ItemList=ItemList))
    return acc
Exemple #14
0
def RPC_OutputCfg(flags):
    """Return ComponentAccumulator with Output for RPC. Not standalone."""
    acc = ComponentAccumulator()
    if flags.Output.doWriteRDO:
        ItemList = ["RpcPadContainer#*"]
        if flags.Digitization.TruthOutput:
            ItemList += ["MuonSimDataCollection#*"]
            acc.merge(TruthDigitizationOutputCfg(flags))
        acc.merge(OutputStreamCfg(flags, "RDO", ItemList))
    return acc
Exemple #15
0
def TruthDigitizationOutputCfg(flags):
    """Return ComponentAccumulator with Truth output items"""
    ItemList = [
        "McEventCollection#*",
        "TrackRecordCollection#*",
        "xAOD::JetContainer#*InTimeAntiKt4TruthJets",
        "xAOD::JetAuxContainer#*InTimeAntiKt4TruthJetsAux.",
        "xAOD::JetContainer#*OutOfTimeAntiKt4TruthJets",
        "xAOD::JetAuxContainer#*OutOfTimeAntiKt4TruthJetsAux.",
    ]
    return OutputStreamCfg(flags, "RDO", ItemList)
Exemple #16
0
def CscOverlayAlgCfg(flags, name="CscOverlay", **kwargs):
    """Return a ComponentAccumulator for CSCOverlay algorithm"""
    from MuonConfig.MuonCalibConfig import CscCalibToolCfg
    acc = CscCalibToolCfg(flags)
    kwargs.setdefault("CalibTool", acc.popPrivateTools())

    from MuonConfig.MuonCSC_CnvToolsConfig import MuonCscRDODecoderCfg
    kwargs.setdefault("CscRdoDecoderTool",
                      acc.popToolsAndMerge(MuonCscRDODecoderCfg(flags)))

    kwargs.setdefault("BkgInputKey", flags.Overlay.BkgPrefix + "CSCRDO")
    kwargs.setdefault("SignalInputKey", flags.Overlay.SigPrefix + "CSCRDO")
    kwargs.setdefault("OutputKey", "CSCRDO")

    kwargs.setdefault("isDataOverlay", flags.Overlay.DataOverlay)

    # Do CSC overlay
    CscOverlay = CompFactory.CscOverlay
    alg = CscOverlay(name, **kwargs)
    acc.addEventAlgo(alg)

    # Setup output
    if flags.Output.doWriteRDO:
        from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
        acc.merge(
            OutputStreamCfg(flags,
                            "RDO",
                            ItemList=["CscRawDataContainer#CSCRDO"]))

    if flags.Output.doWriteRDO_SGNL:
        from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
        acc.merge(
            OutputStreamCfg(flags,
                            "RDO_SGNL",
                            ItemList=[
                                "CscRawDataContainer#" +
                                flags.Overlay.SigPrefix + "CSCRDO"
                            ]))

    return acc
Exemple #17
0
def TileHitOutputCfg(flags, **kwargs):
    """Return component accumulator with Output Stream configuration for Tile hits

    Arguments:
        flags  -- Athena configuration flags (ConfigFlags)
    """

    if flags.Output.doWriteRDO:
        acc = OutputStreamCfg(flags, 'RDO', ['TileHitContainer#*'])
    else:
        acc = ComponentAccumulator()

    return acc
Exemple #18
0
def TileLookForMuAlgOutputCfg(flags, streamName='ESD', **kwargs):

    acc = TileLookForMuAlgCfg(flags, **kwargs)
    lookForMuAlg = acc.getPrimary()

    muContainer = lookForMuAlg.TileMuTagsOutputName
    muContainer = muContainer.split('+').pop()
    outputItemList = ['TileMuContainer#' + muContainer]

    from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
    acc.merge(OutputStreamCfg(flags, streamName, ItemList=outputItemList))

    return acc
Exemple #19
0
def TileMuonFitterOutputCfg(flags, streamName='ESD', **kwargs):

    acc = TileMuonFitterCfg(flags, **kwargs)
    muonFitter = acc.getPrimary()

    cosmiMuonContainer = muonFitter.TileCosmicMuonKey
    cosmiMuonContainer = cosmiMuonContainer.split('+').pop()
    outputItemList = ['TileCosmicMuonContainer#' + cosmiMuonContainer]

    from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
    acc.merge(OutputStreamCfg(flags, streamName, ItemList=outputItemList))

    return acc
Exemple #20
0
def SetupMuonStandaloneOutput(cfg, ConfigFlags, itemsToRecord):
    # Set up output
    from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg

    cfg.merge(OutputStreamCfg(ConfigFlags, 'ESD', ItemList=itemsToRecord))
    outstream = cfg.getEventAlgo("OutputStreamESD")
    outstream.ForceRead = True

    # Fix for ATLASRECTS-5151
    Trk__EventCnvSuperTool = CompFactory.Trk.EventCnvSuperTool
    cnvTool = Trk__EventCnvSuperTool(name='EventCnvSuperTool')
    cnvTool.MuonCnvTool.FixTGCs = True
    cfg.addPublicTool(cnvTool)
Exemple #21
0
def PixelOverlayAlgCfg(flags, name="PixelOverlay", **kwargs):
    """Return a ComponentAccumulator for PixelOverlay algorithm"""
    acc = ComponentAccumulator()

    kwargs.setdefault("BkgInputKey", flags.Overlay.BkgPrefix + "PixelRDOs")
    kwargs.setdefault("SignalInputKey", flags.Overlay.SigPrefix + "PixelRDOs")
    kwargs.setdefault("OutputKey", "PixelRDOs")

    # Do Pixel overlay
    PixelOverlay = CompFactory.PixelOverlay
    alg = PixelOverlay(name, **kwargs)
    acc.addEventAlgo(alg)

    # Setup output
    if flags.Output.doWriteRDO:
        from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
        acc.merge(
            OutputStreamCfg(flags,
                            "RDO",
                            ItemList=["PixelRDO_Container#PixelRDOs"]))

        if flags.Overlay.DataOverlay:
            acc.merge(
                OutputStreamCfg(
                    flags,
                    "RDO",
                    ItemList=["InDetBSErrContainer#PixelByteStreamErrs"]))

    if flags.Output.doWriteRDO_SGNL:
        from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
        acc.merge(
            OutputStreamCfg(flags,
                            "RDO_SGNL",
                            ItemList=[
                                "PixelRDO_Container#" +
                                flags.Overlay.SigPrefix + "PixelRDOs"
                            ]))

    return acc
Exemple #22
0
    def skip_test_sequences_merging(self):
        from AthenaConfiguration.AllConfigFlags import ConfigFlags
        ConfigFlags.lock()
        from AthenaCommon.Logging import logging
        logging.getLogger('ComponentAccumulator').setLevel(DEBUG)

        print("ca1")
        ca1 = ComponentAccumulator()
        ca1.addEventAlgo(TestAlgo("alg1"))
        ca1.printConfig()
        ca1.addSequence(seqAND("someSequence"))

        print("ca2")
        from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
        ca2 = OutputStreamCfg(ConfigFlags,
                              "RDO",
                              ItemList=[
                                  "SCT_RDO_Container#SCT_RDOs",
                                  "InDetSimDataCollection#SCT_SDO_Map"
                              ])
        ca2.printConfig()

        print("after merge")
        ca1.merge(ca2)
        ca1.printConfig()

        self.assertEqual(len(ca1._allSequences), 2,
                         "Dangling sequences not maintained")

        print("Instantiating top CA")
        from AthenaConfiguration.MainServicesConfig import MainServicesCfg
        topca = MainServicesCfg(ConfigFlags)
        topca.printConfig()

        print("Merging to the top level CA")
        topca.merge(ca1)
        topca.printConfig()
        topca.wasMerged()
Exemple #23
0
def BTagESDtoESDCfg(flags, jet, timestamp):
    acc = ComponentAccumulator()

    ESDItemList = []
    #Register new ouput ESD container
    for ts in timestamp:
        ESDItemList += registerOutputBTaggingContainers(flags, jet, ts)

    ESDItemList += registerJetCollectionEL(flags, jet, timestamp)

    from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
    acc.merge(OutputStreamCfg(flags, "ESD", ItemList=ESDItemList))

    return acc
Exemple #24
0
def CopyMcEventCollectionOutputCfg(flags, **kwargs):
    """Return CopyMcEventCollection output configuration"""
    acc = ComponentAccumulator()

    if flags.Output.doWriteRDO:
        from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
        acc.merge(
            OutputStreamCfg(flags,
                            "RDO",
                            ItemList=["McEventCollection#TruthEvent"]))

    # Add signal output
    if flags.Output.doWriteRDO_SGNL:
        from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
        acc.merge(
            OutputStreamCfg(flags,
                            "RDO_SGNL",
                            ItemList=[
                                "McEventCollection#" +
                                flags.Overlay.SigPrefix + "TruthEvent"
                            ]))

    return acc
Exemple #25
0
def BTagRedoESDCfg(flags, jet, extraContainers=[]):
    acc = ComponentAccumulator()

    acc.merge(RenameInputContainerCfg("old"))

    #Register input ESD container in output
    ESDItemList = registerOutputBTaggingContainers(flags, jet)
    ESDItemList += registerJetCollectionEL(flags, jet, [''])
    print(ESDItemList)
    from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
    acc.merge(
        OutputStreamCfg(flags, "ESD", ItemList=ESDItemList + extraContainers))

    return acc
Exemple #26
0
def CopyTimingsOutputCfg(flags, **kwargs):
    """Return CopyTimings output configuration"""
    acc = ComponentAccumulator()

    if flags.Output.doWriteRDO:
        from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
        acc.merge(
            OutputStreamCfg(flags,
                            "RDO",
                            ItemList=["RecoTimingObj#EVNTtoHITS_timings"]))

    # Add signal output
    if flags.Output.doWriteRDO_SGNL:
        from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
        acc.merge(
            OutputStreamCfg(flags,
                            "RDO_SGNL",
                            ItemList=[
                                "RecoTimingObj#" + flags.Overlay.SigPrefix +
                                "EVNTtoHITS_timings"
                            ]))

    return acc
Exemple #27
0
def CopyCaloCalibrationHitContainerOutputCfg(flags, collectionName, **kwargs):
    """Return CopyCaloCalibrationHitContainer output configuration"""
    acc = ComponentAccumulator()

    if flags.Output.doWriteRDO:
        from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
        acc.merge(
            OutputStreamCfg(
                flags,
                "RDO",
                ItemList=["CaloCalibrationHitContainer#" + collectionName]))

    # Add signal output
    if flags.Output.doWriteRDO_SGNL:
        from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
        acc.merge(
            OutputStreamCfg(flags,
                            "RDO_SGNL",
                            ItemList=[
                                "CaloCalibrationHitContainer#" +
                                flags.Overlay.SigPrefix + collectionName
                            ]))

    return acc
Exemple #28
0
def CopyJetTruthInfoOutputCfg(flags, **kwargs):
    """Return CopyTimings output configuration"""
    acc = ComponentAccumulator()

    if flags.Output.doWriteRDO:
        from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
        acc.merge(
            OutputStreamCfg(
                flags,
                "RDO",
                ItemList=[
                    "xAOD::JetContainer#InTimeAntiKt4TruthJets",
                    "xAOD::JetAuxContainer#InTimeAntiKt4TruthJetsAux.",
                    "xAOD::JetContainer#OutOfTimeAntiKt4TruthJets",
                    "xAOD::JetAuxContainer#OutOfTimeAntiKt4TruthJetsAux."
                ]))
    return acc
Exemple #29
0
def TileDigitsMakerOutputCfg(flags, **kwargs):
    """Return component accumulator with configured Tile digits maker algorithm and Output Stream

    Arguments:
        flags  -- Athena configuration flags (ConfigFlags)
    Keyword arguments:
        name -- name of TileDigitsMaker algorithm. Defaults to TileDigitsMaker.
        UseCoolPulseShapes -- flag to use pulse shape from database. Defaults to True.
        RndmEvtOverlay -- flag to add PileUp or noise by overlaying random events.
                          Defaults to Detector.OverlayTile flag.
        MaskBadChannels -- flag to mask channels tagged bad. Defaults to False.
    """

    acc = TileDigitsMakerCfg(flags, **kwargs)
    tileDigitsMaker = acc.getPrimary()

    if flags.Digitization.PileUpPremixing:
        if hasattr(tileDigitsMaker, 'TileDigitsContainer'):
            tileDigitsContainer = tileDigitsMaker.TileDigitsContainer
        else:
            tileDigitsContainer = tileDigitsMaker.getDefaultProperty(
                'TileDigitsContainer')
    else:
        if hasattr(tileDigitsMaker, 'TileFilteredContainer'):
            tileDigitsContainer = tileDigitsMaker.TileFilteredContainer
        else:
            tileDigitsContainer = tileDigitsMaker.getDefaultProperty(
                'TileFilteredContainer')

    tileDigitsContainer = tileDigitsContainer.split('+').pop()
    if flags.Digitization.AddCaloDigi:
        outputItemList = ['TileDigitsContainer#*']
    else:
        outputItemList = ['TileDigitsContainer#' + tileDigitsContainer]

    if flags.Output.doWriteRDO:
        if flags.Digitization.TruthOutput:
            outputItemList += ["CaloCalibrationHitContainer#*"]
            from Digitization.TruthDigitizationOutputConfig import TruthDigitizationOutputCfg
            acc.merge(TruthDigitizationOutputCfg(flags))
        from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
        acc.merge(
            OutputStreamCfg(flags, streamName='RDO', ItemList=outputItemList))

    return acc
Exemple #30
0
def TileRawChannelOutputCfg(flags, tileRawChannelMaker, streamName):
    """Return component accumulator with configured Output stream for Tile raw channel maker algorithm

    Arguments:
        flags  -- Athena configuration flags (ConfigFlags)
        tileRawChannelMaker -- Tile raw channel maker algorithm
        streamName -- name of output stream.
    """

    outputItemList = []
    rawChannelbuilders = tileRawChannelMaker.TileRawChannelBuilder

    for rawChannelBuilder in rawChannelbuilders:
        rawChannelContainer = rawChannelBuilder.TileRawChannelContainer
        outputItemList += ['TileRawChannelContainer#' + rawChannelContainer]

    from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
    acc = OutputStreamCfg(flags, streamName, ItemList=outputItemList)

    return acc