Exemplo n.º 1
0
class DTValidSummary:
    def __init__(self, run, dir, input_file, output_file, config):
        self.runnumber = run
        self.config = config
        self.dir = dir 
        self.input_file = input_file
        self.output_file = output_file

        self.pset_name = 'DTkFactValidation_2_cfg.py'
        self.pset_template = config.templatepath + '/config/DTkFactValidation_2_cfg.py'

        self.initProcess()
        self.configs = [self.pset_name]
        self.task = CmsswTask(self.dir,self.configs)

    def initProcess(self):
        self.process = loadCmsProcess(self.pset_template)
        self.process.resolutionTest.inputFile = self.input_file
        self.process.resolutionTest.OutputFileName = self.output_file

    def writeCfg(self):
        writeCfg(self.process,self.dir,self.pset_name) 

    def run(self):
        self.task.run()
        return
Exemplo n.º 2
0
class DTValidSummary:
    def __init__(self, run, dir, input_file, output_file, config):
        self.runnumber = run
        self.config = config
        self.dir = dir
        self.input_file = input_file
        self.output_file = output_file

        self.pset_name = 'DTkFactValidation_2_cfg.py'
        self.pset_template = config.templatepath + '/config/DTkFactValidation_2_cfg.py'

        self.initProcess()
        self.configs = [self.pset_name]
        self.task = CmsswTask(self.dir, self.configs)

    def initProcess(self):
        self.process = loadCmsProcess(self.pset_template)
        self.process.resolutionTest.inputFile = self.input_file
        self.process.resolutionTest.OutputFileName = self.output_file

    def writeCfg(self):
        writeCfg(self.process, self.dir, self.pset_name)

    def run(self):
        self.task.run()
        return
Exemplo n.º 3
0
    def __init__(self, run, dir, result_dir, config):
        #desc = 'Run%s'%run
        #desc += '/Ttrig/Exec'
        #self.desc = desc
        self.runnumber = int(run)
        self.config = config
        self.dir = dir
        self.result_dir = result_dir

        self.configs = [
            'DTTTrigWriter_cfg.py', 'DumpDBToFile_first_cfg.py',
            'DTTTrigCorrection_cfg.py', 'DumpDBToFile_second_cfg.py'
        ]

        self.pset_templates = {
            'DTTTrigWriter_cfg.py':
            config.templatepath + '/config/DTTTrigWriter_cfg.py',
            'DumpDBToFile_first_cfg.py':
            config.templatepath + '/config/DumpDBToFile_ttrig_cfg.py',
            'DTTTrigCorrection_cfg.py':
            config.templatepath + '/config/DTTTrigCorrection_cfg.py',
            'DumpDBToFile_second_cfg.py':
            config.templatepath + '/config/DumpDBToFile_ttrig_cfg.py'
        }

        #self.task = CmsswTask(self.desc,self.configs,self.pset_templates,self.common_opts,self.pset_opts)
        self.initProcess()
        self.task = CmsswTask(self.dir, self.configs)
Exemplo n.º 4
0
class DTDqm:
    def __init__(self, run, dir, dqm_files, result_dir, config):
        #basedir = 'Run%s/Ttrig' % run
        #self.dir = basedir + '/' + 'Exec'
        #self.result_dir = basedir + '/' + 'Results'
        self.runnumber = int(run)
        self.dir = dir
        self.result_dir = result_dir
        self.dqm_files = dqm_files

        self.pset_name = 'DTkFactValidation_2_DQM_cfg.py'
        self.pset_template = config.templatepath + '/config/DTkFactValidation_2_DQM_cfg.py'

        self.initProcess()
        self.configs = []
        self.configs.append(self.pset_name)
        self.task = CmsswTask(self.dir,self.configs)

    def initProcess(self):
        self.process = loadCmsProcess(self.pset_template)
        self.process.source.fileNames = self.dqm_files
        self.process.dqmSaver.dirName = os.path.abspath(self.result_dir)
        if self.process.DQMStore.collateHistograms: self.process.dqmSaver.forceRunNumber = self.runnumber

    def writeCfg(self):
        writeCfg(self.process,self.dir,self.pset_name) 
    
    def run(self):
        self.task.run()
        return
