ATLAS Offline Software
Loading...
Searching...
No Matches
python.MetAnalysisConfig.MetAnalysisConfig Class Reference
Inheritance diagram for python.MetAnalysisConfig.MetAnalysisConfig:
Collaboration diagram for python.MetAnalysisConfig.MetAnalysisConfig:

Public Member Functions

 __init__ (self)
 instanceName (self)
 makeAlgs (self, config)

Public Attributes

 useLRT
 useJVT
 useFJVT
list invisible
 saveSignificance
str jetCalibConfig = "":
str jetCalibArea = "00-04-81"
str jetCalibSequence = 'JetArea_Residual_EtaJES_GSC_Smear'
str egammaESModel = "":
 containerName
 addExtraSignificanceVars

Detailed Description

the ConfigBlock for the MET configuration

Definition at line 9 of file MetAnalysisConfig.py.

Constructor & Destructor Documentation

◆ __init__()

python.MetAnalysisConfig.MetAnalysisConfig.__init__ ( self)

Definition at line 12 of file MetAnalysisConfig.py.

12 def __init__ (self) :
13 super (MetAnalysisConfig, self).__init__ ()
14 self.addOption('containerName', '', type=str,
15 noneAction='error',
16 info="the name of the output container.")
17 self.addOption ('useJVT', True, type=bool,
18 info="whether to use the JVT decision in the MET calculation.")
19 self.addOption ('useFJVT', False, type=bool,
20 info="whether to use the forward JVT decision in the MET calculation.")
21 self.addOption ('treatPUJets', False, type=bool,
22 info="whether to treat pile-up jets in the MET significance calculation.")
23 self.addOption ('setMuonJetEMScale', True, type=bool,
24 info="enables the handling of muons in jets for the MET calculation. "
25 "Should be turned off for analyses where muons are not reconstructed "
26 "at all.")
27 self.addOption ('jets', "", type=str,
28 info="the input jet container.")
29 self.addOption ('electrons', "", type=str,
30 info="the input electron container, with a possible selection, in "
31 "the format `container` or `container.selection`.")
32 self.addOption ('muons', "", type=str,
33 info="the input muon container, with a possible selection, in the "
34 "format `container` or `container.selection`.")
35 self.addOption ('photons', "", type=str,
36 info="the input photon container, with a possible selection, in "
37 "the format `container` or `container.selection`.")
38 self.addOption ('taus', "", type=str,
39 info="the input tau-jet container, with a possible selection, in "
40 "the format `container` or `container.selection`.")
41 self.addOption ('invisible', [], type=None,
42 info="any input containers to be treated as invisible particles, "
43 "as a single string or a list of strings in the format `container` or `container.selection`.")
44 self.addOption ('metWP', "Tight", type=str,
45 info="the MET working point to use: `Loose`, `Tight`, `Tighter`, "
46 "`Tenacious`.")
47 self.addOption ('skipSystematicJetSelection', False, type=bool,
48 info="EXPERIMENTAL: whether to use simplified OR based on nominal jets "
49 "and for jet-related systematics only. "
50 "WARNING: this option is strictly for doing physics studies of the feasibility "
51 "of this OR scheme, it should not be used in a regular analysis.",
52 expertMode=True)
53 self.addOption ('saveSignificance', True, type=bool,
54 info="whether to save the MET significance.")
55 self.addOption ('jetCalibConfig', "", type=str,
56 info="config file used in jet calibration (for MET significance).")
57 self.addOption ('jetCalibSequence', "", type=str,
58 info="jet calibration sequence (for MET significance).")
59 self.addOption ('jetCalibArea', "", type=str,
60 info="name of the CalibArea used in jet calibration (for MET significance).")
61 self.addOption ('egammaESModel', "", type=str,
62 info="ESModel for EGamma calibration (for MET significance).")
63 self.addOption ('egammaDecorrelationModel', "1NP_v1", type=str,
64 info="decorrelation model for EGamma calibration (for MET significance).")
65 self.addOption ('tauTESConfig', "CombinedTES_R22_Round2.5_v2.root", type=str,
66 info="config file for tau energy scale calibration (for MET significance).")
67 self.addOption ('tauUseMVAResolution', True, type=bool,
68 info="whether to use MVA resolution for taus-jets (for MET significance).")
69 self.addOption ('addExtraSignificanceVars', False, type=bool,
70 info="whether to save some additional (event-based) MET significance variables.")
71 self.addOption ('useLRT', False, type=bool,
72 info="whether to use LRT MET Core and association map.")
73 self.addOption ('useCaloSoftTerm', False, type=bool,
74 info="whether to use calo- instead of track-based soft term.",
75 expertMode=True)
76 self.addOption ('softTermResolution', -1.0, type=float,
77 info="override the default soft term resolution in METSignificance.",
78 expertMode=True)
79 self.addOption ('switchTauMuOrder', False, type=bool,
80 info="whether to switch order of taus and muons",
81 expertMode=True)
82

Member Function Documentation

◆ instanceName()

python.MetAnalysisConfig.MetAnalysisConfig.instanceName ( self)
Return the instance name for this block

Definition at line 83 of file MetAnalysisConfig.py.

83 def instanceName (self) :
84 """Return the instance name for this block"""
85 return self.containerName
86

◆ makeAlgs()

python.MetAnalysisConfig.MetAnalysisConfig.makeAlgs ( self,
config )

Definition at line 87 of file MetAnalysisConfig.py.

87 def makeAlgs (self, config) :
88
89 if config.isPhyslite() :
90 metSuffix = 'AnalysisMET'
91 else :
92 jetContainer = config.originalName (self.jets)
93 metSuffix = jetContainer[:-4]
94 if self.useLRT:
95 metSuffix += "_LRT"
96
97 # Remove b-tagging calibration from the MET suffix name
98 btIndex = metSuffix.find('_BTagging')
99 if btIndex != -1:
100 metSuffix = metSuffix[:btIndex]
101
102 # Set up the met maker algorithm:
103 alg = config.createAlgorithm( 'CP::MetMakerAlg', 'MetMakerAlg' )
104 config.addPrivateTool( 'makerTool', 'met::METMaker' )
105 alg.makerTool.skipSystematicJetSelection = self.skipSystematicJetSelection
106
107 alg.doJetJVT = self.useJVT
108 if self.useJVT:
109 config.addPrivateTool( 'makerTool.JvtSelTool', 'CP::NNJvtSelectionTool' )
110 alg.makerTool.JvtSelTool.JetContainer = config.readName (self.jets)
111 alg.makerTool.JvtSelTool.JvtMomentName = "NNJvt"
112 if self.useFJVT:
113 alg.makerTool.JetRejectionDec = 'fjvt_selection'
114
115 alg.makerTool.JetSelection = self.metWP
116 alg.makerTool.DoPFlow = 'PFlow' in metSuffix or metSuffix=="AnalysisMET"
117 alg.makerTool.DoSetMuonJetEMScale = self.setMuonJetEMScale if self.muons else False
118 alg.switchTauMu = self.switchTauMuOrder
119
120 if config.dataType() is not DataType.Data :
121 config.addPrivateTool( 'systematicsTool', 'met::METSystematicsTool' )
122
123 alg.metCore = 'MET_Core_' + metSuffix
124 alg.metAssociation = 'METAssoc_' + metSuffix
125 alg.jets = config.readName (self.jets)
126 alg.softTermKey = "PVSoftTrk" if not self.useCaloSoftTerm else "SoftClus"
127 if self.muons != "" :
128 alg.muons, alg.muonsSelection = config.readNameAndSelection (self.muons, excludeFrom={'or'})
129 if self.electrons != "" :
130 alg.electrons, alg.electronsSelection = config.readNameAndSelection (self.electrons, excludeFrom={'or'})
131 if self.photons != "" :
132 alg.photons, alg.photonsSelection = config.readNameAndSelection (self.photons, excludeFrom={'or'})
133 if self.taus != "" :
134 alg.taus, alg.tausSelection = config.readNameAndSelection (self.taus, excludeFrom={'or'})
135 if self.invisible:
136 if isinstance(self.invisible, str):
137 self.invisible = [self.invisible]
138 invisibleContainers, invisibleSelections = zip(*[config.readNameAndSelection (container, excludeFrom={'or'}) for container in self.invisible])
139 alg.invisible = list(invisibleContainers)
140 alg.invisibleSelection = list(invisibleSelections)
141 alg.met = config.writeName (self.containerName, isMet = True)
142
143
144 # Set up the met builder algorithm:
145 alg = config.createAlgorithm( 'CP::MetBuilderAlg', 'MetBuilderAlg' )
146 alg.softTerm = "PVSoftTrk" if not self.useCaloSoftTerm else "SoftClus"
147 alg.met = config.readName (self.containerName)
148
149
150 # Set up the met significance algorithm:
151 if self.saveSignificance:
152 alg = config.createAlgorithm( 'CP::MetSignificanceAlg', 'MetSignificanceAlg' )
153 config.addPrivateTool( 'significanceTool', 'met::METSignificance' )
154 if self.muons != "" :
155 config.addPrivateTool( 'significanceTool.MuonCalibTool', 'CP::MuonCalibTool' )
156 # Retrieve the calibMode from the container name.selections
157 alg.significanceTool.MuonCalibTool.calibMode = (
158 config.getContainerMeta(self.muons.split(".")[0], 'calibMode', failOnMiss=True))
159
160 # Preliminary R22 recommendation is to use R21 jet resolutions from 2018 for MET significance.
161 # See Jet/Etmiss recommendation documentation for details.
162 if self.jetCalibConfig == "":
163 self.jetCalibConfig = "JES_data2017_2016_2015_Recommendation_PFlow_Aug2018_rel21.config"
164 self.jetCalibArea = "00-04-81"
165 # Include Smear and not InSitu, even when running on data.
166 # This is for technical reasons and allows access to the correct resolutions for both data and MC.
167 self.jetCalibSequence = 'JetArea_Residual_EtaJES_GSC_Smear'
168
169 # Standard e/gamma calibration. Must be kept in agreement with ElectronAnalysisConfig.py
170 if self.egammaESModel == "":
171 if config.geometry() is LHCPeriod.Run2:
172 self.egammaESModel = 'es2023_R22_Run2_v1'
173 elif config.geometry() is LHCPeriod.Run3:
174 self.egammaESModel = 'es2024_Run3_v0'
175
176 alg.significanceTool.SoftTermParam = 0
177 if self.softTermResolution > 0:
178 alg.significanceTool.SoftTermReso = self.softTermResolution
179 alg.significanceTool.TreatPUJets = self.treatPUJets
180 alg.significanceTool.JetCalibConfig = self.jetCalibConfig
181 alg.significanceTool.JetCalibSequence = self.jetCalibSequence
182 alg.significanceTool.JetCalibArea = self.jetCalibArea
183 alg.significanceTool.EgammaESModel = self.egammaESModel
184 alg.significanceTool.EgammaDecorrelationModel = self.egammaDecorrelationModel
185 alg.significanceTool.EgammaUseFastsim = (config.dataType() is DataType.FastSim)
186 alg.significanceTool.TauTESConfig = self.tauTESConfig
187 alg.significanceTool.TauUseMVAResolution = self.tauUseMVAResolution
188 alg.met = config.readName (self.containerName)
189 config.addOutputVar (self.containerName, 'significance_%SYS%', 'significance')
190 if self.addExtraSignificanceVars:
191 alg.sigDirectionalDecoration = "sigDirectional_%SYS%"
192 alg.METOverSqrtSumETDecoration = "METOverSqrtSumET_%SYS%"
193 alg.METOverSqrtHTDecoration = "METOverSqrtHT_%SYS%"
194 config.addOutputVar (self.containerName, 'sigDirectional_%SYS%', 'sigDirectional')
195 config.addOutputVar (self.containerName, 'METOverSqrtSumET_%SYS%', 'METOverSqrtSumET')
196 config.addOutputVar (self.containerName, 'METOverSqrtHT_%SYS%', 'METOverSqrtHT')
197
198 config.addOutputVar (self.containerName, 'met', 'met')
199 config.addOutputVar (self.containerName, 'phi', 'phi')
200 config.addOutputVar (self.containerName, 'sumet', 'sumet')
201 config.addOutputVar (self.containerName, 'name', 'name', noSys=True, enabled=False)
std::vector< std::string > split(const std::string &s, const std::string &t=":")
Definition hcg.cxx:177

Member Data Documentation

◆ addExtraSignificanceVars

python.MetAnalysisConfig.MetAnalysisConfig.addExtraSignificanceVars

Definition at line 190 of file MetAnalysisConfig.py.

◆ containerName

python.MetAnalysisConfig.MetAnalysisConfig.containerName

Definition at line 189 of file MetAnalysisConfig.py.

◆ egammaESModel

str python.MetAnalysisConfig.MetAnalysisConfig.egammaESModel = "":

Definition at line 170 of file MetAnalysisConfig.py.

◆ invisible

python.MetAnalysisConfig.MetAnalysisConfig.invisible

Definition at line 135 of file MetAnalysisConfig.py.

◆ jetCalibArea

str python.MetAnalysisConfig.MetAnalysisConfig.jetCalibArea = "00-04-81"

Definition at line 164 of file MetAnalysisConfig.py.

◆ jetCalibConfig

str python.MetAnalysisConfig.MetAnalysisConfig.jetCalibConfig = "":

Definition at line 162 of file MetAnalysisConfig.py.

◆ jetCalibSequence

str python.MetAnalysisConfig.MetAnalysisConfig.jetCalibSequence = 'JetArea_Residual_EtaJES_GSC_Smear'

Definition at line 167 of file MetAnalysisConfig.py.

◆ saveSignificance

python.MetAnalysisConfig.MetAnalysisConfig.saveSignificance

Definition at line 151 of file MetAnalysisConfig.py.

◆ useFJVT

python.MetAnalysisConfig.MetAnalysisConfig.useFJVT

Definition at line 112 of file MetAnalysisConfig.py.

◆ useJVT

python.MetAnalysisConfig.MetAnalysisConfig.useJVT

Definition at line 108 of file MetAnalysisConfig.py.

◆ useLRT

python.MetAnalysisConfig.MetAnalysisConfig.useLRT

Definition at line 94 of file MetAnalysisConfig.py.


The documentation for this class was generated from the following file: