256def selectionAndHistos( selectType, histos, selectionName="", histoNameSuffix="",**otherArgs):
257
258 if isinstance(selectType, str):
259
260 tool = jhm.tool(selectType)
261 if issubclass( tool.__class__ , HistosForJetSelection):
262
263 selTool = tool
264 else:
265
266 attSel = tool
267 if tool is None:
268 attSel = attributeHistoManager.addSelector(selectType)
269
270 if histoNameSuffix=="" : histoNameSuffix = attSel.getName()
272 JetSelectorTool = attSel ,
273 HistoTitleSuffix = ' ('+selectType+')',
274 HistoNameSuffix = histoNameSuffix)
275 else:
276 selTool = selectType
277
278 if selTool is None :
279 print ("ERROR can't build histo tool for a jet selection. Uknown or wrong selection request :",selectType , selTool)
280 return None
281
282 if selectionName != "":
283 selTool = selTool.clone(selectionName)
284
285 interpretedTools = []
286 for h in histos:
287 if isinstance(h,str):
288 h = jhm.tool(h)
289 interpretedTools.append(h)
290
291 selTool.HistoTools = interpretedTools
292
293
294 for k,v in otherArgs.items():
295 setattr(selTool, k, v)
296 return selTool
297
298
Fills a list of histograms on a selected subset of a JetContainer.