Exemplo n.º 5
0
class DTDQMHarvesting:
    def __init__(self, run, dir, dqm_files, result_dir, config=None):
        self.runnumber = int(run)
        self.dir = dir
        self.result_dir = result_dir
        self.config = config
        self.dqm_files = dqm_files

        self.pset_name = 'dtDQMClient_cfg.py'
        self.pset_template = 'CalibMuon.DTCalibration.dtDQMClientAlca_cfg'

        self.process = None
        self.initProcess()
        self.configFiles = []
        self.configFiles.append(self.pset_name)
        self.task = CmsswTask(self.dir,self.configFiles)

    def initProcess(self):
        self.process = loadCmsProcess(self.pset_template)
        self.process.GlobalTag.globaltag = self.config.globaltag

        if hasattr(self.config,'inputTTrigDB') and self.config.inputTTrigDB:
            label = ''
            if hasattr(self.config,'runOnCosmics') and self.config.runOnCosmics: label = 'cosmics'
            addPoolDBESSource(process = self.process,
                              moduleName = 'tTrigDB',record = 'DTTtrigRcd',tag = 'ttrig',label = label,
                              connect = 'sqlite_file:%s' % os.path.abspath(self.config.inputTTrigDB))

        if hasattr(self.config,'inputVDriftDB') and self.config.inputVDriftDB:
            addPoolDBESSource(process = self.process,
                              moduleName = 'vDriftDB',record = 'DTMtimeRcd',tag = 'vDrift',
                              connect = 'sqlite_file:%s' % os.path.abspath(self.config.inputVDriftDB))

	if hasattr(self.config,'inputDBTag') and self.config.inputDBTag:
	    tag = self.config.inputDBTag
	    record = self.config.inputDBRcd
	    connect = self.config.connectStrDBTag
	    moduleName = 'customDB%s' % record 
	    addPoolDBESSource(process = self.process,
			      moduleName = moduleName,record = record,tag = tag,
			      connect = connect)

        self.process.source.fileNames = self.dqm_files
        self.process.dqmSaver.dirName = os.path.abspath(self.result_dir)
        if self.config:
            label = 'dtDQMValidation'
            if hasattr(self.config,'label') and self.config.label: label = self.config.label 
            workflowName = dqmWorkflowName(self.config.datasetpath,label,self.config.trial)
            self.process.dqmSaver.workflow = workflowName
        if self.process.DQMStore.collateHistograms == True: self.process.dqmSaver.forceRunNumber = self.runnumber

    def writeCfg(self):
        writeCfg(self.process,self.dir,self.pset_name)   
        #writeCfgPkl(self.process,self.dir,self.pset_name) 
    
    def run(self):
        self.task.run()
        return
Exemplo n.º 6
0
class DTTTrigCorrFirst:
    def __init__(self, run, dir, result_dir, config):
        #desc = 'Run%s'%run
        #desc += '/Ttrig/Exec'
        #self.desc = desc 
        self.runnumber = int(run)
        self.config = config
        self.dir = dir
        self.result_dir = result_dir

        self.configs = ['DTTTrigWriter_cfg.py','DumpDBToFile_first_cfg.py','DTTTrigCorrection_cfg.py','DumpDBToFile_second_cfg.py']

        self.pset_templates = {'DTTTrigWriter_cfg.py':config.templatepath + '/config/DTTTrigWriter_cfg.py',
                               'DumpDBToFile_first_cfg.py':config.templatepath + '/config/DumpDBToFile_ttrig_cfg.py',
                               'DTTTrigCorrection_cfg.py':config.templatepath + '/config/DTTTrigCorrection_cfg.py',
                               'DumpDBToFile_second_cfg.py':config.templatepath + '/config/DumpDBToFile_ttrig_cfg.py'}

        #self.task = CmsswTask(self.desc,self.configs,self.pset_templates,self.common_opts,self.pset_opts)
        self.initProcess()
        self.task = CmsswTask(self.dir,self.configs)

    def initProcess(self):
        timeBoxes = os.path.abspath(self.result_dir + '/' + 'DTTimeBoxes_' + str(self.runnumber) + '.root')
        ttrig_first = self.result_dir + '/' + 'ttrig_first_' + str(self.runnumber)
        ttrig_first_db = os.path.abspath(ttrig_first + '.db')
        ttrig_first_txt = os.path.abspath(ttrig_first + '.txt')
        ttrig_second = self.result_dir + '/' + 'ttrig_second_' + str(self.runnumber)
        ttrig_second_db = os.path.abspath(ttrig_second + '.db')
        ttrig_second_txt = os.path.abspath(ttrig_second + '.txt')
 
        self.process = {}
        self.process['DTTTrigWriter_cfg.py'] = loadCmsProcess(self.pset_templates['DTTTrigWriter_cfg.py'])
        self.process['DTTTrigWriter_cfg.py'].ttrigwriter.rootFileName = timeBoxes
        self.process['DTTTrigWriter_cfg.py'].PoolDBOutputService.connect = 'sqlite_file:%s' % ttrig_first_db

        self.process['DumpDBToFile_first_cfg.py'] = loadCmsProcess(self.pset_templates['DumpDBToFile_first_cfg.py'])
        self.process['DumpDBToFile_first_cfg.py'].calibDB.connect = 'sqlite_file:%s' % ttrig_first_db
        self.process['DumpDBToFile_first_cfg.py'].dumpToFile.outputFileName = ttrig_first_txt

        self.process['DTTTrigCorrection_cfg.py'] = loadCmsProcess(self.pset_templates['DTTTrigCorrection_cfg.py'])
        self.process['DTTTrigCorrection_cfg.py'].GlobalTag.globaltag = self.config.globaltag
        self.process['DTTTrigCorrection_cfg.py'].source.firstRun = self.runnumber
        self.process['DTTTrigCorrection_cfg.py'].calibDB.connect = 'sqlite_file:%s' % ttrig_first_db
        self.process['DTTTrigCorrection_cfg.py'].PoolDBOutputService.connect = 'sqlite_file:%s' % ttrig_second_db

        self.process['DumpDBToFile_second_cfg.py'] = loadCmsProcess(self.pset_templates['DumpDBToFile_second_cfg.py'])
        self.process['DumpDBToFile_second_cfg.py'].calibDB.connect = 'sqlite_file:%s' % ttrig_second_db
        self.process['DumpDBToFile_second_cfg.py'].dumpToFile.outputFileName = ttrig_second_txt  
 
    def writeCfg(self):
        for cfg in self.configs:
            writeCfg(self.process[cfg],self.dir,cfg)
           
    def run(self):
        self.task.run()
Exemplo n.º 7
0
    def __init__(self, run, dir, input_files, output_dir, config=None):
        self.runnumber = int(run)
        self.dir = dir
        self.output_dir = output_dir
        self.config = config
        self.input_files = input_files

        self.pset_template = 'DQMOffline.CalibMuon.dtT0DBValidation_cfg'

        self.configs = []
        self.initProcess()
        self.task = CmsswTask(self.dir, self.configs)
Exemplo n.º 8
0
    def __init__(self, run, dir, input_file, output_file, config):
        self.runnumber = run
        self.config = config
        self.dir = dir
        self.input_file = input_file
        self.output_file = output_file

        self.pset_name = 'DTkFactValidation_2_cfg.py'
        self.pset_template = config.templatepath + '/config/DTkFactValidation_2_cfg.py'

        self.initProcess()
        self.configs = [self.pset_name]
        self.task = CmsswTask(self.dir, self.configs)
Exemplo n.º 9
0
    def __init__(self, run, dir, dqm_files, result_dir, config=None):
        self.runnumber = int(run)
        self.dir = dir
        self.result_dir = result_dir
        self.config = config
        self.dqm_files = dqm_files

        self.pset_name = 'dtDQMClient_cfg.py'
        self.pset_template = 'CalibMuon.DTCalibration.dtDQMClientAlca_cfg'

        self.process = None
        self.initProcess()
        self.configFiles = []
        self.configFiles.append(self.pset_name)
        self.task = CmsswTask(self.dir,self.configFiles)
