CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
MatrixReader.MatrixReader Class Reference
Inheritance diagram for MatrixReader.MatrixReader:

Public Member Functions

def __init__
 
def createWorkFlows
 
def makeCmd
 
def makeStep
 
def prepare
 
def readMatrix
 
def reset
 
def show
 
def showRaw
 
def showWorkFlows
 
def updateDB
 

Public Attributes

 addCommand
 
 apply
 
 commandLineWf
 
 files
 
 filesDefault
 
 filesPrefMap
 
 nameList
 
 noRun
 
 overWrite
 
 relvalModule
 
 revertDqmio
 maybe we want too level deep input More...
 
 what
 
 wm
 
 workFlows
 
 workFlowSteps
 

Detailed Description

Definition at line 16 of file MatrixReader.py.

Constructor & Destructor Documentation

def MatrixReader.MatrixReader.__init__ (   self,
  opt 
)

Definition at line 18 of file MatrixReader.py.

References PuppiAlgo.reset(), TPedResult.reset(), BinningPointByMap.reset(), ora::NamedReference.reset(), AlcaBeamSpotManager.reset(), ora::IRelationalOperation.reset(), VEcalCalibBlock.reset(), ApvLatencyAnalysis.reset(), ora::Handle< T >.reset(), MatrixReader.MatrixReader.reset(), TB06Tree.reset(), ora::IteratorBuffer.reset(), cond::BaseValueExtractor< T >.reset(), EcalCondHeader.reset(), ora::ContainerIterator.reset(), IMACalibBlock.reset(), ora::OId.reset(), SamplingAnalysis.reset(), CondIter< DataT >.reset(), L3CalibBlock.reset(), FactorizedJetCorrectorCalculator::VariableValues.reset(), DaqScopeModeAnalysis.reset(), ora::MultiRecordInsertOperation.reset(), pos::PixelROCStatus.reset(), FedTimingAnalysis.reset(), TB06TreeH2.reset(), L1MuDTTFMasks.reset(), L1MuDTTFParameters.reset(), L1MuDTPhiLut.reset(), L1MuDTPtaLut.reset(), FedCablingAnalysis.reset(), L1MuDTEtaPatternLut.reset(), L1MuDTQualPatternLut.reset(), PedsOnlyAnalysis.reset(), TB06Reco.reset(), L1MuDTExtLut.reset(), VpspScanAnalysis.reset(), PhysicsTools::Calibration::Histogram< Value_t, Axis_t >.reset(), coral_bridge::AuthenticationCredentialSet.reset(), PhysicsTools::Calibration::Histogram2D< Value_t, AxisX_t, AxisY_t >.reset(), PedestalsAnalysis.reset(), NoiseAnalysis.reset(), OptoScanAnalysis.reset(), ApvTimingAnalysis.reset(), CalibrationAnalysis.reset(), PhysicsTools::Calibration::Histogram3D< Value_t, AxisX_t, AxisY_t, AxisZ_t >.reset(), FastFedCablingAnalysis.reset(), ora::UniqueRef< T >.reset(), PedsFullNoiseAnalysis.reset(), cond::persistency::GTProxy.reset(), cond::persistency::IOVProxy.reset(), CommissioningAnalysis.reset(), ora::InsertOperation.reset(), ora::Ptr< T >.reset(), TB06RecoH2.reset(), ora::BulkInsertOperation.reset(), cond::XMLAuthenticationService::XMLAuthenticationService.reset(), TrackerMap.reset(), ora::UpdateOperation.reset(), ora::DeleteOperation.reset(), DTTFBitArray< N >.reset(), and ora::QueryableVector< Tp >.reset().

18 
19  def __init__(self, opt):
20 
21  self.reset(opt.what)
22 
23  self.wm=opt.wmcontrol
24  self.revertDqmio=opt.revertDqmio
25  self.addCommand=opt.command
26  self.apply=opt.apply
27  self.commandLineWf=opt.workflow
28  self.overWrite=opt.overWrite
29 
30  self.noRun = opt.noRun
31  return
revertDqmio
maybe we want too level deep input
Definition: MatrixReader.py:23

