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

 containerName
str jetCollection = "AnalysisJets") :
 recalibratePhyslite

Detailed Description

the ConfigBlock for the large-r jet sequence

Definition at line 460 of file JetAnalysisConfig.py.

Constructor & Destructor Documentation

◆ __init__()

python.JetAnalysisConfig.LargeRJetAnalysisConfig.__init__ ( self)

Definition at line 463 of file JetAnalysisConfig.py.

463 def __init__ (self) :
464 super (LargeRJetAnalysisConfig, self).__init__ ()
465 self.addOption ('containerName', '', type=str,
466 noneAction='error',
467 info="the name of the output container after calibration.")
468 self.addOption ('jetCollection', '', type=str,
469 noneAction='error',
470 info="the jet container to run on. It is interpreted to determine "
471 "the correct config blocks to call for small- or large-R jets.")
472 self.addOption ('jetInput', '', type=str,
473 noneAction='error',
474 info="the type of jet input. Supported options are: `UFO`.")
475 self.addOption ('recalibratePhyslite', True, type=bool,
476 info="whether to run the `CP::JetCalibrationAlg` on PHYSLITE "
477 "derivations.")
478 self.addOption ('systematicsModelJMR', "Full", type=str,
479 info="the NP reduction scheme to use for JMR. Supported options are: `Full`, `Simple`.")
480 # Adding these options to override the jet uncertainty config file when we have new recommendations
481 # Calibration tool options
482 self.addOption ('calibToolConfigFile', None, type=str,
483 info="name of the config file to use for the jet calibration "
484 "tool. Expert option to override JetETmiss recommendations.",
485 expertMode=True)
486 self.addOption ('calibToolCalibArea', None, type=str,
487 info="name of the CVMFS area to use for the jet calibration "
488 "tool. Expert option to override JetETmiss recommendations.",
489 expertMode=True)
490 self.addOption ('calibToolCalibSeq', None, type=str,
491 info="name of the sequence to use for the jet calibration "
492 "tool (e.g. `JetArea_Residual_EtaJES_GSC`). Expert option to override "
493 "JetETmiss recommendations.",
494 expertMode=True)
495 # Uncertainties tool options
496 self.addOption ('uncertToolConfigPath', None, type=str,
497 info="name of the config file to use for the JES, JER, and JMS uncertainty "
498 "tool. Expert option to override JetETmiss recommendations.",
499 expertMode=True)
500 self.addOption ('uncertToolConfigPathJMR', None, type=str,
501 info="name of the config file to use for the JMR uncertainty "
502 "tool. Expert option to override JetETmiss recommendations.",
503 expertMode=True)
504 self.addOption ('minPt', 200.*GeV, type=float,
505 info=r"the minimum $p_\mathrm{T}$ cut (in MeV) to apply to calibrated large-R jets.")
506 self.addOption ('maxPt', 3000.*GeV, type=float,
507 info=r"the maximum $p_\mathrm{T}$ cut (in MeV) to apply to calibrated large-R jets.")
508 self.addOption ('maxEta', 0., type=float,
509 info=r"the maximum $\vert\eta\vert$ cut to apply to calibrated large-R jets.")
510 self.addOption ('maxRapidity', 2., type=float,
511 info="the maximum rapidity cut to apply to calibrated large-R jets.")
512 self.addOption ('minMass', 40.*GeV, type=float,
513 info="the minimum mass cut (in MeV) to apply to calibrated large-R jets.")
514 self.addOption ('maxMass', 600.*GeV, type=float,
515 info="the maximum mass cut (in MeV) to apply to calibrated large-R jets.")
516

Member Function Documentation

◆ createFFSmearingTool()

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

Definition at line 522 of file JetAnalysisConfig.py.

522 def createFFSmearingTool(self, jetFFSmearingAlg, config):
523 # Retrieve appropriate large-R jet mass resolution recommendations for the FFJetSmearingTool.
524
525 # Config file:
526 if self.systematicsModelJMR in ["Simple", "Full"]:
527 config_file = f"R10_{self.systematicsModelJMR}JMR.config"
528 else:
529 raise ValueError(
530 f"Invalid request for systematicsModelJMR settings: {self.systematicsModelJMR}"
531 )
532
533 # Expert override for config path:
534 if self.uncertToolConfigPathJMR is not None:
535 config_file = self.uncertToolConfigPathJMR
536 else:
537 config_file = "rel22/Summer2025_PreRec/" + config_file
538 if config.geometry() is LHCPeriod.Run4:
539 warnings.warn_explicit(
540 "Uncertainties for UFO jets are not for Run 4!",
541 JetUncertaintyWarning, filename='', lineno=0)
542
543 # MC type:
544 if config.geometry() is LHCPeriod.Run2:
545 if config.dataType() is DataType.FastSim:
546 mc_type = "MC20AF3"
547 else:
548 mc_type = "MC20"
549 elif config.geometry() >= LHCPeriod.Run3:
550 if config.dataType() is DataType.FastSim:
551 mc_type = "MC23AF3"
552 else:
553 mc_type = "MC23"
554
555 # Set up the FF smearing tool
556 config.addPrivateTool( 'FFSmearingTool', 'CP::FFJetSmearingTool')
557 jetFFSmearingAlg.FFSmearingTool.MassDef = "UFO"
558 jetFFSmearingAlg.FFSmearingTool.MCType = mc_type
559 jetFFSmearingAlg.FFSmearingTool.ConfigFile = config_file
560

◆ instanceName()

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

Definition at line 517 of file JetAnalysisConfig.py.

517 def instanceName (self) :
518 """Return the instance name for this block"""
519 return self.containerName
520
521

◆ makeAlgs()

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

Definition at line 561 of file JetAnalysisConfig.py.

