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 399 of file JetAnalysisConfig.py.

Constructor & Destructor Documentation

◆ __init__()

def python.JetAnalysisConfig.LargeRJetAnalysisConfig.__init__ (   self)

Definition at line 402 of file JetAnalysisConfig.py.

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

Member Function Documentation

◆ createFFSmearingTool()

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

Definition at line 475 of file JetAnalysisConfig.py.

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

◆ instanceName()

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

Definition at line 470 of file JetAnalysisConfig.py.

470  def instanceName (self) :
471  """Return the instance name for this block"""
472  return self.containerName
473 
474 

◆ makeAlgs()

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

Definition at line 515 of file JetAnalysisConfig.py.

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

Member Data Documentation

◆ jetCollection

python.JetAnalysisConfig.LargeRJetAnalysisConfig.jetCollection

Definition at line 522 of file JetAnalysisConfig.py.

◆ jetInput

python.JetAnalysisConfig.LargeRJetAnalysisConfig.jetInput

Definition at line 533 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:379
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