def runTtrigProd(self,run,runselection,trial,config,runStep=True): print "Processing tTrig production" #config.runselection = runselection datasetstr = getDatasetStr(config.datasetpath) config.userdircaf = 'DTCalibration/' + datasetstr + '/Run' + str(run) + '/TTrigCalibration/' + 'TimeBoxes' + '/' + 'v' + str(trial) task_dir = config.base_dir + '/TimeBoxes' dtTtrigProd = DTTTrigProd(run,task_dir,config) dtTtrigProd.writeCfg() if runStep: project_prod = dtTtrigProd.run() print "Sent calibration jobs with project",project_prod print "%.0f%% of jobs are required to finish" % config.jobsFinishedThreshold crabProd = CrabWatch(project_prod) crabProd.setThreshold(config.jobsFinishedThreshold) crabProd.start() crabProd.join() result_file = config.result_dir + '/DTTimeBoxes_%s.root'%run if config.stageOutLocal: output_dir = project_prod + "/res" haddLocal(output_dir,result_file) elif config.stageOutCAF: castor_dir = config.castorpath + "/" + config.userdircaf haddInCastor(castor_dir,result_file,'DTTimeBoxes','rfio://castorcms/','?svcClass=cmscafuser') return project_prod return None
def runVDriftMeanTimerCalib(self,run,runselection,trial,label,result_file,config,runStep=True): print "Processing vDrift calibration" #config.runselection = runselection datasetstr = getDatasetStr(config.datasetpath) config.userdircaf = 'DTCalibration/' + datasetstr + '/Run' + str(run) + '/VDriftCalibration/' + label + '/' + 'v' + str(trial) task_dir = config.base_dir + '/' + label dtVDriftMeanTimer = DTVDriftMeanTimerCalibration(run=run, dir=task_dir, config=config) dtVDriftMeanTimer.writeCfg() if runStep: project_meantimer = dtVDriftMeanTimer.run() print "Sent validation jobs with project",project_meantimer print "%.0f%% of jobs are required to finish" % config.jobsFinishedThreshold crabVDriftMeanTimer = CrabWatch(project_meantimer) crabVDriftMeanTimer.setThreshold(config.jobsFinishedThreshold) crabVDriftMeanTimer.start() crabVDriftMeanTimer.join() if config.stageOutLocal: output_dir = project_meantimer + "/res" haddLocal(output_dir,result_file,'DTTMaxHistos') elif config.stageOutCAF: castor_dir = config.castorpath + "/" + config.userdircaf haddInCastor(castor_dir,result_file,'DTTMaxHistos','rfio://castorcms/','?svcClass=cmscafuser') return project_meantimer return None
def runAnalysisResiduals(self,run,runselection,trial,label,result_file,config,runStep=True): print "Processing residuals analysis" datasetstr = getDatasetStr(config.datasetpath) config.userdircaf = 'DTCalibration/' + datasetstr + '/Run' + str(run) + '/AnalysisResiduals/' + label + '/' + 'v' + str(trial) task_dir = config.base_dir + '/' + label dtAnalysisResiduals = DTAnalysisResiduals(run=run, dir=task_dir, config=config) dtAnalysisResiduals.writeCfg() if runStep: project_analysisResiduals = dtAnalysisResiduals.run() print "Sent jobs with project",project_analysisResiduals print "%.0f%% of jobs are required to finish" % config.jobsFinishedThreshold crabAnalysisResiduals = CrabWatch(project_analysisResiduals) crabAnalysisResiduals.setThreshold(config.jobsFinishedThreshold) crabAnalysisResiduals.start() crabAnalysisResiduals.join() if config.stageOutLocal: output_dir = project_analysisResiduals + "/res" haddLocal(output_dir,result_file,'residuals') elif config.stageOutCAF: castor_dir = config.castorpath + "/" + config.userdircaf haddInCastor(castor_dir,result_file,'residuals','rfio://castorcms/','?svcClass=cmscafuser') return project_analysisResiduals return None
def runResidualCalib(self,run,runselection,trial,input_db,label,result_file,config,runStep=True): print "Processing tTrig calibration" #config.runselection = runselection datasetstr = getDatasetStr(config.datasetpath) config.userdircaf = 'DTCalibration/' + datasetstr + '/Run' + str(run) + '/TTrigCalibration/' + label + '/' + 'v' + str(trial) task_dir = config.base_dir + '/' + label dtResidualCalib = DTResidualCalibration(run=run, dir=task_dir, input_db=input_db, config=config) dtResidualCalib.writeCfg() if runStep: project_residualCalib = dtResidualCalib.run() print "Sent calibration jobs with project",project_residualCalib print "%.0f%% of jobs are required to finish" % config.jobsFinishedThreshold crabResidualCalib = CrabWatch(project_residualCalib) crabResidualCalib.setThreshold(config.jobsFinishedThreshold) crabResidualCalib.start() crabResidualCalib.join() if config.stageOutLocal: output_dir = project_residualCalib + "/res" haddLocal(output_dir,result_file,'residuals') elif config.stageOutCAF: castor_dir = config.castorpath + "/" + config.userdircaf haddInCastor(castor_dir,result_file,'residuals','rfio://castorcms/','?svcClass=cmscafuser') return project_residualCalib return None
def runNoiseWorkflow(self, mode, run, config, execute=True): print "Processing noise calibration" trial = config.trial runselection = config.runselection result_dir = config.result_dir result_file = os.path.abspath(result_dir + '/' + 'dtNoiseCalib_' + run + '.root') noise_db = os.path.abspath(result_dir + '/' + 'noise_' + run + '.db') noise_txt = os.path.abspath(result_dir + '/' + 'noise_' + run + '.txt') datasetstr = getDatasetStr(config.datasetpath) #config.userdircaf = 'DTCalibration/' + datasetstr + '/Run' + str(run) + '/NoiseCalibration/' + label + '/' + 'v' + str(trial) config.userdircaf = 'DTCalibration/' + datasetstr + '/Run' + str( run) + '/NoiseCalibration/' + 'v' + str(trial) task_dir = config.base_dir + '/NoiseCalib' dtNoiseCalibration = DTNoiseCalibration(run=run, dir=task_dir, config=config) if not execute: dtNoiseCalibration.writeCfg() sys.exit(0) else: dtNoiseCalibration.writeCfg() project_noise = dtNoiseCalibration.run() print "Sent calibration jobs with project", project_noise print "%.0f%% of jobs are required to finish" % config.jobsFinishedThreshold crabNoiseCalibration = CrabWatch(project_noise) crabNoiseCalibration.setThreshold(config.jobsFinishedThreshold) crabNoiseCalibration.start() crabNoiseCalibration.join() if config.stageOutLocal: crab_output_dir = project_noise + "/res" retcode = copyFilesLocal(crab_output_dir, result_dir, 'dtNoiseCalib') retcode = copyFilesLocal(crab_output_dir, result_dir, 'noise') elif config.stageOutCAF: castor_dir = config.castorpath + "/" + config.userdircaf retcode = copyFilesFromCastor(castor_dir, result_dir, 'dtNoiseCalib') retcode = copyFilesFromCastor(castor_dir, result_dir, 'noise') return 0
def runValidationWorkflow(self,mode,run,config,execute=True): print "Processing DQM validation" trial = config.trial runselection = config.runselection result_dir = config.result_dir datasetstr = getDatasetStr(config.datasetpath) dirLabel = 'DQM' config.userdircaf = 'DTCalibration/' + datasetstr + '/Run' + str(run) + '/DQMValidation/' + dirLabel + '/' + 'v' + str(trial) task_dir = config.base_dir + '/' + dirLabel dtDQMValid = DTDQMValidation(run=run, dir=task_dir, config=config) if not execute: dtDQMValid.writeCfg() self.runDQMMerge(run,'',config,False) self.runDQMHarvesting(run,'',config,False) sys.exit(0) else: dtDQMValid.writeCfg() project_valid = dtDQMValid.run() print "Sent validation jobs with project",project_valid print "%.0f%% of jobs are required to finish" % config.jobsFinishedThreshold crabValid = CrabWatch(project_valid) crabValid.setThreshold(config.jobsFinishedThreshold) crabValid.start() crabValid.join() # Produce DQM output dqm_output_dir = self.dqmOutputDir('DQMValidation',dirLabel,config) self.runDQMMerge(run,dqm_output_dir,config) # Run harvesting from merged DQM file dqm_merge_dir = os.path.abspath(result_dir) self.runDQMHarvesting(run,dqm_merge_dir,config) return 0
def runNoiseWorkflow(self,mode,run,config,execute=True): print "Processing noise calibration" trial = config.trial runselection = config.runselection result_dir = config.result_dir result_file = os.path.abspath(result_dir + '/' + 'dtNoiseCalib_' + run + '.root') noise_db = os.path.abspath(result_dir + '/' + 'noise_' + run + '.db') noise_txt = os.path.abspath(result_dir + '/' + 'noise_' + run + '.txt') datasetstr = getDatasetStr(config.datasetpath) #config.userdircaf = 'DTCalibration/' + datasetstr + '/Run' + str(run) + '/NoiseCalibration/' + label + '/' + 'v' + str(trial) config.userdircaf = 'DTCalibration/' + datasetstr + '/Run' + str(run) + '/NoiseCalibration/' + 'v' + str(trial) task_dir = config.base_dir + '/NoiseCalib' dtNoiseCalibration = DTNoiseCalibration(run=run, dir=task_dir, config=config) if not execute: dtNoiseCalibration.writeCfg() sys.exit(0) else: dtNoiseCalibration.writeCfg() project_noise = dtNoiseCalibration.run() print "Sent calibration jobs with project",project_noise print "%.0f%% of jobs are required to finish" % config.jobsFinishedThreshold crabNoiseCalibration = CrabWatch(project_noise) crabNoiseCalibration.setThreshold(config.jobsFinishedThreshold) crabNoiseCalibration.start() crabNoiseCalibration.join() if config.stageOutLocal: crab_output_dir = project_noise + "/res" retcode = copyFilesLocal(crab_output_dir,result_dir,'dtNoiseCalib') retcode = copyFilesLocal(crab_output_dir,result_dir,'noise') elif config.stageOutCAF: castor_dir = config.castorpath + "/" + config.userdircaf retcode = copyFilesFromCastor(castor_dir,result_dir,'dtNoiseCalib') retcode = copyFilesFromCastor(castor_dir,result_dir,'noise') return 0