ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
JetAttributeHistoManager.AttributeHistoManager Class Reference
Inheritance diagram for JetAttributeHistoManager.AttributeHistoManager:
Collaboration diagram for JetAttributeHistoManager.AttributeHistoManager:

Public Member Functions

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

Public Attributes

 jhm
 

Detailed Description

Definition at line 8 of file JetAttributeHistoManager.py.

Constructor & Destructor Documentation

◆ __init__()

def 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()

def 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()

def 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()

def 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()

def 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()

def 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

Definition at line 11 of file JetAttributeHistoManager.py.


The documentation for this class was generated from the following file:
JetAttributeHistoManager.create1DHistoTool
def create1DHistoTool(name, binning, attributeInfo, **otherArgs)
Definition: JetAttributeHistoManager.py:86
JetAttributeHistoManager.create2DHistoTool
def create2DHistoTool(name, binning=None, attributeInfo1=None, attributeInfo2=None, **otherArgs)
Definition: JetAttributeHistoManager.py:101
AtlCoolConsole.tool
tool
Definition: AtlCoolConsole.py:453
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
JetAttributeHistoManager.createAttSelector
def createAttSelector(selectString, name="", typ="float")
Definition: JetAttributeHistoManager.py:121
str
Definition: BTagTrackIpAccessor.cxx:11
HistoDefinitionHelpers.mergeHistoDefinition
def mergeHistoDefinition(hdef1, hdef2)
Definition: HistoDefinitionHelpers.py:12