예제 #1
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
예제 #2
0
def triggerPOOLOutputCfg(flags, decObj, decObjHypoOut, edmSet):
    # Get the list of output collections from TriggerEDM
    from TrigEDMConfig.TriggerEDM import getTriggerEDMList
    edmList = getTriggerEDMList(edmSet, flags.Trigger.EDMDecodingVersion)

    # Build the output ItemList
    itemsToRecord = []
    for edmType, edmKeys in six.iteritems (edmList):
        itemsToRecord.extend([edmType+'#'+collKey for collKey in edmKeys])

    # Add decision containers (navigation)
    for item in decObj:
        dynamic = '.-' # Exclude dynamic
        if item in decObjHypoOut:
            dynamic = '.' # Include dynamic
        itemsToRecord.append('xAOD::TrigCompositeContainer#{:s}'.format(item))
        itemsToRecord.append('xAOD::TrigCompositeAuxContainer#{:s}Aux{:s}'.format(item, dynamic))

    # Add EventInfo
    itemsToRecord.append('xAOD::EventInfo#EventInfo')
    itemsToRecord.append('xAOD::EventAuxInfo#EventInfoAux.')

    # Create OutputStream
    outputType = ''
    if flags.Output.doWriteRDO:
        outputType = 'RDO'
    if flags.Output.doWriteESD:
        outputType = 'ESD'
    if flags.Output.doWriteAOD:
        outputType = 'AOD'
    from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
    acc = OutputStreamCfg(flags, outputType, ItemList=itemsToRecord, disableEventTag=True)
    streamAlg = acc.getEventAlgo("OutputStream"+outputType)

    # Keep input RDO objects in the output RDO_TRIG file
    if flags.Output.doWriteRDO:
        streamAlg.TakeItemsFromInput = True

    # Produce trigger bits
    bitsmaker = CompFactory.TriggerBitsMakerTool()
    decmaker = CompFactory.getComp("TrigDec::TrigDecisionMakerMT")("TrigDecMakerMT", BitsMakerTool = bitsmaker)
    acc.addEventAlgo( decmaker )

    # Produce trigger metadata
    menuwriter = CompFactory.getComp("TrigConf::xAODMenuWriterMT")()
    menuwriter.IsHLTJSONConfig = True
    menuwriter.IsL1JSONConfig = True
    acc.addEventAlgo( menuwriter )

    # Add metadata to the output stream
    streamAlg.MetadataItemList += [ "xAOD::TriggerMenuContainer#*", "xAOD::TriggerMenuAuxContainer#*" ]

    # Ensure OutputStream runs after TrigDecisionMakerMT and xAODMenuWriterMT
    streamAlg.ExtraInputs += [
        ("xAOD::TrigDecision", decmaker.TrigDecisionKey),
        ("xAOD::TrigConfKeys", menuwriter.EventObjectName)]

    # Produce xAOD L1 RoIs from RoIBResult
    from AnalysisTriggerAlgs.AnalysisTriggerAlgsCAConfig import RoIBResultToxAODCfg
    xRoIBResultAcc, xRoIBResultOutputs = RoIBResultToxAODCfg(flags, acc.getSequence().name)
    acc.merge(xRoIBResultAcc)
    # Ensure outputs are produced before streamAlg runs
    streamAlg.ExtraInputs += xRoIBResultOutputs

    return acc