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

Public Member Functions

 __init__ (self, Name, Type='float', Index=-1, Scale=1)
 toTool (self)
 vname (self)
 __str__ (self)
 clone (self, newname, **args)
 defineHisto (self, parentAlg, monhelper, path)
 __getattr__ (self, attr)
 __setattr__ (self, attr, value)
 __setitem__ (self, attr, value)
 dump (self, out=None)

Public Attributes

 Name = Name
 Type = Type
 Scale = Scale
int Index = Index
 name = name
 klass = klass

Protected Member Functions

 _dump (self, writeFunc)

Detailed Description

A dictionary specialized to contain a jet variable specification

Definition at line 203 of file JetMonitoringConfig.py.

Constructor & Destructor Documentation

◆ __init__()

JetMonitoringConfig.VarSpec.__init__ ( self,
Name,
Type = 'float',
Index = -1,
Scale = 1 )

Definition at line 205 of file JetMonitoringConfig.py.

205 def __init__(self, Name , Type='float', Index=-1, Scale=1):
206 # by default we allow only the properties of a JetHistoVarTool
207 if Name.endswith(':GeV'):
208 Scale=1./SystemOfUnits.GeV
209 Name = Name[:-4]
210
211
212 Name , Index = findSelectIndex(Name)
213 if Index != -1:
214 if Type[:3] != 'vec': Type='vec'+Type
215 self.Name = Name
216 self.Type = Type
217 self.Scale = Scale
218 self.Index = Index
219 ConfigDict.__init__(self)
220
221

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

◆ __str__()

JetMonitoringConfig.VarSpec.__str__ ( self)

Definition at line 233 of file JetMonitoringConfig.py.

233 def __str__(self):
234 if self.Index==-1: return 'VarSpec("{n}",{t})'.format(n=self.Name, t=self.Type)
235 else: return 'VarSpec("{n}[{i}]",{t})'.format(n=self.Name, t=self.Type, i=self.Index)
236

◆ _dump()

JetMonitoringConfig.VarSpec._dump ( self,
writeFunc )
protected

Reimplemented from JetMonitoringConfig.ConfigDict.

Definition at line 237 of file JetMonitoringConfig.py.

237 def _dump(self, writeFunc):
238 writeFunc( str(self))
239

◆ 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.ToolSpec.defineHisto ( self,
parentAlg,
monhelper,
path )
inherited

Reimplemented in JetMonitoringConfig.EventHistoSpec, JetMonitoringConfig.HistoSpec, and JetMonitoringConfig.SelectSpec.

Definition at line 195 of file JetMonitoringConfig.py.

195 def defineHisto(self, parentAlg, monhelper , path):
196 # Assume a helper function was given :
197 defineHistoFunc = self.defineHistoFunc
198 # call it :
199 defineHistoFunc(self, parentAlg, monhelper , path)
200
201
202

◆ 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

◆ toTool()

JetMonitoringConfig.VarSpec.toTool ( self)

Reimplemented from JetMonitoringConfig.ToolSpec.

Definition at line 222 of file JetMonitoringConfig.py.

222 def toTool(self):
223 from AthenaConfiguration.ComponentFactory import CompFactory
224 self.pop('topLevelDir', None)
225 self.pop('bottomLevelDir', None)
226 return CompFactory.JetHistoVarTool(self.Name, **self)
227

◆ vname()

JetMonitoringConfig.VarSpec.vname ( self)

Definition at line 228 of file JetMonitoringConfig.py.

228 def vname(self):
229 if self.Index ==-1: return self.Name
230 return self.Name+str(self.Index)
231
232

Member Data Documentation

◆ Index

JetMonitoringConfig.VarSpec.Index = Index

Definition at line 218 of file JetMonitoringConfig.py.

◆ klass

JetMonitoringConfig.ToolSpec.klass = klass
inherited

Definition at line 163 of file JetMonitoringConfig.py.

◆ Name

JetMonitoringConfig.VarSpec.Name = Name

Definition at line 215 of file JetMonitoringConfig.py.

◆ name

JetMonitoringConfig.ToolSpec.name = name
inherited

Definition at line 162 of file JetMonitoringConfig.py.

◆ Scale

JetMonitoringConfig.VarSpec.Scale = Scale

Definition at line 217 of file JetMonitoringConfig.py.

◆ Type

JetMonitoringConfig.VarSpec.Type = Type

Definition at line 216 of file JetMonitoringConfig.py.


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