CMS 3D CMS Logo

List of all members | Public Member Functions
Eras.Eras Class Reference
Inheritance diagram for Eras.Eras:

Public Member Functions

def __init__ (self)
 
def addEra (self, name, obj)
 
def inspect (self, name=None, onlyChosen=False, details=True)
 
def inspectEra (self, e, details)
 
def inspectModifier (self, m, details)
 

Detailed Description

Dummy container for all the cms.Modifier instances that config fragments
can use to selectively configure depending on what scenario is active.

Definition at line 4 of file Eras.py.

Constructor & Destructor Documentation

def Eras.Eras.__init__ (   self)

Definition at line 9 of file Eras.py.

References Eras.Eras.addEra().

9  def __init__(self):
10  allEras=['Run1_pA',
11  'Run1_peripheralPbPb',
12  'Run2_50ns',
13  'Run2_50ns_HIPM',
14  'Run2_25ns',
15  'Run2_25ns_HIPM',
16  'Run2_25ns_peripheralPbPb',
17  'Run2_HI',
18  'Run2_2016',
19  'Run2_2016_HIPM',
20  'Run2_2016_trackingLowPU',
21  'Run2_2016_pA',
22  'Run2_2017',
23  'Run2_2017_trackingRun2',
24  'Run2_2017_trackingPhase1QuadProp',
25  'Run2_2017_trackingLowPU',
26  'Run2_2018',
27  'Run3',
28  'Phase2',
29  'Phase2_timing',
30  'Phase2_timing_layer']
31 
32  internalUseMods = ['run2_common', 'run2_25ns_specific',
33  'run2_50ns_specific', 'run2_HI_specific',
34  'stage1L1Trigger', 'fastSim',
35  'peripheralPbPb', 'pA_2016',
36  'run2_HE_2017', 'stage2L1Trigger', 'stage2L1Trigger_2017',
37  'run2_HF_2017', 'run2_HCAL_2017', 'run2_HEPlan1_2017',
38  'run3_HB', 'run3_common',
39  'phase1Pixel', 'run3_GEM', 'run2_GEM_2017', 'run2_GEM_2017_MCTest',
40  'phase2_common', 'phase2_tracker',
41  'phase2_hgcal', 'phase2_muon', 'phase2_timing',
42  'phase2_timing_layer','phase2_hcal',
43  'trackingLowPU', 'trackingPhase1', 'trackingPhase1QuadProp', 'ctpps_2016', 'trackingPhase2PU140',
44  'tracker_apv_vfp30_2016', 'run2_miniAOD_80XLegacy',
45  'hcalHardcodeConditions', 'hcalSkipPacker']
46  internalUseModChains = ['run2_2017_noTrackingModifier']
47 
48 
49  for e in allEras:
50  eObj=getattr(__import__('Configuration.Eras.Era_'+e+'_cff',globals(),locals(),[e],0),e)
51  self.addEra(e,eObj)
52 
53  for e in internalUseMods:
54  eObj=getattr(__import__('Configuration.Eras.Modifier_'+e+'_cff',globals(),locals(),[e],0),e)
55  self.addEra(e,eObj)
56 
57  for e in internalUseModChains:
58  eObj=getattr(__import__('Configuration.Eras.ModifierChain_'+e+'_cff',globals(),locals(),[e],0),e)
59  self.addEra(e,eObj)
60 
61 
def __init__(self)
Definition: Eras.py:9
def addEra(self, name, obj)
Definition: Eras.py:62

Member Function Documentation

def Eras.Eras.addEra (   self,
  name,
  obj 
)

Definition at line 62 of file Eras.py.

Referenced by Eras.Eras.__init__().

62  def addEra(self,name,obj):
63  setattr(self,name,obj)
64 
def addEra(self, name, obj)
Definition: Eras.py:62
def Eras.Eras.inspect (   self,
  name = None,
  onlyChosen = False,
  details = True 
)

Definition at line 79 of file Eras.py.

References Eras.Eras.inspectEra().

79  def inspect(self,name=None,onlyChosen=False,details=True):
80  if name==None:
81  print 'Inspecting the known eras',
82  if onlyChosen: print ' (all active)'
83  else: print '(all eras defined)'
84  else:
85  print 'Inspecting the '+name+' era',
86 
87  allEras=[]
88  for key, value in self.__dict__.items():
89  if type(value)==ModifierChain: allEras.append(key)
90 
91  for e in allEras:
92  if name is not None and name==e:
93  self.inspectEra(e,details)
94  if name is None:
95  if not onlyChosen or getattr(self,e).isChosen():
96  self.inspectEra(e,details)
97 
98 eras=Eras()
99 
100 
101 #eras.inspect()
102 
def inspectEra(self, e, details)
Definition: Eras.py:68
def inspect(self, name=None, onlyChosen=False, details=True)
Definition: Eras.py:79
Definition: Eras.py:4
def Eras.Eras.inspectEra (   self,
  e,
  details 
)

Definition at line 68 of file Eras.py.

References Eras.Eras.inspectModifier().

Referenced by Eras.Eras.inspect().

68  def inspectEra(self,e,details):
69  print '\nEra:',e
70  print ' isChosen:',getattr(self,e).isChosen()
71  if details: print ' Modifiers:'
72  nmod=0
73  for value in getattr(self,e).__dict__['_ModifierChain__chain']:
74  if type(value)==Modifier:
75  nmod=nmod+1
76  if details: self.inspectModifier(value,details)
77  print ' ',nmod,'modifiers defined'
78 
def inspectEra(self, e, details)
Definition: Eras.py:68
def inspectModifier(self, m, details)
Definition: Eras.py:65
def Eras.Eras.inspectModifier (   self,
  m,
  details 
)

Definition at line 65 of file Eras.py.

Referenced by Eras.Eras.inspectEra().

65  def inspectModifier(self,m,details):
66  print ' ',m.__dict__ ['_Modifier__processModifiers']
67 
def inspectModifier(self, m, details)
Definition: Eras.py:65