Beispiel #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
        ]
Beispiel #2
0
                         "HITrack",
                         hi_trk_modifiers,
                         ptmin=HIJetFlags.TrackJetPtMin())
    HIJetFlags.TrackJetContainerName = tname
    AddToOutputList(tname)
    jtm.HIJetRecs += [f]

#initial unsubtracted jets
for R in HIJetFlags.AntiKtRValues():
    AddHIJetFinder(R)

#initial seeds
if HIJetFlags.SeedRValue() not in HIJetFlags.AntiKtRValues():
    AddHIJetFinder(HIJetFlags.SeedRValue())
seed_prefix = 'AntiKt%dHIJets' % int(10 * HIJetFlags.SeedRValue())
seeds0 = jtm.addJetCopier("%s_%s0" % (seed_prefix, HIJetFlags.SeedSuffix()),
                          "%s_Unsubtracted" % seed_prefix, [jtm.discrim],
                          shallow=False)
jtm.HIJetRecs += [seeds0]

#code nearly identical, but new behavior since upstream ES container and package flags are different
iter0 = AddIteration(seed_container=seeds0.OutputContainer,
                     shape_name=EventShapeKey,
                     map_tool=theMapTool,
                     suffix="iter0")
modulator0 = iter0.Modulator
subtr1 = MakeSubtractionTool(iter0.OutputEventShapeKey,
                             modulator=modulator0,
                             map_tool=theMapTool)

#now iterate
Beispiel #3
0
theSubtrTool=jtm.HIJetClusterSubtractor
theSubtrTool.unlock()
theSubtrTool.UseSamplings=False
theSubtrTool.lock()

if is_mc_or_overlay :
    for theCalibTool in jtm.HICalibMap.values() :
        theCalibTool.unlock()
        theCalibTool.IsData=False
        theCalibTool.CalibSequence='EtaJES'
        theCalibTool.lock()

#use existing R=0.2 jets from previous reco, only making use of discriminant
seed_prefix='AntiKt%dHIJets' % int(10*HIJetFlags.SeedRValue())
seeds0=jtm.addJetCopier("%s_%s0" % (seed_prefix, HIJetFlags.SeedSuffix()),seed_prefix,[jtm.discrim],shallow=False)
jtm.HIJetRecs+=[seeds0]
iter0=AddIteration(seed_container=seeds0.OutputContainer,shape_name=EventShapeKey,suffix="iter0")
modulator0=iter0.Modulator
subtr1=MakeSubtractionTool(iter0.OutputEventShapeKey,modulator=modulator0)

#now iterate
seeds1=jtm.addJetCopier("%s_%s1" % (seed_prefix,HIJetFlags.SeedSuffix()),seed_prefix,[subtr1,jtm.HICalibMap[seed_prefix],jtm.jetfilHISeeds],shallow=False)
jtm.HIJetRecs+=[seeds1]
iteration_dict=dict(suffix="iter1")
if jetFlags.useTracks() and HIJetFlags.TrackJetSeeds() : iteration_dict['track_jet_seeds']=HIJetFlags.TrackJetContainerName()
iter1=AddIteration(seed_container=seeds1.OutputContainer,shape_name=EventShapeKey,**iteration_dict)

HIJetFlags.IteratedEventShapeKey=iter1.OutputEventShapeKey
modulator1=iter1.Modulator
jtm.modulator=modulator1