ATLAS Offline Software
METMakerConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
2 
3 from __future__ import print_function
4 from AthenaConfiguration.ComponentFactory import CompFactory
5 
6 def getMETMaker(name="METMaker", **kwargs):
7  return CompFactory.getComp("met::METMaker")(name, **kwargs)
8 
9 def getMuonSelectionTool(name="MuonSelectionTool_METMakerAlg"):
10  muonSel = CompFactory.getComp("CP::MuonSelectionTool")(name,
11  MuQuality=1, # Medium
12  TurnOffMomCorr= True,
13  MaxEta=2.4,
14  AllowSettingGeometryOnTheFly = True)
15  return muonSel
16 
17 def getEleSelLikelihood(name="EleSelLikelihood_METMakerAlg"):
18  elecSelLH = CompFactory.AsgElectronLikelihoodTool(name,
19  WorkingPoint="MediumLHElectron")
20  return elecSelLH
21 
22 def getPhotonSelIsEM(name="PhotonSelIsEM_METMakerAlg"):
23  photonSelIsEM = CompFactory.AsgPhotonIsEMSelector(name,
24  WorkingPoint="TightPhoton")
25  return photonSelIsEM
26 
27 def getTauSelectionTool(name="TauSelectionTool_METMakerAlg"):
28  from ROOT import TauAnalysisTools
29  SelectionCuts = TauAnalysisTools.SelectionCuts
30 
31  tauSel = CompFactory.getComp("TauAnalysisTools::TauSelectionTool")("TauSelectionTool_METMakerAlg",
32  ConfigPath = "",
33  SelectionCuts = int(SelectionCuts.CutPt | SelectionCuts.CutAbsEta | SelectionCuts.CutAbsCharge | SelectionCuts.CutNTrack | SelectionCuts.CutJetIDWP),
34  PtMin = 20.0,
35  JetIDWP = TauAnalysisTools.JETIDRNNMEDIUM,
36  NTracks = (1, 3),
37  AbsCharge = 1,
38  AbsEtaRegion = (0.0, 1.37, 1.52, 2.5))
39  return tauSel
40 
41 def getMETMakerAlg(suffix,jetSelection="Tier0",jetColl=""):
42 
43  print ("Generate METMaker and METMakerAlg for METAssoc_"+suffix)
44 
45  doPFlow = 'PFlow' in suffix
46  doTruth = suffix.startswith('Truth')
47  metMaker = getMETMaker('METMaker_'+suffix,
48  DoPFlow=doPFlow,
49  DoSoftTruth=doTruth,
50  JetSelection=jetSelection)
51 
52  muonSel = getMuonSelectionTool()
53 
54  elecSelLH = getEleSelLikelihood()
55 
56  photonSelIsEM = getPhotonSelIsEM()
57 
58  tauSel = getTauSelectionTool()
59 
60  if jetColl=="":
61  jetColl = suffix+'Jets'
62  if doTruth:
63  jetColl = suffix.split('_')[1]+'Jets'
64  makerAlg = CompFactory.getComp("met::METMakerAlg")('METMakerAlg_'+suffix,
65  METMapName='METAssoc_'+suffix,
66  METCoreName='MET_Core_'+suffix,
67  METName='MET_Reference_'+suffix,
68  InputJets=jetColl,
69  Maker=metMaker,
70  MuonSelectionTool=muonSel,
71  ElectronLHSelectionTool=elecSelLH,
72  PhotonIsEMSelectionTool=photonSelIsEM,
73  TauSelectionTool=tauSel,
74  )
75  return makerAlg
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
METMakerConfig.getMETMakerAlg
def getMETMakerAlg(suffix, jetSelection="Tier0", jetColl="")
Definition: METMakerConfig.py:41
METMakerConfig.getEleSelLikelihood
def getEleSelLikelihood(name="EleSelLikelihood_METMakerAlg")
Definition: METMakerConfig.py:17
METMakerConfig.getMETMaker
def getMETMaker(name="METMaker", **kwargs)
Definition: METMakerConfig.py:6
METMakerConfig.getTauSelectionTool
def getTauSelectionTool(name="TauSelectionTool_METMakerAlg")
Definition: METMakerConfig.py:27
METMakerConfig.getMuonSelectionTool
def getMuonSelectionTool(name="MuonSelectionTool_METMakerAlg")
Definition: METMakerConfig.py:9
METMakerConfig.getPhotonSelIsEM
def getPhotonSelIsEM(name="PhotonSelIsEM_METMakerAlg")
Definition: METMakerConfig.py:22