CMS 3D CMS Logo

Public Member Functions | Public Attributes

DTCalibrationWorker::DTCalibrationWorker Class Reference

List of all members.

Public Member Functions

def __init__
def dqmOutputDir
def run
def runDBValidationWorkflow
 DB Validation workflow.
def runDQMClient
def runDQMHarvesting
def runDQMMerge
def runNoiseWorkflow
 noise workflow
def runResidualCalib
def runT0Workflow
 t0 workflow
def runTtrigProd
def runTtrigResidualCorr
def runTtrigValid
def runTtrigValidSummary
def runTtrigWorkflow
 tTrig workflow
def runTtrigWriter
def runValidationWorkflow
 Validation workflow.
def runVDriftMeanTimerCalib
def runVDriftMeanTimerWriter
def runVDriftSegmentCalib
def runVDriftSegmentWriter
def runVDriftWorkflow
 vDrift workflow

Public Attributes

 config
 refRun

Detailed Description

Definition at line 21 of file DTCalibrationWorker.py.


Constructor & Destructor Documentation

def DTCalibrationWorker::DTCalibrationWorker::__init__ (   self,
  run,
  config 
)

Definition at line 22 of file DTCalibrationWorker.py.

00023                                  :
00024         self.config = config
00025         self.refRun = run


Member Function Documentation

def DTCalibrationWorker::DTCalibrationWorker::dqmOutputDir (   self,
  type,
  dirLabel,
  config 
)

Definition at line 44 of file DTCalibrationWorker.py.

00045                                                :
00046         dqm_output_dir = ''
00047         if config.stageOutLocal:
00048             from crab_util import findLastWorkDir
00049             cwd = os.getcwd()
00050             crab_task_dir = config.base_dir + '/' + dirLabel
00051             os.chdir(crab_task_dir)
00052             crabdir = findLastWorkDir('crab_0_')
00053             if not crabdir: raise RuntimeError,'Could not find CRAB dir in %s' % crab_task_dir
00054             os.chdir(cwd)
00055             dqm_output_dir = crabdir + "/res"
00056         elif config.stageOutCAF:
00057             datasetstr = getDatasetStr(config.datasetpath)
00058             dqm_output_dir = config.castorpath + '/DTCalibration/' + datasetstr + '/Run' + str(run) + '/' + type + '/' + dirLabel + '/' + 'v' + str(trial)
00059 
00060         return dqm_output_dir

def DTCalibrationWorker::DTCalibrationWorker::run (   self,
  type,
  mode,
  execute 
)

Definition at line 26 of file DTCalibrationWorker.py.

00027                                    :
00028         config = None
00029         if self.config: config = self.config
00030         refRun = 1
00031         if self.refRun: refRun = self.refRun
00032 
00033         if   type == 'ttrig':        self.runTtrigWorkflow(mode,refRun,config,execute)
00034         elif type == 'vdrift':       self.runVDriftWorkflow(mode,refRun,config,execute)
00035         elif type == 'noise':        self.runNoiseWorkflow(mode,refRun,config,execute)
00036         elif type == 't0':           self.runT0Workflow(mode,refRun,config,execute)
00037         elif type == 'validation':   self.runValidationWorkflow(mode,refRun,config,execute)
00038         elif type == 'dbvalidation':
00039             inputFiles = []
00040             if config.dbFiles: inputFiles = config.dbFiles
00041             self.runDBValidationWorkflow(mode,refRun,inputFiles,config,execute)
00042 
00043         return 0

def DTCalibrationWorker::DTCalibrationWorker::runDBValidationWorkflow (   self,
  mode,
  run,
  inputFiles,
  config,
  execute = True 
)

DB Validation workflow.

Definition at line 675 of file DTCalibrationWorker.py.

00676                                                                              :
00677         print "Processing DB validation"
00678 
00679         dtDBValidation = None
00680         if mode == 't0DB':
00681             dtDBValidation = DTT0DBValidation(run=run,
00682                                               dir=config.run_dir,
00683                                               input_files=inputFiles,
00684                                               output_dir=config.result_dir,
00685                                               config=config)
00686             #dtDBValidation.writeCfg()
00687 
00688         if execute:
00689             dtDBValidation.run()
00690 
00691             print "Finished processing:"
00692             for pset in dtDBValidation.configs: print "--->",pset
00693 
00694         return 0
def DTCalibrationWorker::DTCalibrationWorker::runDQMClient (   self,
  run,
  output_dir,
  config,
  runStep = True 
)

Definition at line 311 of file DTCalibrationWorker.py.

