CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Public Attributes
MatrixToProcess.MatrixToProcess Class Reference

Public Member Functions

def __init__
 
def getConfig
 
def getKey
 
def getProcess
 
def identityTest
 
def listAll
 
def load
 

Public Attributes

 configBuilders
 
 mrd
 
 processes
 
 strict
 

Detailed Description

Definition at line 5 of file MatrixToProcess.py.

Constructor & Destructor Documentation

def MatrixToProcess.MatrixToProcess.__init__ (   self,
  what = 'standard',
  strict = True 
)

Definition at line 7 of file MatrixToProcess.py.

7 
8  def __init__(self,what='standard',strict=True):
9  from Configuration.PyReleaseValidation.MatrixReader import MatrixReader
10  self.mrd = MatrixReader(what,noRun=True)
11  self.mrd.prepare('all','',None)
13  self.processes={}
self.strict=strict

Member Function Documentation

def MatrixToProcess.MatrixToProcess.getConfig (   self,
  wfNumber,
  step 
)

Definition at line 52 of file MatrixToProcess.py.

References MatrixToProcess.MatrixToProcess.configBuilders, MatrixToProcess.MatrixToProcess.getKey(), TmModule.getKey(), DTCalibrationMap.getKey(), L1TUtmCut.getKey(), and MatrixToProcess.MatrixToProcess.getProcess().

52 
53  def getConfig(self,wfNumber,step):
54  key=self.getKey(wfNumber,step)
55  if not key in self.configBuilders: self.getProcess(wfNumber,step)
56  if not key in self.configBuilders: return None
57  return self.configBuilders[key].pythonCfgCode
def MatrixToProcess.MatrixToProcess.getKey (   self,
  wfNumber,
  step 
)

Definition at line 14 of file MatrixToProcess.py.

References str.

Referenced by MatrixToProcess.MatrixToProcess.getConfig(), MatrixToProcess.MatrixToProcess.getProcess(), MatrixToProcess.MatrixToProcess.identityTest(), and MatrixToProcess.MatrixToProcess.load().

14 
15  def getKey(self,wfNumber,step):
16  return str(wfNumber)+':'+str(step)
#define str(s)
def MatrixToProcess.MatrixToProcess.getProcess (   self,
  wfNumber,
  step 
)

Definition at line 17 of file MatrixToProcess.py.

References MatrixToProcess.MatrixToProcess.configBuilders, MatrixToProcess.MatrixToProcess.getKey(), TmModule.getKey(), DTCalibrationMap.getKey(), L1TUtmCut.getKey(), VisualizationOptions.load(), BTagCalibrationReader::BTagCalibrationReaderImpl.load(), MatrixToProcess.MatrixToProcess.load(), BTagCalibrationReader.load(), CSCL1TPLookupTableEP.load(), cond::persistency::GTEditor.load(), L1MuDTPtaLut.load(), L1MuDTPhiLut.load(), cond::persistency::IOVEditor.load(), L1MuDTEtaPatternLut.load(), L1MuDTQualPatternLut.load(), PiecewiseScalingPolynomial.load(), L1MuDTExtLut.load(), HBHENegativeEFilter.load(), HBHEChannelGroups.load(), cond::persistency::RunInfoProxy.load(), HcalIndexLookup.load(), cond::persistency::GTProxy.load(), cond::persistency::IOVProxy.load(), OOTPileupCorrData.load(), TrackerMap.load(), ConfigBuilder.ConfigBuilder.load(), and tkal_create_file_lists._DasCache.load().

Referenced by MatrixToProcess.MatrixToProcess.getConfig(), MatrixToProcess.MatrixToProcess.identityTest(), and MatrixToProcess.MatrixToProcess.listAll().

17 
18  def getProcess(self,wfNumber,step):
19  key=self.getKey(wfNumber,step)
20  if not key in self.configBuilders:
21  self.load(wfNumber,step)
22  if not key in self.configBuilders:
23  return None
24  return self.configBuilders[key].process
def MatrixToProcess.MatrixToProcess.identityTest (   self,
  wfNumber,
  step 
)

Definition at line 58 of file MatrixToProcess.py.

References MatrixToProcess.MatrixToProcess.configBuilders, MatrixToProcess.MatrixToProcess.getKey(), TmModule.getKey(), DTCalibrationMap.getKey(), L1TUtmCut.getKey(), and MatrixToProcess.MatrixToProcess.getProcess().

