ATLAS Offline Software
Loading...
Searching...
No Matches
JetHistoManager.py
Go to the documentation of this file.
1# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
2
4
5 knownTools = {}
6 def addTool(self, tool, alias=""):
7 tname = tool.getName()
8 name = tname if alias == "" else alias
9 if name in self.knownTools:
10 print ("ERROR won't add tool ", name," : already existing")
11 return
12
13 self.knownTools[name] = tool
14 aname = name.replace(':','_').replace('[','_').replace(']','')
15
16 setattr(self, aname , tool)
17 return tool
18
19 def hasTool(self,name):
20 return name in self.knownTools
21
22 def tool(self, name, build2Difmissing=True):
23 t = self.knownTools.get(name, None)
24 if t is None and ":" in name and build2Difmissing:
25 from JetMonitoring.JetAttributeHistoManager import attributeHistoManager as ahm
26 t = ahm.create2DHistoToolFrom1D(name)
27 return t
28
29 def printTools(self):
30 for n, t in self.knownTools.items():
31 print ('%20s %40s'%(n, type(t)))
32
33jetHistoManager = JetHistoManager()
tool(self, name, build2Difmissing=True)
addTool(self, tool, alias="")
std::string replace(std::string s, const std::string &s2, const std::string &s3)
Definition hcg.cxx:310
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition hcg.cxx:130