Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop-box metadata management: updates and introduce AAG, BSHP, EcalPed #18865

Merged
2 changes: 1 addition & 1 deletion CondFormats/Common/test/BeamSpotObjectsRcdByLumi_prep.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"destinationDatabase": "oracle://cms_orcoff_prep/CMS_CONDITIONS",
"destinationTags": {
"BeamSpotObjects_PCL_byLumi_v1_prompt": {}
},
},
"inputTag": "BeamSpotObject_ByLumi",
"since": null,
"userText": "Tier0 PCL Upload for BS byLumi"
Expand Down
2 changes: 1 addition & 1 deletion CondFormats/Common/test/BeamSpotObjectsRcdByLumi_prod.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"destinationDatabase": "oracle://cms_orcon_prod/CMS_CONDITIONS",
"destinationTags": {
"BeamSpotObjects_PCL_byLumi_v0_prompt": {}
},
},
"inputTag": "BeamSpotObject_ByLumi",
"since": null,
"userText": "Tier0 PCL Upload for BS byLumi"
Expand Down
9 changes: 4 additions & 5 deletions CondFormats/Common/test/BeamSpotObjectsRcdByRun_prep.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
"destinationDatabase": "oracle://cms_orcoff_prep/CMS_CONDITIONS",
"destinationTags": {
"BeamSpotObjects_PCL_byRun_v1_prompt": {},
"BeamSpotObjects_PCL_byRun_v1_express": {},
"BeamSpotObjects_PCL_byRun_v1_hlt": {}
},
"BeamSpotObjects_PCL_byRun_v1_express": {},
"BeamSpotObjects_PCL_byRun_v1_hlt": {},
"BeamSpotObjects_PCL_byRun_v1_prompt": {}
},
"inputTag": "BeamSpotObject_ByRun",
"since": null,
"userText": "Tier0 PCL Upload for BS byRun"
}

9 changes: 4 additions & 5 deletions CondFormats/Common/test/BeamSpotObjectsRcdByRun_prod.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
"destinationDatabase": "oracle://cms_orcon_prod/CMS_CONDITIONS",
"destinationTags": {
"BeamSpotObjects_PCL_byRun_v0_prompt": {},
"BeamSpotObjects_2009_v1_express": {},
"BeamSpotObjects_PCL_byRun_v0_hlt": {}
},
"BeamSpotObjects_2009_v1_express": {},
"BeamSpotObjects_PCL_byRun_v0_hlt": {},
"BeamSpotObjects_PCL_byRun_v0_prompt": {}
},
"inputTag": "BeamSpotObject_ByRun",
"since": null,
"userText": "Tier0 PCL Upload for BS byRun"
}

9 changes: 9 additions & 0 deletions CondFormats/Common/test/BeamSpotObjectsRcdHPbyLumi_prep.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"destinationDatabase": "oracle://cms_orcoff_prep/CMS_CONDITIONS",
"destinationTags": {
"BeamSpotObjectsHP_PCL_byLumi_v0_prompt": {}
},
"inputTag": "BeamSpotObjectHP_ByLumi",
"since": null,
"userText": "Tier0 PCL Upload for high performance BS byLumi"
}
9 changes: 9 additions & 0 deletions CondFormats/Common/test/BeamSpotObjectsRcdHPbyLumi_prod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"destinationDatabase": "oracle://cms_orcon_prod/CMS_CONDITIONS",
"destinationTags": {
"BeamSpotObjectsHP_PCL_byLumi_v0_prompt": {}
},
"inputTag": "BeamSpotObjectHP_ByLumi",
"since": null,
"userText": "Tier0 PCL Upload for high performance BS byLumi"
}
9 changes: 9 additions & 0 deletions CondFormats/Common/test/EcalPedestal_prep.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"destinationDatabase": "oracle://cms_orcoff_prep/CMS_CONDITIONS",
"destinationTags": {
"EcalPedestals_PCL_byRun_v0_express": {}
},
"inputTag": "EcalPedestals_pcl",
"since": null,
"userText": "Tier0 PCL Upload for ECAL pedestals by run (prod)"
}
9 changes: 9 additions & 0 deletions CondFormats/Common/test/EcalPedestal_prod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"destinationDatabase": "oracle://cms_orcon_prod/CMS_CONDITIONS",
"destinationTags": {
"EcalPedestals_PCL_byRun_v0_express": {}
},
"inputTag": "EcalPedestals_pcl",
"since": null,
"userText": "Tier0 PCL Upload for ECAL pedestals by run (prod)"
}
13 changes: 7 additions & 6 deletions CondFormats/Common/test/ProduceDropBoxMetadata.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ using namespace edm;
ProduceDropBoxMetadata::ProduceDropBoxMetadata(const edm::ParameterSet& pSet) {


read = pSet.getUntrackedParameter<bool>("read");
write = pSet.getUntrackedParameter<bool>("write");
read = pSet.getUntrackedParameter<bool>("read");
write = pSet.getUntrackedParameter<bool>("write");

fToWrite = pSet.getParameter<vector<ParameterSet> >("toWrite");
fToRead = pSet.getUntrackedParameter<vector<string> >("toRead");
fToRead = pSet.getUntrackedParameter<vector<string> >("toRead");

}