00312                                                              :
00313 
00314         print "Processing DQM Merge"
00315 
00316         if runStep:
00317             dqm_files = [] 
00318             if config.stageOutLocal:
00319                 dqm_files = listFilesLocal(output_dir,'DQM')
00320                 dqm_files = ['file:%s' % item for item in dqm_files]
00321                 dtDqmFinal = DTDqm(run,config.run_dir,dqm_files,config.result_dir,config)
00322                 dtDqmFinal.writeCfg()
00323                 dtDqmFinal.run()
00324             elif config.stageOutCAF:
00325                 dqm_files = listFilesInCastor(output_dir,'DQM','')
00326                 dqm_files = [file.replace('/castor/cern.ch/cms','') for file in dqm_files] 
00327                 dtDqmFinal = DTDqm(run,config.run_dir,dqm_files,config.result_dir,config)
00328                 dtDqmFinal.writeCfg()
00329                 dtDqmFinal.run()
00330 
00331             print "...DQM Merge finished"
00332         else:
00333             dqm_files = [] 
00334             dtDqmFinal = DTDqm(run,config.run_dir,dqm_files,config.result_dir,config)
00335             dtDqmFinal.writeCfg()

def DTCalibrationWorker::DTCalibrationWorker::runDQMHarvesting (   self,
  run,
  output_dir,
  config,
  runStep = True 
)

Definition at line 336 of file DTCalibrationWorker.py.

00337                                                                  :
00338 
00339         print "Processing DQM harvesting"
00340 
00341         if runStep:
00342             dqm_files = [] 
00343             if config.stageOutLocal:
00344                 dqm_files = listFilesLocal(output_dir,'DQM')
00345                 dqm_files = ['file:%s' % item for item in dqm_files]
00346                 dtDqmFinal = DTDQMHarvesting(run,config.run_dir,dqm_files,config.result_dir,config)
00347                 dtDqmFinal.writeCfg()
00348                 dtDqmFinal.run()
00349             elif config.stageOutCAF:
00350                 dqm_files = listFilesInCastor(output_dir,'DQM','')
00351                 dqm_files = [file.replace('/castor/cern.ch/cms','') for file in dqm_files] 
00352                 dtDqmFinal = DTDQMHarvesting(run,config.run_dir,dqm_files,config.result_dir,config)
00353                 dtDqmFinal.writeCfg()
00354                 dtDqmFinal.run()
00355 
00356             print "...DQM harvesting finished"
00357         else:
00358             dqm_files = [] 
00359             dtDqmFinal = DTDQMHarvesting(run,config.run_dir,dqm_files,config.result_dir,config)
00360             dtDqmFinal.writeCfg()

def DTCalibrationWorker::DTCalibrationWorker::runDQMMerge (   self,
  run,
  output_dir,
  config,
  runStep = True 
)

Definition at line 361 of file DTCalibrationWorker.py.

00362                                                             :
00363 
00364         print "Processing DQM merge"
00365 
00366         if runStep:
00367             dqm_files = [] 
00368             if config.stageOutLocal:
00369                 dqm_files = listFilesLocal(output_dir,'DQM')
00370                 dqm_files = ['file:%s' % item for item in dqm_files]
00371                 dtDQMMerge = DTDQMMerge(run,config.run_dir,dqm_files,config.result_dir,config)
00372                 dtDQMMerge.writeCfg()
00373                 dtDQMMerge.run()
00374             elif config.stageOutCAF:
00375                 dqm_files = listFilesInCastor(output_dir,'DQM','')
00376                 dqm_files = [file.replace('/castor/cern.ch/cms','') for file in dqm_files] 
00377                 dtDQMMerge = DTDQMMerge(run,config.run_dir,dqm_files,config.result_dir,config)
00378                 dtDQMMerge.writeCfg()
00379                 dtDQMMerge.run()
00380 
00381             print "...DQM merge finished"
00382         else:
00383             dqm_files = [] 
00384             dtDQMMerge = DTDQMMerge(run,config.run_dir,dqm_files,config.result_dir,config)
00385             dtDQMMerge.writeCfg()

def DTCalibrationWorker::DTCalibrationWorker::runNoiseWorkflow (   self,
  mode,
  run,
  config,
  execute = True 
)

noise workflow

Definition at line 579 of file DTCalibrationWorker.py.

