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

Public Member Functions

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

Public Attributes

 jetCollection
 
 jetInput
 

Detailed Description

the ConfigBlock for the small-r jet sequence

Definition at line 106 of file JetAnalysisConfig.py.

Constructor & Destructor Documentation

◆ __init__()

def python.JetAnalysisConfig.SmallRJetAnalysisConfig.__init__ (   self)

Definition at line 109 of file JetAnalysisConfig.py.

109  def __init__ (self) :
110  super (SmallRJetAnalysisConfig, self).__init__ ()
111  self.addOption ('containerName', '', type=str,
112  noneAction='error',
113  info="the name of the output container after calibration.")
114  self.addOption ('jetCollection', '', type=str,
115  noneAction='error',
116  info="the jet container to run on. It is interpreted to determine "
117  "the correct config blocks to call for small- or large-R jets.")
118  # TODO: add info string
119  self.addOption ('jetInput', '', type=str,
120  noneAction='error',
121  info="")
122  self.addOption ('runJvtUpdate', False, type=bool,
123  info="whether to update the JVT. The default is False.")
124  self.addOption ('runNNJvtUpdate', False, type=bool,
125  info="whether to update the NN-JVT. The default is False.")
126  self.addOption ('runJvtSelection', True, type=bool,
127  info="whether to run JVT selection. The default is True.")
128  self.addOption ('runFJvtSelection', False, type=bool,
129  info="whether to run forward JVT selection. The default is False.")
130  self.addOption ('jvtWP', "FixedEffPt", type=str,
131  info="which Jvt WP to apply. The default is FixedEffPt.")
132  self.addOption ('fJvtWP', "Loose", type=str,
133  info="which fJvt WP to apply. The default is Loose.")
134  self.addOption ('runJvtEfficiency', True, type=bool,
135  info="whether to calculate the JVT efficiency. The default is True.")
136  self.addOption ('runFJvtEfficiency', False, type=bool,
137  info="whether to calculate the forward JVT efficiency. The default is False.")
138  self.addOption ('runJERsystematicsOnData', False, type=bool,
139  info="whether to run the All/Full JER model variations also on data samples. Expert option!",
140  expertMode=True)
141  self.addOption ('recalibratePhyslite', True, type=bool,
142  info="whether to run the CP::JetCalibrationAlg on PHYSLITE derivations. "
143  "The default is True.")
144  # Calibration tool options
145  self.addOption ('calibToolConfigFile', None, type=str,
146  info="name (str) of the config file to use for the jet calibration "
147  "tool. Expert option to override JetETmiss recommendations. The "
148  "default is None.",
149  expertMode=True)
150  self.addOption ('calibToolCalibArea', None, type=str,
151  info="name (str) of the CVMFS area to use for the jet calibration "
152  "tool. Expert option to override JetETmiss recommendations. The "
153  "default is None.",
154  expertMode=True)
155  self.addOption ('calibToolCalibSeq', None, type=str,
156  info="name (str) of the sequence to use for the jet calibration "
157  "tool (e.g. 'JetArea_Residual_EtaJES_GSC'). Expert option to override "
158  "JetETmiss recommendations. The default is None.",
159  expertMode=True)
160 

Member Function Documentation

◆ instanceName()

def python.JetAnalysisConfig.SmallRJetAnalysisConfig.instanceName (   self)
Return the instance name for this block

Definition at line 161 of file JetAnalysisConfig.py.

161  def instanceName (self) :
162  """Return the instance name for this block"""
163  return self.containerName
164 

◆ makeAlgs()

def python.JetAnalysisConfig.SmallRJetAnalysisConfig.makeAlgs (   self,
  config 
)

Definition at line 165 of file JetAnalysisConfig.py.

165  def makeAlgs (self, config) :
166 
167  jetCollectionName=self.jetCollection
168  if(self.jetCollection=="AnalysisJets") :
169  jetCollectionName="AntiKt4EMPFlowJets"
170  if(self.jetCollection=="AnalysisLargeRJets") :
171  jetCollectionName="AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets"
172 
173  if self.jetInput not in ["EMTopo", "EMPFlow", "HI"]:
174  raise ValueError(
175  "Unsupported input type '{0}' for R=0.4 jets!".format(self.jetInput) )
176 
177  if self.jvtWP not in ["FixedEffPt"]:
178  raise ValueError(
179  "Unsupported NNJvt WP '{0}'".format(self.jvtWP) )
180 
181  if self.fJvtWP not in ["Loose", "Tight", "Tighter"]:
182  raise ValueError(
183  "Unsupported fJvt WP '{0}'".format(self.fJvtWP) )
184 
185  if not config.isPhyslite() or self.recalibratePhyslite:
186  # Prepare the jet calibration algorithm
187  alg = config.createAlgorithm( 'CP::JetCalibrationAlg', 'JetCalibrationAlg' )
188  config.addPrivateTool( 'calibrationTool', 'JetCalibrationTool' )
189  alg.calibrationTool.JetCollection = jetCollectionName[:-4]
190  # Get the correct string to use in the config file name
191  if self.jetInput == "EMPFlow":
192  if config.geometry() is LHCPeriod.Run2:
193  configFile = "PreRec_R22_PFlow_ResPU_EtaJES_GSC_February23_230215.config"
194  alg.calibrationTool.CalibArea = "00-04-82"
195  elif config.geometry() >= LHCPeriod.Run3:
196  configFile = "AntiKt4EMPFlow_MC23a_PreRecR22_Phase2_CalibConfig_ResPU_EtaJES_GSC_241208_InSitu.config"
197  alg.calibrationTool.CalibArea = "00-04-83"
198  elif self.jetInput == "HI":
199  if config.geometry() is LHCPeriod.Run2:
200  configFile = "JES_MC16_HI_Jan2021_5TeV.config"
201  if config.geometry() is LHCPeriod.Run3:
202  configFile = "AntiKt4HI_JES_constants_11-05-2024_13p6TeVFinalConfiguration.config"
203  alg.calibrationTool.CalibArea = "00-04-83"
204  else:
205  if config.dataType() is DataType.FastSim:
206  configFile = "JES_MC16Recommendation_AFII_{0}_Apr2019_Rel21.config"
207  else:
208  configFile = "JES_MC16Recommendation_Consolidated_{0}_Apr2019_Rel21.config"
209  configFile = configFile.format(self.jetInput)
210  if self.calibToolCalibArea is not None:
211  alg.calibrationTool.CalibArea = self.calibToolCalibArea
212  if self.calibToolConfigFile is not None:
213  configFile = self.calibToolConfigFile
214  alg.calibrationTool.ConfigFile = configFile
215  if config.dataType() is DataType.Data:
216  if self.jetInput == "HI":
217  if config.geometry() is LHCPeriod.Run2:
218  alg.calibrationTool.CalibSequence = 'EtaJES_Insitu'
219  if config.geometry() is LHCPeriod.Run3:
220  alg.calibrationTool.CalibSequence = 'EtaJES'
221  else:
222  alg.calibrationTool.CalibSequence = 'JetArea_Residual_EtaJES_GSC_Insitu'
223  else:
224  if self.jetInput == "EMPFlow":
225  alg.calibrationTool.CalibSequence = 'JetArea_Residual_EtaJES_GSC'
226  elif self.jetInput == "HI":
227  alg.calibrationTool.CalibSequence = 'EtaJES'
228  else:
229  alg.calibrationTool.CalibSequence = 'JetArea_Residual_EtaJES_GSC_Smear'
230  if self.calibToolCalibSeq is not None:
231  alg.calibrationTool.CalibSequence = self.calibToolCalibSeq
232  alg.calibrationTool.IsData = (config.dataType() is DataType.Data)
233  alg.jets = config.readName (self.containerName)
234  alg.jetsOut = config.copyName (self.containerName)
235 
236  # Set up the JVT update algorithm:
237  if self.runJvtUpdate :
238  alg = config.createAlgorithm( 'CP::JvtUpdateAlg', 'JvtUpdateAlg' )
239  config.addPrivateTool( 'jvtTool', 'JetVertexTaggerTool' )
240  alg.jvtTool.JetContainer = self.jetCollection
241  alg.jvtTool.SuppressInputDependence=True
242  alg.jets = config.readName (self.containerName)
243  alg.jetsOut = config.copyName (self.containerName)
244  alg.preselection = config.getPreselection (self.containerName, '')
245 
246  if self.runNNJvtUpdate:
247  assert self.jetInput=="EMPFlow", "NN JVT only defined for PFlow jets"
248  alg = config.createAlgorithm( 'CP::JetDecoratorAlg', 'NNJvtUpdateAlg' )
249  config.addPrivateTool( 'decorator', 'JetPileupTag::JetVertexNNTagger' )
250  # Set this actually to the *output* collection
251  alg.jets = config.readName (self.containerName)
252  alg.jetsOut = config.copyName (self.containerName)
253  alg.decorator.JetContainer = alg.jetsOut.replace ('%SYS%', 'NOSYS')
254  alg.decorator.SuppressInputDependence=True
255  alg.decorator.SuppressOutputDependence=True
256 
257  # Set up the jet efficiency scale factor calculation algorithm
258  # Change the truthJetCollection property to AntiKt4TruthWZJets if preferred
259  if self.runJvtSelection :
260  assert self.jetInput=="EMPFlow", "NNJvt WPs and SFs only valid for PFlow jets"
261  alg = config.createAlgorithm('CP::AsgSelectionAlg', 'JvtSelectionAlg')
262  config.addPrivateTool('selectionTool', 'CP::NNJvtSelectionTool')
263  alg.selectionTool.JetContainer = config.readName(self.containerName)
264  alg.selectionTool.WorkingPoint = self.jvtWP
265  alg.selectionTool.MaxPtForJvt = 60*GeV
266  alg.selectionDecoration = "jvt_selection,as_char"
267  alg.particles = config.readName(self.containerName)
268 
269  if self.runJvtEfficiency and config.dataType() is not DataType.Data:
270  alg = config.createAlgorithm( 'CP::JvtEfficiencyAlg', 'JvtEfficiencyAlg' )
271  config.addPrivateTool( 'efficiencyTool', 'CP::NNJvtEfficiencyTool' )
272  alg.efficiencyTool.JetContainer = config.readName(self.containerName)
273  alg.efficiencyTool.MaxPtForJvt = 60*GeV
274  alg.efficiencyTool.WorkingPoint = self.jvtWP
275  if config.geometry() is LHCPeriod.Run2:
276  alg.efficiencyTool.SFFile = "JetJvtEfficiency/May2024/NNJvtSFFile_Run2_EMPFlow.root"
277  else:
278  alg.efficiencyTool.SFFile = "JetJvtEfficiency/May2024/NNJvtSFFile_Run3_EMPFlow.root"
279  alg.selection = 'jvt_selection,as_char'
280  alg.scaleFactorDecoration = 'jvt_effSF_%SYS%'
281  alg.outOfValidity = 2
282  alg.outOfValidityDeco = 'no_jvt'
283  alg.skipBadEfficiency = False
284  alg.jets = config.readName (self.containerName)
285  alg.preselection = config.getPreselection (self.containerName, '')
286  config.addOutputVar (self.containerName, alg.scaleFactorDecoration, 'jvtEfficiency')
287  config.addSelection (self.containerName, 'baselineJvt', 'jvt_selection,as_char', preselection=False)
288 
289  if self.runFJvtSelection :
290  assert self.jetInput=="EMPFlow", "fJvt WPs and SFs only valid for PFlow jets"
291  alg = config.createAlgorithm('CP::AsgSelectionAlg', 'FJvtSelectionAlg')
292  config.addPrivateTool('selectionTool', 'CP::FJvtSelectionTool')
293  alg.selectionTool.JetContainer = config.readName(self.containerName)
294  alg.selectionTool.WorkingPoint = self.fJvtWP
295  alg.selectionDecoration = "fjvt_selection,as_char"
296  alg.particles = config.readName(self.containerName)
297 
298  if self.runFJvtEfficiency and config.dataType() is not DataType.Data:
299  alg = config.createAlgorithm( 'CP::JvtEfficiencyAlg', 'FJvtEfficiencyAlg' )
300  config.addPrivateTool( 'efficiencyTool', 'CP::FJvtEfficiencyTool' )
301  alg.efficiencyTool.JetContainer = config.readName(self.containerName)
302  alg.efficiencyTool.WorkingPoint = self.fJvtWP
303  if config.geometry() is LHCPeriod.Run2:
304  alg.efficiencyTool.SFFile = "JetJvtEfficiency/May2024/fJvtSFFile_Run2_EMPFlow.root"
305  else:
306  alg.efficiencyTool.SFFile = "JetJvtEfficiency/May2024/fJvtSFFile_Run3_EMPFlow.root"
307  alg.selection = 'fjvt_selection,as_char'
308  alg.scaleFactorDecoration = 'fjvt_effSF_%SYS%'
309  alg.outOfValidity = 2
310  alg.outOfValidityDeco = 'no_fjvt'
311  alg.skipBadEfficiency = False
312  alg.jets = config.readName (self.containerName)
313  alg.preselection = config.getPreselection (self.containerName, '')
314  config.addOutputVar (self.containerName, alg.scaleFactorDecoration, 'fjvtEfficiency')
315  config.addSelection (self.containerName, 'baselineFJvt', 'fjvt_selection,as_char', preselection=False)
316 
317  # Additional decorations
318  alg = config.createAlgorithm( 'CP::AsgEnergyDecoratorAlg', 'AsgEnergyDecoratorAlg' )
319  alg.particles = config.readName (self.containerName)
320 
321  config.addOutputVar (self.containerName, 'e_%SYS%', 'e')
322 
323 

Member Data Documentation

◆ jetCollection

python.JetAnalysisConfig.SmallRJetAnalysisConfig.jetCollection

Definition at line 168 of file JetAnalysisConfig.py.

◆ jetInput

python.JetAnalysisConfig.SmallRJetAnalysisConfig.jetInput

Definition at line 191 of file JetAnalysisConfig.py.


The documentation for this class was generated from the following file:
vtune_athena.format
format
Definition: vtune_athena.py:14
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
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:567