Exemplo n.º 10
0
    def __init__(self, run, dir, dqm_files, result_dir, config):
        #basedir = 'Run%s/Ttrig' % run
        #self.dir = basedir + '/' + 'Exec'
        #self.result_dir = basedir + '/' + 'Results'
        self.runnumber = int(run)
        self.dir = dir
        self.result_dir = result_dir
        self.dqm_files = dqm_files

        self.pset_name = 'DTkFactValidation_2_DQM_cfg.py'
        self.pset_template = config.templatepath + '/config/DTkFactValidation_2_DQM_cfg.py'

        self.initProcess()
        self.configs = []
        self.configs.append(self.pset_name)
        self.task = CmsswTask(self.dir,self.configs)
Exemplo n.º 11
0
class DTDQMMerge:
    def __init__(self, run, dir, dqm_files, result_dir, config=None):
        self.runnumber = int(run)
        self.dir = dir
        self.result_dir = result_dir
        self.config = config
        self.dqm_files = dqm_files

        self.pset_name = 'dtDQMMerge_cfg.py'
        self.pset_template = 'CalibMuon.DTCalibration.dtDQMMerge_cfg'

        self.process = None
        self.initProcess()
        self.configFiles = []
        self.configFiles.append(self.pset_name)
        self.task = CmsswTask(self.dir, self.configFiles)

    def initProcess(self):
        self.process = loadCmsProcess(self.pset_template)
        self.process.source.fileNames = self.dqm_files

        outputFileName = 'DQM.root'
        if self.config:
            label = 'dtDQMValidation'
            if hasattr(self.config, 'label') and self.config.label:
                label = self.config.label
            #workflowName = dqmWorkflowName(self.config.datasetpath,label,self.config.trial)
            datasetStr = getDatasetStr(self.config.datasetpath)

            outputFileName = 'DQM_%s-%s.root' % (datasetStr, label)

        self.process.output.fileName = '%s/%s' % (os.path.abspath(
            self.result_dir), outputFileName)

        #if self.process.DQMStore.collateHistograms:

    def writeCfg(self):
        writeCfg(self.process, self.dir, self.pset_name)
        #writeCfgPkl(self.process,self.dir,self.pset_name)

    def run(self):
        self.task.run()
        return
Exemplo n.º 12
0
class DTDQMMerge:
    def __init__(self, run, dir, dqm_files, result_dir, config=None):
        self.runnumber = int(run)
        self.dir = dir
        self.result_dir = result_dir
        self.config = config
        self.dqm_files = dqm_files

        self.pset_name = 'dtDQMMerge_cfg.py'
        self.pset_template = 'CalibMuon.DTCalibration.dtDQMMerge_cfg'

        self.process = None
        self.initProcess()
        self.configFiles = []
        self.configFiles.append(self.pset_name)
        self.task = CmsswTask(self.dir,self.configFiles)

    def initProcess(self):
        self.process = loadCmsProcess(self.pset_template)
        self.process.source.fileNames = self.dqm_files

        outputFileName = 'DQM.root'
        if self.config:
            label = 'dtDQMValidation'
            if hasattr(self.config,'label') and self.config.label: label = self.config.label 
            #workflowName = dqmWorkflowName(self.config.datasetpath,label,self.config.trial)
            datasetStr = getDatasetStr(self.config.datasetpath)
              
            outputFileName = 'DQM_%s-%s.root' % (datasetStr,label) 

        self.process.output.fileName = '%s/%s' % (os.path.abspath(self.result_dir),outputFileName) 
        
        #if self.process.DQMStore.collateHistograms:

    def writeCfg(self):
        writeCfg(self.process,self.dir,self.pset_name)   
        #writeCfgPkl(self.process,self.dir,self.pset_name) 
    
    def run(self):
        self.task.run()
        return
Exemplo n.º 13
0
    def __init__(self, run, dir, input_files, output_dir, config=None):
        self.runnumber = int(run)
        self.dir = dir
        self.output_dir = output_dir
        self.config = config
        self.input_files = input_files

        self.pset_template = 'DQMOffline.CalibMuon.dtT0DBValidation_cfg'

        self.configs = []
        self.initProcess()
        self.task = CmsswTask(self.dir,self.configs)
Exemplo n.º 14
0
    def __init__(self, run, dir, input_file, output_file, config):
        self.runnumber = run
        self.config = config
        self.dir = dir 
        self.input_file = input_file
        self.output_file = output_file

        self.pset_name = 'DTkFactValidation_2_cfg.py'
        self.pset_template = config.templatepath + '/config/DTkFactValidation_2_cfg.py'

        self.initProcess()
        self.configs = [self.pset_name]
        self.task = CmsswTask(self.dir,self.configs)
Exemplo n.º 15
0
class DTDqm:
    def __init__(self, run, dir, dqm_files, result_dir, config=None):
        self.runnumber = int(run)
        self.dir = dir
        self.result_dir = result_dir
        self.config = config
        self.dqm_files = dqm_files

        self.pset_name = 'dtDQMClient_cfg.py'
        self.pset_template = 'CalibMuon.DTCalibration.dtDQMClient_cfg'

        self.process = None
        self.initProcess()
        self.configFiles = []
        self.configFiles.append(self.pset_name)
        self.task = CmsswTask(self.dir, self.configFiles)

    def initProcess(self):
        self.process = loadCmsProcess(self.pset_template)
        self.process.source.fileNames = self.dqm_files
        self.process.dqmSaver.dirName = os.path.abspath(self.result_dir)
        if self.config:
            label = 'dtCalibration'
            if hasattr(self.config, 'label') and self.config.label:
                label = self.config.label
            workflowName = dqmWorkflowName(self.config.datasetpath, label,
                                           self.config.trial)
            self.process.dqmSaver.workflow = workflowName
        if self.process.DQMStore.collateHistograms == True:
            self.process.dqmSaver.forceRunNumber = self.runnumber

    def writeCfg(self):
        writeCfg(self.process, self.dir, self.pset_name)
        #writeCfgPkl(self.process,self.dir,self.pset_name)

    def run(self):
        self.task.run()
        return
Exemplo n.º 16
0
    def __init__(self, run, dir, input_db, residuals, result_dir, config):
        #desc = 'Run%s'%run
        #desc += '/Ttrig/Exec'
        #self.desc = desc 
        self.runnumber = int(run)
        self.config = config
        self.dir = dir
        self.inputdb = input_db
        self.residuals = residuals
        self.result_dir = result_dir

        #self.common_opts = {'GLOBALTAG':'GR09_P_V1::All'}
        #self.common_opts = common_opts 

        self.configs = ['DTTTrigResidualCorrection_cfg.py','DumpDBToFile_ResidCorr_cfg.py']

        self.pset_templates = {}
        self.pset_templates['DTTTrigResidualCorrection_cfg.py'] = config.templatepath + '/config/DTTTrigResidualCorrection_cfg.py'
        self.pset_templates['DumpDBToFile_ResidCorr_cfg.py'] = config.templatepath + '/config/DumpDBToFile_ttrig_cfg.py'

        #self.task = CmsswTask(self.desc,self.configs,self.pset_templates,self.common_opts,self.pset_opts)
        self.initProcess()
        self.task = CmsswTask(self.dir,self.configs)
Exemplo n.º 17
0
class DTDqm:
    def __init__(self, run, dir, dqm_files, result_dir, config=None):
        self.runnumber = int(run)
        self.dir = dir
        self.result_dir = result_dir
        self.config = config
        self.dqm_files = dqm_files

        self.pset_name = "dtDQMClient_cfg.py"
        self.pset_template = "CalibMuon.DTCalibration.dtDQMClient_cfg"

        self.process = None
        self.initProcess()
        self.configFiles = []
        self.configFiles.append(self.pset_name)
        self.task = CmsswTask(self.dir, self.configFiles)

    def initProcess(self):
        self.process = loadCmsProcess(self.pset_template)
        self.process.source.fileNames = self.dqm_files
        self.process.dqmSaver.dirName = os.path.abspath(self.result_dir)
        if self.config:
            label = "dtCalibration"
            if hasattr(self.config, "label") and self.config.label:
                label = self.config.label
            workflowName = dqmWorkflowName(self.config.datasetpath, label, self.config.trial)
            self.process.dqmSaver.workflow = workflowName
        if self.process.DQMStore.collateHistograms == True:
            self.process.dqmSaver.forceRunNumber = self.runnumber

    def writeCfg(self):
        writeCfg(self.process, self.dir, self.pset_name)
        # writeCfgPkl(self.process,self.dir,self.pset_name)

    def run(self):
        self.task.run()
        return
Exemplo n.º 18
0
    def __init__(self, run, dir, dqm_files, result_dir, config=None):
        self.runnumber = int(run)
        self.dir = dir
        self.result_dir = result_dir
        self.config = config
        self.dqm_files = dqm_files

        self.pset_name = 'dtDQMMerge_cfg.py'
        self.pset_template = 'CalibMuon.DTCalibration.dtDQMMerge_cfg'

        self.process = None
        self.initProcess()
        self.configFiles = []
        self.configFiles.append(self.pset_name)
        self.task = CmsswTask(self.dir,self.configFiles)
Exemplo n.º 19
0
    def __init__(self, run, dir, result_dir, config):
        #desc = 'Run%s'%run
        #desc += '/Ttrig/Exec'
        #self.desc = desc 
        self.runnumber = int(run)
        self.config = config
        self.dir = dir
        self.result_dir = result_dir

        self.configs = ['DTTTrigWriter_cfg.py','DumpDBToFile_first_cfg.py','DTTTrigCorrection_cfg.py','DumpDBToFile_second_cfg.py']

        self.pset_templates = {'DTTTrigWriter_cfg.py':config.templatepath + '/config/DTTTrigWriter_cfg.py',
                               'DumpDBToFile_first_cfg.py':config.templatepath + '/config/DumpDBToFile_ttrig_cfg.py',
                               'DTTTrigCorrection_cfg.py':config.templatepath + '/config/DTTTrigCorrection_cfg.py',
                               'DumpDBToFile_second_cfg.py':config.templatepath + '/config/DumpDBToFile_ttrig_cfg.py'}

        #self.task = CmsswTask(self.desc,self.configs,self.pset_templates,self.common_opts,self.pset_opts)
        self.initProcess()
        self.task = CmsswTask(self.dir,self.configs)