00580                                                            :
00581         print "Processing noise calibration"
00582 
00583         trial = config.trial
00584         runselection = config.runselection
00585         result_dir = config.result_dir
00586         result_file = os.path.abspath(result_dir + '/' + 'dtNoiseCalib_' + run + '.root')
00587         noise_db = os.path.abspath(result_dir + '/' + 'noise_' + run + '.db')
00588         noise_txt = os.path.abspath(result_dir + '/' + 'noise_' + run + '.txt')
00589        
00590         datasetstr = getDatasetStr(config.datasetpath)
00591         config.userdircaf = 'DTCalibration/' + datasetstr + '/Run' + str(run) + '/NoiseCalibration/' + label + '/' + 'v' + str(trial)
00592 
00593         task_dir = config.base_dir + '/NoiseCalib'
00594         dtNoiseCalibration = DTNoiseCalibration(run=run,
00595                                                 dir=task_dir,
00596                                                 config=config)
00597         if not execute:
00598             dtNoiseCalibration.writeCfg()
00599             sys.exit(0)
00600         else:
00601             dtNoiseCalibration.writeCfg()
00602             project_noise = dtNoiseCalibration.run()
00603 
00604             print "Sent calibration jobs with project",project_noise
00605             print "%.0f%% of jobs are required to finish" % config.jobsFinishedThreshold
00606 
00607             crabNoiseCalibration = CrabWatch(project_noise)
00608             crabNoiseCalibration.setThreshold(config.jobsFinishedThreshold)
00609             crabNoiseCalibration.start()
00610             crabNoiseCalibration.join()     
00611 
00612             if config.stageOutLocal:
00613                 crab_output_dir = project_noise + "/res"
00614                 retcode = copyFilesLocal(crab_output_dir,result_dir,'dtNoiseCalib')
00615                 retcode = copyFilesLocal(crab_output_dir,result_dir,'noise')
00616             elif config.stageOutCAF:
00617                 castor_dir = config.castorpath + "/" + config.userdircaf
00618                 retcode = copyFilesFromCastor(castor_dir,result_dir,'dtNoiseCalib')
00619                 retcode = copyFilesFromCastor(castor_dir,result_dir,'noise')
00620 
00621         return 0

def DTCalibrationWorker::DTCalibrationWorker::runResidualCalib (   self,
  run,
  runselection,
  trial,
  input_db,
  label,
  result_file,
  config,
  runStep = True 
)

Definition at line 107 of file DTCalibrationWorker.py.

00108                                                                                                     :
00109 
00110         print "Processing tTrig calibration"
00111         #config.runselection = runselection
00112         datasetstr = getDatasetStr(config.datasetpath)
00113         config.userdircaf = 'DTCalibration/' + datasetstr + '/Run' + str(run) + '/TTrigCalibration/' + label + '/' + 'v' + str(trial)
00114         
00115         task_dir = config.base_dir + '/' + label
00116         dtResidualCalib = DTResidualCalibration(run=run,
00117                                                 dir=task_dir,
00118                                                 input_db=input_db,
00119                                                 config=config) 
00120         dtResidualCalib.writeCfg()
00121 
00122         if runStep:
00123             project_residualCalib = dtResidualCalib.run()
00124 
00125             print "Sent calibration jobs with project",project_residualCalib
00126             print "%.0f%% of jobs are required to finish" % config.jobsFinishedThreshold
00127 
00128             crabResidualCalib = CrabWatch(project_residualCalib)
00129             crabResidualCalib.setThreshold(config.jobsFinishedThreshold)
00130             crabResidualCalib.start()
00131             crabResidualCalib.join()
00132 
00133             if config.stageOutLocal:
00134                 output_dir = project_residualCalib + "/res"
00135                 haddLocal(output_dir,result_file,'residuals')
00136             elif config.stageOutCAF:
00137                 castor_dir = config.castorpath + "/" + config.userdircaf
00138                 haddInCastor(castor_dir,result_file,'residuals','rfio://castorcms/','?svcClass=cmscafuser')
00139 
00140             return project_residualCalib
00141 
00142         return None

def DTCalibrationWorker::DTCalibrationWorker::runT0Workflow (   self,
  mode,
  run,
  config,
  execute = True 
)

t0 workflow

Definition at line 625 of file DTCalibrationWorker.py.

00626                                                         :
00627 
00628         return 0

def DTCalibrationWorker::DTCalibrationWorker::runTtrigProd (   self,
  run,
  runselection,
  trial,
  config,
  runStep = True 
)

Definition at line 61 of file DTCalibrationWorker.py.

00062                                                                      :
00063 
00064         print "Processing tTrig production"
00065         #config.runselection = runselection
00066         datasetstr = getDatasetStr(config.datasetpath)
00067         config.userdircaf = 'DTCalibration/' + datasetstr + '/Run' + str(run) + '/TTrigCalibration/' + 'TimeBoxes' + '/' + 'v' + str(trial)
00068        
00069         task_dir = config.base_dir + '/TimeBoxes'
00070         dtTtrigProd = DTTTrigProd(run,task_dir,config) 
00071         dtTtrigProd.writeCfg()
00072         
00073         if runStep:
00074             project_prod = dtTtrigProd.run()
00075 
00076             print "Sent calibration jobs with project",project_prod
00077             print "%.0f%% of jobs are required to finish" % config.jobsFinishedThreshold
00078           
00079             crabProd = CrabWatch(project_prod)
00080             crabProd.setThreshold(config.jobsFinishedThreshold)
00081             crabProd.start()
00082             crabProd.join()
00083 
00084             result_file = config.result_dir + '/DTTimeBoxes_%s.root'%run
00085             if config.stageOutLocal:
00086                 output_dir = project_prod + "/res"
00087                 haddLocal(output_dir,result_file) 
00088             elif config.stageOutCAF:
00089                 castor_dir = config.castorpath + "/" + config.userdircaf
00090                 haddInCastor(castor_dir,result_file,'DTTimeBoxes','rfio://castorcms/','?svcClass=cmscafuser')
00091 
00092             return project_prod
00093 
00094         return None

