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