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

Constructor & Destructor Documentation

◆ __init__()

python.JetAnalysisConfig.LargeRJetAnalysisConfig.__init__ ( self)

Definition at line 401 of file JetAnalysisConfig.py.

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

Member Function Documentation

◆ createFFSmearingTool()

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

Definition at line 462 of file JetAnalysisConfig.py.

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

◆ instanceName()

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

Definition at line 457 of file JetAnalysisConfig.py.

457 def instanceName (self) :
458 """Return the instance name for this block"""
459 return self.containerName
460
461

◆ makeAlgs()

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

Definition at line 501 of file JetAnalysisConfig.py.

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

Member Data Documentation

◆ containerName

python.JetAnalysisConfig.LargeRJetAnalysisConfig.containerName

Definition at line 585 of file JetAnalysisConfig.py.

◆ jetCollection

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

Definition at line 508 of file JetAnalysisConfig.py.

◆ jetInput

str python.JetAnalysisConfig.LargeRJetAnalysisConfig.jetInput

Definition at line 517 of file JetAnalysisConfig.py.

◆ largeRMass

python.JetAnalysisConfig.LargeRJetAnalysisConfig.largeRMass

Definition at line 514 of file JetAnalysisConfig.py.

◆ recalibratePhyslite

python.JetAnalysisConfig.LargeRJetAnalysisConfig.recalibratePhyslite

Definition at line 543 of file JetAnalysisConfig.py.


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