def DTCalibrationWorker::DTCalibrationWorker::runTtrigResidualCorr (   self,
  run,
  input_db,
  root_file,
  config,
  runStep = True 
)

Definition at line 143 of file DTCalibrationWorker.py.

00144                                                                              :
00145 
00146         print "Processing tTrig residual correction"
00147         dtTtrigResidualCorr = DTTTrigResidualCorr(run=run,
00148                                                   dir=config.run_dir,
00149                                                   input_db=input_db,
00150                                                   residuals=root_file,
00151                                                   result_dir=config.result_dir,
00152                                                   config=config)
00153         dtTtrigResidualCorr.writeCfg()
00154 
00155         if runStep:  
00156             dtTtrigResidualCorr.run()
00157 
00158             print "Finished processing:"
00159             for pset in dtTtrigResidualCorr.configs: print "--->",pset

def DTCalibrationWorker::DTCalibrationWorker::runTtrigValid (   self,
  run,
  runselection,
  trial,
  input_db,
  label,
  config,
  runStep = True 
)

Definition at line 160 of file DTCalibrationWorker.py.

00161                                                                                      :
00162 
00163         print "Processing tTrig validation"
00164         #config.runselection = runselection
00165         datasetstr = getDatasetStr(config.datasetpath)
00166         config.userdircaf = 'DTCalibration/' + datasetstr + '/Run' + str(run) + '/TTrigValidation/' + label + '/' + 'v' + str(trial)
00167 
00168         task_dir = config.base_dir + '/' + label
00169         dtTtrigValid = DTTTrigValid(run=run,
00170                                     dir=task_dir,
00171                                     input_db=input_db,
00172                                     config=config)
00173         dtTtrigValid.writeCfg()
00174 
00175         if runStep:
00176             project_valid = dtTtrigValid.run()
00177 
00178             print "Sent validation jobs with project",project_valid
00179             print "%.0f%% of jobs are required to finish" % config.jobsFinishedThreshold
00180 
00181             crabValid = CrabWatch(project_valid)
00182             crabValid.setThreshold(config.jobsFinishedThreshold)
00183             crabValid.start()
00184             crabValid.join()
00185 
00186             """  
00187             if config.stageOutLocal:
00188                 output_dir = project_valid + "/res"
00189                 haddLocal(output_dir,result_file,'residuals')
00190             elif config.stageOutCAF:
00191                 castor_dir = config.castorpath + "/" + config.userdircaf
00192                 haddInCastor(castor_dir,result_file,'residuals','rfio://castorcms/','?svcClass=cmscafuser')
00193             """
00194 
00195             return project_valid
00196 
00197         return None

def DTCalibrationWorker::DTCalibrationWorker::runTtrigValidSummary (   self,
  run,
  input_file,
  output_file,
  config,
  runStep = True 
)

Definition at line 198 of file DTCalibrationWorker.py.

00199                                                                                  :
00200 
00201         print "Processing Validation Summary"
00202         dtTtrigValidSummary = DTValidSummary(run,config.run_dir,input_file,output_file,config)
00203         dtTtrigValidSummary.writeCfg()
00204 
00205         if runStep:
00206             dtTtrigValidSummary.run()
00207      
00208             print "...Validation Summary finished"

def DTCalibrationWorker::DTCalibrationWorker::runTtrigWorkflow (   self,
  mode,
  run,
  config,
  execute = True 
)

tTrig workflow

Definition at line 389 of file DTCalibrationWorker.py.

