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

Public Member Functions

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

Public Attributes

str jetCollection = "AnalysisJets") :
 largeRMass
str jetInput
 recalibratePhyslite
 containerName

Detailed Description

the ConfigBlock for the large-r jet sequence

Definition at line 401 of file JetAnalysisConfig.py.

Constructor & Destructor Documentation

◆ __init__()

python.JetAnalysisConfig.LargeRJetAnalysisConfig.__init__ ( self)

Definition at line 404 of file JetAnalysisConfig.py.

404 def __init__ (self) :
405 super (LargeRJetAnalysisConfig, self).__init__ ()
406 self.addOption ('containerName', '', type=str,
407 noneAction='error',
408 info="the name of the output container after calibration.")
409 self.addOption ('jetCollection', '', type=str,
410 noneAction='error',
411 info="the jet container to run on. It is interpreted to determine "
412 "the correct config blocks to call for small- or large-R jets.")
413 self.addOption ('jetInput', '', type=str,
414 noneAction='error',
415 info="the type of jet input. Supported options are: `LCTopo`, `TrackCaloCluster`, `UFO`.")
416 self.addOption ('largeRMass', "Comb", type=str,
417 info="the large-R mass definition to use. Supported options are: `Comb`, `Calo`, `TA`.")
418 self.addOption ('recalibratePhyslite', True, type=bool,
419 info="whether to run the `CP::JetCalibrationAlg` on PHYSLITE "
420 "derivations.")
421 self.addOption ('systematicsModelJMR', "Full", type=str,
422 info="the NP reduction scheme to use for JMR. Supported options are: `Full`, `Simple`.")
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 of the config file to use for the jet calibration "
427 "tool. Expert option to override JetETmiss recommendations.",
428 expertMode=True)
429 self.addOption ('calibToolCalibArea', None, type=str,
430 info="name of the CVMFS area to use for the jet calibration "
431 "tool. Expert option to override JetETmiss recommendations.",
432 expertMode=True)
433 self.addOption ('calibToolCalibSeq', None, type=str,
434 info="name of the sequence to use for the jet calibration "
435 "tool (e.g. `JetArea_Residual_EtaJES_GSC`). Expert option to override "
436 "JetETmiss recommendations.",
437 expertMode=True)
438 # Uncertainties tool options
439 self.addOption ('uncertToolConfigPath', None, type=str,
440 info="name of the config file to use for the JES, JER, and JMS uncertainty "
441 "tool. Expert option to override JetETmiss recommendations.",
442 expertMode=True)
443 self.addOption ('uncertToolConfigPathJMR', None, type=str,
444 info="name of the config file to use for the JMR uncertainty "
445 "tool. Expert option to override JetETmiss recommendations.",
446 expertMode=True)
447 self.addOption ('minPt', 200.*GeV, type=float,
448 info=r"the minimum $p_\mathrm{T}$ cut to apply to calibrated large-R jets.")
449 self.addOption ('maxPt', 3000.*GeV, type=float,
450 info=r"the maximum $p_\mathrm{T}$ cut to apply to calibrated large-R jets.")
451 self.addOption ('maxEta', 0., type=float,
452 info=r"the maximum $\vert\eta\vert$ cut to apply to calibrated large-R jets.")
453 self.addOption ('maxRapidity', 2., type=float,
454 info="the maximum rapidity cut to apply to calibrated large-R jets.")
455 self.addOption ('minMass', 40.*GeV, type=float,
456 info="the minimum mass cut to apply to calibrated large-R jets.")
457 self.addOption ('maxMass', 600.*GeV, type=float,
458 info="the maximum mass cut to apply to calibrated large-R jets.")
459

Member Function Documentation

◆ createFFSmearingTool()

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

Definition at line 465 of file JetAnalysisConfig.py.

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

◆ instanceName()

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

Definition at line 460 of file JetAnalysisConfig.py.

460 def instanceName (self) :
461 """Return the instance name for this block"""
462 return self.containerName
463
464

◆ makeAlgs()

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

Definition at line 504 of file JetAnalysisConfig.py.

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

Member Data Documentation

◆ containerName

python.JetAnalysisConfig.LargeRJetAnalysisConfig.containerName

Definition at line 588 of file JetAnalysisConfig.py.

◆ jetCollection

str python.JetAnalysisConfig.LargeRJetAnalysisConfig.jetCollection = "AnalysisJets") :

Definition at line 511 of file JetAnalysisConfig.py.

◆ jetInput

str python.JetAnalysisConfig.LargeRJetAnalysisConfig.jetInput

Definition at line 520 of file JetAnalysisConfig.py.

◆ largeRMass

python.JetAnalysisConfig.LargeRJetAnalysisConfig.largeRMass

Definition at line 517 of file JetAnalysisConfig.py.

◆ recalibratePhyslite

python.JetAnalysisConfig.LargeRJetAnalysisConfig.recalibratePhyslite

Definition at line 546 of file JetAnalysisConfig.py.


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