def addTruthMET(kernel=None): # Ensure that we are adding it to something if kernel is None: from DerivationFrameworkCore.DerivationFrameworkMaster import DerivationFrameworkJob kernel = DerivationFrameworkJob # Only do this if the truth MET is not present # This should handle EVNT correctly without an explicit check from DerivationFrameworkCore.DerivationFrameworkMaster import DerivationFrameworkJob if not objKeyStore.isInInput( "xAOD::MissingETContainer", "MET_Truth") and not hasattr( DerivationFrameworkJob, "METReconstruction"): import METReconstruction.METConfig_Truth from METReconstruction.METRecoConfig import getMETRecoAlg metAlg = getMETRecoAlg('METReconstruction') kernel += metAlg
BuildConfig('SoftClus'), BuildConfig('SoftTrk')] met_refiners = [RefConfig('JetFilter','RefJet_JVFCut'), RefConfig('TrackFilter','PVSoftTrk')] # Define the details of the full configuration METConfigs_Top[met_key] = METConfig('EleLHTightNoGammaNoTau', # Container suffix met_builders, met_refiners, doSum=True, doTracks=True, duplicateWarning=False ) # Access the tool configurations here # Switch electron selection to Tight METConfigs_Top[met_key].builders['Ele'].PIDSel = 'Electrons.DFCommonElectronsLHTight' ######################################## MET FLAGS ####################################### # Update the common METFlags with the defined configurations print ("DFMissingET -- Defined custom MET configurations for TOP:") for key,cfg in METConfigs_Top.items(): print ("DFMissingET -- ",key) metFlags.METConfigs()[key] = cfg metFlags.METOutputList().append(key) import METCommon METCommon.METLists['Top'] = METConfigs_Top.keys() DerivationFrameworkMetAlg_Top = getMETRecoAlg('METReco_DF_Top', METConfigs_Top) DerivationFrameworkJob += DerivationFrameworkMetAlg_Top
met_refiners = [ RefConfig('JetFilter', 'RefJet_JVFCut'), RefConfig('TrackFilter', 'PVSoftTrk') ] # Define the details of the full configuration METConfigs_SUSY[met_key] = METConfig(met_key, met_builders, met_refiners, doSum=True, doTracks=True, duplicateWarning=False) # Access the tool configurations here METConfigs_SUSY[met_key].builders[ 'Ele'].PIDSel = 'Electrons.DFCommonElectronsLHMedium' ######################################## MET FLAGS ####################################### # Update the common METFlags with the defined configurations print("DFMissingET -- Defined custom MET configurations for SUSY:") for key, cfg in METConfigs_SUSY.items(): print("DFMissingET -- ", key) metFlags.METConfigs()[key] = cfg metFlags.METOutputList().append(key) import METCommon METCommon.METLists['SUSY'] = METConfigs_SUSY.keys() DerivationFrameworkMetAlg_SUSY = getMETRecoAlg('METReco_DF_SUSY', METConfigs_SUSY) DerivationFrameworkJob += DerivationFrameworkMetAlg_SUSY
'Ele'].PIDSel = 'Electrons.DFCommonElectronsLHMedium' ######################################## CONFIG 2 ######################################## # MET_Topo: EM topoclusters # Define the tools to build each term met_key = 'Topo' # Container suffix met_builders = [BuildConfig('SoftClus', 'Topo')] met_refiners = [] # Define the details of the full configuration METConfigs_JetMet[met_key] = METConfig(met_key, met_builders, met_refiners, doSum=False, doTracks=True, duplicateWarning=False) ######################################## MET FLAGS ####################################### # Update the common METFlags with the defined configurations print "DFMissingET -- Defined custom MET configurations for JETMET:" for key, cfg in METConfigs_JetMet.iteritems(): print "DFMissingET -- ", key metFlags.METConfigs()[key] = cfg metFlags.METOutputList().append(key) import METCommon METCommon.METLists['JetMet'] = METConfigs_JetMet.keys() DerivationFrameworkMetAlg_JetMet = getMETRecoAlg('METReco_DF_JetMet', METConfigs_JetMet) DerivationFrameworkJob += DerivationFrameworkMetAlg_JetMet
DerivationFrameworkJob += akt10alg akt10trim = jtm.addJetTrimmer( "TrimmedAntiKt10TruthJets", rclus=0.2, ptfrac=0.05, input='AntiKt10TruthJets', modifiersin=[jtm.nsubjettiness, jtm.removeconstit]) akt10trimalg = JetAlgorithm("jetalgTrimmedAntiKt10TruthJets", Tools=[akt10trim]) DerivationFrameworkJob += akt10trimalg # Add truth-based MET algorithm here import METReconstruction.METConfig_Truth from METReconstruction.METRecoFlags import metFlags # not sure if you even need this line from METReconstruction.METRecoConfig import getMETRecoAlg metAlg = getMETRecoAlg('METReconstruction') DerivationFrameworkJob += metAlg #============================================================================== # HEAVY FLAVOR DECORATIONS (ttbar) #============================================================================== # PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/trunk/src/HadronOriginClassifier.cxx # PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/trunk/src/HadronOriginDecorator.cxx # list of ttbar samples by mc_channel_number TRUTH1DSIDList = [ 410000, 410001, 410002, 410003, 410004, 410007,
BuildConfig('Jet'), BuildConfig('SoftClus'), BuildConfig('SoftTrk') ] rf_refiners = [ RefConfig('TrackFilter', 'PVSoftTrk'), RefConfig('JetFilter', 'RefJet_JVFCut') ] cfg_mrf = METConfig('RefFinalFix', rf_builders, rf_refiners, doSum=True, doTracks=True) cfg_mrf.builders['Tau'].MinWet = 1. metconfigs = {'RefFinalFix': cfg_mrf} metAlg = getMETRecoAlg('METReconstruction', metconfigs) # The tools are accessible via the configurations in metFlags from AthenaCommon.AppMgr import ToolSvc metMaker = CfgMgr.met__METMaker( 'METMaker', JetPtCut=0e3, DoJetJvfCut=False, ) ToolSvc += metMaker makerAlg = CfgMgr.met__METMakerAlg('METMakerAlg', METCoreName='MET_Core', METName='MET_RefAssoc', Maker=metMaker)
METConfigs_JetMet[met_key].builders['Ele'].PIDSel = 'Electrons.DFCommonElectronsLHMedium' ######################################## CONFIG 2 ######################################## # MET_Topo: EM topoclusters # Define the tools to build each term met_key = 'Topo' # Container suffix met_builders = [BuildConfig('SoftClus','Topo')] met_refiners = [] # Define the details of the full configuration METConfigs_JetMet[met_key] = METConfig(met_key, met_builders, met_refiners, doSum=False, doTracks=True, duplicateWarning=False ) ######################################## MET FLAGS ####################################### # Update the common METFlags with the defined configurations print "DFMissingET -- Defined custom MET configurations for JETMET:" for key,cfg in METConfigs_JetMet.iteritems(): print "DFMissingET -- ",key metFlags.METConfigs()[key] = cfg metFlags.METOutputList().append(key) import METCommon METCommon.METLists['JetMet'] = METConfigs_JetMet.keys() DerivationFrameworkMetAlg_JetMet = getMETRecoAlg('METReco_DF_JetMet', METConfigs_JetMet) DerivationFrameworkJob += DerivationFrameworkMetAlg_JetMet
RefConfig('TrackFilter', 'PVSoftTrk') ] # Define the details of the full configuration METConfigs_Higgs[met_key] = METConfig(met_key, met_builders, met_refiners, doSum=True, doTracks=True, duplicateWarning=False) # Access the tool configurations here METConfigs_Higgs[met_key].builders['Jet'].InputCollection = 'AntiKt4EMTopoJets' METConfigs_Higgs[met_key].builders[ 'Ele'].PIDSel = 'Electrons.DFCommonElectronsLHMedium' ######################################## MET FLAGS ####################################### # Update the common METFlags with the defined configurations print "DFMissingET -- Defined custom MET configurations for HIGG:" for key, cfg in METConfigs_Higgs.iteritems(): print "DFMissingET -- ", key metFlags.METConfigs()[key] = cfg metFlags.METOutputList().append(key) import METCommon METCommon.METLists['Higgs'] = METConfigs_Higgs.keys() DerivationFrameworkMetAlg_Higgs = getMETRecoAlg('METReco_DF_Higgs', METConfigs_Higgs) DerivationFrameworkJob += DerivationFrameworkMetAlg_Higgs
] met_refiners = [RefConfig("JetFilter", "RefJet_JVFCut"), RefConfig("TrackFilter", "PVSoftTrk")] # Define the details of the full configuration METConfigs_Top[met_key] = METConfig( "EleLHTightNoGammaNoTau", # Container suffix met_builders, met_refiners, doSum=True, doTracks=True, duplicateWarning=False, ) # Access the tool configurations here # Switch electron selection to Tight METConfigs_Top[met_key].builders["Ele"].PIDSel = "Electrons.DFCommonElectronsLHTight" ######################################## MET FLAGS ####################################### # Update the common METFlags with the defined configurations print "DFMissingET -- Defined custom MET configurations for TOP:" for key, cfg in METConfigs_Top.iteritems(): print "DFMissingET -- ", key metFlags.METConfigs()[key] = cfg metFlags.METOutputList().append(key) import METCommon METCommon.METLists["Top"] = METConfigs_Top.keys() DerivationFrameworkMetAlg_Top = getMETRecoAlg("METReco_DF_Top", METConfigs_Top) DerivationFrameworkJob += DerivationFrameworkMetAlg_Top
BuildConfig("Tau"), BuildConfig("Jet"), BuildConfig("Muon"), BuildConfig("SoftClus"), BuildConfig("SoftTrk"), ] met_refiners = [RefConfig("JetFilter", "RefJet_JVFCut"), RefConfig("TrackFilter", "PVSoftTrk")] # Define the details of the full configuration METConfigs_Higgs[met_key] = METConfig( met_key, met_builders, met_refiners, doSum=True, doTracks=True, duplicateWarning=False ) # Access the tool configurations here METConfigs_Higgs[met_key].builders["Jet"].InputCollection = "AntiKt4EMTopoJets" METConfigs_Higgs[met_key].builders["Ele"].PIDSel = "Electrons.DFCommonElectronsLHMedium" ######################################## MET FLAGS ####################################### # Update the common METFlags with the defined configurations print "DFMissingET -- Defined custom MET configurations for HIGG:" for key, cfg in METConfigs_Higgs.iteritems(): print "DFMissingET -- ", key metFlags.METConfigs()[key] = cfg metFlags.METOutputList().append(key) import METCommon METCommon.METLists["Higgs"] = METConfigs_Higgs.keys() DerivationFrameworkMetAlg_Higgs = getMETRecoAlg("METReco_DF_Higgs", METConfigs_Higgs) DerivationFrameworkJob += DerivationFrameworkMetAlg_Higgs