Member Function Documentation

def MatrixReader.MatrixReader.createWorkFlows (   self,
  fileNameIn 
)

Definition at line 432 of file MatrixReader.py.

References MatrixReader.MatrixReader.filesPrefMap, MatrixReader.MatrixReader.nameList, and MatrixReader.MatrixReader.workFlowSteps.

Referenced by MatrixReader.MatrixReader.prepare().

433  def createWorkFlows(self, fileNameIn):
434 
435  prefixIn = self.filesPrefMap[fileNameIn]
436 
437  # get through the list of items and update the requested workflows only
438  keyList = self.workFlowSteps.keys()
439  ids = []
440  for item in keyList:
441  id, pref = item
442  if pref != prefixIn : continue
443  ids.append(id)
444  ids.sort()
445  for key in ids:
446  val = self.workFlowSteps[(key,prefixIn)]
447  num, name, commands, stepList = val
448  nameId = str(num)+'_'+name
449  if nameId in self.nameList:
450  print "==> duplicate name found for ", nameId
451  print ' keeping : ', self.nameList[nameId]
452  print ' ignoring : ', val
453  else:
454  self.nameList[nameId] = val
455 
456  self.workFlows.append(WorkFlow(num, name, commands=commands))
457 
458  return
def MatrixReader.MatrixReader.makeCmd (   self,
  step 
)

Definition at line 87 of file MatrixReader.py.

Referenced by MatrixReader.MatrixReader.readMatrix().

87 
88  def makeCmd(self, step):
89 
90  cmd = ''
91  cfg = None
92  input = None
93  for k,v in step.items():
94  if 'no_exec' in k : continue # we want to really run it ...
95  if k.lower() == 'cfg':
96  cfg = v
97  continue # do not append to cmd, return separately
98  if k.lower() == 'input':
99  input = v
100  continue # do not append to cmd, return separately
101 
102  #chain the configs
103  #if k.lower() == '--python':
104  # v = 'step%d_%s'%(index,v)
105  cmd += ' ' + k + ' ' + str(v)
106  return cfg, input, cmd
def MatrixReader.MatrixReader.makeStep (   self,
  step,
  overrides 
)

Definition at line 107 of file MatrixReader.py.

Referenced by MatrixReader.MatrixReader.readMatrix().

108  def makeStep(self,step,overrides):
110  if len(overrides.keys()) > 0:
111  copyStep=merge([overrides]+[step])
112  return copyStep
113  else:
114  return step
Definition: merge.py:1
def MatrixReader.MatrixReader.prepare (   self,
  useInput = None,
  refRel = '',
  fromScratch = None 
)

Definition at line 459 of file MatrixReader.py.

References MatrixReader.MatrixReader.createWorkFlows(), MatrixReader.MatrixReader.files, geometryComparison.GeometryComparison.files, MatrixReader.MatrixReader.filesDefault, MatrixReader.MatrixReader.readMatrix(), and MatrixReader.MatrixReader.what.

460  def prepare(self, useInput=None, refRel='', fromScratch=None):
461 
462  for matrixFile in self.files:
463  if self.what != 'all' and self.what not in matrixFile:
464  print "ignoring non-requested file",matrixFile
465  continue
466  if self.what == 'all' and not self.filesDefault[matrixFile]:
467  print "ignoring",matrixFile,"from default matrix"
468  continue
469 
470  try:
471  self.readMatrix(matrixFile, useInput, refRel, fromScratch)
472  except Exception, e:
473  print "ERROR reading file:", matrixFile, str(e)
474  raise
475 
476  try:
477  self.createWorkFlows(matrixFile)
478  except Exception, e:
479  print "ERROR creating workflows :", str(e)
480  raise
481 
def MatrixReader.MatrixReader.readMatrix (   self,
  fileNameIn,
  useInput = None,
  refRel = None,
  fromScratch = None 
)

Definition at line 115 of file MatrixReader.py.

