示例#1
0
    def myjets():
        from JetRec.JetMomentGetter import make_JetMomentGetter

        from JetMomentTools.SetupJetMomentTools import getJetVertexAssociationTool
        jvatool = getJetVertexAssociationTool('AntiKt', 0.4, 'Topo') # parameters are irrelevant, these will work for any jets
        jvatool_lc = getJetVertexAssociationTool('AntiKt', 0.4, 'LCTopo') # parameters are irrelevant, these will work for any jets
        make_JetMomentGetter( 'AntiKt4TopoEMJets' , [jvatool] ) 
        make_JetMomentGetter( 'AntiKt4LCTopoJets' , [jvatool_lc] ) 
示例#2
0
def hsg2_redo_jvf_for_d3pd():
    from JetRec.JetMomentGetter import make_JetMomentGetter

    from JetMomentTools.SetupJetMomentTools import getJetVertexAssociationTool
    jvatool = getJetVertexAssociationTool('AntiKt', 0.4, 'Topo')
    # optional : rename the moment if you don't want to overwrite the existing one
    jvatool.JVFMomentName = "JVF2"
    make_JetMomentGetter( 'AntiKt4TopoJets' , [jvatool] )
    make_JetMomentGetter( 'AntiKt4TopoEMJets' , [jvatool] )


    import JetD3PDMaker
    from JetD3PDMaker.JetD3PDObject import JetD3PDObject
    JetD3PDObject.defineBlock(1, 'JVF2',
                              JetD3PDMaker.JetMomentFillerTool,
                              Moments=['JVF2'])
def JetVertexFractionConfig \
        (seq = AlgSequence(D3PDMakerFlags.PreD3PDAlgSeqName()),
         prefix = '',
         sgkey = D3PDMakerFlags.JetSGKey(),
         typeName = 'JetCollection'):
    """Configure algorithms required to fill JVF information into UserData.

    SEQ is the Gaudi sequence to which the algorithms should be added.
    Default is that given by PreD3PDAlgSeqName.

    PREFIX is a prefix to add to the names of the algorithms scheduled.

    SGKEY/TYPENAME is the StoreGate key of the input jet container
    and the name of its type.
"""
    DVGetter = D3PDMakerCoreComps.SGDataVectorGetterTool

    if (not D3PDMakerFlags.MakeJetUserData() or
        D3PDMakerFlags.HaveJetUserData()):
        return

    resolved_sgkey = resolveSGKey (typeName, sgkey)

    jvfname = 'JetVertexFractionAlg_' + resolved_sgkey
    if not hasattr (seq, jvfname):
        # Need to rebuild track associations...
        from JetD3PDAnalysis.JetMomentCalcConfig import JetMomentCalcConfig
        JetMomentCalcConfig (resolved_sgkey, None, seq=seq)

        from JetMomentTools.SetupJetMomentTools\
             import getJetVertexAssociationTool
        seq += JetD3PDAnalysis.JetVertexFractionAlg \
               (jvfname,
                Getter = DVGetter 
                  (prefix + 'JetVertexFractionGetter',
                   TypeName = typeName,
                   SGKey = sgkey),
                JetVertexAssociationTool =
                  # Parameters are irrelevant; these will work for any jets.
                  getJetVertexAssociationTool ('AntiKt', 0.4, 'Topo'),
                UDPrefix = D3PDMakerFlags.JetUserDataPrefix())
示例#4
0
from RecExConfig.RecFlags import rec
from JetRec.JetMomentGetter import make_JetMomentGetter
from JetMomentTools.SetupJetMomentTools import getJetVertexAssociationTool

jvatool = getJetVertexAssociationTool('AntiKt', 0.4, 'Topo')
jvatool.StoreQualityVariables = True
# jvatool.JVFMomentName = "JVF2"
make_JetMomentGetter('AntiKt4TopoEMNewJets', [jvatool])
#make_JetMomentGetter( 'AntiKt6TopoEMNewJets' , [jvatool] )
#make_JetMomentGetter( 'AntiKt4TopoJets' , [jvatool] )
#make_JetMomentGetter( 'AntiKt6TopoJets' , [jvatool] )
make_JetMomentGetter('AntiKt4LCTopoJets', [jvatool])
#make_JetMomentGetter( 'AntiKt6LCTopoJets' , [jvatool] )
#make_JetMomentGetter( 'AntiKt4TowerJets' , [jvatool] )
#make_JetMomentGetter( 'AntiKt6TowerJets' , [jvatool] )

from D3PDMakerConfig.CommonD3PDMakerFlags import CommonD3PDMakerFlags
if CommonD3PDMakerFlags.doRecJet():
    make_JetMomentGetter('AntiKt4TopoEMNewJets', [jvatool])
    #make_JetMomentGetter( 'AntiKt6TopoEMNewJets' , [jvatool] )
    #make_JetMomentGetter( 'AntiKt4TopoNewJets' , [jvatool] )
    #make_JetMomentGetter( 'AntiKt6TopoNewJets' , [jvatool] )
    make_JetMomentGetter('AntiKt4LCTopoNewJets', [jvatool])
    #make_JetMomentGetter( 'AntiKt6LCTopoNewJets' , [jvatool] )
    if not rec.readAOD():
        make_JetMomentGetter('AntiKt4TowerEMNewJets', [jvatool])
        #make_JetMomentGetter( 'AntiKt6TowerEMNewJets' , [jvatool] )
        make_JetMomentGetter('AntiKt4TowerNewJets', [jvatool])
        #make_JetMomentGetter( 'AntiKt6TowerNewJets' , [jvatool] )
