Ejemplo n.º 1
0
def JetAlgFromTools(rtools, suffix="HI", persistify=True):
    #insert exe tools at front of list, e.g. tracksel and tvassoc for HI etc.
    HIJet_exe_tools = []
    from JetRec.JetRecFlags import jetFlags
    if jetFlags.useTruth() and not jetFlags.Enabled():
        HIJet_exe_tools += HITruthParticleCopy()
    #if jetFlags.useCells():  HIJet_exe_tools += [jtm.missingcells]
    if HIJetFlags.UseHITracks():
        HIJet_exe_tools += [jtm.tracksel_HI, jtm.gtracksel_HI, jtm.tvassoc_HI]
    rtools = HIJet_exe_tools + rtools
    from JetRec.JetRecConf import JetToolRunner
    runner = JetToolRunner("jetrun" + suffix,
                           Tools=rtools,
                           Timer=jetFlags.timeJetToolRunner())
    jtm.add(runner)

    from JetRec.JetRecConf import JetAlgorithm
    theAlg = JetAlgorithm("jetalg" + suffix)
    theAlg.Tools = [runner]
    from AthenaCommon.AlgSequence import AlgSequence
    topsequence = AlgSequence()
    topsequence += theAlg

    from GaudiKernel.Constants import DEBUG
    if jetFlags.debug > 0:

        jtm.setOutputLevel(runner, DEBUG)
        theAlg.OutputLevel = DEBUG

    if jetFlags.debug > 3:
        jtm.setOutputLevel(jtm.jetBuilderWithoutArea, DEBUG)

    if persistify:
        for t in rtools:
            if hasattr(t, "OutputContainer"):
                AddToOutputList(t.OutputContainer)
    return theAlg
Ejemplo n.º 2
0
from JetRec.JetRecFlags import jetFlags
from JetRec.JetRecStandard import jtm
import AthenaCommon.SystemOfUnits as Units

#configuring getter tools
#selection for track jets
from InDetTrackSelectionTool.InDetTrackSelectionToolConf import InDet__InDetTrackSelectionTool
from JetRecTools.JetRecToolsConf import TrackPseudoJetGetter
from JetRecTools.JetRecToolsConf import JetTrackSelectionTool
from JetRecTools.JetRecToolsConf import SimpleJetTrackSelectionTool
from JetRecTools.JetRecToolsConf import TrackVertexAssociationTool
from JetMomentTools.JetMomentToolsConf import JetCaloQualityTool 
from JetMomentTools.JetMomentToolsConf import JetCaloCellQualityTool 

#select the tracks
if jetFlags.Enabled() : HIJetFlags.UseHITracks.set_Value_and_Lock(False)
if HIJetFlags.UseHITracks() :
    jtm += InDet__InDetTrackSelectionTool("trk_tracksel_HI",
                                          minPt                = HIJetFlags.TrackInputPtMin(),
                                          maxAbsEta            = 2.5,
                                          minNSiHits           = 7,
                                          maxNSiSharedModules  = 100,
                                          maxNSiHoles          = 2,
                                          maxNPixelHoles       = 1)

    #select the tracks for jet finding
    jtm += JetTrackSelectionTool( "tracksel_HI",
                                  InputContainer  = jtm.trackContainer,
                                  OutputContainer = "JetSelectedTracks_HI",
                                  Selector        = jtm.trk_tracksel_HI)
Ejemplo n.º 3
0
    except Exception:
        treatException("Could not set up EFlow. Switched off !")
        recAlgs.doEFlow = False
else:
    recAlgs.doEFlow = False

#AODFix_postMuonCombinedRec()
#
# functionality : CaloTower protojets + preclustering + KT algorithm + CombinedJetAlg
#
pdr.flag_domain('jet')
jetOK = False
if rec.doJetMissingETTag() and DetFlags.Calo_on():
    try:
        from JetRec.JetRecFlags import jetFlags
        if jetFlags.Enabled():
            include("JetRec/JetRec_jobOptions.py")
            jetOK = jetFlags.Enabled()
    except Exception:
        treatException("Could not set up jet reconstruction")
        jetOK = False
    AODFix_postJetRec()

#
# functionality : isolation for egamma and combined muon
#
pdr.flag_domain('egmiso')
if (rec.doESD() and (rec.doMuonCombined() or rec.doEgamma()) and
    (jobproperties.CaloRecFlags.doCaloTopoCluster() or objKeyStore.isInInput(
        'xAOD::ParticleContainer', 'CaloCalTopoClusters'))):
    try:
Ejemplo n.º 4
0
def JetAlgFromTools(rtools, suffix="HI", persistify=True):

    from HIJetRec.HIJetRecTools import jtm
    #insert exe tools at front of list, e.g. tracksel and tvassoc for HI etc.
    HIJet_exe_tools = []
    from JetRec.JetRecFlags import jetFlags
    if jetFlags.useTruth() and not jetFlags.Enabled():
        HIJet_exe_tools += HITruthParticleCopy()
    #if jetFlags.useCells():  HIJet_exe_tools += [jtm.missingcells]
    if HIJetFlags.UseHITracks():
        HIJet_exe_tools += [jtm.tracksel_HI, jtm.gtracksel_HI, jtm.tvassoc_HI]

    #Now we split in two algorithms to provide input to PseudoJetAlgorithm
    #rtools=HIJet_exe_tools+rtools

    from AthenaCommon.AlgSequence import AlgSequence
    topsequence = AlgSequence()

    JetToolRunner = CompFactory.JetToolRunner
    JetAlgorithm = CompFactory.JetAlgorithm

    if len(HIJet_exe_tools) > 0:
        jtm += JetToolRunner("jetrunconstit" + suffix,
                             Tools=HIJet_exe_tools,
                             Timer=jetFlags.timeJetToolRunner())
        topsequence += JetAlgorithm("jetalgconstit" + suffix,
                                    Tools=[jtm.jetrunconstitHI])

    # Add the PseudoJetAlgorithm
    # To avoid massive refactoring and to preserve familiarity,
    # jet guys kept calling things "getters", but these are already
    # PseudoJetAlgorithms as they eliminated the wrappers
    for getter in jtm.allGetters:
        print('Adding PseudoJetAlgorithm %s' % getter.name)
        print('Input Container %s' % getter.InputContainer)
        print('Output Container %s' % getter.OutputContainer)
        print('Label %s' % getter.Label)
        topsequence += getter

    runner = JetToolRunner("jetrun" + suffix,
                           Tools=rtools,
                           Timer=jetFlags.timeJetToolRunner())
    jtm.add(runner)

    theAlg = JetAlgorithm("jetalg" + suffix)
    theAlg.Tools = [runner]
    topsequence += theAlg

    from GaudiKernel.Constants import DEBUG
    if jetFlags.debug > 0:

        jtm.setOutputLevel(runner, DEBUG)
        theAlg.OutputLevel = DEBUG

    if jetFlags.debug > 3:
        jtm.setOutputLevel(jtm.jetBuilderWithoutArea, DEBUG)

    if persistify:
        for t in rtools:
            if hasattr(t, "OutputContainer"):
                AddToOutputList(t.OutputContainer)
    return theAlg