ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
python.MetAnalysisConfig.MetAnalysisConfig Class Reference
Inheritance diagram for python.MetAnalysisConfig.MetAnalysisConfig:
Collaboration diagram for python.MetAnalysisConfig.MetAnalysisConfig:

Public Member Functions

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

Public Attributes

 invisible
 
 jetCalibConfig
 
 jetCalibArea
 
 jetCalibSequence
 
 egammaESModel
 

Detailed Description

the ConfigBlock for the MET configuration

Definition at line 9 of file MetAnalysisConfig.py.

Constructor & Destructor Documentation

◆ __init__()

def 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()

def 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()

def 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  if self.useFJVT:
109  alg.makerTool.JetRejectionDec = 'fjvt_selection'
110 
111  alg.makerTool.JetSelection = self.metWP
112  alg.makerTool.DoPFlow = 'PFlow' in metSuffix or metSuffix=="AnalysisMET"
113  alg.makerTool.DoSetMuonJetEMScale = self.setMuonJetEMScale if self.muons else False
114 
115  if config.dataType() is not DataType.Data :
116  config.addPrivateTool( 'systematicsTool', 'met::METSystematicsTool' )
117 
118  alg.metCore = 'MET_Core_' + metSuffix
119  alg.metAssociation = 'METAssoc_' + metSuffix
120  alg.jets = config.readName (self.jets)
121  alg.softTermKey = "PVSoftTrk" if not self.useCaloSoftTerm else "SoftClus"
122  if self.muons != "" :
123  alg.muons, alg.muonsSelection = config.readNameAndSelection (self.muons, excludeFrom={'or'})
124  if self.electrons != "" :
125  alg.electrons, alg.electronsSelection = config.readNameAndSelection (self.electrons, excludeFrom={'or'})
126  if self.photons != "" :
127  alg.photons, alg.photonsSelection = config.readNameAndSelection (self.photons, excludeFrom={'or'})
128  if self.taus != "" :
129  alg.taus, alg.tausSelection = config.readNameAndSelection (self.taus, excludeFrom={'or'})
130  if self.invisible:
131  if isinstance(self.invisible, str):
132  self.invisible = [self.invisible]
133  invisibleContainers, invisibleSelections = zip(*[config.readNameAndSelection (container, excludeFrom={'or'}) for container in self.invisible])
134  alg.invisible = list(invisibleContainers)
135  alg.invisibleSelection = list(invisibleSelections)
136  alg.met = config.writeName (self.containerName, isMet = True)
137 
138 
139  # Set up the met builder algorithm:
140  alg = config.createAlgorithm( 'CP::MetBuilderAlg', 'MetBuilderAlg' )
141  alg.softTerm = "PVSoftTrk" if not self.useCaloSoftTerm else "SoftClus"
142  alg.met = config.readName (self.containerName)
143 
144 
145  # Set up the met significance algorithm:
146  if self.saveSignificance:
147  alg = config.createAlgorithm( 'CP::MetSignificanceAlg', 'MetSignificanceAlg' )
148  config.addPrivateTool( 'significanceTool', 'met::METSignificance' )
149  if self.muons != "" :
150  config.addPrivateTool( 'significanceTool.MuonCalibTool', 'CP::MuonCalibTool' )
151  # Retrieve the calibMode from the container name.selections
152  alg.significanceTool.MuonCalibTool.calibMode = (
153  config.getContainerMeta(self.muons.split(".")[0], 'calibMode', failOnMiss=True))
154 
155  # Standard jet calibration. Must be kept in agreement with JetAnalysisConfig.py
156  if self.jetCalibConfig == "":
157  if config.geometry() is LHCPeriod.Run2:
158  self.jetCalibConfig = "PreRec_R22_PFlow_ResPU_EtaJES_GSC_February23_230215.config"
159  self.jetCalibArea = "00-04-82"
160  elif config.geometry() >= LHCPeriod.Run3:
161  self.jetCalibConfig = "AntiKt4EMPFlow_MC23a_PreRecR22_Phase2_CalibConfig_ResPU_EtaJES_GSC_241208_InSitu.config"
162  self.jetCalibArea = "00-04-83"
163 
164  if self.jetCalibSequence == "":
165  # Omit the in situ piece, even 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'
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)

Member Data Documentation

◆ egammaESModel

python.MetAnalysisConfig.MetAnalysisConfig.egammaESModel

Definition at line 170 of file MetAnalysisConfig.py.

◆ invisible

python.MetAnalysisConfig.MetAnalysisConfig.invisible

Definition at line 132 of file MetAnalysisConfig.py.

◆ jetCalibArea

python.MetAnalysisConfig.MetAnalysisConfig.jetCalibArea

Definition at line 159 of file MetAnalysisConfig.py.

◆ jetCalibConfig

python.MetAnalysisConfig.MetAnalysisConfig.jetCalibConfig

Definition at line 156 of file MetAnalysisConfig.py.

◆ jetCalibSequence

python.MetAnalysisConfig.MetAnalysisConfig.jetCalibSequence

Definition at line 164 of file MetAnalysisConfig.py.


The documentation for this class was generated from the following file:
python.processes.powheg.ZZj_MiNNLO.ZZj_MiNNLO.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZj_MiNNLO.py:18
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
Trk::split
@ split
Definition: LayerMaterialProperties.h:38