Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-12-12 23:18:57

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                                       "TrackerAlignmentHGCombinedRcd",
0042                                       "TrackerAlignmentHLTHGCombinedRcd",
0043                                       "SiStripApvGainRcdAAG",
0044                                       "EcalPedestalsRcd",
0045                                       "LumiCorrectionsRcd",
0046                                       "SiPixelQualityFromDbRcd_prompt",
0047                                       "SiPixelQualityFromDbRcd_stuckTBM",
0048                                       "SiPixelQualityFromDbRcd_other",
0049                                       "SiPixelLorentzAngleRcd",
0050                                       "SiPixelLorentzAngleRcdMCS",
0051                                       "CTPPSRPAlignmentCorrectionsDataRcd",
0052                                       "PPSTimingCalibrationRcd_HPTDC",
0053                                       "PPSTimingCalibrationRcd_SAMPIC",
0054                                       "SiStripLorentzAngleRcd") # same strings as fType
0055                                   )
0056 
0057 process.p = cms.Path(process.myReader)
0058 
0059 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0060 process.GlobalTag.globaltag = '124X_dataRun3_Express_Queue'
0061 
0062 # Set to True if you want to read a DropBoxMetadata payload from a local sqlite
0063 # specify the name of the sqlitefile.db and the tag name; the payload loaded will be for run 300000
0064 readsqlite = True 
0065 if readsqlite:
0066     process.GlobalTag.toGet = cms.VPSet(
0067         cms.PSet(record = cms.string("DropBoxMetadataRcd"),
0068                  tag = cms.string("DropBoxMetadata"),
0069                  connect = cms.string("sqlite_file:DropBoxMetadata.db")
0070                 )
0071         )