Expand All @@ -58,7 +58,7 @@ void ProduceDropBoxMetadata::beginRun(const edm::Run& run, const edm::EventSetup


if(write) {

cout << "\n\n[ProduceDropBoxMetadata] entering write, to loop over toWrite\n" << endl;
DropBoxMetadata *metadata = new DropBoxMetadata;

// loop over all the pSets for the TF1 that we want to write to DB
Expand All @@ -67,7 +67,7 @@ void ProduceDropBoxMetadata::beginRun(const edm::Run& run, const edm::EventSetup
++fSetup) {

string record = (*fSetup).getUntrackedParameter<string>("record");
cout << "--- record: " << record << endl;
cout << "\n--- record: " << record << endl;
DropBoxMetadata::Parameters params;
vector<string> paramKeys = (*fSetup).getParameterNames();
for(vector<string>::const_iterator key = paramKeys.begin();
Expand All @@ -93,6 +93,7 @@ void ProduceDropBoxMetadata::beginRun(const edm::Run& run, const edm::EventSetup

if(read) {
// Read the objects
cout << "\n\n[ProduceDropBoxMetadata] entering read, to loop over toRead\n" << endl;
edm::ESHandle<DropBoxMetadata> mdPayload;
eSetup.get<DropBoxMetadataRcd>().get(mdPayload);

Expand All @@ -101,7 +102,7 @@ void ProduceDropBoxMetadata::beginRun(const edm::Run& run, const edm::EventSetup
// loop
for(vector<string>::const_iterator name = fToRead.begin();
name != fToRead.end(); ++name) {
cout << "--- record: " << *name << endl;
cout << "\n--- record: " << *name << endl;
if(metadata->knowsRecord(*name)) {
const map<string, string> & params = metadata->getRecordParameters(*name).getParameterMap();
for(map<string, string>::const_iterator par = params.begin();
Expand Down
2 changes: 1 addition & 1 deletion CondFormats/Common/test/ProduceDropBoxMetadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ProduceDropBoxMetadata : public edm::EDAnalyzer {
virtual ~ProduceDropBoxMetadata();

// Operations
// virtual void beginJob();
// virtual void beginJob();
virtual void beginRun(const edm::Run& run, const edm::EventSetup& eSetup);

virtual void analyze(const edm::Event&, const edm::EventSetup&) {}
Expand Down
62 changes: 50 additions & 12 deletions CondFormats/Common/test/ProduceDropBoxMetadata.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# documentation: https://twiki.cern.ch/twiki/bin/view/CMS/AlCaDBPCL#Drop_box_metadata_management

import FWCore.ParameterSet.Config as cms

process = cms.Process("myprocess")
Expand Down Expand Up @@ -31,25 +33,39 @@ def encodeJsonInString(filename):
BeamSpotObjectsRcdByLumi_prod_str = encodeJsonInString("BeamSpotObjectsRcdByLumi_prod.json")
BeamSpotObjectsRcdByLumi_prep_str = encodeJsonInString("BeamSpotObjectsRcdByLumi_prep.json")

# beamspot High Perf by lumi
BeamSpotObjectsRcdHPByLumi_prod_str = encodeJsonInString("BeamSpotObjectsRcdHPbyLumi_prod.json")
BeamSpotObjectsRcdHPByLumi_prep_str = encodeJsonInString("BeamSpotObjectsRcdHPbyLumi_prep.json")

#SiStripBadStripRcd
SiStripBadStripRcd_prod_str = encodeJsonInString("SiStripBadStripRcd_prod.json")
SiStripBadStripRcd_prep_str = encodeJsonInString("SiStripBadStripRcd_prep.json")

#SiStripApvGainRcd
SiStripApvGainRcd_prod_str = encodeJsonInString("SiStripApvGainRcd_prod.json")
SiStripApvGainRcd_multirun_prod_str = encodeJsonInString("SiStripApvGainRcd_multirun_prod.json")
SiStripApvGainRcdAfterAbortGap_prod_str = encodeJsonInString("SiStripApvGainRcdAfterAbortGap_prod.json")
SiStripApvGainRcdAfterAbortGap_prod_str = encodeJsonInString("SiStripApvGainRcdAfterAbortGap_prod.json") # can be removed, once 92x deployed
SiStripApvGainRcdAAG_prod_str = encodeJsonInString("SiStripApvGainRcdAAG_prod.json") # will take over

SiStripApvGainRcd_prep_str = encodeJsonInString("SiStripApvGainRcd_prep.json")
SiStripApvGainRcd_multirun_prep_str = encodeJsonInString("SiStripApvGainRcd_multirun_prep.json")
SiStripApvGainRcdAfterAbortGap_prep_str = encodeJsonInString("SiStripApvGainRcdAfterAbortGap_prep.json")
SiStripApvGainRcdAfterAbortGap_prep_str = encodeJsonInString("SiStripApvGainRcdAfterAbortGap_prep.json") # can be removed, once 92x deployed
SiStripApvGainRcdAAG_prep_str = encodeJsonInString("SiStripApvGainRcdAAG_prep.json") # will take over

#SiPixelAli
SiPixelAliRcd_prod_str = encodeJsonInString("SiPixelAliRcd_prod.json")
SiPixelAliRcd_prep_str = encodeJsonInString("SiPixelAliRcd_prep.json")

#EcalPedestalsRcd
EcalPedestalsRcd_prod_str = encodeJsonInString("EcalPedestal_prod.json")
EcalPedestalsRcd_prep_str = encodeJsonInString("EcalPedestal_prep.json")

# given a set of .json files in the current dir, ProduceDropBoxMetadata produces a sqlite containign the payload with the prod/and/prep metadata
process.mywriter = cms.EDAnalyzer("ProduceDropBoxMetadata",
write = cms.untracked.bool(True),
# set to True if you want to write out a sqlite.db translating the json's into a payload
write = cms.untracked.bool(False),

# toWrite holds a list of Pset's, one for each workflow you want to produce DropBoxMetadata for; you need to have 2 .json files for each PSet
toWrite = cms.VPSet(cms.PSet(record = cms.untracked.string("BeamSpotObjectsRcdByRun"),
Source = cms.untracked.string("AlcaHarvesting"),
FileClass = cms.untracked.string("ALCA"),
Expand All @@ -62,6 +78,12 @@ def encodeJsonInString(filename):
prodMetaData = cms.untracked.string(BeamSpotObjectsRcdByLumi_prod_str),
prepMetaData = cms.untracked.string(BeamSpotObjectsRcdByLumi_prep_str),
),
cms.PSet(record = cms.untracked.string('BeamSpotObjectsRcdHPByLumi'),
Source = cms.untracked.string("AlcaHarvesting"),
FileClass = cms.untracked.string("ALCA"),
prodMetaData = cms.untracked.string(BeamSpotObjectsRcdHPByLumi_prod_str),
prepMetaData = cms.untracked.string(BeamSpotObjectsRcdHPByLumi_prep_str),
),
cms.PSet(record = cms.untracked.string('SiStripBadStripRcd'),
Source = cms.untracked.string("AlcaHarvesting"),
FileClass = cms.untracked.string("ALCA"),
Expand All @@ -82,24 +104,38 @@ def encodeJsonInString(filename):
prodMetaData = cms.untracked.string(SiPixelAliRcd_prod_str),
prepMetaData = cms.untracked.string(SiPixelAliRcd_prep_str),
),
cms.PSet(record = cms.untracked.string('SiStripApvGainRcdAfterAbortGap'),
cms.PSet(record = cms.untracked.string('SiStripApvGainRcdAfterAbortGap'), # can be removed, once 92x deployed...
Source = cms.untracked.string("AlcaHarvesting"),
FileClass = cms.untracked.string("ALCA"),
prodMetaData = cms.untracked.string(SiStripApvGainRcdAfterAbortGap_prod_str),
prepMetaData = cms.untracked.string(SiStripApvGainRcdAfterAbortGap_prep_str),
),
cms.PSet(record = cms.untracked.string('SiStripApvGainRcdAAG'), # ... will take over
Source = cms.untracked.string("AlcaHarvesting"),
FileClass = cms.untracked.string("ALCA"),
prodMetaData = cms.untracked.string(SiStripApvGainRcdAAG_prod_str),
prepMetaData = cms.untracked.string(SiStripApvGainRcdAAG_prep_str),
),
cms.PSet(record = cms.untracked.string('EcalPedestalsRcd'),
Source = cms.untracked.string("AlcaHarvesting"),
FileClass = cms.untracked.string("ALCA"),
prodMetaData = cms.untracked.string(EcalPedestalsRcd_prod_str),
prepMetaData = cms.untracked.string(EcalPedestalsRcd_prep_str),
),
),
# this boolean will read the content of whichever payload is available and print its content to stoutput
read = cms.untracked.bool(True),
toRead = cms.untracked.vstring("BeamSpotObjectsRcdByRun",'BeamSpotObjectsRcdByLumi','SiStripBadStripRcd','SiStripApvGainRcd','TrackerAlignmentRcd','SiStripApvGainRcdAfterAbortGap') # same strings as fType
)

# toRead lists of record naemes to be sought inside the DropBoxMetadataRcd payload avaialble to the ProduceDropBoxMetadata; for instance, if write is True, you're reading back the metadata you've just entered in the payload from the .json files
toRead = cms.untracked.vstring('BeamSpotObjectsRcdByRun','BeamSpotObjectsRcdByLumi','BeamSpotObjectsRcdHPByLumi','SiStripBadStripRcd','SiStripApvGainRcd','TrackerAlignmentRcd','SiStripApvGainRcdAfterAbortGap','SiStripApvGainRcdAAG','EcalPedestalsRcd') # same strings as fType
)

process.p = cms.Path(process.mywriter)

if process.mywriter.write:

from CondCore.CondDB.CondDB_cfi import CondDB
CondDB.connect = "sqlite_file:DropBoxMetadata.db"
CondDB.connect = "sqlite_file:DropBoxMetadata_addAAG.db"

process.PoolDBOutputService = cms.Service("PoolDBOutputService",
CondDB,
Expand All @@ -114,16 +150,18 @@ def encodeJsonInString(filename):
)

process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
process.GlobalTag.globaltag = '80X_dataRun2_Express_Queue'
process.GlobalTag.globaltag = '91X_dataRun2_Express_Queue'

process.GlobalTag.connect = 'frontier://PromptProd/CMS_CONDITIONS'
#process.GlobalTag.connect = 'sqlite_file:/afs/cern.ch/user/c/cerminar/public/Alca/GlobalTag/GR_R_311_V2.db'
#process.GlobalTag.connect = 'frontier://PromptProd/CMS_CONDITIONS'
#process.GlobalTag.connect = 'sqlite_file:/data/franzoni/92x/CMSSW_9_2_X_2017-05-16-1100_metadata/src/CondFormats/Common/test/last-iov-DropBoxMetadata_v5.1_express.db'

readsqlite = False
# Set to True if you want to read a DropBoxMetadata payload from a local sqlite
# specify the name of the sqlitefile.db and the tag name; the payload loaded will be for run 300000
readsqlite = True
if readsqlite:
process.GlobalTag.toGet = cms.VPSet(
cms.PSet(record = cms.string("DropBoxMetadataRcd"),
tag = cms.string("DropBoxMetadata"),
connect = cms.string("sqlite_file:DropBoxMetadata.db")
connect = cms.string("sqlite_file:DropBoxMetadata_addAAG.db")
)
)
5 changes: 2 additions & 3 deletions CondFormats/Common/test/SiPixelAliRcd_prep.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"destinationDatabase": "oracle://cms_orcoff_prep/CMS_CONDITIONS",
"destinationTags": {
"SiPixelAli_PCL_v0_prompt": {},
"SiPixelAli_PCL_v0_hlt": {}
"SiPixelAli_PCL_v0_hlt": {},
"SiPixelAli_PCL_v0_prompt": {}
},
"inputTag": "SiPixelAli_pcl",
"since": null,
"userText": "T0 PCL Upload for SiPixel Ali. (prep)"
}

9 changes: 4 additions & 5 deletions CondFormats/Common/test/SiPixelAliRcd_prod.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"destinationDatabase": "oracle://cms_orcoff_prep/CMS_CONDITIONS",
"destinationDatabase": "oracle://cms_orcon_prod/CMS_CONDITIONS",
"destinationTags": {
"SiPixelAli_PCL_v0_prompt": {},
"SiPixelAli_PCL_v0_hlt": {}
"SiPixelAli_PCL_v0_hlt": {},
"TrackerAlignment_PCL_byRun_v1_express": {}
},
"inputTag": "SiPixelAli_pcl",
"since": null,
"userText": "T0 PCL Upload for SiPixel Ali. (prep)"
"userText": "T0 PCL Upload for SiPixel Ali - temp. not the tag consumed by prompt. (prod)"
}

10 changes: 10 additions & 0 deletions CondFormats/Common/test/SiStripApvGainRcdAAG_prep.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"destinationDatabase": "oracle://cms_orcoff_prep/CMS_CONDITIONS",
"destinationTags": {
"SiStripApvGainAfterAbortGap_PCL_v0_hlt": {},
"SiStripApvGainAfterAbortGap_PCL_v0_prompt": {}
},
"inputTag": "SiStripApvGainAAG_pcl",
"since": null,
"userText": "T0 PCL Upload for SiStrip Gains AfterAbortGap calib. (prep)"
}
10 changes: 10 additions & 0 deletions CondFormats/Common/test/SiStripApvGainRcdAAG_prod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"destinationDatabase": "oracle://cms_orcoff_prep/CMS_CONDITIONS",
"destinationTags": {
"SiStripApvGainAfterAbortGap_PCL_v0_hlt": {},
"SiStripApvGainAfterAbortGap_PCL_v0_prompt": {}
},
"inputTag": "SiStripApvGainAAG_pcl",
"since": null,
"userText": "T0 PCL Upload for SiStrip Gains AfterAbortGap calib. (prod)"
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"destinationDatabase": "oracle://cms_orcoff_prep/CMS_CONDITIONS",
"destinationTags": {
"SiStripApvGainAfterAbortGap_PCL_v0_prompt": {},
"SiStripApvGainAfterAbortGap_PCL_v0_hlt": {}
"SiStripApvGainAfterAbortGap_PCL_v0_hlt": {},
"SiStripApvGainAfterAbortGap_PCL_v0_prompt": {}
},
"inputTag": "SiStripApvGainAfterAbortGap_pcl",
"inputTag": "SiStripApvGainAAG_pcl",
"since": null,
"userText": "T0 PCL Upload for SiStrip Gains AfterAbortGap calib. (prep)"
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"destinationDatabase": "oracle://cms_orcoff_prep/CMS_CONDITIONS",
"destinationTags": {
"SiStripApvGainAfterAbortGap_PCL_v0_prompt": {},
"SiStripApvGainAfterAbortGap_PCL_v0_hlt": {}
"SiStripApvGainAfterAbortGap_PCL_v0_hlt": {},
"SiStripApvGainAfterAbortGap_PCL_v0_prompt": {}
},
"inputTag": "SiStripApvGainAfterAbortGap_pcl",
"inputTag": "SiStripApvGainAAG_pcl",
"since": null,
"userText": "T0 PCL Upload for SiStrip Gains AfterAbortGap calib. (prod)"
}
7 changes: 3 additions & 4 deletions CondFormats/Common/test/SiStripApvGainRcd_prep.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"destinationDatabase": "oracle://cms_orcoff_prep/CMS_CONDITIONS",
"destinationTags": {
"SiStripApvGain_PCL_v0_prompt": {},
"SiStripApvGain_PCL_v0_hlt": {}
"SiStripApvGain_PCL_multirun_v0_hlt": {},
"SiStripApvGain_PCL_multirun_v0_prompt": {}
},
"inputTag": "SiStripApvGain_pcl",
"since": null,
"userText": "T0 PCL Upload for SiStrip Gains calib. (prod)"
"userText": "PCL MultiRun Upload for SiStrip Gains calib. (prep)"
}

7 changes: 3 additions & 4 deletions CondFormats/Common/test/SiStripApvGainRcd_prod.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"destinationDatabase": "oracle://cms_orcoff_prep/CMS_CONDITIONS",
"destinationTags": {
"SiStripApvGain_PCL_v0_prompt": {},
"SiStripApvGain_PCL_v0_hlt": {}
"SiStripApvGain_PCL_multirun_v0_hlt": {},
"SiStripApvGain_PCL_multirun_v0_prompt": {}
},
"inputTag": "SiStripApvGain_pcl",
"since": null,
"userText": "T0 PCL Upload for SiStrip Gains calib. (prod)"
"userText": "PCL MultiRun Upload for SiStrip Gains calib. (prod)"
}

Loading