CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
MatrixToProcess.MatrixToProcess Class Reference

Public Member Functions

def __init__ (self, what='standard', strict=True)
 
def getConfig (self, wfNumber, step)
 
def getKey (self, wfNumber, step)
 
def getProcess (self, wfNumber, step)
 
def identityTest (self, wfNumber, step)
 
def listAll (self)
 
def load (self, wfNumber, step)
 

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  def __init__(self,what='standard',strict=True):
8  from Configuration.PyReleaseValidation.MatrixReader import MatrixReader
9  self.mrd = MatrixReader(what,noRun=True)
10  self.mrd.prepare('all','',None)
12  self.processes={}
13  self.strict=strict
def __init__(self, what='standard', strict=True)

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  def getConfig(self,wfNumber,step):
53  key=self.getKey(wfNumber,step)
54  if not key in self.configBuilders: self.getProcess(wfNumber,step)
55  if not key in self.configBuilders: return None
56  return self.configBuilders[key].pythonCfgCode
57 
def getConfig(self, wfNumber, step)
def getKey(self, wfNumber, step)
def getProcess(self, wfNumber, step)
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  def getKey(self,wfNumber,step):
15  return str(wfNumber)+':'+str(step)
16 
def getKey(self, wfNumber, 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(), cond::persistency::KeyList.load(), cond::persistency::GTEditor.load(), cond::persistency::IOVEditor.load(), L1MuDTPhiLut.load(), L1MuDTPtaLut.load(), L1MuDTEtaPatternLut.load(), L1MuDTQualPatternLut.load(), PiecewiseScalingPolynomial.load(), L1MuDTExtLut.load(), cond::persistency::RunInfoProxy.load(), HcalIndexLookup.load(), HBHENegativeEFilter.load(), cond::persistency::GTProxy.load(), cond::persistency::IOVProxy.load(), HBHEChannelGroups.load(), TrackerMap.load(), OOTPileupCorrData.load(), ConfigBuilder.ConfigBuilder.load(), and mps_create_file_lists._DasCache.load().

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

17  def getProcess(self,wfNumber,step):
18  key=self.getKey(wfNumber,step)
19  if not key in self.configBuilders:
20  self.load(wfNumber,step)
21  if not key in self.configBuilders:
22  return None
23  return self.configBuilders[key].process
24 
def getKey(self, wfNumber, step)
def getProcess(self, wfNumber, step)
def load(self, wfNumber, step)
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  def identityTest(self,wfNumber,step):
59  self.getProcess(wfNumber,step)
60  key=self.getKey(wfNumber,step)
61  if not key in self.configBuilders: return None
62 
63  cb=self.configBuilders[key]
64  #need to compare those two for identity
65  cb.process
66  cd.pythonCfgCode
67 
68 
def getKey(self, wfNumber, step)
def getProcess(self, wfNumber, step)
def identityTest(self, wfNumber, step)
def MatrixToProcess.MatrixToProcess.listAll (   self)

Definition at line 69 of file MatrixToProcess.py.

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

69  def listAll(self):
70  for wf in self.mrd.workFlows:
71  step=1
72  print('---------------------')
73  print('process workflow',wf.numId)
74  print()
75  while self.load(float(wf.numId),step):
76  p=self.getProcess(float(wf.numId),step)
77  print(', '.join(s.label() for s in p.schedule))
78  #print p.outputModules()
79  step+=1
80 
81 
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:65
def getProcess(self, wfNumber, step)
def load(self, wfNumber, step)
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def MatrixToProcess.MatrixToProcess.load (   self,
  wfNumber,
  step 
)

Definition at line 25 of file MatrixToProcess.py.

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

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

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

Member Data Documentation

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().