References MatrixReader.MatrixReader.addCommand, MatrixReader.MatrixReader.apply, MatrixReader.MatrixReader.filesPrefMap, join(), MatrixReader.MatrixReader.makeCmd(), MatrixReader.MatrixReader.makeStep(), python.multivaluedict.map(), MatrixReader.MatrixReader.noRun, MatrixReader.MatrixReader.overWrite, MatrixReader.MatrixReader.relvalModule, MatrixReader.MatrixReader.revertDqmio, MatrixReader.MatrixReader.wm, and MatrixReader.MatrixReader.workFlowSteps.

Referenced by MatrixReader.MatrixReader.prepare(), and MatrixReader.MatrixReader.showRaw().

116  def readMatrix(self, fileNameIn, useInput=None, refRel=None, fromScratch=None):
117 
118  prefix = self.filesPrefMap[fileNameIn]
119 
120  print "processing", fileNameIn
121 
122  try:
123  _tmpMod = __import__( 'Configuration.PyReleaseValidation.'+fileNameIn )
124  self.relvalModule = sys.modules['Configuration.PyReleaseValidation.'+fileNameIn]
125  except Exception, e:
126  print "ERROR importing file ", fileNameIn, str(e)
127  return
128 
129  if useInput is not None:
130  print "request for INPUT for ", useInput
131 
132 
133  fromInput={}
134 
135  if useInput:
136  for i in useInput:
137  if ':' in i:
138  (ik,il)=i.split(':')
139  if ik=='all':
140  for k in self.relvalModule.workflows.keys():
141  fromInput[float(k)]=int(il)
142  else:
143  fromInput[float(ik)]=int(il)
144  else:
145  if i=='all':
146  for k in self.relvalModule.workflows.keys():
147  fromInput[float(k)]=0
148  else:
149  fromInput[float(i)]=0
150 
151  if fromScratch:
152  fromScratch=map(float,fromScratch)
153  for num in fromScratch:
154  if num in fromInput:
155  fromInput.pop(num)
156  #overwrite steps
157  if self.overWrite:
158  for p in self.overWrite:
159  self.relvalModule.steps.overwrite(p)
160 
161  #change the origin of dataset on the fly
162  if refRel:
163  if ',' in refRel:
164  refRels=refRel.split(',')
165  if len(refRels)!=len(self.relvalModule.baseDataSetRelease):
166  return
167  self.relvalModule.changeRefRelease(
168  self.relvalModule.steps,
169  zip(self.relvalModule.baseDataSetRelease,refRels)
170  )
171  else:
172  self.relvalModule.changeRefRelease(
173  self.relvalModule.steps,
174  [(x,refRel) for x in self.relvalModule.baseDataSetRelease]
175  )
176 
177 
178  for num, wfInfo in self.relvalModule.workflows.items():
179  commands=[]
180  wfName = wfInfo[0]
181  stepList = wfInfo[1]
182  stepOverrides=wfInfo.overrides
183  # if no explicit name given for the workflow, use the name of step1
184  if wfName.strip() == '': wfName = stepList[0]
185  # option to specialize the wf as the third item in the WF list
186  addTo=None
187  addCom=None
188  if len(wfInfo)>=3:
189  addCom=wfInfo[2]
190  if not type(addCom)==list: addCom=[addCom]
191  #print 'added dict',addCom
192  if len(wfInfo)>=4:
193  addTo=wfInfo[3]
194  #pad with 0
195  while len(addTo)!=len(stepList):
196  addTo.append(0)
197 
198  name=wfName
199  stepIndex=0
200  ranStepList=[]
201 
202  #first resolve INPUT possibilities
203  if num in fromInput:
204  ilevel=fromInput[num]
205  #print num,ilevel
206  for (stepIr,step) in enumerate(reversed(stepList)):
207  stepName=step
208  stepI=(len(stepList)-stepIr)-1
209  #print stepIr,step,stepI,ilevel
210  if stepI>ilevel:
211  #print "ignoring"
212  continue
213  if stepI!=0:
214  testName='__'.join(stepList[0:stepI+1])+'INPUT'
215  else:
216  testName=step+'INPUT'
217  #print "JR",stepI,stepIr,testName,stepList
218  if testName in self.relvalModule.steps.keys():
219  #print "JR",stepI,stepIr
220  stepList[stepI]=testName
221  #pop the rest in the list
222  #print "\tmod prepop",stepList
223  for p in range(stepI):
224  stepList.pop(0)
225  #print "\t\tmod",stepList
226  break
227 
228 
229  for (stepI,step) in enumerate(stepList):
230  stepName=step
231  if self.wm:
232  #cannot put a certain number of things in wm
233  if stepName in [
234  #'HARVEST','HARVESTD','HARVESTDreHLT',
235  'RECODFROMRAWRECO','SKIMD','SKIMCOSD','SKIMDreHLT'
236  ]:
237  continue
238 
239  #replace stepName is needed
240  #if stepName in self.replaceStep
241  if len(name) > 0 : name += '+'
242  #any step can be mirrored with INPUT
243  ## maybe we want too level deep input
244  """
245  if num in fromInput:
246  if step+'INPUT' in self.relvalModule.steps.keys():
247  stepName = step+"INPUT"
248  stepList.remove(step)
249  stepList.insert(stepIndex,stepName)
250  """
251  name += stepName
252  if addCom and (not addTo or addTo[stepIndex]==1):
254  copyStep=merge(addCom+[self.makeStep(self.relvalModule.steps[stepName],stepOverrides)])
255  cfg, input, opts = self.makeCmd(copyStep)
256  else:
257  cfg, input, opts = self.makeCmd(self.makeStep(self.relvalModule.steps[stepName],stepOverrides))
258 
259  if input and cfg :
260  msg = "FATAL ERROR: found both cfg and input for workflow "+str(num)+' step '+stepName
261  raise MatrixException(msg)
262 
263  if input:
264  cmd = input
265  if self.noRun:
266  cmd.run=[]
267  else:
268  if cfg:
269  cmd = 'cmsDriver.py '+cfg+' '+opts
270  else:
271  cmd = 'cmsDriver.py step'+str(stepIndex+1)+' '+opts
272  if self.wm:
273  cmd+=' --io %s.io --python %s.py'%(stepName,stepName)
274  if self.addCommand:
275  if self.apply:
276  if stepIndex in self.apply or stepName in self.apply:
277  cmd +=' '+self.addCommand
278  else:
279  cmd +=' '+self.addCommand
280  if self.wm and self.revertDqmio=='yes':
281  cmd=cmd.replace('DQMIO','DQM')
282  cmd=cmd.replace('--filetype DQM','')
283  commands.append(cmd)
284  ranStepList.append(stepName)
285  stepIndex+=1
286 
287  self.workFlowSteps[(num,prefix)] = (num, name, commands, ranStepList)
288 
289  return
290 
Definition: merge.py:1
revertDqmio
maybe we want too level deep input
Definition: MatrixReader.py:23
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def MatrixReader.MatrixReader.reset (   self,
  what = 'all' 
)

