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

Public Member Functions

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

Public Attributes

 Name
 
 Type
 
 Scale
 
 Index
 
 name
 
 klass
 

Private Member Functions

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

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

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

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

◆ __setitem__()

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

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

def JetMonitoringConfig.VarSpec._dump (   self,
  writeFunc 
)
private

Reimplemented from JetMonitoringConfig.ConfigDict.

Definition at line 237 of file JetMonitoringConfig.py.

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

◆ clone() [1/2]

def JetMonitoringConfig.ConfigDict.clone (   self,
**  kwargs 
)
inherited

Definition at line 68 of file JetMonitoringConfig.py.

68  def clone(self, **kwargs):
69  from copy import deepcopy
70  c = deepcopy(self)
71  for k,v in kwargs.items():
72  setattr(c,k,v)
73  return c
74 
75 

◆ clone() [2/2]

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

Definition at line 192 of file JetMonitoringConfig.py.

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

◆ defineHisto()

def JetMonitoringConfig.ToolSpec.defineHisto (   self,
  parentAlg,
  monhelper,
  path 
)
inherited

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

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

def 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 

◆ toTool()

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

def 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

Definition at line 218 of file JetMonitoringConfig.py.

◆ klass

JetMonitoringConfig.ToolSpec.klass
inherited

Definition at line 163 of file JetMonitoringConfig.py.

◆ name

JetMonitoringConfig.ToolSpec.name
inherited

Definition at line 162 of file JetMonitoringConfig.py.

◆ Name

JetMonitoringConfig.VarSpec.Name

Definition at line 215 of file JetMonitoringConfig.py.

◆ Scale

JetMonitoringConfig.VarSpec.Scale

Definition at line 217 of file JetMonitoringConfig.py.

◆ Type

JetMonitoringConfig.VarSpec.Type

Definition at line 216 of file JetMonitoringConfig.py.


The documentation for this class was generated from the following file:
vtune_athena.format
format
Definition: vtune_athena.py:14
python.TIDAMonTool.defineHisto
def defineHisto(montool, name, **args)
Definition: TIDAMonTool.py:334
python.Utilities.clone
clone
Definition: Utilities.py:134
run_Egamma1_LArStrip_Fex.dump
dump
Definition: run_Egamma1_LArStrip_Fex.py:88
python.ByteStreamConfig.write
def write
Definition: Event/ByteStreamCnvSvc/python/ByteStreamConfig.py:247
print
void print(char *figname, TCanvas *c1)
Definition: TRTCalib_StrawStatusPlots.cxx:25
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
python.Bindings.__setitem__
__setitem__
Definition: Control/AthenaPython/python/Bindings.py:771
str
Definition: BTagTrackIpAccessor.cxx:11
python.PyAthenaComps.__setattr__
__setattr__
Definition: PyAthenaComps.py:39
JetMonitoringConfig.findSelectIndex
def findSelectIndex(name)
Definition: JetMonitoringConfig.py:144