ATLAS Offline Software
Loading...
Searching...
No Matches
JetMonitoringConfig.EventHistoSpec Class Reference
Inheritance diagram for JetMonitoringConfig.EventHistoSpec:
Collaboration diagram for JetMonitoringConfig.EventHistoSpec:

Public Member Functions

 __init__ (self, name, bins, **args)
 histName (self)
 toTool (self)
 defineHisto (self, parentAlg, monhelper, path)
 clone (self, newname, **args)
 __getattr__ (self, attr)
 __setattr__ (self, attr, value)
 __setitem__ (self, attr, value)
 dump (self, out=None)

Public Attributes

 bins = bins
 hargs = ConfigDict( **args)
 name = name
 klass = klass

Protected Member Functions

 _dump (self, writeFunc)

Detailed Description

A similar dictionary to HistoSpec above, but specialized to contain a
JetHistoEventLevelFiller specification.
Invocation is like : spec = EventHistoSpec( name, bins=(n,xlow,xhigh) )

Definition at line 383 of file JetMonitoringConfig.py.

Constructor & Destructor Documentation

◆ __init__()

JetMonitoringConfig.EventHistoSpec.__init__ ( self,
name,
bins,
** args )

Definition at line 388 of file JetMonitoringConfig.py.

388 def __init__(self, name, bins, **args):
389 ToolSpec.__init__(self, klass=None, name=name, **args) # we don't really need to pass a klass because we're specialized for JetHistoEventLevelFiller, see toTool()
390 self.bins = bins
391 self.hargs = ConfigDict( **args)
392

Member Function Documentation

◆ __getattr__()

JetMonitoringConfig.ConfigDict.__getattr__ ( self,
attr )
inherited

Definition at line 47 of file JetMonitoringConfig.py.

47 def __getattr__(self, attr):
48 try:
49 return self[attr]
50 except KeyError:
51 dict.__getattribute__(self,attr)
52 #raise AttributeError(attr)
53

◆ __setattr__()

JetMonitoringConfig.ConfigDict.__setattr__ ( self,
attr,
value )
inherited

Definition at line 54 of file JetMonitoringConfig.py.

54 def __setattr__(self, attr, value):
55 if attr in ['keys', 'clear', 'update', 'pop', 'iteritems', 'values','setdefault','get','has_key','copy']:
56 print('ConfigDict ERROR can not assign attribute ', attr)
57 return
58 dict.__setitem__(self, attr, value)
59 dict.__setattr__(self, attr, value)
void print(char *figname, TCanvas *c1)

◆ __setitem__()

JetMonitoringConfig.ConfigDict.__setitem__ ( self,
attr,
value )
inherited

Definition at line 60 of file JetMonitoringConfig.py.

60 def __setitem__(self, attr, value):
61 if attr in ['keys', 'clear', 'update', 'pop', 'iteritems', 'values','setdefault','get','has_key','copy']:
62 print('ConfigDict ERROR can not assign attribute ', attr)
63 return
64 dict.__setitem__(self, attr, value)
65 dict.__setattr__(self, attr, value)
66
67

◆ _dump()

JetMonitoringConfig.ConfigDict._dump ( self,
writeFunc )
protectedinherited

Reimplemented in JetMonitoringConfig.HistoSpec, JetMonitoringConfig.JetMonAlgSpec, JetMonitoringConfig.SelectSpec, and JetMonitoringConfig.VarSpec.

Definition at line 85 of file JetMonitoringConfig.py.

85 def _dump(self, writeFunc):
86 def write(s, e='\n'): writeFunc(' '+s,e)
87 writeFunc(self.__class__.__name__+'(')
88 for k,v in sorted(self.items()):
89 if isinstance(v, ConfigDict):
90 write(k+' = ','')
91 v._dump(write)
92 else:
93 write(k+' = '+str(v))
94 writeFunc(')')
95
96
97
98
99# **********************************************************
100# **********************************************************
101# Helper functions
102# **********************************************************
103
104

