Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-10-08 05:12:06

0001 import FWCore.ParameterSet.Config as cms
0002 from DQMServices.Core.DQMEDHarvester import DQMEDHarvester
0003 
0004 import os
0005 import sys
0006 import re
0007 
0008 class config: pass
0009 config.runNumber = int(sys.argv[1])
0010 print(config.runNumber)
0011 
0012 for arg in sys.argv: 
0013    print(arg)
0014 
0015 readFiles = cms.untracked.vstring()
0016 
0017 matchRootFile = re.compile("\S*\.root$")
0018 for argument in sys.argv[2:]:
0019    if matchRootFile.search(argument):
0020       fileToRead = "file:"+argument
0021       readFiles.append(fileToRead)
0022 
0023 print("readFiles : \n", readFiles)
0024 
0025 print(config.runNumber)
0026 
0027 ##########
0028 
0029 process = cms.Process('HARVESTING')
0030 
0031 # import of standard configurations
0032 process.load('Configuration.StandardSequences.Services_cff')
0033 process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
0034 process.load('FWCore.MessageService.MessageLogger_cfi')
0035 process.load('Configuration.EventContent.EventContent_cff')
0036 process.load('Configuration.StandardSequences.GeometryRecoDB_cff')
0037 process.load('Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff')
0038 process.load('Configuration.StandardSequences.EDMtoMEAtRunEnd_cff')
0039 process.load('Configuration.StandardSequences.Harvesting_cff')
0040 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0041 
0042 process.load("DQMServices.Core.DQM_cfg")
0043 process.load("DQMServices.Components.DQMEnvironment_cfi")
0044 
0045 process.maxEvents = cms.untracked.PSet(
0046     input = cms.untracked.int32(100)
0047 )
0048 
0049 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0050 from Configuration.AlCa.autoCond import autoCond
0051 #process.GlobalTag.globaltag = autoCond['com10']
0052 from Configuration.AlCa.GlobalTag import GlobalTag
0053 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run1_data', '')
0054 
0055 process.load("FWCore.MessageLogger.MessageLogger_cfi")
0056 process.MessageLogger.cerr.FwkReport.reportEvery = 1
0057 
0058 # summary
0059 process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) )
0060 
0061 #process.source = cms.Source("PoolSource",
0062 #    fileNames = readFiles,
0063 #    processingMode = cms.untracked.string('RunsAndLumis')
0064 #)
0065 
0066 # Input source
0067 process.source = cms.Source("DQMRootSource",
0068     fileNames = readFiles,
0069     filterOnRun = cms.untracked.uint32(config.runNumber)                        
0070 )
0071 process.options = cms.untracked.PSet(
0072     Rethrow = cms.untracked.vstring('ProductNotFound'),
0073     fileMode = cms.untracked.string('FULLMERGE')
0074 )
0075 
0076 #process.load('Configuration/StandardSequences/EDMtoMEAtRunEnd_cff')
0077 ##process.EDMtoMEConverter.convertOnEndLumi = False
0078 
0079 cmssw_version = os.environ.get('CMSSW_VERSION','CMSSW_X_Y_Z')
0080 Workflow = '/HcalValidation/'+'Harvesting/'+str(cmssw_version)
0081 process.dqmSaver.workflow = Workflow
0082 
0083 #process.dqmSaver.saveByRun         = 1
0084 #process.dqmSaver.saveAtJobEnd = False
0085 #process.dqmSaver.forceRunNumber = 208339
0086 #process.dqmSaver.runIsComplete = True
0087 #process.dqmSaver.saveByRun = cms.untracked.int32(1)
0088 #process.dqmSaver.saveAtJobEnd = cms.untracked.bool(True)
0089 #process.dqmSaver.forceRunNumber = cms.untracked.int32(999999)
0090 process.dqmSaver.convention = 'Offline'
0091 process.dqmSaver.saveByRun = -1
0092 process.dqmSaver.saveAtJobEnd = True
0093 process.dqmSaver.forceRunNumber = config.runNumber
0094 
0095 process.calotowersClient = DQMEDHarvester("CaloTowersClient", 
0096      outputFile = cms.untracked.string('CaloTowersHarvestingME.root'),
0097      DQMDirName = cms.string("/") # root directory
0098 )
0099 
0100 process.noiseratesClient = DQMEDHarvester("NoiseRatesClient", 
0101      outputFile = cms.untracked.string('NoiseRatesHarvestingME.root'),
0102      DQMDirName = cms.string("/") # root directory
0103 )
0104 
0105 process.hcalrechitsClient = DQMEDHarvester("HcalRecHitsClient", 
0106      outputFile = cms.untracked.string('HcalRecHitsHarvestingME.root'),
0107      DQMDirName = cms.string("/") # root directory
0108 )
0109 
0110 ##########
0111 process.calotowersDQMClient = DQMEDHarvester("CaloTowersDQMClient",
0112       outputFile = cms.untracked.string('CaloTowersHarvestingME.root'),
0113 #     outputFile = cms.untracked.string(''),
0114       DQMDirName = cms.string("/") # root directory
0115 )
0116 process.hcalNoiseRatesClient = DQMEDHarvester("HcalNoiseRatesClient", 
0117      outputFile = cms.untracked.string('NoiseRatesHarvestingME.root'),
0118 #     outputFile = cms.untracked.string(''),
0119      DQMDirName = cms.string("/") # root directory
0120 )
0121 process.hcalRecHitsDQMClient = DQMEDHarvester("HcalRecHitsDQMClient", 
0122      outputFile = cms.untracked.string('HcalRecHitsHarvestingME.root'),
0123 #    outputFile = cms.untracked.string(''),
0124      DQMDirName = cms.string("/") # root directory
0125 )
0126 
0127 ##########
0128 
0129 #process.p = cms.Path(process.EDMtoME * process.calotowersClient * process.noiseratesClient * process.hcalrechitsClient * process.dqmSaver)
0130 #process.p = cms.Path(process.EDMtoME * process.calotowersClient * process.noiseratesClient * process.hcalrechitsClient * process.dqmSaver)
0131 #process.p = cms.Path(process.EDMtoME * process.dqmSaver)
0132 #process.p = cms.Path(process.EDMtoME * process.calotowersClient * process.dqmSaver)
0133 
0134 process.edmtome_step = cms.Path(process.EDMtoME)
0135 process.validationHarvesting = cms.Path(process.calotowersClient + process.noiseratesClient + process.hcalrechitsClient + process.calotowersDQMClient + process.hcalNoiseRatesClient + process.hcalRecHitsDQMClient)
0136 process.dqmsave_step = cms.Path(process.DQMSaver)
0137 
0138 # Schedule definition
0139 process.schedule = cms.Schedule(process.edmtome_step,process.validationHarvesting,process.dqmsave_step)