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)
 

Public Attributes

 class_object
 
 instance_label
 
 name
 
 verbose
 

Static Public Attributes

 num_instance
 

Detailed Description

Base analyzer configuration, see constructor

Definition at line 79 of file config.py.

Constructor & Destructor Documentation

◆ __init__()

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 84 of file config.py.

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

Member Function Documentation

◆ __setattr__()

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 117 of file config.py.

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

Referenced by GenObject.GenObject.setValue().

◆ build_name()

def config.Analyzer.build_name (   self)

◆ clone()

def config.Analyzer.clone (   self,
**  kwargs 
)
Make a copy of this object, redefining (or adding) some parameters, just
   like in the CMSSW python configuration files. 

   For example, you can do
      module1 = cfg.Analyzer(SomeClass, 
          param1 = value1, 
          param2 = value2, 
          param3 = value3, 
          ...)
      module2 = module1.clone(
         param2 = othervalue,
         newparam = newvalue)
   and module2 will inherit the configuration of module2 except for
   the value of param2, and for having an extra newparam of value newvalue
   (the latter may be useful if e.g. newparam were optional, and needed
   only when param2 == othervalue)

   Note that, just like in CMSSW, this is a shallow copy and not a deep copy,
   i.e. if in the example above value1 were to be an object, them module1 and
   module2 will share the same instance of value1, and not have two copies.

Reimplemented from config.CFG.

Definition at line 130 of file config.py.

130  def clone(self, **kwargs):
131  other = super(Analyzer, self).clone(**kwargs)
132  if 'class_object' in kwargs and 'name' not in kwargs:
133  other.name = other.build_name()
134  return other
135 

Member Data Documentation

◆ class_object

config.Analyzer.class_object

Definition at line 108 of file config.py.

Referenced by config.Analyzer.build_name(), and config.Service.build_name().

◆ instance_label

config.Analyzer.instance_label

◆ name

config.Analyzer.name

◆ num_instance

config.Analyzer.num_instance
static

Definition at line 82 of file config.py.

◆ verbose

config.Analyzer.verbose
join
static std::string join(char **cmd)
Definition: RemoteFile.cc:17
clone
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
str
#define str(s)
Definition: TestProcessor.cc:53
parallelization.build_name
build_name
Definition: parallelization.py:159