diff --git a/PhysicsAnalysis/Algorithms/AnalysisAlgorithmsConfig/python/FullCPAlgorithmsTest.py b/PhysicsAnalysis/Algorithms/AnalysisAlgorithmsConfig/python/FullCPAlgorithmsTest.py index 754efbc93d8a5a9015506e0dcfd2f1f27cbe0093..24321891238a8950d7e72d886a0b1926324be8d4 100644 --- a/PhysicsAnalysis/Algorithms/AnalysisAlgorithmsConfig/python/FullCPAlgorithmsTest.py +++ b/PhysicsAnalysis/Algorithms/AnalysisAlgorithmsConfig/python/FullCPAlgorithmsTest.py @@ -450,6 +450,11 @@ def makeSequenceOld (dataType, algSeq, vars, forCompare, isPhyslite, noPhysliteB def makeSequenceBlocks (dataType, algSeq, vars, forCompare, isPhyslite, noPhysliteBroken) : + # it seems the right containers are in the test input files so far + largeRJets = False + # there are no track jets in PHYSLITE, or in the sequence configuration + trackJets = not isPhyslite and not forCompare + configSeq = ConfigSequence () @@ -574,6 +579,22 @@ def makeSequenceBlocks (dataType, algSeq, vars, forCompare, isPhyslite, noPhysli ] + if largeRJets : + makeJetAnalysisConfig( configSeq, 'AnaLargeRJets', 'AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets', postfix = 'largeR_jets' ) + vars += ['OutLargeRJets_%SYS%.pt -> larger_jet_pt_%SYS%', + 'OutLargeRJets_NOSYS.phi -> larger_jet_phi', + 'OutLargeRJets_NOSYS.eta -> larger_jet_eta', + 'OutLargeRJets_NOSYS.m -> larger_jet_m', ] + + + if trackJets : + makeJetAnalysisConfig( configSeq, 'AnaTrackJets', 'AntiKtVR30Rmax4Rmin02PV0TrackJets', postfix = 'track_jets' ) + vars += ['OutTrackJets_%SYS%.pt -> track_jet_pt_%SYS%', + 'OutTrackJets_NOSYS.phi -> track_jet_phi', + 'OutTrackJets_NOSYS.eta -> track_jet_eta', + 'OutTrackJets_NOSYS.m -> track_jet_m', ] + + if dataType != 'data' : # Include, and then set up the generator analysis sequence: from AsgAnalysisAlgorithms.AsgAnalysisConfig import \ @@ -609,6 +630,14 @@ def makeSequenceBlocks (dataType, algSeq, vars, forCompare, isPhyslite, noPhysli makePtEtaSelectionConfig (configSeq, 'AnaJets', selectionDecoration='selectPtEta', minPt=jetMinPt, maxEta=jetMaxEta) + if largeRJets : + makePtEtaSelectionConfig (configSeq, 'AnaLargeRJets', + selectionDecoration='selectPtEta', + minPt=jetMinPt, maxEta=jetMaxEta) + if trackJets : + makePtEtaSelectionConfig (configSeq, 'AnaTrackJets', + selectionDecoration='selectPtEta', + minPt=jetMinPt, maxEta=jetMaxEta) # Include, and then set up the met analysis algorithm config: @@ -667,6 +696,14 @@ def makeSequenceBlocks (dataType, algSeq, vars, forCompare, isPhyslite, noPhysli makeOutputThinningConfig (configSeq, 'AnaJets', selection='selectPtEta', outputName='OutJets') + if largeRJets : + makeOutputThinningConfig (configSeq, 'AnaLargeRJets', + selection='selectPtEta', + outputName='OutLargeRJets') + if trackJets : + makeOutputThinningConfig (configSeq, 'AnaTrackJets', + selection='selectPtEta', + outputName='OutTrackJets') diff --git a/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/python/JetAnalysisConfig.py b/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/python/JetAnalysisConfig.py index 0da23ee33d6a9cb8c61926d2f28776fb80eff5c7..4a7b7f8bb688367baaea9b27dca4884cc1fc4339 100644 --- a/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/python/JetAnalysisConfig.py +++ b/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/python/JetAnalysisConfig.py @@ -10,13 +10,12 @@ import ROOT class PreJetAnalysisConfig (ConfigBlock) : - """the ConfigBlock for the small-r jet sequence""" + """the ConfigBlock for the common preprocessing of jet sequences""" - def __init__ (self, containerName, jetCollection, jetInput, postfix = '') : + def __init__ (self, containerName, jetCollection, postfix = '') : super (PreJetAnalysisConfig, self).__init__ () self.containerName = containerName self.jetCollection = jetCollection - self.jetInput = jetInput self.postfix = postfix if self.postfix != '' and self.postfix[0] != '_' : self.postfix = '_' + self.postfix @@ -26,8 +25,10 @@ class PreJetAnalysisConfig (ConfigBlock) : def makeAlgs (self, config) : - if config.isPhyslite() : + if config.isPhyslite() and self.jetCollection == 'AntiKt4EMPFlowJets' : config.setSourceName (self.containerName, "AnalysisJets", originalName = self.jetCollection) + elif config.isPhyslite() and self.jetCollection == 'AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets' : + config.setSourceName (self.containerName, "AnalysisLargeRJets", originalName = self.jetCollection) else : config.setSourceName (self.containerName, self.jetCollection, originalName = self.jetCollection) @@ -50,7 +51,11 @@ class PreJetAnalysisConfig (ConfigBlock) : if config.wantCopy (self.containerName) : alg.jetsOut = config.copyName (self.containerName) - + # Set up shallow copy if needed and not yet done + if config.wantCopy (self.containerName) : + alg = config.createAlgorithm( 'CP::AsgShallowCopyAlg', 'JetShallowCopyAlg' + self.postfix ) + alg.input = config.readName (self.containerName) + alg.output = config.copyName (self.containerName) @@ -275,13 +280,14 @@ class LargeRJetAnalysisConfig (ConfigBlock) : """the ConfigBlock for the large-r jet sequence""" def __init__ (self, containerName, jetCollection, jetInput, postfix = '') : - super (RScanJetAnalysisConfig, self).__init__ () + super (LargeRJetAnalysisConfig, self).__init__ () self.containerName = containerName self.jetCollection = jetCollection self.postfix = postfix if self.postfix != '' and self.postfix[0] != '_' : self.postfix = '_' + self.postfix self.largeRMass = "Comb" + self.jetInput = jetInput def makeAlgs (self, config) : @@ -404,9 +410,17 @@ def makeJetAnalysisConfig( seq, containerName, jetCollection, postfix = '', #AntiKt10UFO CSSKSoftDropBeta100Zcut10Jets + if jetCollectionName == 'AntiKtVR30Rmax4Rmin02PV0TrackJets' : + # don't to anything on track jets + config = PreJetAnalysisConfig (containerName, jetCollection, postfix) + config.runOriginalObjectLink = False + config.runGhostMuonAssociation = False + seq.append (config) + return + # interpret the jet collection collection_pattern = re.compile( - r"AntiKt(\d+)(EMTopo|EMPFlow|LCTopo|TrackCaloCluster|UFO)(TrimmedPtFrac5SmallR20|CSSKSoftDropBeta100Zcut10)?Jets") + r"AntiKt(\d+)(EMTopo|EMPFlow|LCTopo|TrackCaloCluster|UFO|Track)(TrimmedPtFrac5SmallR20|CSSKSoftDropBeta100Zcut10)?Jets") match = collection_pattern.match(jetCollectionName) if not match: raise ValueError( @@ -417,7 +431,7 @@ def makeJetAnalysisConfig( seq, containerName, jetCollection, postfix = '', jetInput = match.group(2) - config = PreJetAnalysisConfig (containerName, jetCollection, jetInput, postfix) + config = PreJetAnalysisConfig (containerName, jetCollection, postfix) config.runOriginalObjectLink = (btIndex != -1) config.runGhostMuonAssociation = runGhostMuonAssociation seq.append (config)