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") :
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: `UFO`.")
416 self.addOption ('recalibratePhyslite', True, type=bool,
417 info="whether to run the `CP::JetCalibrationAlg` on PHYSLITE "
418 "derivations.")
419 self.addOption ('systematicsModelJMR', "Full", type=str,
420 info="the NP reduction scheme to use for JMR. Supported options are: `Full`, `Simple`.")
421 # Adding these options to override the jet uncertainty config file when we have new recommendations
422 # Calibration tool options
423 self.addOption ('calibToolConfigFile', None, type=str,
424 info="name of the config file to use for the jet calibration "
425 "tool. Expert option to override JetETmiss recommendations.",
426 expertMode=True)
427 self.addOption ('calibToolCalibArea', None, type=str,
428 info="name of the CVMFS area to use for the jet calibration "
429 "tool. Expert option to override JetETmiss recommendations.",
430 expertMode=True)
431 self.addOption ('calibToolCalibSeq', None, type=str,
432 info="name of the sequence to use for the jet calibration "
433 "tool (e.g. `JetArea_Residual_EtaJES_GSC`). Expert option to override "
434 "JetETmiss recommendations.",
435 expertMode=True)
436 # Uncertainties tool options
437 self.addOption ('uncertToolConfigPath', None, type=str,
438 info="name of the config file to use for the JES, JER, and JMS uncertainty "
439 "tool. Expert option to override JetETmiss recommendations.",
440 expertMode=True)
441 self.addOption ('uncertToolConfigPathJMR', None, type=str,
442 info="name of the config file to use for the JMR uncertainty "
443 "tool. Expert option to override JetETmiss recommendations.",
444 expertMode=True)
445 self.addOption ('minPt', 200.*GeV, type=float,
446 info=r"the minimum $p_\mathrm{T}$ cut (in MeV) to apply to calibrated large-R jets.")
447 self.addOption ('maxPt', 3000.*GeV, type=float,
448 info=r"the maximum $p_\mathrm{T}$ cut (in MeV) to apply to calibrated large-R jets.")
449 self.addOption ('maxEta', 0., type=float,
450 info=r"the maximum $\vert\eta\vert$ cut to apply to calibrated large-R jets.")
451 self.addOption ('maxRapidity', 2., type=float,
452 info="the maximum rapidity cut to apply to calibrated large-R jets.")
453 self.addOption ('minMass', 40.*GeV, type=float,
454 info="the minimum mass cut (in MeV) to apply to calibrated large-R jets.")
455 self.addOption ('maxMass', 600.*GeV, type=float,
456 info="the maximum mass cut (in MeV) to apply to calibrated large-R jets.")
457

Member Function Documentation

◆ createFFSmearingTool()

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

Definition at line 463 of file JetAnalysisConfig.py.

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

◆ instanceName()

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

Definition at line 458 of file JetAnalysisConfig.py.

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

◆ makeAlgs()

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

Definition at line 502 of file JetAnalysisConfig.py.