561 def makeAlgs (self, config) :
562
563 # Self-select: only run for large-R (radius 10) jets
564 if config.getContainerMeta(self.containerName, 'jetRadius', failOnMiss=True) != 10:
565 return
566
567 configFile = None
568 calibSeq = None
569 calibArea = None
570
571 jetCollectionName=self.jetCollection
572 if(self.jetCollection=="AnalysisJets") :
573 jetCollectionName="AntiKt4EMPFlowJets"
574 if(self.jetCollection=="AnalysisLargeRJets") :
575 jetCollectionName="AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets"
576
577 jetInput = config.getContainerMeta(self.containerName, 'jetInput', failOnMiss=True)
578 trim = config.getContainerMeta(self.containerName, 'jetTrim', failOnMiss=True)
579
580 if jetInput not in ["UFO"]:
581 raise ValueError("Invalid input type '{0}' for large-R jets!".format(jetInput) )
582
583 if not trim:
584 raise ValueError("Untrimmed large-R jets are not supported!")
585
586 configFile = "JES_MC20PreRecommendation_R10_UFO_CSSK_SoftDrop_JMS_R21Insitu_26Nov2024.config"
587 calibArea = "00-04-83"
588 if self.calibToolConfigFile is not None:
589 configFile = self.calibToolConfigFile
590
591 if config.dataType() is not DataType.Data:
592 calibSeq = "EtaJES_JMS"
593 elif config.dataType() is DataType.Data:
594 calibSeq = "EtaJES_JMS_Insitu"
595 if self.calibToolCalibSeq is not None:
596 calibSeq = self.calibToolCalibSeq
597
598 if self.calibToolCalibArea is not None:
599 calibArea = self.calibToolCalibArea
600
601 if not config.isPhyslite() or self.recalibratePhyslite:
602 # Create calibration tool before algorithm (EventLoop ordering)
603 calibToolName = 'JetCalibTool_' + jetCollectionName[:-4]
604 calibTool = config.createPublicTool( 'JetCalibrationTool', calibToolName )
605
606 calibTool.JetCollection = jetCollectionName[:-4]
607
608 if configFile is None:
609 raise ValueError(f'Unsupported: {self.jetInput=}, {config.dataType()=}')
610 calibTool.ConfigFile = configFile
611
612 if calibSeq is None:
613 raise ValueError(f'Unsupported: {self.jetInput=}, {config.dataType()=}')
614 calibTool.CalibSequence = calibSeq
615
616 if calibArea is not None:
617 calibTool.CalibArea = calibArea
618
619 calibTool.IsData = (config.dataType() is DataType.Data)
620 # Prepare the jet calibration algorithm
621 alg = config.createAlgorithm( 'CP::JetCalibrationAlg', 'JetCalibrationAlg' )
622 alg.calibrationTool = f'{calibTool.getType()}/{calibTool.getName()}'
623 alg.jets = config.readName(self.containerName)
624 alg.jetsOut = config.copyName(self.containerName)
625
626 if jetInput == "UFO" and config.dataType() is not DataType.Data:
627 # set up the FF smearing algorithm
628 alg = config.createAlgorithm( 'CP::JetFFSmearingAlg', 'JetFFSmearingAlg' )
629 self.createFFSmearingTool(alg, config)
630 alg.outOfValidity = 2 # SILENT
631 alg.outOfValidityDeco = 'outOfValidityJMR'
632 alg.jets = config.readName (self.containerName)
633 alg.jetsOut = config.copyName (self.containerName)
634 alg.preselection = config.getPreselection (self.containerName, '')
635
636 if self.minPt > 0 or self.maxPt > 0 or self.maxEta > 0 or self.maxRapidity > 0:
637 # Set up the the pt-eta selection
638 alg = config.createAlgorithm( 'CP::AsgSelectionAlg', 'JetPtEtaCutAlg' )
639 alg.selectionDecoration = 'selectPtEta,as_bits'
640 config.addPrivateTool( 'selectionTool', 'CP::AsgPtEtaSelectionTool' )
641 alg.selectionTool.minPt = self.minPt
642 alg.selectionTool.maxPt = self.maxPt
643 alg.selectionTool.maxEta = self.maxEta
644 alg.selectionTool.maxRapidity = self.maxRapidity
645 alg.particles = config.readName (self.containerName)
646 alg.preselection = config.getPreselection (self.containerName, '')
647 config.addSelection (self.containerName, '', alg.selectionDecoration,
648 preselection=True)
649
650 if self.minMass > 0 or self.maxMass > 0:
651 # Set up the the mass selection
652 alg = config.createAlgorithm( 'CP::AsgSelectionAlg', 'JetMassCutAlg' )
653 alg.selectionDecoration = 'selectMass,as_bits'
654 config.addPrivateTool( 'selectionTool', 'CP::AsgMassSelectionTool' )
655 alg.selectionTool.minM = self.minMass
656 alg.selectionTool.maxM = self.maxMass
657 alg.particles = config.readName (self.containerName)
658 alg.preselection = config.getPreselection (self.containerName, '')
659 config.addSelection (self.containerName, '', alg.selectionDecoration,
660 preselection=True)
661
662 config.addOutputVar (self.containerName, 'm', 'm')
663
if(pathvar)

Member Data Documentation

◆ containerName

python.JetAnalysisConfig.LargeRJetAnalysisConfig.containerName

Definition at line 564 of file JetAnalysisConfig.py.

◆ jetCollection

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

Definition at line 572 of file JetAnalysisConfig.py.

◆ recalibratePhyslite

python.JetAnalysisConfig.LargeRJetAnalysisConfig.recalibratePhyslite

Definition at line 601 of file JetAnalysisConfig.py.


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