Definition at line 32 of file MatrixReader.py.

Referenced by MatrixReader.MatrixReader.__init__(), and MatrixReader.MatrixReader.showRaw().

32 
33  def reset(self, what='all'):
34 
35  self.what = what
36 
37  #a bunch of information, but not yet the WorkFlow object
38  self.workFlowSteps = {}
39  #the actual WorkFlow objects
40  self.workFlows = []
41  self.nameList = {}
42 
43  self.filesPrefMap = {'relval_standard' : 'std-' ,
44  'relval_highstats': 'hi-' ,
45  'relval_pileup': 'PU-' ,
46  'relval_generator': 'gen-',
47  'relval_extendedgen': 'genExt-',
48  'relval_production': 'prod-' ,
49  'relval_ged': 'ged-',
50  'relval_upgrade':'upg-',
51  'relval_identity':'id-',
52  'relval_machine': 'mach-',
53  'relval_unsch': 'unsch-',
54  'relval_premix': 'premix-'
55  }
56 
57  self.files = ['relval_standard' ,
58  'relval_highstats',
59  'relval_pileup',
60  'relval_generator',
61  'relval_extendedgen',
62  'relval_production',
63  'relval_ged',
64  'relval_upgrade',
65  'relval_identity',
66  'relval_machine',
67  'relval_unsch',
68  'relval_premix'
69  ]
70  self.filesDefault = {'relval_standard':True ,
71  'relval_highstats':True ,
72  'relval_pileup':True,
73  'relval_generator':True,
74  'relval_extendedgen':True,
75  'relval_production':True,
76  'relval_ged':True,
77  'relval_upgrade':False,
78  'relval_identity':False,
79  'relval_machine':True,
80  'relval_unsch':True,
81  'relval_premix':True
82  }
83 
84  self.relvalModule = None
85 
86  return
def MatrixReader.MatrixReader.show (   self,
  selected = None,
  extended = True 
)

