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 input 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 (default=True)")
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="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="Use MVA resolution for taus? (for MET significance)")
69 self.addOption ('addExtraSignificanceVars', False, type=bool,
70 info="whether to save some additional (event-based) MET significance variables (default=False)")
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="(expert) use calo- instead of track-based soft term",
75 expertMode=True)
76 self.addOption ('softTermResolution', -1.0, type=float,
77 info="(expert) override the default soft term resolution in METSignificance",
78 expertMode=True)
79

Member Function Documentation

◆ instanceName()

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

Definition at line 80 of file MetAnalysisConfig.py.

80 def instanceName (self) :
81 """Return the instance name for this block"""
82 return self.containerName
83

◆ makeAlgs()

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

Definition at line 84 of file MetAnalysisConfig.py.

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

◆ containerName

python.MetAnalysisConfig.MetAnalysisConfig.containerName

Definition at line 185 of file MetAnalysisConfig.py.

◆ egammaESModel

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

Definition at line 166 of file MetAnalysisConfig.py.

◆ invisible

python.MetAnalysisConfig.MetAnalysisConfig.invisible

Definition at line 131 of file MetAnalysisConfig.py.

◆ jetCalibArea

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

Definition at line 160 of file MetAnalysisConfig.py.

◆ jetCalibConfig

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

Definition at line 158 of file MetAnalysisConfig.py.

◆ jetCalibSequence

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

Definition at line 163 of file MetAnalysisConfig.py.

◆ saveSignificance

python.MetAnalysisConfig.MetAnalysisConfig.saveSignificance

Definition at line 147 of file MetAnalysisConfig.py.

◆ useFJVT

python.MetAnalysisConfig.MetAnalysisConfig.useFJVT

Definition at line 109 of file MetAnalysisConfig.py.

◆ useJVT

python.MetAnalysisConfig.MetAnalysisConfig.useJVT

Definition at line 105 of file MetAnalysisConfig.py.

◆ useLRT

python.MetAnalysisConfig.MetAnalysisConfig.useLRT

Definition at line 91 of file MetAnalysisConfig.py.


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