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

Public Member Functions

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

Public Attributes

 jetCollection
 
 jetInput
 

Detailed Description

the ConfigBlock for the large-r jet sequence

Definition at line 402 of file JetAnalysisConfig.py.

Constructor & Destructor Documentation

◆ __init__()

def python.JetAnalysisConfig.LargeRJetAnalysisConfig.__init__ (   self)

Definition at line 405 of file JetAnalysisConfig.py.

405  def __init__ (self) :
406  super (LargeRJetAnalysisConfig, self).__init__ ()
407  self.addOption ('containerName', '', type=str,
408  noneAction='error',
409  info="the name of the output container after calibration.")
410  self.addOption ('jetCollection', '', type=str,
411  noneAction='error',
412  info="the jet container to run on. It is interpreted to determine "
413  "the correct config blocks to call for small- or large-R jets.")
414  # TODO: add info string
415  self.addOption ('jetInput', '', type=str,
416  noneAction='error',
417  info="")
418  # TODO: add info string
419  self.addOption ('largeRMass', "Comb", type=str,
420  info="")
421  self.addOption ('recalibratePhyslite', True, type=bool,
422  info="whether to run the CP::JetCalibrationAlg on PHYSLITE "
423  "derivations. The default is True.")
424  self.addOption ('systematicsModelJER', "Full", type=str)
425  self.addOption ('systematicsModelJMS', "Full", type=str)
426  self.addOption ('systematicsModelJMR', "Full", type=str,
427  info="the NP reduction scheme to use for JMR: Full, Simple. The default is Full.")
428  self.addOption ('runJERsystematicsOnData', False, type=bool,
429  info="whether to run the All/Full JER model variations also on data samples. Expert option!",
430  expertMode=True)
431  # Adding these options to override the jet uncertainty config file when we have new recommendations
432  # Calibration tool options
433  self.addOption ('calibToolConfigFile', None, type=str,
434  info="name (str) of the config file to use for the jet calibration "
435  "tool. Expert option to override JetETmiss recommendations. The "
436  "default is None.",
437  expertMode=True)
438  self.addOption ('calibToolCalibArea', None, type=str,
439  info="name (str) of the CVMFS area to use for the jet calibration "
440  "tool. Expert option to override JetETmiss recommendations. The "
441  "default is None.",
442  expertMode=True)
443  self.addOption ('calibToolCalibSeq', None, type=str,
444  info="name (str) of the sequence to use for the jet calibration "
445  "tool (e.g. 'JetArea_Residual_EtaJES_GSC'). Expert option to override "
446  "JetETmiss recommendations. The default is None.",
447  expertMode=True)
448  # Uncertainties tool options
449  self.addOption ('uncertToolConfigPath', None, type=str,
450  info="name (str) of the config file to use for the JES, JER, and JMS uncertainty "
451  "tool. Expert option to override JetETmiss recommendations. The "
452  "default is None.",
453  expertMode=True)
454  self.addOption ('uncertToolConfigPathJMR', None, type=str,
455  info="name (str) of the config file to use for the JMR uncertainty "
456  "tool. Expert option to override JetETmiss recommendations. The "
457  "default is None.",
458  expertMode=True)
459  self.addOption ('minPt', 200.*GeV, type=float,
460  info="the minimum pt cut to apply to calibrated large-R jets. "
461  "The default is 200 GeV.")
462  self.addOption ('maxPt', 3000.*GeV, type=float,
463  info="the maximum pt cut to apply to calibrated large-R jets. "
464  "The default is 3000 GeV.")
465  self.addOption ('maxEta', 0., type=float,
466  info="the maximum |eta| cut to apply to calibrated large-R jets. "
467  "The default is 0.")
468  self.addOption ('maxRapidity', 2., type=float,
469  info="the maximum rapidity cut to apply to calibrated large-R jets. "
470  "The default is 2.")
471  self.addOption ('minMass', 40.*GeV, type=float,
472  info="the minimum mass cut to apply to calibrated large-R jets. "
473  "The default is 40 GeV.")
474  self.addOption ('maxMass', 600.*GeV, type=float,
475  info="the maximum mass cut to apply to calibrated large-R jets. "
476  "The default is 600 GeV.")
477 

Member Function Documentation

◆ createFFSmearingTool()

def python.JetAnalysisConfig.LargeRJetAnalysisConfig.createFFSmearingTool (   self,
  jetFFSmearingAlg,
  config 
)

