ATLAS Offline Software
Loading...
Searching...
No Matches
JetAttributeHistoManager.AttributeHistoManager Class Reference
Inheritance diagram for JetAttributeHistoManager.AttributeHistoManager:
Collaboration diagram for JetAttributeHistoManager.AttributeHistoManager:

Public Types

typedef HLT::TypeInformation::for_each_type_c< typenameEDMLIST::map, my_functor, my_result<>, my_arg< HLT::TypeInformation::get_cont, CONTAINER > >::type result

Public Member Functions

 __init__ (self, jhm)
 buildKnownTools (self, compactSpecification)
 add1DHistoTool (self, name, binning, attributeInfo, **otherArgs)
 add2DHistoTool (self, name, binning=None, attributeInfo1=None, attributeInfo2=None, **otherArgs)
 create2DHistoToolFrom1D (self, name, **otherArgs)
 addSelector (self, selectString, name="", typ="float")

Public Attributes

 jhm = jhm

Detailed Description

Definition at line 8 of file JetAttributeHistoManager.py.

Member Typedef Documentation

◆ result

Definition at line 90 of file EDM_MasterSearch.h.

Constructor & Destructor Documentation

◆ __init__()

JetAttributeHistoManager.AttributeHistoManager.__init__ ( self,
jhm )

Definition at line 10 of file JetAttributeHistoManager.py.

10 def __init__(self, jhm ):
11 self.jhm = jhm
12

Member Function Documentation

◆ add1DHistoTool()

JetAttributeHistoManager.AttributeHistoManager.add1DHistoTool ( self,
name,
binning,
attributeInfo,
** otherArgs )

Definition at line 23 of file JetAttributeHistoManager.py.

23 def add1DHistoTool(self, name, binning, attributeInfo,**otherArgs):
24
25 if self.jhm.hasTool(name):
26 print ("ERROR JetAttributeHisto with name ", name ," already exists. Can't add a new one")
27 return None
28
29 tool = create1DHistoTool(name, binning, attributeInfo, **otherArgs)
30 return self.jhm.addTool( tool)
31
32
33

◆ add2DHistoTool()

JetAttributeHistoManager.AttributeHistoManager.add2DHistoTool ( self,
name,
binning = None,
attributeInfo1 = None,
attributeInfo2 = None,
** otherArgs )

Definition at line 34 of file JetAttributeHistoManager.py.

34 def add2DHistoTool(self, name, binning=None, attributeInfo1=None, attributeInfo2=None,**otherArgs):
35 if self.jhm.hasTool(name):
36 print ("ERROR JetAttributeHisto with name ", name ," already exists. Can't add a new one")
37 return None
38
39 tool = create2DHistoTool(name, binning, attributeInfo1, attributeInfo2, **otherArgs)
40 return self.jhm.addTool( tool )
41
42

◆ addSelector()

JetAttributeHistoManager.AttributeHistoManager.addSelector ( self,
selectString,
name = "",
typ = "float" )

Definition at line 69 of file JetAttributeHistoManager.py.

69 def addSelector(self, selectString, name="", typ="float"):
70 if name != "" and self.jhm.hasTool(name) :
71 print ("ERROR JetSelectorAttributeRunII with name ", name ," already exists. Can't add a new one")
72 return None
73 if self.jhm.hasTool(selectString) :
74 print ("ERROR JetSelectorAttributeRunII ", selectString ," already exists. Can't add a new one")
75 return None
76 tool = createAttSelector( selectString, name=name, typ=typ)
77 # selectors are public tools :
78 from AthenaCommon.AppMgr import ToolSvc
79
80 ToolSvc += tool
81 return self.jhm.addTool( tool , alias=selectString)
82
83
84
85

◆ buildKnownTools()

JetAttributeHistoManager.AttributeHistoManager.buildKnownTools ( self,
compactSpecification )

Definition at line 13 of file JetAttributeHistoManager.py.

13 def buildKnownTools(self, compactSpecification):
14 for name, spec in compactSpecification.items():
15 if len(spec) == 2 :
16 binning, attributeInfo = spec
17 self.add1DHistoTool(name, binning, attributeInfo)
18 elif len(spec) == 3 :
19 binning, attributeInfo1, attributeInfo2 = spec
20 doTProfile = name.beginswith("Prof_")
21 self.add2DHistoTool(name, binning, attributeInfo1, attributeInfo2, DoTProfile=doTProfile)
22

◆ create2DHistoToolFrom1D()

JetAttributeHistoManager.AttributeHistoManager.create2DHistoToolFrom1D ( self,
name,
** otherArgs )

Definition at line 43 of file JetAttributeHistoManager.py.

43 def create2DHistoToolFrom1D(self, name, **otherArgs):
44 tool = self.jhm.tool(name, build2Difmissing=False)
45 if tool is not None : return tool
46
47 # else try to build it
48 # We are trying to build a 2D histo tool from existing 1D histo tools.
49 n1, n2 = name.split(':')
50 t1 = self.jhm.tool(n1)
51 t2 = self.jhm.tool(n2)
52
53 if None in (t1, t2):
54 missing = n1 if t1 is None else n2
55 print ("ERROR : can't build 2D histo", name, " : ",missing, " is unknonw")
56 return None
57
58 binning = mergeHistoDefinition( t1.HistoDef, t2.HistoDef)
59 def rebuildSuffix(index):
60 if index==-1: return ''
61 return '['+str(index)+']'
62 attInfo1 = (t1.AttributeNames[0]+rebuildSuffix(t1.SelectIndex), t1.AttributeTypes[0])
63 attInfo2 = (t2.AttributeNames[0]+rebuildSuffix(t2.SelectIndex), t2.AttributeTypes[0])
64
65 tool = create2DHistoTool(name, binning, attInfo1, attInfo2, **otherArgs)
66
67 return self.jhm.addTool( tool)
68

Member Data Documentation

◆ jhm

JetAttributeHistoManager.AttributeHistoManager.jhm = jhm

Definition at line 11 of file JetAttributeHistoManager.py.


The documentation for this class was generated from the following file: