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

Public Member Functions

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

Public Attributes

 noEffSF
 saveDetailedSF
 containerName
str quality = 'HighPt' and not self.noEffSF:
 saveCombinedSF

Detailed Description

the ConfigBlock for the muon working point efficiency computation

Definition at line 286 of file MuonAnalysisConfig.py.

Constructor & Destructor Documentation

◆ __init__()

python.MuonAnalysisConfig.MuonWorkingPointEfficiencyConfig.__init__ ( self)

Definition at line 289 of file MuonAnalysisConfig.py.

289 def __init__ (self) :
290 super (MuonWorkingPointEfficiencyConfig, self).__init__ ()
291 self.setBlockName('MuonWorkingPointEfficiency')
292 self.addDependency('MuonWorkingPointSelection', required=True)
293 self.addDependency('EventSelection', required=False)
294 self.addDependency('EventSelectionMerger', required=False)
295 self.addOption ('containerName', '', type=str,
296 noneAction='error',
297 info="the name of the input container.")
298 self.addOption ('selectionName', '', type=str,
299 noneAction='error',
300 info="the name of the muon selection to define (e.g. `tight` or `loose`).")
301 self.addOption ('postfix', None, type=str,
302 info="a postfix to apply to decorations and algorithm names. "
303 "Typically not needed here as `selectionName` is used internally.")
304 self.addOption ('trackSelection', True, type=bool,
305 info="whether or not to set up an instance of "
306 "`CP::AsgLeptonTrackSelectionAlg`, with the recommended $d_0$ and "
307 r"$z_0\sin\theta$ cuts.")
308 self.addOption ('quality', None, type=str,
309 info="the ID WP to use. Supported ID WPs: `Tight`, `Medium`, "
310 "`Loose`, `LowPt`, `HighPt`.")
311 self.addOption ('isolation', None, type=str,
312 info="the isolation WP to use. Supported isolation WPs: "
313 "`PflowLoose_VarRad`, `PflowTight_VarRad`, `Loose_VarRad`, "
314 "`Tight_VarRad`, `NonIso`.")
315 self.addOption ('systematicBreakdown', False, type=bool,
316 info="enables the full breakdown of efficiency SF systematics "
317 "(1 NP per uncertainty source, instead of 1 NP in total).")
318 self.addOption ('noEffSF', False, type=bool,
319 info="disables the calculation of efficiencies and scale factors. "
320 "Experimental! Only useful to test a new WP for which scale "
321 "factors are not available.",
322 expertMode=True)
323 self.addOption ('saveDetailedSF', True, type=bool,
324 info="save all the independent detailed object scale factors.")
325 self.addOption ('saveCombinedSF', False, type=bool,
326 info="save the combined object scale factor.")
327

Member Function Documentation

◆ instanceName()

python.MuonAnalysisConfig.MuonWorkingPointEfficiencyConfig.instanceName ( self)

Definition at line 328 of file MuonAnalysisConfig.py.

328 def instanceName (self) :
329 if self.postfix is not None:
330 return self.containerName + '_' + self.postfix
331 else:
332 return self.containerName + '_' + self.selectionName
333

◆ makeAlgs()

python.MuonAnalysisConfig.MuonWorkingPointEfficiencyConfig.makeAlgs ( self,
config )

Definition at line 334 of file MuonAnalysisConfig.py.

