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

Constructor & Destructor Documentation

◆ __init__()

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()

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 config_file = "rel22/Summer2025_PreRec/" + config_file
493 if config.geometry() is LHCPeriod.Run4:
494 log.warning("Uncertainties for UFO jets are not for Run 4!")
495
496 # MC type:
497 if config.geometry() is LHCPeriod.Run2:
498 if config.dataType() is DataType.FastSim:
499 mc_type = "MC20AF3"
500 else:
501 mc_type = "MC20"
502 elif config.geometry() >= LHCPeriod.Run3:
503 if config.dataType() is DataType.FastSim:
504 mc_type = "MC23AF3"
505 else:
506 mc_type = "MC23"
507
508 # Set up the FF smearing tool
509 config.addPrivateTool( 'FFSmearingTool', 'CP::FFJetSmearingTool')
510 jetFFSmearingAlg.FFSmearingTool.MassDef = "UFO"
511 jetFFSmearingAlg.FFSmearingTool.MCType = mc_type
512 jetFFSmearingAlg.FFSmearingTool.ConfigFile = config_file
513

◆ instanceName()

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()

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

Definition at line 514 of file JetAnalysisConfig.py.

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

Member Data Documentation

◆ containerName

python.JetAnalysisConfig.LargeRJetAnalysisConfig.containerName

Definition at line 597 of file JetAnalysisConfig.py.

◆ jetCollection

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

Definition at line 521 of file JetAnalysisConfig.py.

◆ jetInput

str python.JetAnalysisConfig.LargeRJetAnalysisConfig.jetInput

Definition at line 530 of file JetAnalysisConfig.py.

◆ largeRMass

python.JetAnalysisConfig.LargeRJetAnalysisConfig.largeRMass

Definition at line 527 of file JetAnalysisConfig.py.

◆ recalibratePhyslite

python.JetAnalysisConfig.LargeRJetAnalysisConfig.recalibratePhyslite

Definition at line 555 of file JetAnalysisConfig.py.


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