Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-12-08 23:57:36

0001 ########## Configuration ##########

0002 # if set to True, a file with logs will be produced.

0003 produce_logs = True
0004 
0005 # if set to True, the harvester will produce an extra ROOT file with some debug plots. 

0006 # Works only for one-run input.

0007 harvester_debug = True
0008 
0009 # Path for a ROOT file with the histograms.

0010 input_distributions = 'file:dqm_run_distributions_test.root'
0011 
0012 # Reference dataset path.

0013 reference_dataset_path = 'DQM_V0001_CalibPPS_R000314273.root'
0014 
0015 # If set to True, the results will be also written to an SQLite file.

0016 write_sqlite_results = False
0017 
0018 # Output database. Used only if write_sqlite_results is set to True.

0019 output_conditions = 'sqlite_file:alignment_results.db'
0020 
0021 # Database tag. Used only if write_sqlite_results is set to True.

0022 output_db_tag = 'CTPPSRPAlignment_real_pcl'
0023 ###################################

0024 
0025 import sys 
0026 import os
0027 import FWCore.ParameterSet.Config as cms
0028 
0029 process = cms.Process('testDistributions')
0030 
0031 process.load('FWCore.MessageService.MessageLogger_cfi')
0032 process.load("DQMServices.Core.DQMStore_cfi")
0033 process.load("CalibPPS.AlignmentGlobal.ppsAlignmentHarvester_cfi")
0034 
0035 if harvester_debug:
0036     process.ppsAlignmentHarvester.debug = cms.bool(True)
0037 
0038 # Message Logger

0039 if produce_logs:
0040     process.MessageLogger = cms.Service("MessageLogger",
0041         destinations = cms.untracked.vstring('run_analysis', 
0042                                             'cout'
0043                                             ),
0044         run_analysis = cms.untracked.PSet(
0045             threshold = cms.untracked.string("INFO")
0046         ),
0047         cout = cms.untracked.PSet(
0048             threshold = cms.untracked.string('WARNING')
0049         )
0050     )
0051 else:
0052     process.MessageLogger = cms.Service("MessageLogger",
0053         destinations = cms.untracked.vstring('cout'),
0054         cout = cms.untracked.PSet(
0055             threshold = cms.untracked.string('WARNING')
0056         )
0057     )
0058 
0059 # load DQM framework

0060 process.load("DQMServices.Components.DQMEnvironment_cfi")
0061 process.dqmEnv.subSystemFolder = "CalibPPS"
0062 process.dqmSaver.convention = 'Offline'
0063 process.dqmSaver.workflow = "/CalibPPS/AlignmentGlobal/CMSSW_12_1_0_pre1"
0064 process.dqmSaver.saveByRun = -1
0065 process.dqmSaver.saveAtJobEnd = True
0066 process.dqmSaver.forceRunNumber = 999999
0067 
0068 # Source (histograms)

0069 process.source = cms.Source("DQMRootSource",
0070     fileNames = cms.untracked.vstring(input_distributions),
0071 )
0072 
0073 # Event Setup (test)

0074 from config_cff import ppsAlignmentConfigESSource as ppsAlignmentConfigESSourceTest
0075 process.ppsAlignmentConfigESSourceTest = ppsAlignmentConfigESSourceTest
0076 
0077 # Event Setup (reference)

0078 from config_reference_cff import ppsAlignmentConfigESSource as ppsAlignmentConfigESSourceReference
0079 ppsAlignmentConfigESSourceReference.matching = cms.PSet(
0080     reference_dataset = cms.string(reference_dataset_path)
0081 )
0082 process.ppsAlignmentConfigESSourceReference = ppsAlignmentConfigESSourceReference
0083 
0084 # SQLite results

0085 if write_sqlite_results:
0086     process.load("CondCore.CondDB.CondDB_cfi")
0087     process.CondDB.connect = output_conditions
0088     process.PoolDBOutputService = cms.Service("PoolDBOutputService",
0089         process.CondDB,
0090         timetype = cms.untracked.string('runnumber'),
0091         toPut = cms.VPSet(cms.PSet(
0092             record = cms.string('CTPPSRPAlignmentCorrectionsDataRcd'),
0093             tag = cms.string(output_db_tag)
0094         ))
0095     )
0096 
0097     # DB object maker parameters

0098     process.ppsAlignmentHarvester.write_sqlite_results = cms.bool(True)
0099 
0100 process.path = cms.Path(
0101       process.ppsAlignmentHarvester
0102 )
0103 
0104 process.end_path = cms.EndPath(
0105     process.dqmSaver
0106 )
0107 
0108 process.schedule = cms.Schedule(
0109     process.path,
0110     process.end_path
0111 )