Definition at line 482 of file MatrixReader.py.

References MatrixReader.MatrixReader.showWorkFlows().

Referenced by Vispa.Main.AboutDialog.AboutDialog.onScreen(), Vispa.Gui.BoxContentDialog.BoxContentDialog.onScreen(), and Vispa.Gui.FindDialog.FindDialog.onScreen().

483  def show(self, selected=None, extended=True):
484 
485  self.showWorkFlows(selected,extended)
486  print '\n','-'*80,'\n'
487 
def MatrixReader.MatrixReader.showRaw (   self,
  useInput,
  refRel = None,
  fromScratch = None,
  what = 'all',
  step1Only = False,
  selected = None 
)

Definition at line 291 of file MatrixReader.py.

References Clusterizer1DCommons.add(), MatrixReader.MatrixReader.files, geometryComparison.GeometryComparison.files, MatrixReader.MatrixReader.filesDefault, join(), python.multivaluedict.map(), MatrixReader.MatrixReader.readMatrix(), PuppiAlgo.reset(), TPedResult.reset(), BinningPointByMap.reset(), ora::NamedReference.reset(), AlcaBeamSpotManager.reset(), ora::IRelationalOperation.reset(), VEcalCalibBlock.reset(), ApvLatencyAnalysis.reset(), MatrixReader.MatrixReader.reset(), ora::Handle< T >.reset(), TB06Tree.reset(), ora::IteratorBuffer.reset(), cond::BaseValueExtractor< T >.reset(), EcalCondHeader.reset(), ora::ContainerIterator.reset(), IMACalibBlock.reset(), CondIter< DataT >.reset(), ora::OId.reset(), SamplingAnalysis.reset(), L3CalibBlock.reset(), FactorizedJetCorrectorCalculator::VariableValues.reset(), DaqScopeModeAnalysis.reset(), ora::MultiRecordInsertOperation.reset(), FedTimingAnalysis.reset(), pos::PixelROCStatus.reset(), TB06TreeH2.reset(), L1MuDTTFMasks.reset(), L1MuDTTFParameters.reset(), L1MuDTPhiLut.reset(), L1MuDTPtaLut.reset(), FedCablingAnalysis.reset(), L1MuDTEtaPatternLut.reset(), L1MuDTQualPatternLut.reset(), PedsOnlyAnalysis.reset(), TB06Reco.reset(), VpspScanAnalysis.reset(), L1MuDTExtLut.reset(), PhysicsTools::Calibration::Histogram< Value_t, Axis_t >.reset(), coral_bridge::AuthenticationCredentialSet.reset(), PhysicsTools::Calibration::Histogram2D< Value_t, AxisX_t, AxisY_t >.reset(), NoiseAnalysis.reset(), PedestalsAnalysis.reset(), OptoScanAnalysis.reset(), ApvTimingAnalysis.reset(), CalibrationAnalysis.reset(), PhysicsTools::Calibration::Histogram3D< Value_t, AxisX_t, AxisY_t, AxisZ_t >.reset(), FastFedCablingAnalysis.reset(), ora::UniqueRef< T >.reset(), PedsFullNoiseAnalysis.reset(), cond::persistency::GTProxy.reset(), cond::persistency::IOVProxy.reset(), CommissioningAnalysis.reset(), ora::InsertOperation.reset(), ora::Ptr< T >.reset(), TB06RecoH2.reset(), ora::BulkInsertOperation.reset(), cond::XMLAuthenticationService::XMLAuthenticationService.reset(), TrackerMap.reset(), ora::UpdateOperation.reset(), ora::DeleteOperation.reset(), DTTFBitArray< N >.reset(), ora::QueryableVector< Tp >.reset(), MatrixReader.MatrixReader.revertDqmio, MatrixReader.MatrixReader.what, and MatrixReader.MatrixReader.workFlowSteps.

