CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Static Public Attributes
config.Analyzer Class Reference
Inheritance diagram for config.Analyzer:
config.CFG

Public Member Functions

def __init__ (self, class_object, instance_label=None, verbose=False, kwargs)
 
def __setattr__ (self, name, value)
 
def build_name (self)
 
def clone (self, kwargs)
 
- Public Member Functions inherited from config.CFG
def __init__ (self, kwargs)
 
def __str__ (self)
 
def clone (self, kwargs)
 

Public Attributes

 class_object
 
 instance_label
 
 name
 
 verbose
 

Static Public Attributes

 num_instance
 

Detailed Description

Base analyzer configuration, see constructor

Definition at line 77 of file config.py.

Constructor & Destructor Documentation

def config.Analyzer.__init__ (   self,
  class_object,
  instance_label = None,
  verbose = False,
  kwargs 
)
One could for example define the analyzer configuration for a
di-muon framework.Analyzer.Analyzer in the following way:

ZMuMuAna = cfg.Analyzer(
"ZMuMuAnalyzer",
pt1 = 20,
pt2 = 20,
iso1 = 0.1,
iso2 = 0.1,
eta1 = 2,
eta2 = 2,
m_min = 0,
m_max = 200
)

Any kinds of keyword arguments can be added.
The name must be present, and must be well chosen, as it will be used
by the Looper to find the module containing the Analyzer class.
This module should be in your PYTHONPATH. If not, modify your python path
accordingly in your script.

Definition at line 83 of file config.py.

83  verbose=False, **kwargs):
84  '''
85  One could for example define the analyzer configuration for a
86  di-muon framework.Analyzer.Analyzer in the following way:
87 
88  ZMuMuAna = cfg.Analyzer(
89  "ZMuMuAnalyzer",
90  pt1 = 20,
91  pt2 = 20,
92  iso1 = 0.1,
93  iso2 = 0.1,
94  eta1 = 2,
95  eta2 = 2,
96  m_min = 0,
97  m_max = 200
98  )
99 
100  Any kinds of keyword arguments can be added.
101  The name must be present, and must be well chosen, as it will be used
102  by the Looper to find the module containing the Analyzer class.
103  This module should be in your PYTHONPATH. If not, modify your python path
104  accordingly in your script.
105  '''
106 
107  self.class_object = class_object
108  self.__class__.num_instance += 1
109  if instance_label is None:
110  instance_label = str(self.__class__.num_instance)
111  self.instance_label = instance_label
112  self.verbose = verbose
113  super(Analyzer, self).__init__(**kwargs)
114 
def __init__(self, class_object, instance_label=None, verbose=False, kwargs)
Definition: config.py:83

Member Function Documentation

def config.Analyzer.__setattr__ (   self,
  name,
  value 
)
You may decide to copy an existing analyzer and change
its instance_label. In that case, one must stay consistent.

Definition at line 115 of file config.py.

Referenced by GenObject.GenObject.setValue().

115  def __setattr__(self, name, value):
116  '''You may decide to copy an existing analyzer and change
117  its instance_label. In that case, one must stay consistent.'''
118  self.__dict__[name] = value
119  if name == 'instance_label':
120  self.name = self.build_name()
121 
def build_name(self)
Definition: config.py:122
def __setattr__(self, name, value)
Definition: config.py:115
def config.Analyzer.build_name (   self)

Definition at line 122 of file config.py.

References analyzer.Analyzer.instance_label, config.Analyzer.instance_label, and join().

Referenced by config.Service.__setattr__().

122  def build_name(self):
123  class_name = '.'.join([self.class_object.__module__,
124  self.class_object.__name__])
125  name = '_'.join([class_name, self.instance_label])
126  return name
127 
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def build_name(self)
Definition: config.py:122
def config.Analyzer.clone (   self,
  kwargs 
)

Definition at line 128 of file config.py.

128  def clone(self, **kwargs):
129  other = super(Analyzer, self).clone(**kwargs)
130  if 'class_object' in kwargs and 'name' not in kwargs:
131  other.name = other.build_name()
132  return other
133 
def clone(self, kwargs)
Definition: config.py:128

Member Data Documentation

config.Analyzer.class_object

Definition at line 107 of file config.py.

config.Analyzer.instance_label
config.Analyzer.name
config.Analyzer.num_instance
static

Definition at line 80 of file config.py.

config.Analyzer.verbose