Definition at line 483 of file JetAnalysisConfig.py.

483  def createFFSmearingTool(self, jetFFSmearingAlg, config):
484  # Retrieve appropriate large-R jet mass resolution recommendations for the FFJetSmearingTool.
485 
486  log = logging.getLogger('LargeRJetAnalysisConfig')
487 
488  # Config file:
489  if self.systematicsModelJMR in ["Simple", "Full"]:
490  config_file = f"R10_{self.systematicsModelJMR}JMR.config"
491  else:
492  raise ValueError(
493  f"Invalid request for systematicsModelJMR settings: {self.systematicsModelJMR}"
494  )
495 
496  # Expert override for config path:
497  if self.uncertToolConfigPathJMR is not None:
498  config_file = self.uncertToolConfigPathJMR
499  else:
500  if config.geometry() in [LHCPeriod.Run2, LHCPeriod.Run3]:
501  config_file = "rel22/Summer2025_PreRec/" + config_file
502  else:
503  log.warning("Uncertainties for UFO jets are not for Run 4!")
504 
505  # MC type:
506  if config.geometry() is LHCPeriod.Run2:
507  if config.dataType() is DataType.FastSim:
508  mc_type = "MC20AF3"
509  else:
510  mc_type = "MC20"
511  elif config.geometry() is LHCPeriod.Run3:
512  if config.dataType() is DataType.FastSim:
513  mc_type = "MC23AF3"
514  else:
515  mc_type = "MC23"
516 
517  # Set up the FF smearing tool
518  config.addPrivateTool( 'FFSmearingTool', 'CP::FFJetSmearingTool')
519  jetFFSmearingAlg.FFSmearingTool.MassDef = "UFO"
520  jetFFSmearingAlg.FFSmearingTool.MCType = mc_type
521  jetFFSmearingAlg.FFSmearingTool.ConfigFile = config_file
522 

◆ instanceName()

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

Definition at line 478 of file JetAnalysisConfig.py.

478  def instanceName (self) :
479  """Return the instance name for this block"""
480  return self.containerName
481 
482 

◆ makeAlgs()

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

Definition at line 523 of file JetAnalysisConfig.py.