00390                                                            :
00391         trial = config.trial
00392         runselection = config.runselection
00393         ttrig_input_db = None
00394         if hasattr(config,'inputTTrigDB') and config.inputTTrigDB: ttrig_input_db = os.path.abspath(config.inputTTrigDB)
00395         result_dir = config.result_dir
00396         if mode == 'timeboxes':
00397             timeBoxes = os.path.abspath(result_dir + '/' + 'DTTimeBoxes_' + run + '.root')
00398             ttrig_timeboxes_db = os.path.abspath(result_dir + '/' + 'ttrig_timeboxes_' + run + '.db')
00399             residualsFirst = os.path.abspath(result_dir + '/' + 'DTResidualValidation_' + run + '.root')
00400             ttrig_residuals_db = os.path.abspath(result_dir + '/' + 'ttrig_residuals_' + run + '.db')
00401             residualsResidCorr = os.path.abspath(result_dir + '/' + 'DTResidualValidation_ResidCorr_' + run + '.root')
00402             summaryResiduals = os.path.abspath(result_dir + '/' + 'SummaryResiduals_' + run + '.root') 
00403 
00404             if not execute:
00405                 print "Writing configuration files.."
00406                 self.runTtrigProd(run,runselection,trial,config,False)
00407                 self.runTtrigWriter(run,config,False)
00408                 self.runResidualCalib(run,runselection,trial,ttrig_timeboxes_db,'Residuals',residualsFirst,config,False)
00409                 self.runTtrigResidualCorr(run,ttrig_timeboxes_db,residualsFirst,config,False)                
00410                 self.runTtrigValid(run,runselection,trial,ttrig_residuals_db,'ResidualsResidCorr',config,False)
00411                 #self.runTtrigValidSummary(run,residualsResidCorr,summaryResiduals,config,False)
00412                 self.runDQMClient(run,'',config,False)
00413 
00414                 sys.exit(0)
00415 
00416             # Produce time-boxes
00417             if not os.path.exists(timeBoxes): self.runTtrigProd(run,runselection,trial,config)
00418             if not os.path.exists(timeBoxes): raise RuntimeError,'Could not produce %s' % timeBoxes
00419 
00420             # Write tTrig DB
00421             if not os.path.exists(ttrig_timeboxes_db): self.runTtrigWriter(run,config)
00422             if not os.path.exists(ttrig_timeboxes_db): raise RuntimeError,'Could not produce %s' % ttrig_timeboxes_db
00423 
00424             # Produce residuals
00425             if not os.path.exists(residualsFirst):
00426                 self.runResidualCalib(run,runselection,trial,ttrig_timeboxes_db,'Residuals',residualsFirst,config)
00427             if not os.path.exists(residualsFirst): raise RuntimeError,'Could not produce %s' % residualsFirst
00428 
00429             # Correction from residuals and write tTrig DB
00430             if not os.path.exists(ttrig_residuals_db): self.runTtrigResidualCorr(run,ttrig_timeboxes_db,residualsFirst,config)
00431             if not os.path.exists(ttrig_residuals_db): raise RuntimeError,'Could not produce %s' % ttrig_residuals_db
00432 
00433             # Validation
00434             self.runTtrigValid(run,runselection,trial,ttrig_residuals_db,'ResidualsResidCorr',config)
00435 
00436             """
00437             # Summary of validation
00438             if not os.path.exists(summaryResiduals): self.runTtrigValidSummary(run,residualsResidCorr,summaryResiduals,config)
00439             if not os.path.exists(summaryResiduals): raise RuntimeError,'Could not produce %s' % summaryResiduals
00440             """
00441             # Produce DQM output 
00442             dqm_output_dir = self.dqmOutputDir('TTrigValidation','ResidualsResidCorr',config)
00443             self.runDQMClient(run,dqm_output_dir,config)
00444 
00445         elif mode == 'residuals':
00446             residualsFirst = os.path.abspath(result_dir + '/' + 'DTResidualValidation_' + run + '.root')
00447             ttrig_residuals_db = os.path.abspath(result_dir + '/' + 'ttrig_residuals_' + run + '.db')
00448             residualsResidCorr = os.path.abspath(result_dir + '/' + 'DTResidualValidation_ResidCorr_' + run + '.root')
00449             summaryResiduals = os.path.abspath(result_dir + '/' + 'SummaryResiduals_' + run + '.root')
00450 
00451             if not execute:
00452                 print "Writing configuration files.."
00453                 if ttrig_input_db:
00454                     self.runResidualCalib(run,runselection,trial,ttrig_input_db,'Residuals',residualsFirst,config,False)
00455                     self.runTtrigResidualCorr(run,ttrig_input_db,residualsFirst,config,False)
00456                 else:
00457                     self.runResidualCalib(run,runselection,trial,None,'Residuals',residualsFirst,config,False)
00458                     self.runTtrigResidualCorr(run,None,residualsFirst,config,False)
00459 
00460                 self.runTtrigValid(run,runselection,trial,ttrig_residuals_db,'ResidualsResidCorr',config,False)
00461                 #self.runTtrigValidSummary(run,residualsResidCorr,summaryResiduals,config,False)
00462                 self.runDQMClient(run,'',config,False)
00463 
00464                 sys.exit(0)
00465 
00466             # Produce residuals
00467             if not os.path.exists(residualsFirst):
00468                 if ttrig_input_db:
00469                     self.runResidualCalib(run,runselection,trial,ttrig_input_db,'Residuals',residualsFirst,config) 
00470                 else:
00471                     self.runResidualCalib(run,runselection,trial,None,'Residuals',residualsFirst,config)
00472             if not os.path.exists(residualsFirst): raise RuntimeError,'Could not produce %s' % residualsFirst
00473 
00474             # Correction from residuals and write tTrig DB
00475             if not os.path.exists(ttrig_residuals_db):
00476                 if ttrig_input_db: self.runTtrigResidualCorr(run,ttrig_input_db,residualsFirst,config)
00477                 else: self.runTtrigResidualCorr(run,None,residualsFirst,config)
00478             if not os.path.exists(ttrig_residuals_db): raise RuntimeError,'Could not produce %s' % ttrig_residuals_db
00479 
00480             # Validation
00481             self.runTtrigValid(run,runselection,trial,ttrig_residuals_db,'ResidualsResidCorr',config)
00482 
00483             """  
00484             # Summary of validation
00485             if not os.path.exists(summaryResiduals):
00486                 self.runTtrigValidSummary(run,residualsResidCorr,summaryResiduals,config)
00487             if not os.path.exists(summaryResiduals): raise RuntimeError,'Could not produce %s' % summaryResiduals
00488             """
00489             # Produce DQM output 
00490             dqm_output_dir = self.dqmOutputDir('TTrigValidation','ResidualsResidCorr',config)
00491             self.runDQMClient(run,dqm_output_dir,config)
00492 
00493         elif mode == 'validation':
00494             residualsValid = os.path.abspath(result_dir + '/' + 'DTResidualValidation_' + run + '.root')
00495             summaryResiduals = os.path.abspath(result_dir + '/' + 'SummaryResiduals_' + run + '.root')
00496 
00497             if not execute:
00498                 print "Writing configuration files.."
00499                 if ttrig_input_db:
00500                     self.runTtrigValid(run,runselection,trial,ttrig_input_db,'Residuals',config,False)
00501                 else:
00502                     self.runTtrigValid(run,runselection,trial,None,'Residuals',config,False)
00503 
00504                 #self.runTtrigValidSummary(run,residualsValid,summaryResiduals,config,False)
00505                 self.runDQMClient(run,'',config,False)
00506 
00507                 sys.exit(0)
00508 
00509             # Validation
00510             if ttrig_input_db:
00511                 self.runTtrigValid(run,runselection,trial,ttrig_input_db,'Residuals',config)
00512             else:
00513                 self.runTtrigValid(run,runselection,trial,None,'Residuals',config)
00514 
00515             """
00516             # Summary of validation
00517             if not os.path.exists(summaryResiduals):
00518                 self.runTtrigValidSummary(run,residualsValid,summaryResiduals,config)
00519             if not os.path.exists(summaryResiduals): raise RuntimeError,'Could not produce %s' % summaryResiduals
00520             """
00521 
00522             # Produce DQM output 
00523             dqm_output_dir = self.dqmOutputDir('TTrigValidation','Residuals',config)
00524             self.runDQMClient(run,dqm_output_dir,config)
00525 
00526         return 0

def DTCalibrationWorker::DTCalibrationWorker::runTtrigWriter (   self,
  run,
  config,
  runStep = True 
)

Definition at line 95 of file DTCalibrationWorker.py.

00096                                                     :
00097 
00098         print "Processing tTrig correction"
00099         dtTtrigWriter = DTTTrigTimeBoxesWriter(run,config.run_dir,config.result_dir,config)
00100         dtTtrigWriter.writeCfg()
00101      
00102         if runStep:  
00103             dtTtrigWriter.run()
00104 
00105             print "Finished processing:"
00106             for pset in dtTtrigWriter.configs: print "--->",pset

def DTCalibrationWorker::DTCalibrationWorker::runValidationWorkflow (   self,
  mode,
  run,
  config,
  execute = True 
)

Validation workflow.

Definition at line 632 of file DTCalibrationWorker.py.

00633                                                                 :
00634         print "Processing DQM validation"
00635         trial = config.trial
00636         runselection = config.runselection
00637         result_dir = config.result_dir
00638         datasetstr = getDatasetStr(config.datasetpath)
00639         dirLabel = 'DQM'
00640         config.userdircaf = 'DTCalibration/' + datasetstr + '/Run' + str(run) + '/DQMValidation/' + dirLabel + '/' + 'v' + str(trial)
00641 
00642         task_dir = config.base_dir + '/' + dirLabel
00643         dtDQMValid = DTDQMValidation(run=run,
00644                                      dir=task_dir,
00645                                      config=config)
00646         if not execute:
00647             dtDQMValid.writeCfg()
00648             self.runDQMMerge(run,'',config,False)
00649             self.runDQMHarvesting(run,'',config,False)
00650 
00651             sys.exit(0)
00652         else:
00653             dtDQMValid.writeCfg()
00654             project_valid = dtDQMValid.run()
00655 
00656             print "Sent validation jobs with project",project_valid
00657             print "%.0f%% of jobs are required to finish" % config.jobsFinishedThreshold
00658 
00659             crabValid = CrabWatch(project_valid)
00660             crabValid.setThreshold(config.jobsFinishedThreshold)
00661             crabValid.start()
00662             crabValid.join()
00663 
00664             # Produce DQM output 
00665             dqm_output_dir = self.dqmOutputDir('DQMValidation',dirLabel,config)
00666             self.runDQMMerge(run,dqm_output_dir,config)
00667             # Run harvesting from merged DQM file 
00668             dqm_merge_dir = os.path.abspath(result_dir)
00669             self.runDQMHarvesting(run,dqm_merge_dir,config)
00670 
00671         return 0

def DTCalibrationWorker::DTCalibrationWorker::runVDriftMeanTimerCalib (   self,
  run,
  runselection,
  trial,
  label,
  result_file,
  config,
  runStep = True 
)

Definition at line 260 of file DTCalibrationWorker.py.

00261                                                                                                   :
00262 
00263         print "Processing vDrift calibration"
00264         #config.runselection = runselection
00265         datasetstr = getDatasetStr(config.datasetpath)
00266         config.userdircaf = 'DTCalibration/' + datasetstr + '/Run' + str(run) + '/VDriftCalibration/' + label + '/' + 'v' + str(trial)
00267 
00268         task_dir = config.base_dir + '/' + label
00269         dtVDriftMeanTimer = DTVDriftMeanTimerCalibration(run=run,
00270                                                          dir=task_dir,
00271                                                          config=config)
00272         dtVDriftMeanTimer.writeCfg()
00273 
00274         if runStep:
00275             project_meantimer = dtVDriftMeanTimer.run()
00276 
00277             print "Sent validation jobs with project",project_meantimer
00278             print "%.0f%% of jobs are required to finish" % config.jobsFinishedThreshold
00279 
00280             crabVDriftMeanTimer = CrabWatch(project_meantimer)
00281             crabVDriftMeanTimer.setThreshold(config.jobsFinishedThreshold)
00282             crabVDriftMeanTimer.start()
00283             crabVDriftMeanTimer.join()
00284 
00285             if config.stageOutLocal:
00286                 output_dir = project_meantimer + "/res"
00287                 haddLocal(output_dir,result_file,'DTTMaxHistos')
00288             elif config.stageOutCAF:
00289                 castor_dir = config.castorpath + "/" + config.userdircaf
00290                 haddInCastor(castor_dir,result_file,'DTTMaxHistos','rfio://castorcms/','?svcClass=cmscafuser')
00291 
00292             return project_meantimer
00293 
00294         return None

def DTCalibrationWorker::DTCalibrationWorker::runVDriftMeanTimerWriter (   self,
  run,
  root_file,
  config,
  runStep = True 
)

Definition at line 295 of file DTCalibrationWorker.py.

00296                                                                         :
00297 
00298         print "Processing vDrift writer"
00299         dtVDriftMeanTimerWriter = DTVDriftMeanTimerWriter(run=run,
00300                                                       dir=config.run_dir,
00301                                                       input_file=root_file,
00302                                                       output_dir=config.result_dir,
00303                                                       config=config)
00304         dtVDriftMeanTimerWriter.writeCfg()
00305 
00306         if runStep:
00307             dtVDriftMeanTimerWriter.run()
00308 
00309             print "Finished processing:"
00310             for pset in dtVDriftMeanTimerWriter.configs: print "--->",pset

def DTCalibrationWorker::DTCalibrationWorker::runVDriftSegmentCalib (   self,
  run,
  runselection,
  trial,
  label,
  result_file,
  config,
  runStep = True 
)

Definition at line 209 of file DTCalibrationWorker.py.

