639 def makeAlgs (self, config) :
641 log = logging.getLogger(
'LargeRJetAnalysisConfig')
645 jetCollectionName=self.jetCollection
646 if(self.jetCollection==
"AnalysisJets") :
647 jetCollectionName=
"AntiKt4EMPFlowJets"
648 if(self.jetCollection==
"AnalysisLargeRJets") :
649 jetCollectionName=
"AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets"
651 if self.largeRMass
not in [
"Comb",
"Calo",
"TA"]:
652 raise ValueError (
"Invalid large-R mass defintion {0}!".
format(self.largeRMass) )
654 if self.jetInput
not in [
"LCTopo",
"TrackCaloCluster",
"UFO"]:
656 "Unsupported input type '{0}' for large-R jets!".
format(self.jetInput) )
658 if self.jetInput ==
"TrackCaloCluster":
660 if self.largeRMass !=
"Calo":
662 "Unsupported large-R TCC jet mass '{0}'!".
format(self.largeRMass) )
663 configFile =
"JES_MC16recommendation_FatJet_TCC_JMS_calo_30Oct2018.config"
665 if self.jetInput ==
"LCTopo":
668 if self.jetInput ==
"UFO":
669 configFile =
"JES_MC20PreRecommendation_R10_UFO_CSSK_SoftDrop_JMS_R21Insitu_02Aug2024.config"
671 if not config.isPhyslite()
or self.recalibratePhyslite:
673 alg = config.createAlgorithm(
'CP::JetCalibrationAlg',
'JetCalibrationAlg'+self.containerName )
674 config.addPrivateTool(
'calibrationTool',
'JetCalibrationTool' )
675 alg.calibrationTool.JetCollection = jetCollectionName[:-4]
676 if self.configFileOverride
is not None:
677 configFile = self.configFileOverride
678 if configFile
is None:
680 f
'Unsupported: {self.jetInput=}, {config.dataType()=}')
681 alg.calibrationTool.ConfigFile = configFile
682 if self.jetInput ==
"TrackCaloCluster" or self.jetInput ==
"UFO" or config.dataType()
is DataType.FullSim:
683 alg.calibrationTool.CalibSequence =
"EtaJES_JMS"
684 elif config.dataType()
is DataType.Data:
685 alg.calibrationTool.CalibSequence =
"EtaJES_JMS_Insitu"
686 alg.calibrationTool.IsData = (config.dataType()
is DataType.Data)
687 alg.jets = config.readName (self.containerName)
690 if self.jetInput ==
"UFO" and config.dataType()
is (DataType.FullSim
or DataType.FastSim):
691 alg = config.createAlgorithm(
'CP::JetUncertaintiesAlg',
'JetUncertaintiesAlg'+self.containerName )
692 self.createUncertaintyTool(alg, config, jetCollectionName, doPseudoData=( self.systematicsModelJER
in [
"Full",
"All"] ))
694 alg.outOfValidity = 2
695 alg.outOfValidityDeco =
'outOfValidity'
696 alg.uncertaintiesTool.JetDefinition = jetCollectionName[:-4]
697 alg.uncertaintiesTool.ConfigFile = (
698 "rel22/Winter2024_PreRec/R10_CategoryJES_FullJER_FullJMS.config"
701 log.warning(
"Uncertainties for UFO jets are test only! This {0} is not for physics analysis! ".
format(alg.uncertaintiesTool.ConfigFile))
702 if config.dataType()
is DataType.FastSim:
703 log.warning(
"You are applying UFO FS uncertainty on AF3! This {0} is only for test purpose and not for physics analysis! ".
format(alg.uncertaintiesTool.ConfigFile))
705 alg.uncertaintiesTool.MCType =
"MC20"
706 alg.uncertaintiesTool.IsData = config.dataType()
is DataType.Data
708 alg.jets = config.readName (self.containerName)
709 alg.jetsOut = config.copyName (self.containerName)
710 alg.preselection = config.getPreselection (self.containerName,
'')
712 if self.jetInput !=
"UFO":
713 alg = config.createAlgorithm(
'CP::JetUncertaintiesAlg',
'JetUncertaintiesAlg'+self.containerName )
715 alg.outOfValidity = 2
716 alg.outOfValidityDeco =
'outOfValidity'
717 config.addPrivateTool(
'uncertaintiesTool',
'JetUncertaintiesTool' )
719 alg.uncertaintiesTool.JetDefinition = jetCollectionName[:-4]
720 alg.uncertaintiesTool.ConfigFile = \
721 "rel21/Moriond2018/R10_{0}Mass_all.config".
format(self.largeRMass)
722 alg.uncertaintiesTool.MCType =
"MC16a"
723 alg.uncertaintiesTool.IsData = (config.dataType()
is DataType.Data)
725 alg.jets = config.readName (self.containerName)
726 alg.jetsOut = config.copyName (self.containerName)
727 alg.preselection = config.getPreselection (self.containerName,
'')
728 config.addSelection (self.containerName,
'',
'outOfValidity')
730 config.addOutputVar (self.containerName,
'm',
'm')