58 
59  def identityTest(self,wfNumber,step):
60  self.getProcess(wfNumber,step)
61  key=self.getKey(wfNumber,step)
62  if not key in self.configBuilders: return None
63 
64  cb=self.configBuilders[key]
65  #need to compare those two for identity
66  cb.process
67  cd.pythonCfgCode
68 
def MatrixToProcess.MatrixToProcess.listAll (   self)

Definition at line 69 of file MatrixToProcess.py.

References MatrixToProcess.MatrixToProcess.getProcess(), join(), VisualizationOptions.load(), BTagCalibrationReader::BTagCalibrationReaderImpl.load(), MatrixToProcess.MatrixToProcess.load(), BTagCalibrationReader.load(), CSCL1TPLookupTableEP.load(), cond::persistency::GTEditor.load(), L1MuDTPtaLut.load(), L1MuDTPhiLut.load(), cond::persistency::IOVEditor.load(), L1MuDTEtaPatternLut.load(), L1MuDTQualPatternLut.load(), PiecewiseScalingPolynomial.load(), L1MuDTExtLut.load(), HBHENegativeEFilter.load(), HBHEChannelGroups.load(), cond::persistency::RunInfoProxy.load(), HcalIndexLookup.load(), cond::persistency::GTProxy.load(), cond::persistency::IOVProxy.load(), OOTPileupCorrData.load(), TrackerMap.load(), ConfigBuilder.ConfigBuilder.load(), tkal_create_file_lists._DasCache.load(), and print().

69 
70  def listAll(self):
71  for wf in self.mrd.workFlows:
72  step=1
73  print('---------------------')
74  print('process workflow',wf.numId)
75  print()
76  while self.load(float(wf.numId),step):
77  p=self.getProcess(float(wf.numId),step)
78  print(', '.join(s.label() for s in p.schedule))
79  #print p.outputModules()
80  step+=1
81 
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
static std::string join(char **cmd)
Definition: RemoteFile.cc:19
def MatrixToProcess.MatrixToProcess.load (   self,
  wfNumber,
  step 
)

Definition at line 25 of file MatrixToProcess.py.

References MatrixToProcess.MatrixToProcess.configBuilders, MatrixToProcess.MatrixToProcess.getKey(), TmModule.getKey(), DTCalibrationMap.getKey(), L1TUtmCut.getKey(), cmsDriverOptions.OptionsFromCommand(), print(), and MatrixToProcess.MatrixToProcess.strict.

Referenced by MatrixToProcess.MatrixToProcess.getProcess(), and MatrixToProcess.MatrixToProcess.listAll().

25 
26  def load(self,wfNumber,step):
27  from Configuration.Applications.ConfigBuilder import ConfigBuilder
28  from Configuration.Applications.cmsDriverOptions import OptionsFromCommand
29  import copy
30 
31  if len(self.configBuilders)!=0 and self.strict:
32  raise Exception('one should never be loading more than one process at a time due to python loading/altering feature')
33  key=self.getKey(wfNumber,step)
34  if key in self.configBuilders:
35  return True
36 
37  for wf in self.mrd.workFlows:
38  if float(wf.numId)!=wfNumber: continue
39 
40  if not hasattr(wf,'cmdStep%d'%(step)): continue
41  if not getattr(wf,'cmdStep%d'%(step)): continue
42 
43  command=getattr(wf,'cmdStep%d'%(step))
44  opt=OptionsFromCommand(command)
45  if opt:
46  cb = ConfigBuilder(opt,with_input=True,with_output=True)
47  cb.prepare()
48  self.configBuilders[key]=copy.copy(cb)
49  return True
50  print("could not satisfy the request for step",step,"of workflow",wfNumber)
51  return False
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47

Member Data Documentation

MatrixToProcess.MatrixToProcess.configBuilders

Definition at line 11 of file MatrixToProcess.py.

Referenced by MatrixToProcess.MatrixToProcess.getConfig(), MatrixToProcess.MatrixToProcess.getProcess(), MatrixToProcess.MatrixToProcess.identityTest(), and MatrixToProcess.MatrixToProcess.load().

MatrixToProcess.MatrixToProcess.mrd

Definition at line 9 of file MatrixToProcess.py.

MatrixToProcess.MatrixToProcess.processes

Definition at line 12 of file MatrixToProcess.py.

MatrixToProcess.MatrixToProcess.strict

Definition at line 13 of file MatrixToProcess.py.

Referenced by MatrixToProcess.MatrixToProcess.load().