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_FastSim', #new modifier for Phase1 FastSim, skips the muon GEM sequence
24  'Run2_2017_trackingRun2',
25  'Run2_2017_trackingLowPU',
26  'Run2_2017_pp_on_XeXe',
27  'Run2_2017_ppRef',
28  'Run2_2018',
29  'Run2_2018_pp_on_AA',
30  'Run2_2018_highBetaStar',
31  'Run3',
32  'Phase2',
33  'Phase2_timing',
34  'Phase2_timing_layer',
35  'Phase2_timing_layer_new',
36  'Phase2C4',
37  'Phase2C4_timing',
38  ]
39 
40  internalUseMods = ['run2_common', 'run2_25ns_specific',
41  'run2_50ns_specific', 'run2_HI_specific',
42  'stage1L1Trigger', 'fastSim',
43  'peripheralPbPb', 'pA_2016',
44  'run2_HE_2017', 'stage2L1Trigger', 'stage2L1Trigger_2017',
45  'run2_HF_2017', 'run2_HCAL_2017', 'run2_HEPlan1_2017', 'run2_HB_2018','run2_HE_2018',
46  'run3_HB', 'run3_common',
47  'phase1Pixel', 'run3_GEM', 'run2_GEM_2017',
48  'run2_CSC_2018',
49  'phase2_common', 'phase2_tracker',
50  'phase2_hgcal', 'phase2_muon', 'phase2_timing', 'phase2_hgcalV9',
51  'phase2_timing_layer','phase2_timing_layer_new','phase2_hcal',
52  'trackingLowPU', 'trackingPhase1', 'ctpps_2016', 'trackingPhase2PU140','highBetaStar_2018',
53  'tracker_apv_vfp30_2016', 'pf_badHcalMitigation', 'run2_miniAOD_80XLegacy','run2_miniAOD_94XFall17', 'run2_nanoAOD_92X',
54  'run2_nanoAOD_94XMiniAODv1', 'run2_nanoAOD_94XMiniAODv2', 'run2_nanoAOD_94X2016',
55  'run2_miniAOD_devel', 'run2_nanoAOD_102Xv1',
56  'hcalHardcodeConditions', 'hcalSkipPacker']
57  internalUseModChains = ['run2_2017_noTrackingModifier']
58 
59 
60  for e in allEras:
61  eObj=getattr(__import__('Configuration.Eras.Era_'+e+'_cff',globals(),locals(),[e],0),e)
62  self.addEra(e,eObj)
63 
64  for e in internalUseMods:
65  eObj=getattr(__import__('Configuration.Eras.Modifier_'+e+'_cff',globals(),locals(),[e],0),e)
66  self.addEra(e,eObj)
67 
68  for e in internalUseModChains:
69  eObj=getattr(__import__('Configuration.Eras.ModifierChain_'+e+'_cff',globals(),locals(),[e],0),e)
70  self.addEra(e,eObj)
71 
72 
def __init__(self)
Definition: Eras.py:9
def addEra(self, name, obj)
Definition: Eras.py:73

Member Function Documentation

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

Definition at line 73 of file Eras.py.

Referenced by Eras.Eras.__init__().

73  def addEra(self,name,obj):
74  setattr(self,name,obj)
75 
def addEra(self, name, obj)
Definition: Eras.py:73
def Eras.Eras.inspect (   self,
  name = None,
  onlyChosen = False,
  details = True 
)

Definition at line 90 of file Eras.py.

References Eras.Eras.inspectEra().

90  def inspect(self,name=None,onlyChosen=False,details=True):
91  if name==None:
92  print 'Inspecting the known eras',
93  if onlyChosen: print ' (all active)'
94  else: print '(all eras defined)'
95  else:
96  print 'Inspecting the '+name+' era',
97 
98  allEras=[]
99  for key, value in self.__dict__.items():
100  if isinstance(value, ModifierChain): allEras.append(key)
101 
102  for e in allEras:
103  if name is not None and name==e:
104  self.inspectEra(e,details)
105  if name is None:
106  if not onlyChosen or getattr(self,e).isChosen():
107  self.inspectEra(e,details)
108 
109 eras=Eras()
110 
111 
112 #eras.inspect()
113 
def inspectEra(self, e, details)
Definition: Eras.py:79
def inspect(self, name=None, onlyChosen=False, details=True)
Definition: Eras.py:90
Definition: Eras.py:4
def Eras.Eras.inspectEra (   self,
  e,
  details 
)

Definition at line 79 of file Eras.py.

References Eras.Eras.inspectModifier().

Referenced by Eras.Eras.inspect().

79  def inspectEra(self,e,details):
80  print '\nEra:',e
81  print ' isChosen:',getattr(self,e).isChosen()
82  if details: print ' Modifiers:'
83  nmod=0
84  for value in getattr(self,e).__dict__['_ModifierChain__chain']:
85  if isinstance(value, Modifier):
86  nmod=nmod+1
87  if details: self.inspectModifier(value,details)
88  print ' ',nmod,'modifiers defined'
89 
def inspectEra(self, e, details)
Definition: Eras.py:79
def inspectModifier(self, m, details)
Definition: Eras.py:76
def Eras.Eras.inspectModifier (   self,
  m,
  details 
)

Definition at line 76 of file Eras.py.

Referenced by Eras.Eras.inspectEra().

76  def inspectModifier(self,m,details):
77  print ' ',m.__dict__ ['_Modifier__processModifiers']
78 
def inspectModifier(self, m, details)
Definition: Eras.py:76