292  def showRaw(self, useInput, refRel=None, fromScratch=None, what='all',step1Only=False,selected=None):
293 
294  if selected:
295  selected=map(float,selected)
296  for matrixFile in self.files:
297 
298  self.reset(what)
299 
300  if self.what != 'all' and self.what not in matrixFile:
301  print "ignoring non-requested file",matrixFile
302  continue
303 
304  if self.what == 'all' and not self.filesDefault[matrixFile]:
305  print "ignoring file not used by default (enable with -w)",matrixFile
306  continue
307 
308  try:
309  self.readMatrix(matrixFile, useInput, refRel, fromScratch)
310  except Exception, e:
311  print "ERROR reading file:", matrixFile, str(e)
312  raise
313 
314  if not self.workFlowSteps: continue
315 
316  dataFileName = matrixFile.replace('relval_', 'cmsDriver_')+'_hlt.txt'
317  outFile = open(dataFileName,'w')
318 
319  print "found ", len(self.workFlowSteps.keys()), ' workflows for ', dataFileName
320  ids = self.workFlowSteps.keys()
321  ids.sort()
322  indexAndSteps=[]
323 
324  writtenWF=0
325  for key in ids:
326  if selected and not (key[0] in selected):
327  continue
328  #trick to skip the HImix IB test
329  if key[0]==203.1 or key[0]==204.1 or key[0]==205.1 or key[0]==4.51 or key[0]==4.52: continue
330  num, name, commands, stepList = self.workFlowSteps[key]
331 
332  wfName,stepNames= name.split('+',1)
333 
334  stepNames=stepNames.replace('+RECODFROMRAWRECO','')
335  stepNames=stepNames.replace('+SKIMCOSD','')
336  stepNames=stepNames.replace('+SKIMD','')
337  if 'HARVEST' in stepNames:
338  #find out automatically what to remove
339  exactb=stepNames.index('+HARVEST')
340  exacte=stepNames.index('+',exactb+1) if ('+' in stepNames[exactb+1:]) else (len(stepNames))
341  stepNames=stepNames.replace(stepNames[exactb:exacte],'')
342  otherSteps = None
343  if '+' in stepNames:
344  step1,otherSteps = stepNames.split('+',1)
345 
346  line = str(num) + ' ++ '+ wfName
347  if otherSteps and not step1Only:
348  line += ' ++ ' +otherSteps.replace('+',',')
349  else:
350  line += ' ++ none'
351  inputInfo=None
352  if not isinstance(commands[0],str):
353  inputInfo=commands[0]
354  if otherSteps:
355  for (i,c) in enumerate(otherSteps.split('+')):
356  #pad with set
357  for p in range(len(indexAndSteps),i+2):
358  indexAndSteps.append(set())
359  indexAndSteps[i+1].add((c,commands[i+1]))
360 
361  if inputInfo :
362  #skip the samples from INPUT when step1Only is on
363  if step1Only: continue
364  line += ' ++ REALDATA: '+inputInfo.dataSet
365  if inputInfo.run!=[]: line += ', RUN:'+'|'.join(map(str,inputInfo.run))
366  line += ', FILES: ' +str(inputInfo.files)
367  line += ', EVENTS: '+str(inputInfo.events)
368  if inputInfo.label!='':
369  line += ', LABEL: ' +inputInfo.label
370  line += ', LOCATION:'+inputInfo.location
371  line += ' @@@'
372  else:
373  line += ' @@@ '+commands[0]
374  if self.revertDqmio=='yes':
375  line=line.replace('DQMIO','DQM')
376  writtenWF+=1
377  outFile.write(line+'\n')
378 
379 
380  outFile.write('\n'+'\n')
381  if step1Only: continue
382 
383  for (index,s) in enumerate(indexAndSteps):
384  for (stepName,cmd) in s:
385  stepIndex=index+1
386  if 'dasquery.log' in cmd: continue
387  line = 'STEP%d ++ '%(stepIndex,) +stepName + ' @@@ '+cmd
388  if self.revertDqmio=='yes':
389  line=line.replace('DQMIO','DQM')
390  outFile.write(line+'\n')
391  outFile.write('\n'+'\n')
392  outFile.close()
393  print "wrote ",writtenWF, ' workflow'+('s' if (writtenWF!=1) else ''),' to ', outFile.name
394  return
395 
revertDqmio
maybe we want too level deep input
Definition: MatrixReader.py:23
void add(const std::vector< const T * > &source, std::vector< const T * > &dest)
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def MatrixReader.MatrixReader.showWorkFlows (   self,
  selected = None,
  extended = True 
)

