コード例 #1
0
def AddToOutputList(tname, objType='xAOD::JetContainer'):

    #filter container based on package flags
    if HIJetFlags.UnsubtractedSuffix(
    ) in tname and not HIJetFlags.WriteUnsubtracted():
        return
    if HIJetFlags.SeedSuffix() in tname and not HIJetFlags.WriteSeeds(): return

    has_key = False
    for k in HIJetFlags.HIJetOutputList():
        if tname == k.split('#')[1]:
            has_key = True
            break
    if not has_key:
        aux_suffix = 'Aux.'
        if 'CaloCluster' in objType:
            HIJetFlags.HIJetOutputList += [
                objType.replace("Container", "CellLinkContainer") + "#" +
                tname + "_links"
            ]
            if not HIJetFlags.WriteClusterMoments(): aux_suffix += '-'
        else:
            for k in HIJetFlags.MomentsSkipped():
                if 'ScaleMomentum' in k:
                    for var in ['pt', 'eta', 'phi', 'm']:
                        aux_suffix += '-%s_%s.' % (k, var)
                else:
                    aux_suffix += '-%s.' % k
        HIJetFlags.HIJetOutputList += [objType + "#" + tname]
        HIJetFlags.HIJetOutputList += [
            objType.replace("Container", "AuxContainer") + "#" + tname +
            aux_suffix
        ]
コード例 #2
0
def AddHIJetFinder(R=0.4):
    unsubtr_suffix = HIJetFlags.UnsubtractedSuffix()
    cname = "AntiKt%dHIJets_%s" % (int(10 * R), unsubtr_suffix)
    #'HI' is not allowed 'Label'
    #Name parsing for JetPtAssociationTool in JetToolSupport.buildModifiers will break
    #when building PtAssociations, build and add them manually
    myMods = jtm.modifiersMap["HI_Unsubtr"]
    #myMods += AddPtAssociationTools(R)
    finder = jtm.addJetFinder(cname,
                              "AntiKt",
                              R,
                              "HI",
                              myMods,
                              consumers=None,
                              ivtxin=None,
                              ghostArea=0.0,
                              ptmin=0.,
                              ptminFilter=5000)
    jtm.HIJetRecs += [finder]
コード例 #3
0
#put subtraction tool at the FRONT of the jet modifiers list
hi_tools = [subtr1, subtr2]
hi_tools += GetFlowMomentTools(iter1.OutputEventShapeKey,
                               iter1.ModulationEventShapeKey)
hi_tools += [
    GetConstituentsModifierTool(
        name="HIJetConstituentModifierTool",
        cluster_key=cluster_key_final_deep,
        apply_origin_correction=HIJetFlags.ApplyOriginCorrection())
]

###
#subtracted algorithms
#make main jets from unsubtr collections w/ same R, add modifiers for subtraction
unsubtr_suffix = HIJetFlags.UnsubtractedSuffix()
for k in jtm.jetrecs:
    if unsubtr_suffix in k.name():
        in_name = k.OutputContainer
        out_name = in_name.replace("_%s" % unsubtr_suffix, "")
        #>slight tweak in case R=1.0 jets are requestd, add some substructure tools
        modifiers = GetHIModifierList(out_name, hi_tools)
        if '10HIJets' in k.name():
            from JetSubStructureMomentTools.JetSubStructureMomentToolsConf import KtDeltaRTool
            jtm += KtDeltaRTool('ktdr10', JetRadius=1.0)
            modifiers += [
                jtm.ktdr10, jtm.ktsplitter, jtm.pull, jtm.angularity,
                jtm.planarflow, jtm.ktmassdrop
            ]
        copier = jtm.addJetCopier(out_name, in_name, modifiers, shallow=False)
        AddToOutputList(out_name)