示例#5
0
#
# TrackJet
#
from JetRec.JetGetters import *
from JetMomentTools.JetMomentToolsConf import JetVertexAssociationTool, JetOriginCorrectionTool
#jvaTool = JetVertexAssociationTool("JetVertexAssociation")
from JetMomentTools.SetupJetMomentTools import getJetVertexAssociationTool
jvaTool = getJetVertexAssociationTool("AntiKt", 0.4, "LCTopo")
#-- TrackJet --
include("QcdD3PDMaker/JetTrackZClusterTool_jobOptions.py")
#... Anti-Kt D=0.4
my_att_dict1 = dict(jet_attribute_dict)
my_att_dict1['_finderType'] = 'AntiKt'
my_att_dict1['_finderParams'] = [0.4]
my_att_dict1['_inputType'] = 'TrackZ'
my_att_dict1['_inputColl'] = []
mygetter1 = make_customJetGetter(
    my_att_dict1,
    [MyAKt4JetTrackZClusterTool,
     JetSorterTool(),
     JetWidthTool(), jvaTool])
mygetter1.OutputLevel = INFO
#... Anti-Kt D=0.6
my_att_dict2 = dict(jet_attribute_dict)
my_att_dict2['_finderType'] = 'AntiKt'
my_att_dict2['_finderParams'] = [0.6]
my_att_dict2['_inputType'] = 'TrackZ'
my_att_dict2['_inputColl'] = []
mygetter2 = make_customJetGetter(
    my_att_dict2,
    [MyAKt6JetTrackZClusterTool,
def _getJvfTool():
    from JetMomentTools.SetupJetMomentTools import getJetVertexAssociationTool
    jvatool = getJetVertexAssociationTool(
        'AntiKt', 0.4,
        'Topo')  # parameters are irrelevant, these will work for any jets.
    return jvatool
示例#7
0
def myjets():
    from JetRec.JetMomentGetter import make_JetMomentGetter
    from JetMomentTools.SetupJetMomentTools import getJetVertexAssociationTool
    jvatool = getJetVertexAssociationTool('AntiKt', 0.4, 'Topo')
    make_JetMomentGetter('AntiKt4TopoEMJets', [jvatool])
    make_JetMomentGetter('AntiKt6TopoEMJets', [jvatool])
from TriggerJobOpts.TriggerFlags import TriggerFlags
TriggerFlags.configurationSourceList = ['ds']

# set up trigger config service
from TriggerJobOpts.TriggerConfigGetter import TriggerConfigGetter
cfg =  TriggerConfigGetter()

#set up jet vtx helper thingy to help the jet vertex fraction thingy
##from JetMomentTools.SetupJetMomentTools import getDefaultJetVtxTrackHelper
##jhelp = getDefaultJetVtxTrackHelper()
##ToolSvc += jhelp

#set up jet vertex fraction calculator thingy
from JetMomentTools.SetupJetMomentTools import getJetVertexAssociationTool
jvatool = getJetVertexAssociationTool('AntiKt',0.4,'Topo')
#according to twiki page, the parameters are not critical; the tool will work for all jets.
ToolSvc += jvatool

# Re-run the MissingET
if RedoMissingET:
  include("MissingET/MissingET_jobOptions.py")

# Re-run the b-tagging
if RedoBTagging:
  BTagJetContainerName = [ JetContainer ]
  if not 'BTaggingFlags' in dir():
    from BTagging.BTaggingFlags import BTaggingFlags
  BTaggingFlags.Jets                             = BTagJetContainerName[:]
  BTaggingFlags.JetsWithInfoPlus                 = BTagJetContainerName[:]
  include( "BTagging/BTagging_jobOptions.py" )
示例#9
0
if not JetTagD3PD_redoTagging:
    JetTagD3PD_AntiKt4MuonNonInteractingTruth = False
    JetTagD3PD_AntiKt6MuonNonInteractingTruth = False
    JetTagD3PD_AntiKtZ4TrackJets = False
    JetTagD3PD_AntiKt4TruthPurePU = False

if JetTagD3PD_rerunJVF or JetTagD3PD_runJVF:
    from JetRec.JetMomentGetter import make_JetMomentGetter
    from JetMomentTools.SetupJetMomentTools import getJetVertexAssociationTool

if JetTagD3PD_rerunJVF:
    # parameters are irrelevant, these will work for any jets
    # optional : rename the moment if you don't want to overwrite the existing one
    # jvatool.JVFMomentName = "JVF2"
    if JetTagD3PD_AntiKt4TopoEM:
        myjvatoolakt4em = getJetVertexAssociationTool('AntiKt', 0.4, 'Topo')
        make_JetMomentGetter('AntiKt4TopoEMJets', [myjvatoolakt4em])

    if JetTagD3PD_AntiKt6TopoEM:
        myjvatoolakt6em = getJetVertexAssociationTool('AntiKt', 0.6, 'Topo')
        make_JetMomentGetter('AntiKt6TopoEMJets', [myjvatoolakt6em])

    if JetTagD3PD_AntiKt4LCTopo:
        myjvatoolakt4lc = getJetVertexAssociationTool('AntiKt', 0.4, 'LCTopo')
        make_JetMomentGetter('AntiKt4LCTopoJets', [myjvatoolakt4lc])

    if JetTagD3PD_AntiKt6LCTopo:
        myjvatoolakt6lc = getJetVertexAssociationTool('AntiKt', 0.6, 'LCTopo')
        make_JetMomentGetter('AntiKt6LCTopoJets', [myjvatoolakt6lc])

if JetTagD3PD_runJVF: