test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DTDqm.py
Go to the documentation of this file.
1 from tools import loadCmsProcess,writeCfg,dqmWorkflowName
2 from CmsswTask import *
3 import os
4 
5 class DTDqm:
6  def __init__(self, run, dir, dqm_files, result_dir, config=None):
7  self.runnumber = int(run)
8  self.dir = dir
9  self.result_dir = result_dir
10  self.config = config
11  self.dqm_files = dqm_files
12 
13  self.pset_name = 'dtDQMClient_cfg.py'
14  self.pset_template = 'CalibMuon.DTCalibration.dtDQMClient_cfg'
15 
16  self.process = None
17  self.initProcess()
18  self.configFiles = []
19  self.configFiles.append(self.pset_name)
20  self.task = CmsswTask(self.dir,self.configFiles)
21 
22  def initProcess(self):
24  self.process.source.fileNames = self.dqm_files
25  self.process.dqmSaver.dirName = os.path.abspath(self.result_dir)
26  if self.config:
27  label = 'dtCalibration'
28  if hasattr(self.config,'label') and self.config.label: label = self.config.label
29  workflowName = dqmWorkflowName(self.config.datasetpath,label,self.config.trial)
30  self.process.dqmSaver.workflow = workflowName
31  if self.process.DQMStore.collateHistograms == True: self.process.dqmSaver.forceRunNumber = self.runnumber
32 
33  def writeCfg(self):
34  writeCfg(self.process,self.dir,self.pset_name)
35  #writeCfgPkl(self.process,self.dir,self.pset_name)
36 
37  def run(self):
38  self.task.run()
39  return
40 
41 def runDQM(run,castor_dir,result_dir):
42  from CalibMuon.DTCalibration.Workflow.tools import listFilesInCastor
43  dqm_files = listFilesInCastor(castor_dir,'DQM')
44  runDir = '.'
45 
46  dtDqmFinal = DTDqm(run,runDir,dqm_files,result_dir)
47  dtDqmFinal.writeCfg()
48  dtDqmFinal.run()
def initProcess
Definition: DTDqm.py:22
def run
Definition: DTDqm.py:37
result_dir
Definition: DTDqm.py:9
def writeCfg
Definition: DTDqm.py:33
def listFilesInCastor
Definition: tools.py:30
def __init__
Definition: DTDqm.py:6
pset_template
Definition: DTDqm.py:14
def loadCmsProcess
Definition: tools.py:144
runnumber
Definition: DTDqm.py:7
configFiles
Definition: DTDqm.py:18
def dqmWorkflowName
Definition: tools.py:23
def runDQM
Definition: DTDqm.py:41