102 def makeAlgs (self, config) :
103
104
105 if config.isPhyslite() and self.jetCollection == 'AntiKt4EMPFlowJets' :
106 config.setSourceName (self.containerName, "AnalysisJets", originalName = self.jetCollection)
107 elif config.isPhyslite() and self.jetCollection == 'AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets' :
108 config.setSourceName (self.containerName, "AnalysisLargeRJets", originalName = self.jetCollection)
109 else :
110 config.setSourceName (self.containerName, self.jetCollection, originalName = self.jetCollection)
111
112
113 radius, jetInput, trim, hasBTag = _parseJetCollection(self.jetCollection)
114 config.setContainerMeta(self.containerName, 'jetRadius', radius)
115 config.setContainerMeta(self.containerName, 'jetInput', jetInput)
116 config.setContainerMeta(self.containerName, 'jetTrim', trim)
117 config.setContainerMeta(self.containerName, 'hasBTag', hasBTag)
118 config.setContainerMeta(self.containerName, 'jetCollectionName',
119 _resolveJetCollectionName(self.jetCollection))
120
121
122 if self.runOriginalObjectLink or hasBTag :
123 alg = config.createAlgorithm( 'CP::AsgOriginalObjectLinkAlg',
124 'JetOriginalObjectLinkAlg',
125 reentrant=True )
126 alg.baseContainerName = self.jetCollection
127 alg.particles = config.readName (self.containerName)
128 if config.wantCopy (self.containerName) :
129 alg.particlesOut = config.copyName (self.containerName)
130 alg.preselection = config.getPreselection (self.containerName, '')
131
132
133 if (self.runGhostMuonAssociation is None and not config.isPhyslite()) or \
134 (self.runGhostMuonAssociation is True):
135 alg = config.createAlgorithm( 'CP::JetGhostMuonAssociationAlg',
136 'JetGhostMuonAssociationAlg' )
137 alg.jets = config.readName (self.containerName)
138 if config.isPhyslite():
139 alg.muons = "AnalysisMuons"
140 if config.wantCopy (self.containerName) :
141 alg.jetsOut = config.copyName (self.containerName)
142 taggerName = "GN2HLv01" if config.geometry() >= LHCPeriod.Run4 else "GN2v01"
143 extraInputs = [
144 ( 'xAOD::JetContainer' , f"StoreGateSvc+{self.jetCollection}.DFCommonJets_jetClean_LooseBad"),
145 ( 'xAOD::JetContainer' , f"StoreGateSvc+{self.jetCollection}.DFCommonJets_jetClean_TightBad"),
146 ( 'xAOD::JetContainer' , f"StoreGateSvc+{self.jetCollection}.{taggerName}_pb"),
147 ( 'xAOD::JetContainer' , f"StoreGateSvc+{self.jetCollection}.{taggerName}_pc"),
148 ( 'xAOD::JetContainer' , f"StoreGateSvc+{self.jetCollection}.{taggerName}_ptau"),
149 ( 'xAOD::JetContainer' , f"StoreGateSvc+{self.jetCollection}.{taggerName}_pu")]
150 config.setExtraInputs (extraInputs)
151
152 if self.runTruthJetTagging and config.dataType() is not DataType.Data:
153
154 alg = config.createAlgorithm( 'CP::JetDecoratorAlg', 'JetPileupLabelAlg' )
155 config.addPrivateTool( 'decorator', 'JetPileupLabelingTool' )
156 alg.jets = config.readName (self.containerName)
157 alg.jetsOut = config.copyName (self.containerName)
158 alg.decorator.RecoJetContainer = alg.jetsOut.replace ('%SYS%', 'NOSYS')
159 alg.decorator.SuppressOutputDependence=True
160 if self.jetCollection == 'AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets' :
161 extraInputs = [
162 ( 'xAOD::JetContainer' , f"StoreGateSvc+{self.jetCollection}.GN2Xv01_phbb"),
163 ( 'xAOD::JetContainer' , f"StoreGateSvc+{self.jetCollection}.GN2Xv01_phcc"),
164 ( 'xAOD::JetContainer' , f"StoreGateSvc+{self.jetCollection}.GN2Xv01_pqcd"),
165 ( 'xAOD::JetContainer' , f"StoreGateSvc+{self.jetCollection}.GN2Xv01_ptop")]
166 config.setExtraInputs (extraInputs)
167
168
169 if config.wantCopy (self.containerName) :
170 alg = config.createAlgorithm( 'CP::AsgShallowCopyAlg', 'JetShallowCopyAlg' )
171 alg.input = config.readName (self.containerName)
172 alg.output = config.copyName (self.containerName)
173 alg.outputType = 'xAOD::JetContainer'
174 if self.jetCollection == 'AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets' :
175 alg.declareDecorations = ['GN2Xv01_phbb', 'GN2Xv01_phcc',
176 'GN2Xv01_pqcd', 'GN2Xv01_ptop']
177
178 config.addOutputVar (self.containerName, 'pt', 'pt')
179 config.addOutputVar (self.containerName, 'eta', 'eta', noSys=True)
180 config.addOutputVar (self.containerName, 'phi', 'phi', noSys=True)
181 config.addOutputVar (self.containerName, 'charge', 'charge', noSys=True, enabled=False)
182
183
184 if self.outputTruthLabelIDs and config.dataType() is not DataType.Data:
185 config.addOutputVar (self.containerName, 'HadronConeExclTruthLabelID', 'HadronConeExclTruthLabelID', noSys=True, auxType="int")
186 config.addOutputVar (self.containerName, 'PartonTruthLabelID', 'PartonTruthLabelID', noSys=True, auxType="int")
187
188
189