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 5 of file Eras.py.

Constructor & Destructor Documentation

def Eras.Eras.__init__ (   self)

Definition at line 10 of file Eras.py.

References Eras.Eras.addEra().

10  def __init__(self):
11  allEras=['Run1_pA',
12  'Run1_peripheralPbPb',
13  'Run2_50ns',
14  'Run2_50ns_HIPM',
15  'Run2_25ns',
16  'Run2_25ns_HIPM',
17  'Run2_25ns_peripheralPbPb',
18  'Run2_HI',
19  'Run2_2016',
20  'Run2_2016_HIPM',
21  'Run2_2016_trackingLowPU',
22  'Run2_2016_pA',
23  'Run2_2017',
24  'Run2_2017_FastSim', #new modifier for Phase1 FastSim, skips the muon GEM sequence
25  'Run2_2017_trackingRun2',
26  'Run2_2017_trackingLowPU',
27  'Run2_2017_pp_on_XeXe',
28  'Run2_2017_ppRef',
29  'Run2_2018',
30  'Run2_2018_pp_on_AA',
31  'Run2_2018_pp_on_AA_noHCALmitigation',
32  'Run2_2018_highBetaStar',
33  'Run3',
34  'Phase2',
35  'Phase2_timing',
36  'Phase2_timing_layer',
37  'Phase2_timing_layer_new',
38  'Phase2C4',
39  'Phase2C4_timing',
40  'Phase2C6',
41  'Phase2C6_timing',
42  ]
43 
44  internalUseMods = ['run2_common', 'run2_25ns_specific',
45  'run2_50ns_specific', 'run2_HI_specific',
46  'stage1L1Trigger', 'fastSim',
47  'peripheralPbPb', 'pA_2016',
48  'run2_HE_2017', 'stage2L1Trigger', 'stage2L1Trigger_2017',
49  'run2_HF_2017', 'run2_HCAL_2017', 'run2_HEPlan1_2017', 'run2_HB_2018','run2_HE_2018',
50  'run3_HB', 'run3_common',
51  'phase1Pixel', 'run3_GEM', 'run2_GEM_2017',
52  'run2_CSC_2018',
53  'phase2_common', 'phase2_tracker',
54  'phase2_hgcal', 'phase2_muon', 'phase2_timing', 'phase2_hgcalV9', 'phase2_hfnose',
55  'phase2_timing_layer','phase2_timing_layer_new','phase2_hcal',
56  'trackingLowPU', 'trackingPhase1', 'ctpps_2016', 'trackingPhase2PU140','highBetaStar_2018',
57  'tracker_apv_vfp30_2016', 'pf_badHcalMitigation', 'run2_miniAOD_80XLegacy','run2_miniAOD_94XFall17', 'run2_nanoAOD_92X',
58  'run2_nanoAOD_94XMiniAODv1', 'run2_nanoAOD_94XMiniAODv2', 'run2_nanoAOD_94X2016',
59  'hcalHardcodeConditions', 'hcalSkipPacker']
60  internalUseModChains = ['run2_2017_noTrackingModifier']
61 
62 
63  for e in allEras:
64  eObj=getattr(__import__('Configuration.Eras.Era_'+e+'_cff',globals(),locals(),[e],0),e)
65  self.addEra(e,eObj)
66 
67  for e in internalUseMods:
68  eObj=getattr(__import__('Configuration.Eras.Modifier_'+e+'_cff',globals(),locals(),[e],0),e)
69  self.addEra(e,eObj)
70 
71  for e in internalUseModChains:
72  eObj=getattr(__import__('Configuration.Eras.ModifierChain_'+e+'_cff',globals(),locals(),[e],0),e)
73  self.addEra(e,eObj)
74 
75 
def __init__(self)
Definition: Eras.py:10
def addEra(self, name, obj)
Definition: Eras.py:76

Member Function Documentation

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

Definition at line 76 of file Eras.py.

Referenced by Eras.Eras.__init__().

76  def addEra(self,name,obj):
77  setattr(self,name,obj)
78 
def addEra(self, name, obj)
Definition: Eras.py:76
def Eras.Eras.inspect (   self,
  name = None,
  onlyChosen = False,
  details = True 
)

Definition at line 93 of file Eras.py.

References Eras.Eras.inspectEra(), and edm.print().

93  def inspect(self,name=None,onlyChosen=False,details=True):
94  if name==None:
95  print('Inspecting the known eras', end=' ')
96  if onlyChosen: print(' (all active)')
97  else: print('(all eras defined)')
98  else:
99  print('Inspecting the '+name+' era', end=' ')
100 
101  allEras=[]
102  for key, value in self.__dict__.items():
103  if isinstance(value, ModifierChain): allEras.append(key)
104 
105  for e in allEras:
106  if name is not None and name==e:
107  self.inspectEra(e,details)
108  if name is None:
109  if not onlyChosen or getattr(self,e).isChosen():
110  self.inspectEra(e,details)
111 
112 eras=Eras()
113 
114 
115 #eras.inspect()
116 
def inspectEra(self, e, details)
Definition: Eras.py:82
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:65
def inspect(self, name=None, onlyChosen=False, details=True)
Definition: Eras.py:93
Definition: Eras.py:5
def Eras.Eras.inspectEra (   self,
  e,
  details 
)

Definition at line 82 of file Eras.py.

References Eras.Eras.inspectModifier(), and edm.print().

Referenced by Eras.Eras.inspect().

82  def inspectEra(self,e,details):
83  print('\nEra:',e)
84  print(' isChosen:',getattr(self,e).isChosen())
85  if details: print(' Modifiers:')
86  nmod=0
87  for value in getattr(self,e).__dict__['_ModifierChain__chain']:
88  if isinstance(value, Modifier):
89  nmod=nmod+1
90  if details: self.inspectModifier(value,details)
91  print(' ',nmod,'modifiers defined')
92 
def inspectEra(self, e, details)
Definition: Eras.py:82
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:65
def inspectModifier(self, m, details)
Definition: Eras.py:79
def Eras.Eras.inspectModifier (   self,
  m,
  details 
)

Definition at line 79 of file Eras.py.

References edm.print().

Referenced by Eras.Eras.inspectEra().

79  def inspectModifier(self,m,details):
80  print(' ',m.__dict__ ['_Modifier__processModifiers'])
81 
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:65
def inspectModifier(self, m, details)
Definition: Eras.py:79