2 from tools
import loadCmsProcess,writeCfg,dqmWorkflowName,getDatasetStr
3 from CmsswTask
import *
7 def __init__(self, run, dir, input_files, output_dir, config=None):
22 if hasattr(self.
config,
'refDBTag')
and self.config.refDBTag: refDBTag = self.config.refDBTag
24 if hasattr(self.
config,
'config.connectStrRefDBTag')
and self.config.config.connectStrRefDBTag: connect = self.config.config.connectStrRefDBTag
25 runNumbersToFiles = []
26 if hasattr(self.
config,
'dbValidRuns')
and self.config.dbValidRuns
and len(self.config.dbValidRuns) == len(self.
input_files): runNumbersToFiles = self.config.dbValidRuns
31 file = os.path.abspath(inputFile)
32 fileLabel = os.path.basename(file).
split(
'.')[0]
33 pset_name =
'dtT0DBValidation_%s_Run%d_cfg.py' % (fileLabel,self.
runnumber)
37 self.
process[pset_name].tzeroRef.toGet = cms.VPSet(
39 record = cms.string(
'DTT0Rcd'),
40 tag = cms.string(refDBTag),
41 label = cms.untracked.string(
'tzeroRef')
44 record = cms.string(
'DTT0Rcd'),
45 tag = cms.string(
't0'),
46 connect = cms.untracked.string(
'sqlite_file:%s' % file),
47 label = cms.untracked.string(
'tzeroToValidate')
50 self.
process[pset_name].tzeroRef.connect = connect
53 label =
'dtT0DBValidation'
54 if hasattr(self.
config,
'label')
and self.config.label: label = self.config.label
55 workflowName =
dqmWorkflowName(self.config.datasetpath,label,self.config.trial)
56 self.
process[pset_name].dqmSaver.workflow = workflowName
58 if runNumbersToFiles: self.
process[pset_name].dqmSaver.forceRunNumber = runNumbersToFiles[idx_file]
61 self.configs.append(pset_name)
67 for cfg in self.configs:
68 writeCfg(self.process[cfg],self.dir,cfg)
69 #writeCfgPkl(self.process,self.dir,self.pset_name)