243def selectionAndHistos( selectType, histos, selectionName="", histoNameSuffix="",**otherArgs):
244
245 if isinstance(selectType, str):
246
247 tool = jhm.tool(selectType)
248 if issubclass( tool.__class__ , HistosForJetSelection):
249
250 selTool = tool
251 else:
252
253 attSel = tool
254 if tool is None:
255 attSel = attributeHistoManager.addSelector(selectType)
256
257 if histoNameSuffix=="" : histoNameSuffix = attSel.getName()
259 JetSelectorTool = attSel ,
260 HistoTitleSuffix = ' ('+selectType+')',
261 HistoNameSuffix = histoNameSuffix)
262 else:
263 selTool = selectType
264
265 if selTool is None :
266 print ("ERROR can't build histo tool for a jet selection. Uknown or wrong selection request :",selectType , selTool)
267 return None
268
269 if selectionName != "":
270 selTool = selTool.clone(selectionName)
271
272 interpretedTools = []
273 for h in histos:
274 if isinstance(h,str):
275 h = jhm.tool(h)
276 interpretedTools.append(h)
277
278 selTool.HistoTools = interpretedTools
279
280
281 for k,v in otherArgs.items():
282 setattr(selTool, k, v)
283 return selTool
284
285
286
287
Fills a list of histograms on a selected subset of a JetContainer.