523  def makeAlgs (self, config) :
524 
525  configFile = None
526  calibSeq = None
527  calibArea = None
528 
529  jetCollectionName=self.jetCollection
530  if(self.jetCollection=="AnalysisJets") :
531  jetCollectionName="AntiKt4EMPFlowJets"
532  if(self.jetCollection=="AnalysisLargeRJets") :
533  jetCollectionName="AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets"
534 
535  if self.largeRMass not in ["Comb", "Calo", "TA"]:
536  raise ValueError("Invalid large-R mass defintion {0}!".format(self.largeRMass) )
537 
538  if self.jetInput not in ["LCTopo", "TrackCaloCluster", "UFO"]:
539  raise ValueError("Invalid input type '{0}' for large-R jets!".format(self.jetInput) )
540 
541  if self.jetInput == "TrackCaloCluster":
542  # Only one mass defintion supported
543  if self.largeRMass != "Calo":
544  raise ValueError("Invalid large-R TCC jet mass '{0}'!".format(self.largeRMass) )
545  configFile = "JES_MC16recommendation_FatJet_TCC_JMS_calo_30Oct2018.config"
546  if self.jetInput == "LCTopo":
547  configFile = _largeLCTopoConfigFile(config, self)
548  if self.jetInput == "UFO":
549  configFile = "JES_MC20PreRecommendation_R10_UFO_CSSK_SoftDrop_JMS_R21Insitu_26Nov2024.config"
550  calibArea = "00-04-83"
551  if self.calibToolConfigFile is not None:
552  configFile = self.calibToolConfigFile
553 
554  if self.jetInput == "TrackCaloCluster" or self.jetInput == "UFO" or config.dataType() is DataType.FullSim:
555  calibSeq = "EtaJES_JMS"
556  elif config.dataType() is DataType.Data:
557  calibSeq = "EtaJES_JMS_Insitu"
558  if self.calibToolCalibSeq is not None:
559  calibSeq = self.calibToolCalibSeq
560 
561  if self.calibToolCalibArea is not None:
562  calibArea = self.calibToolCalibArea
563 
564  if not config.isPhyslite() or self.recalibratePhyslite:
565  # Prepare the jet calibration algorithm
566  alg = config.createAlgorithm( 'CP::JetCalibrationAlg', 'JetCalibrationAlg' )
567  config.addPrivateTool( 'calibrationTool', 'JetCalibrationTool' )
568 
569  alg.calibrationTool.JetCollection = jetCollectionName[:-4]
570 
571  if configFile is None:
572  raise ValueError(f'Unsupported: {self.jetInput=}, {config.dataType()=}')
573  alg.calibrationTool.ConfigFile = configFile
574 
575  if calibSeq is None:
576  raise ValueError(f'Unsupported: {self.jetInput=}, {config.dataType()=}')
577  alg.calibrationTool.CalibSequence = calibSeq
578 
579  if calibArea is not None:
580  alg.calibrationTool.CalibArea = calibArea
581 
582  alg.calibrationTool.IsData = (config.dataType() is DataType.Data)
583  alg.jets = config.readName(self.containerName)
584 
585  if self.jetInput == "UFO" and config.dataType() is not DataType.Data:
586  # set up the FF smearing algorithm
587  alg = config.createAlgorithm( 'CP::JetFFSmearingAlg', 'JetFFSmearingAlg' )
588  self.createFFSmearingTool(alg, config)
589  alg.outOfValidity = 2 # SILENT
590  alg.outOfValidityDeco = 'outOfValidityJMR'
591  alg.jets = config.readName (self.containerName)
592  alg.jetsOut = config.copyName (self.containerName)
593  alg.preselection = config.getPreselection (self.containerName, '')
594 
595  if self.minPt > 0 or self.maxPt > 0 or self.maxEta > 0 or self.maxRapidity > 0:
596  # Set up the the pt-eta selection
597  alg = config.createAlgorithm( 'CP::AsgSelectionAlg', 'JetPtEtaCutAlg' )
598  alg.selectionDecoration = 'selectPtEta,as_bits'
599  config.addPrivateTool( 'selectionTool', 'CP::AsgPtEtaSelectionTool' )
600  alg.selectionTool.minPt = self.minPt
601  alg.selectionTool.maxPt = self.maxPt
602  alg.selectionTool.maxEta = self.maxEta
603  alg.selectionTool.maxRapidity = self.maxRapidity
604  alg.particles = config.readName (self.containerName)
605  alg.preselection = config.getPreselection (self.containerName, '')
606  config.addSelection (self.containerName, '', alg.selectionDecoration,
607  preselection=True)
608 
609  if self.minMass > 0 or self.maxMass > 0:
610  # Set up the the mass selection
611  alg = config.createAlgorithm( 'CP::AsgSelectionAlg', 'JetMassCutAlg' )
612  alg.selectionDecoration = 'selectMass,as_bits'
613  config.addPrivateTool( 'selectionTool', 'CP::AsgMassSelectionTool' )
614  alg.selectionTool.minM = self.minMass
615  alg.selectionTool.maxM = self.maxMass
616  alg.particles = config.readName (self.containerName)
617  alg.preselection = config.getPreselection (self.containerName, '')
618  config.addSelection (self.containerName, '', alg.selectionDecoration,
619  preselection=True)
620 
621  config.addOutputVar (self.containerName, 'm', 'm')
622 
623 # These algorithms set up the jet recommendations as-of 04/02/2019.
624 # Jet calibration recommendations
625 # https://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/ApplyJetCalibrationR21
626 # Jet uncertainties recommendations
627 # Small-R
628 # https://twiki.cern.ch/twiki/bin/view/AtlasProtected/JetUncertaintiesRel21Summer2018SmallR
629 # Large-R
630 # https://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/JetUncertaintiesRel21Moriond2018LargeR
631 # JVT recommendations
632 # https://twiki.cern.ch/twiki/bin/view/AtlasProtected/JVTCalibrationRel21
633 
634 @groupBlocks

Member Data Documentation

◆ jetCollection

python.JetAnalysisConfig.LargeRJetAnalysisConfig.jetCollection

Definition at line 530 of file JetAnalysisConfig.py.

◆ jetInput

python.JetAnalysisConfig.LargeRJetAnalysisConfig.jetInput

Definition at line 541 of file JetAnalysisConfig.py.


The documentation for this class was generated from the following file:
python.JetAnalysisConfig._largeLCTopoConfigFile
def _largeLCTopoConfigFile(config, self)
Definition: JetAnalysisConfig.py:382
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