Exemplo n.º 20
0
class DTTTrigResidualCorr:
    def __init__(self, run, dir, input_db, residuals, result_dir, config):
        #desc = 'Run%s'%run
        #desc += '/Ttrig/Exec'
        #self.desc = desc 
        self.runnumber = int(run)
        self.config = config
        self.dir = dir
        self.inputdb = input_db
        self.residuals = residuals
        self.result_dir = result_dir

        #self.common_opts = {'GLOBALTAG':'GR09_P_V1::All'}
        #self.common_opts = common_opts 

        self.configs = ['DTTTrigResidualCorrection_cfg.py','DumpDBToFile_ResidCorr_cfg.py']

        self.pset_templates = {}
        self.pset_templates['DTTTrigResidualCorrection_cfg.py'] = config.templatepath + '/config/DTTTrigResidualCorrection_cfg.py'
        self.pset_templates['DumpDBToFile_ResidCorr_cfg.py'] = config.templatepath + '/config/DumpDBToFile_ttrig_cfg.py'

        #self.task = CmsswTask(self.desc,self.configs,self.pset_templates,self.common_opts,self.pset_opts)
        self.initProcess()
        self.task = CmsswTask(self.dir,self.configs)
    
    def initProcess(self): 
        import FWCore.ParameterSet.Config as cms
        ttrig_ResidCorr = self.result_dir + '/' + 'ttrig_ResidCorr_' + str(self.runnumber)
        ttrig_ResidCorr_db = os.path.abspath(ttrig_ResidCorr + '.db')
        ttrig_ResidCorr_txt = os.path.abspath(ttrig_ResidCorr + '.txt')
        #root_file = os.path.abspath(self.result_dir + '/' + 'DTkFactValidation_' + str(self.runnumber) + '.root')
        root_file = self.residuals

        self.process = {}
        # DTTTrigResidualCorrection
        self.process['DTTTrigResidualCorrection_cfg.py'] = loadCmsProcess(self.pset_templates['DTTTrigResidualCorrection_cfg.py'])
        self.process['DTTTrigResidualCorrection_cfg.py'].source.firstRun = self.runnumber
        self.process['DTTTrigResidualCorrection_cfg.py'].GlobalTag.globaltag = self.config.globaltag
        if(self.inputdb):
            condDBSetup = self.process['DTTTrigResidualCorrection_cfg.py'].CondDBSetup 
            self.process['DTTTrigResidualCorrection_cfg.py'].calibDB = cms.ESSource("PoolDBESSource",
                                                            condDBSetup,
                                                            timetype = cms.string('runnumber'),
                                                            toGet = cms.VPSet(cms.PSet(
                                                                record = cms.string('DTTtrigRcd'),
                                                                tag = cms.string('ttrig')
                                                            )),
                                                            connect = cms.string('sqlite_file:'),
                                                            authenticationMethod = cms.untracked.uint32(0))

            self.process['DTTTrigResidualCorrection_cfg.py'].calibDB.connect = 'sqlite_file:%s' % self.inputdb
            self.process['DTTTrigResidualCorrection_cfg.py'].es_prefer_calibDB = cms.ESPrefer('PoolDBESSource','calibDB')

        self.process['DTTTrigResidualCorrection_cfg.py'].PoolDBOutputService.connect = 'sqlite_file:%s' % ttrig_ResidCorr_db
        self.process['DTTTrigResidualCorrection_cfg.py'].DTTTrigCorrection.correctionAlgoConfig.residualsRootFile = root_file

        # DumpDBToFile
        self.process['DumpDBToFile_ResidCorr_cfg.py'] = loadCmsProcess(self.pset_templates['DumpDBToFile_ResidCorr_cfg.py'])
        self.process['DumpDBToFile_ResidCorr_cfg.py'].calibDB.connect = 'sqlite_file:%s' % ttrig_ResidCorr_db
        self.process['DumpDBToFile_ResidCorr_cfg.py'].dumpToFile.outputFileName = ttrig_ResidCorr_txt 
 
    def writeCfg(self):
        for cfg in self.configs:
            writeCfg(self.process[cfg],self.dir,cfg)

    def run(self):
        self.task.run()
        return
Exemplo n.º 21
0
class DTT0DBValidation:
    def __init__(self, run, dir, input_files, output_dir, config=None):
        self.runnumber = int(run)
        self.dir = dir
        self.output_dir = output_dir
        self.config = config
        self.input_files = input_files

        self.pset_template = 'DQMOffline.CalibMuon.dtT0DBValidation_cfg'

        self.configs = []
        self.initProcess()
        self.task = CmsswTask(self.dir,self.configs)

    def initProcess(self):
        refDBTag = ''
        if hasattr(self.config,'refDBTag') and self.config.refDBTag: refDBTag = self.config.refDBTag
        connect = ''
        if hasattr(self.config,'config.connectStrRefDBTag') and self.config.config.connectStrRefDBTag: connect = self.config.config.connectStrRefDBTag
        runNumbersToFiles = []
        if hasattr(self.config,'dbValidRuns') and self.config.dbValidRuns and len(self.config.dbValidRuns) == len(self.input_files): runNumbersToFiles = self.config.dbValidRuns

        self.process = {}
        idx_file = 0
        for inputFile in self.input_files:
            file = os.path.abspath(inputFile)
            fileLabel = os.path.basename(file).split('.')[0] 
            pset_name = 'dtT0DBValidation_%s_Run%d_cfg.py' % (fileLabel,self.runnumber)
            self.process[pset_name] = loadCmsProcess(self.pset_template)
	    self.process[pset_name].source.firstRun = self.runnumber

	    self.process[pset_name].tzeroRef.toGet = cms.VPSet(
		cms.PSet(
		    record = cms.string('DTT0Rcd'),
		    tag = cms.string(refDBTag),
		    label = cms.untracked.string('tzeroRef')
		    ),
		cms.PSet(
		    record = cms.string('DTT0Rcd'),
		    tag = cms.string('t0'),
		    connect = cms.untracked.string('sqlite_file:%s' % file),
		    label = cms.untracked.string('tzeroToValidate')
		    )
	        )
            self.process[pset_name].tzeroRef.connect = connect

	    if self.config:
		label = 'dtT0DBValidation'
		if hasattr(self.config,'label') and self.config.label: label = self.config.label 
		workflowName = dqmWorkflowName(self.config.datasetpath,label,self.config.trial)
                self.process[pset_name].dqmSaver.workflow = workflowName

            if runNumbersToFiles: self.process[pset_name].dqmSaver.forceRunNumber = runNumbersToFiles[idx_file]
	    self.process[pset_name].dqmSaver.dirName = os.path.abspath(self.output_dir)

            self.configs.append(pset_name)
            writeCfg(self.process[pset_name],self.dir,pset_name) 
            idx_file += 1

    """
    def writeCfg(self):
        for cfg in self.configs:
            writeCfg(self.process[cfg],self.dir,cfg)
            #writeCfgPkl(self.process,self.dir,self.pset_name) 
    """

    def run(self):
        self.task.run()
        return
