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
2 from CmsswTask import *
3 import os
4 
5 class DTDqm:
6  def __init__(self, run, dir, dqm_files, result_dir, config):
7  #basedir = 'Run%s/Ttrig' % run
8  #self.dir = basedir + '/' + 'Exec'
9  #self.result_dir = basedir + '/' + 'Results'
10  self.runnumber = int(run)
11  self.dir = dir
12  self.result_dir = result_dir
13  self.dqm_files = dqm_files
14 
15  self.pset_name = 'DTkFactValidation_2_DQM_cfg.py'
16  self.pset_template = config.templatepath + '/config/DTkFactValidation_2_DQM_cfg.py'
17 
18  self.initProcess()
19  self.configs = []
20  self.configs.append(self.pset_name)
21  self.task = CmsswTask(self.dir,self.configs)
22 
23  def initProcess(self):
25  self.process.source.fileNames = self.dqm_files
26  self.process.dqmSaver.dirName = os.path.abspath(self.result_dir)
27  if self.process.DQMStore.collateHistograms: self.process.dqmSaver.forceRunNumber = self.runnumber
28 
29  def writeCfg(self):
30  writeCfg(self.process,self.dir,self.pset_name)
31 
32  def run(self):
33  self.task.run()
34  return
35 
36 def runDQM(run,castor_dir,result_dir,template_path):
37  from CalibMuon.DTCalibration.Workflow.tools import listFilesInCastor
38  dqm_files = listFilesInCastor(castor_dir,'DQM')
39  runDir = '.'
40  class config: pass
41  config.templatepath = template_path
42 
43  dtDqmFinal = DTDqm(run,runDir,dqm_files,result_dir,config)
44  dtDqmFinal.writeCfg()
45  dtDqmFinal.run()
def initProcess
Definition: DTDqm.py:23
def run
Definition: DTDqm.py:32
result_dir
Definition: DTDqm.py:12
def writeCfg
Definition: DTDqm.py:29
def listFilesInCastor
Definition: tools.py:14
def __init__
Definition: DTDqm.py:6
pset_template
Definition: DTDqm.py:16
def loadCmsProcess
Definition: tools.py:93
tuple config
Definition: cmsDriver.py:17
def runDQM
Definition: DTDqm.py:36