Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-06-24 22:51:42

0001 # documentation: https://twiki.cern.ch/twiki/bin/view/CMS/AlCaDBPCL#Drop_box_metadata_management
0002 
0003 import FWCore.ParameterSet.Config as cms
0004 
0005 process = cms.Process("myprocess")
0006 
0007 process.load("CondCore.CondDB.CondDB_cfi")
0008 process.load("FWCore.MessageService.MessageLogger_cfi")
0009 
0010 process.CondDB.connect = 'sqlite_file:DropBoxMetadata.db' 
0011 
0012 process.maxEvents = cms.untracked.PSet(
0013     input = cms.untracked.int32(1)
0014 )
0015 process.source = cms.Source("EmptySource",
0016                             firstRun = cms.untracked.uint32(300000)
0017                             )
0018 
0019 
0020 # given a set of .json files in the current dir, ProduceDropBoxMetadata produces a sqlite containign the payload with the prod/and/prep metadata
0021 process.myReader = cms.EDAnalyzer("ProduceDropBoxMetadata",
0022                                   # set to True if you want to write out a sqlite.db translating the json's into a payload
0023                                   write = cms.untracked.bool(False),
0024                                   toWrite = cms.VPSet(),
0025 
0026                                   # this boolean will read the content of whichever payload is available and print its content to stoutput
0027                                   # set this to false if you write out a sqlite.db translating the json's into a payload
0028                                   read = cms.untracked.bool(True),
0029                                   # toRead lists of record names to be sought inside the DropBoxMetadataRcd payload avaialble to the ProduceDropBoxMetadata;
0030                                   # for instance, if write is True, you're reading back the metadata you've just entered in the payload from the .json files
0031                                   toRead = cms.untracked.vstring(
0032                                     'BeamSpotObjectsRcdByRun',
0033                                     'BeamSpotObjectsRcdByLumi',
0034                                     'BeamSpotObjectsRcdHPByLumi',
0035                                     'BeamSpotObjectsRcdHPByRun',
0036                                     'SiStripBadStripRcd',
0037                                     'SiStripBadStripFromHitEffRcd',
0038                                     'SiStripApvGainRcd',
0039                                     'TrackerAlignmentRcd',
0040                                     'TrackerAlignmentHGRcd',
0041                                     'SiStripApvGainRcdAfterAbortGap',
0042                                     'SiStripApvGainRcdAAG',
0043                                     'EcalPedestalsRcd',
0044                                     "LumiCorrectionsRcd",
0045                                     "SiPixelQualityFromDbRcd_prompt",
0046                                     "SiPixelQualityFromDbRcd_stuckTBM",
0047                                     "SiPixelQualityFromDbRcd_other",
0048                                     "SiPixelLorentzAngleRcd",
0049                                     "CTPPSRPAlignmentCorrectionsDataRcd",
0050                                     "PPSTimingCalibrationRcd",
0051                                     "PPSTimingCalibrationRcd_Sampic"
0052                                     ) # same strings as fType
0053                                   )
0054 
0055 process.p = cms.Path(process.myReader)
0056 
0057 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0058 process.GlobalTag.globaltag = '124X_dataRun3_Express_Queue'
0059 
0060 # Set to True if you want to read a DropBoxMetadata payload from a local sqlite
0061 # specify the name of the sqlitefile.db and the tag name; the payload loaded will be for run 300000
0062 readsqlite = True 
0063 if readsqlite:
0064     process.GlobalTag.toGet = cms.VPSet(
0065         cms.PSet(record = cms.string("DropBoxMetadataRcd"),
0066                  tag = cms.string("DropBoxMetadata"),
0067                  connect = cms.string("sqlite_file:DropBoxMetadata.db")
0068                 )
0069         )