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