Exemplo n.º 22
0
class DTT0DBValidation:
    def __init__(self, run, dir, input_files, output_dir, config=None):
        self.runnumber = int(run)
        self.dir = dir
        self.output_dir = output_dir
        self.config = config
        self.input_files = input_files

        self.pset_template = 'DQMOffline.CalibMuon.dtT0DBValidation_cfg'

        self.configs = []
        self.initProcess()
        self.task = CmsswTask(self.dir, self.configs)

    def initProcess(self):
        refDBTag = ''
        if hasattr(self.config, 'refDBTag') and self.config.refDBTag:
            refDBTag = self.config.refDBTag
        connect = ''
        if hasattr(self.config, 'config.connectStrRefDBTag'
                   ) and self.config.config.connectStrRefDBTag:
            connect = self.config.config.connectStrRefDBTag
        runNumbersToFiles = []
        if hasattr(self.config,
                   'dbValidRuns') and self.config.dbValidRuns and len(
                       self.config.dbValidRuns) == len(self.input_files):
            runNumbersToFiles = self.config.dbValidRuns

        self.process = {}
        idx_file = 0
        for inputFile in self.input_files:
            file = os.path.abspath(inputFile)
            fileLabel = os.path.basename(file).split('.')[0]
            pset_name = 'dtT0DBValidation_%s_Run%d_cfg.py' % (fileLabel,
                                                              self.runnumber)
            self.process[pset_name] = loadCmsProcess(self.pset_template)
            self.process[pset_name].source.firstRun = self.runnumber

            self.process[pset_name].tzeroRef.toGet = cms.VPSet(
                cms.PSet(record=cms.string('DTT0Rcd'),
                         tag=cms.string(refDBTag),
                         label=cms.untracked.string('tzeroRef')),
                cms.PSet(record=cms.string('DTT0Rcd'),
                         tag=cms.string('t0'),
                         connect=cms.untracked.string('sqlite_file:%s' % file),
                         label=cms.untracked.string('tzeroToValidate')))
            self.process[pset_name].tzeroRef.connect = connect

            if self.config:
                label = 'dtT0DBValidation'
                if hasattr(self.config, 'label') and self.config.label:
                    label = self.config.label
                workflowName = dqmWorkflowName(self.config.datasetpath, label,
                                               self.config.trial)
                self.process[pset_name].dqmSaver.workflow = workflowName

            if runNumbersToFiles:
                self.process[
                    pset_name].dqmSaver.forceRunNumber = runNumbersToFiles[
                        idx_file]
            self.process[pset_name].dqmSaver.dirName = os.path.abspath(
                self.output_dir)

            self.configs.append(pset_name)
            writeCfg(self.process[pset_name], self.dir, pset_name)
            idx_file += 1

    """
    def writeCfg(self):
        for cfg in self.configs:
            writeCfg(self.process[cfg],self.dir,cfg)
            #writeCfgPkl(self.process,self.dir,self.pset_name) 
    """

    def run(self):
        self.task.run()
        return