00210                                                                                                 :
00211 
00212         print "Processing vDrift calibration"
00213         #config.runselection = runselection
00214         datasetstr = getDatasetStr(config.datasetpath)
00215         config.userdircaf = 'DTCalibration/' + datasetstr + '/Run' + str(run) + '/VDriftCalibration/' + label + '/' + 'v' + str(trial)
00216 
00217         task_dir = config.base_dir + '/' + label
00218         dtVDriftSegment = DTVDriftSegmentCalibration(run=run,
00219                                                      dir=task_dir,
00220                                                      config=config)
00221         dtVDriftSegment.writeCfg()
00222 
00223         if runStep:
00224             project_segment = dtVDriftSegment.run()
00225 
00226             print "Sent validation jobs with project",project_segment
00227             print "%.0f%% of jobs are required to finish" % config.jobsFinishedThreshold
00228 
00229             crabVDriftSegment = CrabWatch(project_segment)
00230             crabVDriftSegment.setThreshold(config.jobsFinishedThreshold)
00231             crabVDriftSegment.start()
00232             crabVDriftSegment.join()
00233 
00234             if config.stageOutLocal:
00235                 output_dir = project_segment + "/res"
00236                 haddLocal(output_dir,result_file,'DTVDriftHistos')
00237             elif config.stageOutCAF:
00238                 castor_dir = config.castorpath + "/" + config.userdircaf
00239                 haddInCastor(castor_dir,result_file,'DTVDriftHistos','rfio://castorcms/','?svcClass=cmscafuser')
00240 
00241             return project_segment
00242 
00243         return None

def DTCalibrationWorker::DTCalibrationWorker::runVDriftSegmentWriter (   self,
  run,
  root_file,
  config,
  runStep = True 
)

Definition at line 244 of file DTCalibrationWorker.py.

00245                                                                       :
00246 
00247         print "Processing vDrift writer"
00248         dtVDriftSegmentWriter = DTVDriftSegmentWriter(run=run,
00249                                                       dir=config.run_dir,
00250                                                       input_file=root_file,
00251                                                       output_dir=config.result_dir,
00252                                                       config=config)
00253         dtVDriftSegmentWriter.writeCfg()
00254 
00255         if runStep:
00256             dtVDriftSegmentWriter.run()
00257 
00258             print "Finished processing:"
00259             for pset in dtVDriftSegmentWriter.configs: print "--->",pset

def DTCalibrationWorker::DTCalibrationWorker::runVDriftWorkflow (   self,
  mode,
  run,
  config,
  execute = True 
)

vDrift workflow

Definition at line 530 of file DTCalibrationWorker.py.

00531                                                             :
00532         trial = config.trial
00533         runselection = config.runselection
00534         result_dir = config.result_dir
00535         if mode == 'segment':
00536             vDriftHistos = os.path.abspath(result_dir + '/' + 'DTVDriftHistos_' + run + '.root')
00537             vDrift_segment_db = os.path.abspath(result_dir + '/' + 'vDrift_segment_' + run + '.db')
00538 
00539             if not execute:
00540                 print "Writing configuration files.."
00541                 self.runVDriftSegmentCalib(run,runselection,trial,'VDriftHistos',vDriftHistos,config,False)
00542                 self.runVDriftSegmentWriter(run,vDriftHistos,config,False)
00543          
00544                 sys.exit(0)
00545 
00546             # Produce vDrift histos
00547             if not os.path.exists(vDriftHistos):
00548                 self.runVDriftSegmentCalib(run,runselection,trial,'VDriftHistos',vDriftHistos,config)
00549             if not os.path.exists(vDriftHistos): raise RuntimeError,'Could not produce %s' % vDriftHistos
00550 
00551             # Write vDrift DB
00552             if not os.path.exists(vDrift_segment_db): self.runVDriftSegmentWriter(run,vDriftHistos,config)
00553             if not os.path.exists(vDrift_segment_db): raise RuntimeError,'Could not produce %s' % vDrift_segment_db
00554 
00555         elif mode == 'meantimer':
00556             vDriftTMaxHistos = os.path.abspath(result_dir + '/' + 'DTTMaxHistos_' + run + '.root')
00557             vDrift_meantimer_db = os.path.abspath(result_dir + '/' + 'vDrift_meantimer_' + run + '.db')
00558 
00559             if not execute:
00560                 print "Writing configuration files.."
00561                 self.runVDriftMeanTimerCalib(run,runselection,trial,'VDriftTMaxHistos',vDriftTMaxHistos,config,False)
00562                 self.runVDriftMeanTimerWriter(run,vDriftTMaxHistos,config,False)
00563 
00564                 sys.exit(0)
00565 
00566             # Produce t_max histos
00567             if not os.path.exists(vDriftTMaxHistos):
00568                 self.runVDriftMeanTimerCalib(run,runselection,trial,'VDriftTMaxHistos',vDriftTMaxHistos,config)
00569             if not os.path.exists(vDriftTMaxHistos): raise RuntimeError,'Could not produce %s' % vDriftTMaxHistos
00570 
00571             # Write vDrift DB
00572             if not os.path.exists(vDrift_meantimer_db): self.runVDriftMeanTimerWriter(run,vDriftTMaxHistos,config)
00573             if not os.path.exists(vDrift_meantimer_db): raise RuntimeError,'Could not produce %s' % vDrift_meantimer_db
00574 
00575         return 0        


Member Data Documentation

Definition at line 22 of file DTCalibrationWorker.py.

Definition at line 22 of file DTCalibrationWorker.py.