Definition at line 396 of file MatrixReader.py.

References python.multivaluedict.map(), and MatrixReader.MatrixReader.workFlows.

Referenced by MatrixReader.MatrixReader.show().

397  def showWorkFlows(self, selected=None, extended=True):
398  if selected: selected = map(float,selected)
399  maxLen = 100 # for summary, limit width of output
400  fmt1 = "%-6s %-35s [1]: %s ..."
401  fmt2 = " %35s [%d]: %s ..."
402  print "\nfound a total of ", len(self.workFlows), ' workflows:'
403  if selected:
404  print " of which the following", len(selected), 'were selected:'
405  #-ap for now:
406  maxLen = -1 # for individual listing, no limit on width
407  fmt1 = "%-6s %-35s [1]: %s "
408  fmt2 = " %35s [%d]: %s"
409 
410  N=[]
411  for wf in self.workFlows:
412  if selected and float(wf.numId) not in selected: continue
413  if extended: print ''
414  #pad with zeros
415  for i in range(len(N),len(wf.cmds)): N.append(0)
416  N[len(wf.cmds)-1]+=1
417  wfName, stepNames = wf.nameId.split('+',1)
418  for i,s in enumerate(wf.cmds):
419  if extended:
420  if i==0:
421  print fmt1 % (wf.numId, stepNames, (str(s)+' ')[:maxLen])
422  else:
423  print fmt2 % ( ' ', i+1, (str(s)+' ')[:maxLen])
424  else:
425  print "%-6s %-35s "% (wf.numId, stepNames)
426  break
427  print ''
428  for i,n in enumerate(N):
429  if n: print n,'workflows with',i+1,'steps'
430 
431  return
def MatrixReader.MatrixReader.updateDB (   self)

Definition at line 488 of file MatrixReader.py.

References MatrixReader.MatrixReader.workFlows.

489  def updateDB(self):
490 
491  import pickle
492  pickle.dump(self.workFlows, open('theMatrix.pkl', 'w') )
493 
494  return
495 

Member Data Documentation

MatrixReader.MatrixReader.addCommand

Definition at line 24 of file MatrixReader.py.

Referenced by MatrixReader.MatrixReader.readMatrix().

MatrixReader.MatrixReader.apply

Definition at line 25 of file MatrixReader.py.