◆ clone()

JetMonitoringConfig.ToolSpec.clone ( self,
newname,
** args )
inherited

Reimplemented from JetMonitoringConfig.ConfigDict.

Reimplemented in JetMonitoringConfig.HistoSpec.

Definition at line 192 of file JetMonitoringConfig.py.

192 def clone(self, newname,**args):
193 return ConfigDict.clone(self, name=newname, **args)
194

◆ defineHisto()

JetMonitoringConfig.EventHistoSpec.defineHisto ( self,
parentAlg,
monhelper,
path )

Reimplemented from JetMonitoringConfig.ToolSpec.

Definition at line 416 of file JetMonitoringConfig.py.

416 def defineHisto(self, parentAlg, monhelper , path):
417 hargs = dict(xbins = self.bins[0],xmin = self.bins[1], xmax=self.bins[2],
418 type='TH1F', )
419 hargs.update( **self.hargs)
420 # we create one group for each histoFiller : self.name() are unique within a JetMonitoringAlg
421 bottomLevelDir = self.bottomLevelDir if self.bottomLevelDir != '' else parentAlg.JetContainerName.Path
422 group = monhelper.addGroup(parentAlg, self.name, self.topLevelDir+bottomLevelDir)
423 group.defineHistogram(self.histName()+";"+self.name, path=path, **hargs) #give a recognisable histogram name in case of SelectSpec usage
424
425

◆ dump()

JetMonitoringConfig.ConfigDict.dump ( self,
out = None )
inherited
prints the content of this dict on stdout (default) or in the file 'out' 

Definition at line 76 of file JetMonitoringConfig.py.

76 def dump(self, out=None):
77 """ prints the content of this dict on stdout (default) or in the file 'out' """
78 if out is None :
79 from sys import stdout
80 out = stdout
81 _write = out.write
82 def write(s, e='\n'): _write(s+e)
83 self._dump(write)
84
-event-from-file

◆ histName()

JetMonitoringConfig.EventHistoSpec.histName ( self)

Definition at line 393 of file JetMonitoringConfig.py.

393 def histName(self):
394 from JetMonitoring.JetStandardHistoSpecs import knownEventVar
395 histname = self.name
396 while knownEventVar.get(histname,None) is None: #try to remove suffixes in the form of "_SelectionName" when using with external SelectSpecs
397 if "_" in histname:
398 histnamesplit = histname.split("_")
399 histname = histname.replace("_"+histnamesplit[-1],"")
400 else:
401 raise JetMonSpecException(" Unknown EventHisto specification : '{}' ".format(histname))
402 return histname
403

◆ toTool()

JetMonitoringConfig.EventHistoSpec.toTool ( self)

Reimplemented from JetMonitoringConfig.ToolSpec.

Definition at line 404 of file JetMonitoringConfig.py.

404 def toTool(self):
405 from AthenaConfiguration.ComponentFactory import CompFactory
406 from JetMonitoring.JetStandardHistoSpecs import knownEventVar
407 # force the property "VarName" to simply be the name of the variable specification:
408 v = knownEventVar[self.histName()]
409 v.VarName = v.name
410 tool = CompFactory.JetHistoEventLevelFiller( self.name+"hfiller",
411 Var = v.toTool(),
412 Group = self.name,
413 )
414 return tool
415

Member Data Documentation

◆ bins

JetMonitoringConfig.EventHistoSpec.bins = bins

Definition at line 390 of file JetMonitoringConfig.py.

◆ hargs

JetMonitoringConfig.EventHistoSpec.hargs = ConfigDict( **args)

Definition at line 391 of file JetMonitoringConfig.py.

◆ klass

JetMonitoringConfig.ToolSpec.klass = klass
inherited

Definition at line 163 of file JetMonitoringConfig.py.

◆ name

JetMonitoringConfig.ToolSpec.name = name
inherited

Definition at line 162 of file JetMonitoringConfig.py.


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