334 def makeAlgs (self, config) :
335
336 # The setup below is inappropriate for Run 1
337 if config.geometry() is LHCPeriod.Run1:
338 raise ValueError ("Can't set up the MuonWorkingPointEfficiencyConfig with %s, there must be something wrong!" % config.geometry().value)
339
340 postfix = self.postfix
341 if postfix is None :
342 postfix = self.selectionName
343 if postfix != '' and postfix[0] != '_' :
344 postfix = '_' + postfix
345
346 sfList = []
347 # Set up the reco/ID efficiency scale factor calculation algorithm:
348 if config.dataType() is not DataType.Data and not self.noEffSF:
349 alg = config.createAlgorithm( 'CP::MuonEfficiencyScaleFactorAlg',
350 'MuonEfficiencyScaleFactorAlgReco' )
351 config.addPrivateTool( 'efficiencyScaleFactorTool',
352 'CP::MuonEfficiencyScaleFactors' )
353 alg.scaleFactorDecoration = 'muon_reco_effSF' + postfix + "_%SYS%"
354 alg.outOfValidity = 2 #silent
355 alg.outOfValidityDeco = 'muon_reco_bad_eff' + postfix
356 alg.efficiencyScaleFactorTool.WorkingPoint = self.quality
357 if config.geometry() >= LHCPeriod.Run3:
358 alg.efficiencyScaleFactorTool.CalibrationRelease = '251211_Preliminary_r24run3'
359 else:
360 alg.efficiencyScaleFactorTool.CalibrationRelease = '230213_Preliminary_r22run2'
361 alg.efficiencyScaleFactorTool.BreakDownSystematics = self.systematicBreakdown
362 alg.muons = config.readName (self.containerName)
363 alg.preselection = config.getPreselection (self.containerName, self.selectionName)
364 if self.saveDetailedSF:
365 config.addOutputVar (self.containerName, alg.scaleFactorDecoration,
366 'reco_effSF' + postfix)
367 sfList += [alg.scaleFactorDecoration]
368
369 # Set up the HighPt-specific BadMuonVeto efficiency scale factor calculation algorithm:
370 if config.dataType() is not DataType.Data and self.quality == 'HighPt' and not self.noEffSF:
371 alg = config.createAlgorithm( 'CP::MuonEfficiencyScaleFactorAlg',
372 'MuonEfficiencyScaleFactorAlgBMVHighPt' )
373 config.addPrivateTool( 'efficiencyScaleFactorTool',
374 'CP::MuonEfficiencyScaleFactors' )
375 alg.scaleFactorDecoration = 'muon_BadMuonVeto_effSF' + postfix + "_%SYS%"
376 alg.outOfValidity = 2 #silent
377 alg.outOfValidityDeco = 'muon_BadMuonVeto_bad_eff' + postfix
378 alg.efficiencyScaleFactorTool.WorkingPoint = 'BadMuonVeto_HighPt'
379 if config.geometry() >= LHCPeriod.Run3:
380 alg.efficiencyScaleFactorTool.CalibrationRelease = '220817_Preliminary_r22run3' # not available as part of '230123_Preliminary_r22run3'!
381 else:
382 alg.efficiencyScaleFactorTool.CalibrationRelease = '230213_Preliminary_r22run2'
383 alg.efficiencyScaleFactorTool.BreakDownSystematics = self.systematicBreakdown
384 alg.muons = config.readName (self.containerName)
385 alg.preselection = config.getPreselection (self.containerName, self.selectionName)
386 if self.saveDetailedSF:
387 config.addOutputVar (self.containerName, alg.scaleFactorDecoration,
388 'BadMuonVeto_effSF' + postfix)
389 sfList += [alg.scaleFactorDecoration]
390
391 # Set up the isolation efficiency scale factor calculation algorithm:
392 if config.dataType() is not DataType.Data and self.isolation != 'NonIso' and not self.noEffSF:
393 alg = config.createAlgorithm( 'CP::MuonEfficiencyScaleFactorAlg',
394 'MuonEfficiencyScaleFactorAlgIsol' )
395 config.addPrivateTool( 'efficiencyScaleFactorTool',
396 'CP::MuonEfficiencyScaleFactors' )
397 alg.scaleFactorDecoration = 'muon_isol_effSF' + postfix + "_%SYS%"
398 alg.outOfValidity = 2 #silent
399 alg.outOfValidityDeco = 'muon_isol_bad_eff' + postfix
400 alg.efficiencyScaleFactorTool.WorkingPoint = self.isolation + 'Iso'
401 if config.geometry() >= LHCPeriod.Run3:
402 alg.efficiencyScaleFactorTool.CalibrationRelease = '251211_Preliminary_r24run3'
403 else:
404 alg.efficiencyScaleFactorTool.CalibrationRelease = '230213_Preliminary_r22run2'
405 alg.efficiencyScaleFactorTool.BreakDownSystematics = self.systematicBreakdown
406 alg.muons = config.readName (self.containerName)
407 alg.preselection = config.getPreselection (self.containerName, self.selectionName)
408 if self.saveDetailedSF:
409 config.addOutputVar (self.containerName, alg.scaleFactorDecoration,
410 'isol_effSF' + postfix)
411 sfList += [alg.scaleFactorDecoration]
412
413 # Set up the TTVA scale factor calculation algorithm:
414 if config.dataType() is not DataType.Data and self.trackSelection and not self.noEffSF:
415 alg = config.createAlgorithm( 'CP::MuonEfficiencyScaleFactorAlg',
416 'MuonEfficiencyScaleFactorAlgTTVA' )
417 config.addPrivateTool( 'efficiencyScaleFactorTool',
418 'CP::MuonEfficiencyScaleFactors' )
419 alg.scaleFactorDecoration = 'muon_TTVA_effSF' + postfix + "_%SYS%"
420 alg.outOfValidity = 2 #silent
421 alg.outOfValidityDeco = 'muon_TTVA_bad_eff' + postfix
422 alg.efficiencyScaleFactorTool.WorkingPoint = 'TTVA'
423 if config.geometry() >= LHCPeriod.Run3:
424 alg.efficiencyScaleFactorTool.CalibrationRelease = '251211_Preliminary_r24run3'
425 else:
426 alg.efficiencyScaleFactorTool.CalibrationRelease = '230213_Preliminary_r22run2'
427 alg.efficiencyScaleFactorTool.BreakDownSystematics = self.systematicBreakdown
428 alg.muons = config.readName (self.containerName)
429 alg.preselection = config.getPreselection (self.containerName, self.selectionName)
430 if self.saveDetailedSF:
431 config.addOutputVar (self.containerName, alg.scaleFactorDecoration,
432 'TTVA_effSF' + postfix)
433 sfList += [alg.scaleFactorDecoration]
434
435 if config.dataType() is not DataType.Data and not self.noEffSF and self.saveCombinedSF:
436 alg = config.createAlgorithm( 'CP::AsgObjectScaleFactorAlg',
437 'MuonCombinedEfficiencyScaleFactorAlg' )
438 alg.particles = config.readName (self.containerName)
439 alg.inScaleFactors = sfList
440 alg.outScaleFactor = 'effSF' + postfix + '_%SYS%'
441 config.addOutputVar (self.containerName, alg.outScaleFactor, 'effSF' + postfix)
442

Member Data Documentation

◆ containerName

python.MuonAnalysisConfig.MuonWorkingPointEfficiencyConfig.containerName

Definition at line 365 of file MuonAnalysisConfig.py.

◆ noEffSF

python.MuonAnalysisConfig.MuonWorkingPointEfficiencyConfig.noEffSF

Definition at line 348 of file MuonAnalysisConfig.py.

◆ quality

str python.MuonAnalysisConfig.MuonWorkingPointEfficiencyConfig.quality = 'HighPt' and not self.noEffSF:

Definition at line 370 of file MuonAnalysisConfig.py.

◆ saveCombinedSF

python.MuonAnalysisConfig.MuonWorkingPointEfficiencyConfig.saveCombinedSF

Definition at line 435 of file MuonAnalysisConfig.py.

◆ saveDetailedSF

python.MuonAnalysisConfig.MuonWorkingPointEfficiencyConfig.saveDetailedSF

Definition at line 364 of file MuonAnalysisConfig.py.


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