132 selectionName = perRegionConfig[
"selectionName"]
133 alg = config.createAlgorithm(
134 "EventReco::RunKLFitterAlg",
135 f
"RunKLFitterAlg_{selectionName}",
138 alg.electrons, alg.electronSelection = config.readNameAndSelection(
141 alg.muons, alg.muonSelection = config.readNameAndSelection(self.muons)
142 alg.jets, alg.jetSelection = config.readNameAndSelection(self.jets)
143 alg.met = config.readName(self.met)
150 alg.selectionDecorationName = selectionName +
"_%SYS%,as_char"
152 alg.LeptonType = perRegionConfig.get(
"leptonType", self.leptonType)
153 alg.JetSelectionMode = perRegionConfig.get(
154 "jetSelectionMode", self.jetSelectionMode
156 btagAlgo = perRegionConfig.get(
"btagger", self.btagger)
157 btagWP = perRegionConfig.get(
"btagWP", self.btagWP)
158 alg.BTaggingDecoration = f
"ftag_select_{btagAlgo}_{btagWP}"
160 alg.BTaggingMethod = perRegionConfig.get(
161 "btaggingMethod", self.btaggingMethod
163 if alg.BTaggingMethod ==
"kWorkingPoint":
164 config.addPrivateTool(
"btagEffTool",
"BTaggingEfficiencyTool")
165 alg.btagEffTool.TaggerName = self.btagger
166 alg.btagEffTool.OperatingPoint = self.btagWP
167 jetCollection = config.originalName(self.jets.
split(
".")[0])
168 alg.btagEffTool.JetAuthor = jetCollection
169 alg.btagEffTool.ScaleFactorFileName = (
170 getRecommendedBTagCalib(config.geometry(), self.btagWP)
171 if self.bTagCDIFile
is None
172 else self.bTagCDIFile
174 alg.btagEffTool.IgnoreOutOfValidityRange = (
175 self.btagIgnoreOutOfValidityRange
177 alg.btagEffTool.MinPt = (
183 finalizeAlg = config.createAlgorithm(
184 "EventReco::KLFitterFinalizeOutputAlg",
185 "KLFitterFinalizeOutputAlg",
187 finalizeAlg.resultContainerToCheck = self.
containerName +
"_%SYS%"
188 finalizeAlg.resultContainerToWrite = self.
containerName +
"_%SYS%"
192 config.addOutputVar(self.
containerName,
"eventProbability",
"eventProbability", auxType=
"float")
193 config.addOutputVar(self.
containerName,
"logLikelihood",
"logLikelihood", auxType=
"float")
195 config.addOutputVar(self.
containerName,
"selected",
"selected", auxType=
"char")
199 self.
containerName,
"model_bhad_jetIndex",
"bhad_jetIndex", auxType=
"unsigned_int"
202 self.
containerName,
"model_blep_jetIndex",
"blep_jetIndex", auxType=
"unsigned_int"
205 self.
containerName,
"model_lq1_jetIndex",
"lq1_jetIndex", auxType=
"unsigned_int"
209 self.
containerName,
"model_lq2_jetIndex",
"lq2_jetIndex", auxType=
"unsigned_int"
213 self.
containerName,
"model_Higgs_b1_jetIndex",
"Higgs_b1_jetIndex", auxType=
"unsigned_int"
216 self.
containerName,
"model_Higgs_b2_jetIndex",
"Higgs_b2_jetIndex", auxType=
"unsigned_int"
219 config.addOutputVar(self.
containerName,
"model_nu_pt",
"nu_pt", auxType=
"float")
220 config.addOutputVar(self.
containerName,
"model_nu_eta",
"nu_eta", auxType=
"float")
221 config.addOutputVar(self.
containerName,
"model_nu_phi",
"nu_phi", auxType=
"float")
222 config.addOutputVar(self.
containerName,
"model_nu_E",
"nu_E", auxType=
"float")
225 config.addOutputVar(self.
containerName,
"model_lep_index",
"lep_index", auxType=
"unsigned_int")
227 self.
containerName,
"model_lepZ1_index",
"lepZ1_index", auxType=
"unsigned_int"
230 self.
containerName,
"model_lepZ2_index",
"lepZ2_index", auxType=
"unsigned_int"
234 self.
containerName,
"model_b_from_top1_jetIndex",
"b_from_top1_jetIndex", auxType=
"unsigned_int"
237 self.
containerName,
"model_b_from_top2_jetIndex",
"b_from_top2_jetIndex", auxType=
"unsigned_int"
241 "model_lj1_from_top1_jetIndex",
242 "lj1_from_top1_jetIndex",
243 auxType=
"unsigned_int"
247 "model_lj2_from_top1_jetIndex",
248 "lj2_from_top1_jetIndex",
249 auxType=
"unsigned_int"
253 "model_lj1_from_top2_jetIndex",
254 "lj1_from_top2_jetIndex",
255 auxType=
"unsigned_int"
259 "model_lj2_from_top2_jetIndex",
260 "lj2_from_top2_jetIndex",
261 auxType=
"unsigned_int"