502 def makeAlgs (self, config) :
503
504 configFile = None
505 calibSeq = None
506 calibArea = None
507
508 jetCollectionName=self.jetCollection
509 if(self.jetCollection=="AnalysisJets") :
510 jetCollectionName="AntiKt4EMPFlowJets"
511 if(self.jetCollection=="AnalysisLargeRJets") :
512 jetCollectionName="AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets"
513
514 if self.jetInput not in ["UFO"]:
515 raise ValueError("Invalid input type '{0}' for large-R jets!".format(self.jetInput) )
516
517 configFile = "JES_MC20PreRecommendation_R10_UFO_CSSK_SoftDrop_JMS_R21Insitu_26Nov2024.config"
518 calibArea = "00-04-83"
519 if self.calibToolConfigFile is not None:
520 configFile = self.calibToolConfigFile
521
522 if config.dataType() is not DataType.Data:
523 calibSeq = "EtaJES_JMS"
524 elif config.dataType() is DataType.Data:
525 calibSeq = "EtaJES_JMS_Insitu"
526 if self.calibToolCalibSeq is not None:
527 calibSeq = self.calibToolCalibSeq
528
529 if self.calibToolCalibArea is not None:
530 calibArea = self.calibToolCalibArea
531
532 if not config.isPhyslite() or self.recalibratePhyslite:
533 # Create calibration tool before algorithm (EventLoop ordering)
534 calibToolName = 'JetCalibTool_' + jetCollectionName[:-4]
535 calibTool = config.createPublicTool( 'JetCalibrationTool', calibToolName )
536
537 calibTool.JetCollection = jetCollectionName[:-4]
538
539 if configFile is None:
540 raise ValueError(f'Unsupported: {self.jetInput=}, {config.dataType()=}')
541 calibTool.ConfigFile = configFile
542
543 if calibSeq is None:
544 raise ValueError(f'Unsupported: {self.jetInput=}, {config.dataType()=}')
545 calibTool.CalibSequence = calibSeq
546
547 if calibArea is not None:
548 calibTool.CalibArea = calibArea
549
550 calibTool.IsData = (config.dataType() is DataType.Data)
551 # Prepare the jet calibration algorithm
552 alg = config.createAlgorithm( 'CP::JetCalibrationAlg', 'JetCalibrationAlg' )
553 alg.calibrationTool = f'{calibTool.getType()}/{calibTool.getName()}'
554 alg.jets = config.readName(self.containerName)
555 alg.jetsOut = config.copyName(self.containerName)
556
557 if self.jetInput == "UFO" and config.dataType() is not DataType.Data:
558 # set up the FF smearing algorithm
559 alg = config.createAlgorithm( 'CP::JetFFSmearingAlg', 'JetFFSmearingAlg' )
560 self.createFFSmearingTool(alg, config)
561 alg.outOfValidity = 2 # SILENT
562 alg.outOfValidityDeco = 'outOfValidityJMR'
563 alg.jets = config.readName (self.containerName)
564 alg.jetsOut = config.copyName (self.containerName)
565 alg.preselection = config.getPreselection (self.containerName, '')
566
567 if self.minPt > 0 or self.maxPt > 0 or self.maxEta > 0 or self.maxRapidity > 0:
568 # Set up the the pt-eta selection
569 alg = config.createAlgorithm( 'CP::AsgSelectionAlg', 'JetPtEtaCutAlg' )
570 alg.selectionDecoration = 'selectPtEta,as_bits'
571 config.addPrivateTool( 'selectionTool', 'CP::AsgPtEtaSelectionTool' )
572 alg.selectionTool.minPt = self.minPt
573 alg.selectionTool.maxPt = self.maxPt
574 alg.selectionTool.maxEta = self.maxEta
575 alg.selectionTool.maxRapidity = self.maxRapidity
576 alg.particles = config.readName (self.containerName)
577 alg.preselection = config.getPreselection (self.containerName, '')
578 config.addSelection (self.containerName, '', alg.selectionDecoration,
579 preselection=True)
580
581 if self.minMass > 0 or self.maxMass > 0:
582 # Set up the the mass selection
583 alg = config.createAlgorithm( 'CP::AsgSelectionAlg', 'JetMassCutAlg' )
584 alg.selectionDecoration = 'selectMass,as_bits'
585 config.addPrivateTool( 'selectionTool', 'CP::AsgMassSelectionTool' )
586 alg.selectionTool.minM = self.minMass
587 alg.selectionTool.maxM = self.maxMass
588 alg.particles = config.readName (self.containerName)
589 alg.preselection = config.getPreselection (self.containerName, '')
590 config.addSelection (self.containerName, '', alg.selectionDecoration,
591 preselection=True)
592
593 config.addOutputVar (self.containerName, 'm', 'm')
594
595# These algorithms set up the jet recommendations as-of 04/02/2019.
596# Jet recommendations:
597# https://atlas-jetetmiss.docs.cern.ch/recs/latest-recs/
598
599@groupBlocks

Member Data Documentation

◆ containerName

python.JetAnalysisConfig.LargeRJetAnalysisConfig.containerName

Definition at line 578 of file JetAnalysisConfig.py.

◆ jetCollection

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

Definition at line 509 of file JetAnalysisConfig.py.

◆ jetInput

str python.JetAnalysisConfig.LargeRJetAnalysisConfig.jetInput

Definition at line 515 of file JetAnalysisConfig.py.

◆ recalibratePhyslite

python.JetAnalysisConfig.LargeRJetAnalysisConfig.recalibratePhyslite

Definition at line 532 of file JetAnalysisConfig.py.


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