Referenced by heavyIonTools.ConfigureHeavyIons.__call__(), editorTools.UserCodeTool.__call__(), HiCoreTools.RestrictInputToAOD.__call__(), coreTools.RunOnData.__call__(), trackTools.MakeAODTrackCandidates.__call__(), runJetUncertainties.RunJetUncertainties.__call__(), metTools.AddMETCollection.__call__(), heavyIonTools.ProductionDefaults.__call__(), editorTools.ChangeSource.__call__(), HiCoreTools.RemoveMCMatching.__call__(), cmsswVersionTools.PickRelValInputFiles.__call__(), coreTools.RemoveMCMatching.__call__(), trackTools.MakePATTrackCandidates.__call__(), trigTools.SwitchOnTrigger.__call__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.__call__(), jetTools.AddJetCollection.__call__(), heavyIonTools.SelectionDefaults.__call__(), HiCoreTools.RemoveAllPATObjectsBut.__call__(), heavyIonTools.DisbaleMonteCarloDeps.__call__(), HiCoreTools.RemoveSpecificPATObjects.__call__(), trigTools.SwitchOnTriggerStandAlone.__call__(), trackTools.MakeTrackCandidates.__call__(), tauTools.AddTauCollection.__call__(), trigTools.SwitchOnTriggerMatching.__call__(), HiCoreTools.RemoveCleaning.__call__(), HiCoreTools.AddCleaning.__call__(), trigTools.SwitchOnTriggerMatchingStandAlone.__call__(), trigTools.SwitchOnTriggerMatchEmbedding.__call__(), jetTools.SwitchJetCollection.__call__(), jetTools.AddJetID.__call__(), jetTools.SetTagInfos.__call__(), and MatrixReader.MatrixReader.readMatrix().

MatrixReader.MatrixReader.commandLineWf

Definition at line 26 of file MatrixReader.py.

MatrixReader.MatrixReader.files

Definition at line 56 of file MatrixReader.py.

Referenced by chain.Chain._guessTreeName(), MatrixReader.MatrixReader.prepare(), and MatrixReader.MatrixReader.showRaw().

MatrixReader.MatrixReader.filesDefault

Definition at line 69 of file MatrixReader.py.

Referenced by MatrixReader.MatrixReader.prepare(), and MatrixReader.MatrixReader.showRaw().

MatrixReader.MatrixReader.filesPrefMap

Definition at line 42 of file MatrixReader.py.

Referenced by MatrixReader.MatrixReader.createWorkFlows(), and MatrixReader.MatrixReader.readMatrix().

MatrixReader.MatrixReader.nameList

Definition at line 40 of file MatrixReader.py.

Referenced by MatrixReader.MatrixReader.createWorkFlows().

MatrixReader.MatrixReader.noRun

Definition at line 29 of file MatrixReader.py.

Referenced by MatrixReader.MatrixReader.readMatrix().

MatrixReader.MatrixReader.overWrite

Definition at line 27 of file MatrixReader.py.

Referenced by MatrixReader.MatrixReader.readMatrix().

MatrixReader.MatrixReader.relvalModule

Definition at line 83 of file MatrixReader.py.

Referenced by MatrixReader.MatrixReader.readMatrix().

MatrixReader.MatrixReader.revertDqmio

maybe we want too level deep input

Definition at line 23 of file MatrixReader.py.

Referenced by MatrixReader.MatrixReader.readMatrix(), and MatrixReader.MatrixReader.showRaw().

MatrixReader.MatrixReader.what

Definition at line 34 of file MatrixReader.py.

Referenced by MatrixReader.MatrixReader.prepare(), and MatrixReader.MatrixReader.showRaw().

MatrixReader.MatrixReader.wm

Definition at line 22 of file MatrixReader.py.

Referenced by MatrixReader.MatrixReader.readMatrix().

MatrixReader.MatrixReader.workFlows

Definition at line 39 of file MatrixReader.py.

Referenced by MatrixRunner.MatrixRunner.runTests(), MatrixReader.MatrixReader.showWorkFlows(), and MatrixReader.MatrixReader.updateDB().

MatrixReader.MatrixReader.workFlowSteps

Definition at line 37 of file MatrixReader.py.

Referenced by MatrixReader.MatrixReader.createWorkFlows(), MatrixReader.MatrixReader.readMatrix(), and MatrixReader.MatrixReader.showRaw().