diff --git a/CondCore/L1TPlugins/src/UpgradeRecords2.cc b/CondCore/L1TPlugins/src/UpgradeRecords2.cc index 0a6b3e1dd1ada..bb691586721a8 100644 --- a/CondCore/L1TPlugins/src/UpgradeRecords2.cc +++ b/CondCore/L1TPlugins/src/UpgradeRecords2.cc @@ -14,6 +14,9 @@ #include "CondFormats/DataRecord/interface/L1TMuonEndCapForestRcd.h" #include "CondFormats/DataRecord/interface/L1TMuonEndCapForestO2ORcd.h" +#include "CondFormats/L1TObjects/interface/L1TMuonOverlapFwVersion.h" +#include "CondFormats/DataRecord/interface/L1TMuonOverlapFwVersionRcd.h" +#include "CondFormats/DataRecord/interface/L1TMuonOverlapFwVersionO2ORcd.h" #include "CondFormats/L1TObjects/interface/L1TMuonOverlapParams.h" #include "CondFormats/DataRecord/interface/L1TMuonOverlapParamsRcd.h" #include "CondFormats/DataRecord/interface/L1TMuonOverlapParamsO2ORcd.h" @@ -32,6 +35,7 @@ REGISTER_PLUGIN(L1TMuonEndcapParamsRcd, L1TMuonEndCapParams); // Temporary copy REGISTER_PLUGIN(L1TMuonEndCapParamsRcd, L1TMuonEndCapParams); REGISTER_PLUGIN(L1TMuonEndCapForestRcd, L1TMuonEndCapForest); +REGISTER_PLUGIN(L1TMuonOverlapFwVersionRcd, L1TMuonOverlapFwVersion); REGISTER_PLUGIN(L1TMuonOverlapParamsRcd, L1TMuonOverlapParams); REGISTER_PLUGIN(L1TMuonBarrelParamsRcd, L1TMuonBarrelParams); REGISTER_PLUGIN(L1TMuonBarrelKalmanParamsRcd, L1TMuonBarrelKalmanParams); @@ -39,6 +43,7 @@ REGISTER_PLUGIN(L1TMuonGlobalParamsRcd, L1TMuonGlobalParams); REGISTER_PLUGIN(L1TMuonEndCapParamsO2ORcd, L1TMuonEndCapParams); REGISTER_PLUGIN(L1TMuonEndCapForestO2ORcd, L1TMuonEndCapForest); +REGISTER_PLUGIN(L1TMuonOverlapFwVersionO2ORcd, L1TMuonOverlapFwVersion); REGISTER_PLUGIN(L1TMuonOverlapParamsO2ORcd, L1TMuonOverlapParams); REGISTER_PLUGIN(L1TMuonBarrelParamsO2ORcd, L1TMuonBarrelParams); REGISTER_PLUGIN(L1TMuonGlobalParamsO2ORcd, L1TMuonGlobalParams); diff --git a/CondCore/Utilities/plugins/Module_2XML.cc b/CondCore/Utilities/plugins/Module_2XML.cc index dfc0c16321ddb..b8344db8e60c2 100644 --- a/CondCore/Utilities/plugins/Module_2XML.cc +++ b/CondCore/Utilities/plugins/Module_2XML.cc @@ -195,6 +195,7 @@ PAYLOAD_2XML_MODULE(pluginUtilities_payload2xml) { PAYLOAD_2XML_CLASS(L1TMuonEndCapParams); PAYLOAD_2XML_CLASS(L1TMuonGlobalParams); PAYLOAD_2XML_CLASS(L1TMuonOverlapParams); + PAYLOAD_2XML_CLASS(L1TMuonOverlapFwVersion); PAYLOAD_2XML_CLASS(L1TUtmAlgorithm); PAYLOAD_2XML_CLASS(L1TUtmBin); PAYLOAD_2XML_CLASS(L1TUtmCondition); @@ -205,6 +206,8 @@ PAYLOAD_2XML_MODULE(pluginUtilities_payload2xml) { PAYLOAD_2XML_CLASS(L1TUtmTriggerMenu); PAYLOAD_2XML_CLASS(L1TriggerKey); PAYLOAD_2XML_CLASS(L1TriggerKeyList); + PAYLOAD_2XML_CLASS(L1TriggerKeyExt); + PAYLOAD_2XML_CLASS(L1TriggerKeyListExt); PAYLOAD_2XML_CLASS(LHCInfo); PAYLOAD_2XML_CLASS(METCorrectorParametersCollection); PAYLOAD_2XML_CLASS(MEtXYcorrectParametersCollection); diff --git a/CondCore/Utilities/src/CondFormats.h b/CondCore/Utilities/src/CondFormats.h index 2fc9054377a8f..53f861aad5595 100644 --- a/CondCore/Utilities/src/CondFormats.h +++ b/CondCore/Utilities/src/CondFormats.h @@ -250,6 +250,7 @@ #include "CondFormats/L1TObjects/interface/L1TMuonEndCapParams.h" #include "CondFormats/L1TObjects/interface/L1TMuonGlobalParams.h" #include "CondFormats/L1TObjects/interface/L1TMuonOverlapParams.h" +#include "CondFormats/L1TObjects/interface/L1TMuonOverlapFwVersion.h" #include "CondFormats/L1TObjects/interface/L1TUtmAlgorithm.h" #include "CondFormats/L1TObjects/interface/L1TUtmBin.h" #include "CondFormats/L1TObjects/interface/L1TUtmCondition.h" @@ -263,6 +264,8 @@ #include "CondFormats/L1TObjects/interface/L1TGlobalPrescalesVetosFract.h" #include "CondFormats/L1TObjects/interface/L1TriggerKey.h" #include "CondFormats/L1TObjects/interface/L1TriggerKeyList.h" +#include "CondFormats/L1TObjects/interface/L1TriggerKeyExt.h" +#include "CondFormats/L1TObjects/interface/L1TriggerKeyListExt.h" #include "CondFormats/PhysicsToolsObjects/interface/Histogram3D.h" #include "CondFormats/PhysicsToolsObjects/interface/PerformancePayload.h" #include "CondFormats/PhysicsToolsObjects/interface/PerformancePayloadFromTFormula.h" diff --git a/CondFormats/DataRecord/interface/L1TMuonOverlapFwVersionO2ORcd.h b/CondFormats/DataRecord/interface/L1TMuonOverlapFwVersionO2ORcd.h new file mode 100644 index 0000000000000..c4a98ca383058 --- /dev/null +++ b/CondFormats/DataRecord/interface/L1TMuonOverlapFwVersionO2ORcd.h @@ -0,0 +1,30 @@ +#ifndef L1TMTFOverlapFwVersionRcd_L1TMuonOverlapFwVersionO2ORcd_h +#define L1TMTFOverlapFwVersionRcd_L1TMuonOverlapFwVersionO2ORcd_h +// -*- C++ -*- +// +// Package: CondFormats/DataRecord +// Class : L1TMuonOverlapFwVersionRcd +// +/**\class L1TMuonOverlapFwVersionRcd L1TMuonOverlapFwVersionRcd.h CondFormats/DataRecord/interface/L1TMuonOverlapFwVersionRcd.h + + Description: [one line class summary] + + Usage: + + +*/ +// +// Author: Michal Szleper +// Created: Wed, 20 Oct 2020 13:55:50 GMT +// + +#include "FWCore/Framework/interface/EventSetupRecordImplementation.h" +#include "CondFormats/DataRecord/interface/L1TriggerKeyListExtRcd.h" +#include "CondFormats/DataRecord/interface/L1TriggerKeyExtRcd.h" +#include "CondFormats/DataRecord/interface/L1TMuonOverlapFwVersionRcd.h" +class L1TMuonOverlapFwVersionO2ORcd + : public edm::eventsetup::DependentRecordImplementation< + L1TMuonOverlapFwVersionO2ORcd, + edm::mpl::Vector > {}; + +#endif diff --git a/CondFormats/DataRecord/interface/L1TMuonOverlapFwVersionRcd.h b/CondFormats/DataRecord/interface/L1TMuonOverlapFwVersionRcd.h new file mode 100644 index 0000000000000..7a2d86948982f --- /dev/null +++ b/CondFormats/DataRecord/interface/L1TMuonOverlapFwVersionRcd.h @@ -0,0 +1,26 @@ +#ifndef L1TMTFOverlapFwVersionRcd_L1TMTFOverlapFwVersionRcd_h +#define L1TMTFOverlapFwVersionRcd_L1TMTFOverlapFwVersionRcd_h +// -*- C++ -*- +// +// Package: CondFormats/DataRecord +// Class : L1TMuonOverlapFwVersionRcd +// +/**\class L1TMuonOverlapFwVersionRcd L1TMuonOverlapFwVersionRcd.h CondFormats/DataRecord/interface/L1TMuonOverlapFwVersionRcd.h + + Description: [one line class summary] + + Usage: + + +*/ +// +// Author: Michal Szleper +// Created: Wed, 20 May 2020 13:50:35 GMT +// + +#include "FWCore/Framework/interface/EventSetupRecordImplementation.h" + +class L1TMuonOverlapFwVersionRcd : public edm::eventsetup::EventSetupRecordImplementation { +}; + +#endif diff --git a/CondFormats/DataRecord/src/L1TMuonOverlapFwVersionO2ORcd.cc b/CondFormats/DataRecord/src/L1TMuonOverlapFwVersionO2ORcd.cc new file mode 100644 index 0000000000000..d53d248ff141c --- /dev/null +++ b/CondFormats/DataRecord/src/L1TMuonOverlapFwVersionO2ORcd.cc @@ -0,0 +1,15 @@ +// -*- C++ -*- +// +// Package: CondFormats/DataRecord +// Class : L1TMuonOverlapFwVersionRcd +// +// Implementation: +// [Notes on implementation] +// +// Author: Michal Szleper +// Created: Wed, 20 Oct 2020 13:58:35 GMT + +#include "CondFormats/DataRecord/interface/L1TMuonOverlapFwVersionO2ORcd.h" +#include "FWCore/Framework/interface/eventsetuprecord_registration_macro.h" + +EVENTSETUP_RECORD_REG(L1TMuonOverlapFwVersionO2ORcd); diff --git a/CondFormats/DataRecord/src/L1TMuonOverlapFwVersionRcd.cc b/CondFormats/DataRecord/src/L1TMuonOverlapFwVersionRcd.cc new file mode 100644 index 0000000000000..8a0074ee07e27 --- /dev/null +++ b/CondFormats/DataRecord/src/L1TMuonOverlapFwVersionRcd.cc @@ -0,0 +1,15 @@ +// -*- C++ -*- +// +// Package: CondFormats/DataRecord +// Class : L1TMuonOverlapFwVersionRcd +// +// Implementation: +// [Notes on implementation] +// +// Author: Michal Szleper +// Created: Wed, 20 Oct 2020 13:57:35 GMT + +#include "CondFormats/DataRecord/interface/L1TMuonOverlapFwVersionRcd.h" +#include "FWCore/Framework/interface/eventsetuprecord_registration_macro.h" + +EVENTSETUP_RECORD_REG(L1TMuonOverlapFwVersionRcd); diff --git a/CondFormats/L1TObjects/interface/L1TMuonOverlapFwVersion.h b/CondFormats/L1TObjects/interface/L1TMuonOverlapFwVersion.h new file mode 100644 index 0000000000000..ac28442c22054 --- /dev/null +++ b/CondFormats/L1TObjects/interface/L1TMuonOverlapFwVersion.h @@ -0,0 +1,49 @@ +#ifndef L1TMuonOverlapFwVersion_h +#define L1TMuonOverlapFwVersion_h + +#include +#include +#include +#include + +#include "CondFormats/Serialization/interface/Serializable.h" +#include "CondFormats/L1TObjects/interface/LUT.h" + +/////////////////////////////////////// +/////////////////////////////////////// +class L1TMuonOverlapFwVersion { +public: + L1TMuonOverlapFwVersion() { + algorithmVer_ = 0x110; + layersVer_ = 0x6; + patternsVer_ = 0x3; + synthDate_ = "2018-9-18 21:26:2"; + } + L1TMuonOverlapFwVersion(unsigned algoV, unsigned layersV, unsigned patternsV, std::string sDate) { + algorithmVer_ = algoV; + layersVer_ = layersV; + patternsVer_ = patternsV; + synthDate_ = sDate; + } + ~L1TMuonOverlapFwVersion() {} + + unsigned algoVersion() const { return algorithmVer_; } + unsigned layersVersion() const { return layersVer_; } + unsigned fwVersion() const { return layersVer_; } + unsigned patternsVersion() const { return patternsVer_; } + std::string synthDate() const { return synthDate_; } + void setAlgoVersion(unsigned algoV) { algorithmVer_ = algoV; } + void setLayersVersion(unsigned layersV) { layersVer_ = layersV; } + void setFwVersion(unsigned layersV) { layersVer_ = layersV; } + void setPatternsVersion(unsigned patternsV) { patternsVer_ = patternsV; } + void setSynthDate(std::string sDate) { synthDate_ = sDate; } + + ///Firmware configuration parameters + unsigned algorithmVer_; + unsigned layersVer_; + unsigned patternsVer_; + std::string synthDate_; + + COND_SERIALIZABLE; +}; +#endif diff --git a/CondFormats/L1TObjects/src/L1TMuonOverlapFwVersion.cc b/CondFormats/L1TObjects/src/L1TMuonOverlapFwVersion.cc new file mode 100644 index 0000000000000..1837e8f1bbe48 --- /dev/null +++ b/CondFormats/L1TObjects/src/L1TMuonOverlapFwVersion.cc @@ -0,0 +1 @@ +#include "CondFormats/L1TObjects/interface/L1TMuonOverlapFwVersion.h" diff --git a/CondFormats/L1TObjects/src/T_EventSetup_L1TMuonOverlapFwVersion.cc b/CondFormats/L1TObjects/src/T_EventSetup_L1TMuonOverlapFwVersion.cc new file mode 100644 index 0000000000000..b157f4a471204 --- /dev/null +++ b/CondFormats/L1TObjects/src/T_EventSetup_L1TMuonOverlapFwVersion.cc @@ -0,0 +1,4 @@ +#include "CondFormats/L1TObjects/interface/L1TMuonOverlapFwVersion.h" +#include "FWCore/Utilities/interface/typelookup.h" + +TYPELOOKUP_DATA_REG(L1TMuonOverlapFwVersion); diff --git a/CondFormats/L1TObjects/src/classes.h b/CondFormats/L1TObjects/src/classes.h index 1e8a970371d25..53469ea1c2d9d 100644 --- a/CondFormats/L1TObjects/src/classes.h +++ b/CondFormats/L1TObjects/src/classes.h @@ -51,6 +51,7 @@ #include "CondFormats/L1TObjects/interface/CaloConfig.h" #include "CondFormats/L1TObjects/interface/L1TMuonOverlapParams.h" +#include "CondFormats/L1TObjects/interface/L1TMuonOverlapFwVersion.h" #include "CondFormats/L1TObjects/interface/L1TMuonGlobalParams.h" #include "CondFormats/L1TObjects/interface/L1TMuonBarrelParams.h" #include "CondFormats/L1TObjects/interface/L1TMuonBarrelKalmanParams.h" @@ -96,6 +97,8 @@ namespace CondFormats_L1TObjects { // std::vector dummy15; // std::vector dummy15a; // std::vector dummy15b; + L1TMuonOverlapFwVersion dummy15; + L1TMuonGlobalParams dummy16; std::vector dummy16a; diff --git a/CondFormats/L1TObjects/src/classes_def.xml b/CondFormats/L1TObjects/src/classes_def.xml index 158b8cdd2c18b..c2fe776b1ee9c 100644 --- a/CondFormats/L1TObjects/src/classes_def.xml +++ b/CondFormats/L1TObjects/src/classes_def.xml @@ -11,6 +11,9 @@ + + + diff --git a/CondTools/L1TriggerExt/plugins/SealModule.cc b/CondTools/L1TriggerExt/plugins/SealModule.cc index 2042439681653..c70f0c4ad507b 100644 --- a/CondTools/L1TriggerExt/plugins/SealModule.cc +++ b/CondTools/L1TriggerExt/plugins/SealModule.cc @@ -61,6 +61,11 @@ REGISTER_L1_WRITER(L1TMuonEndCapParamsO2ORcd, L1TMuonEndCapParams); REGISTER_L1_WRITER(L1TMuonEndCapForestO2ORcd, L1TMuonEndCapForest); +#include "CondFormats/L1TObjects/interface/L1TMuonOverlapFwVersion.h" +#include "CondFormats/DataRecord/interface/L1TMuonOverlapFwVersionO2ORcd.h" + +REGISTER_L1_WRITER(L1TMuonOverlapFwVersionO2ORcd, L1TMuonOverlapFwVersion); + #include "CondFormats/L1TObjects/interface/L1TMuonOverlapParams.h" #include "CondFormats/DataRecord/interface/L1TMuonOverlapParamsO2ORcd.h" diff --git a/CondTools/L1TriggerExt/python/L1CondEnumExt_cfi.py b/CondTools/L1TriggerExt/python/L1CondEnumExt_cfi.py index caf9a5edfa075..4800820a6d0c2 100644 --- a/CondTools/L1TriggerExt/python/L1CondEnumExt_cfi.py +++ b/CondTools/L1TriggerExt/python/L1CondEnumExt_cfi.py @@ -11,5 +11,6 @@ class L1CondEnumExt: L1TCaloParams=7 L1TGlobalPrescalesVetosFract=8 L1TMuonEndCapForest=9 - NumL1Cond=10 + L1TMuonOverlapFwVersion=10 + NumL1Cond=11 diff --git a/CondTools/L1TriggerExt/python/L1ConfigTSCPayloadsExt_cff.py b/CondTools/L1TriggerExt/python/L1ConfigTSCPayloadsExt_cff.py index 28a156e988286..afae222e53681 100644 --- a/CondTools/L1TriggerExt/python/L1ConfigTSCPayloadsExt_cff.py +++ b/CondTools/L1TriggerExt/python/L1ConfigTSCPayloadsExt_cff.py @@ -2,6 +2,7 @@ from L1TriggerConfig.L1TConfigProducers.L1TMuonBarrelParamsOnline_cfi import * from L1TriggerConfig.L1TConfigProducers.L1TMuonGlobalParamsOnline_cfi import * from L1TriggerConfig.L1TConfigProducers.L1TMuonOverlapParamsOnline_cfi import * +from L1TriggerConfig.L1TConfigProducers.L1TMuonOverlapFwVersionOnline_cfi import * from L1TriggerConfig.L1TConfigProducers.L1TMuonEndCapParamsOnline_cfi import * from L1TriggerConfig.L1TConfigProducers.L1TMuonEndCapForestOnline_cfi import * from L1TriggerConfig.L1TConfigProducers.L1TCaloParamsOnline_cfi import * @@ -16,6 +17,7 @@ def setTSCPayloadsDB(process, DBConnect, DBAuth, protoDBConnect, protoDBAuth): process.L1TMuonEndCapForestOnlineProd.onlineDB = cms.string( DBConnect ) process.L1TMuonGlobalParamsOnlineProd.onlineDB = cms.string( DBConnect ) process.L1TMuonOverlapParamsOnlineProd.onlineDB = cms.string( DBConnect ) + process.L1TMuonOverlapFwVersionOnlineProd.onlineDB = cms.string( DBConnect ) process.L1TUtmTriggerMenuOnlineProd.onlineDB = cms.string( DBConnect ) process.L1TCaloParamsOnlineProd.onlineAuthentication = cms.string( DBAuth ) @@ -25,15 +27,18 @@ def setTSCPayloadsDB(process, DBConnect, DBAuth, protoDBConnect, protoDBAuth): process.L1TMuonEndCapForestOnlineProd.onlineAuthentication = cms.string( DBAuth ) process.L1TMuonGlobalParamsOnlineProd.onlineAuthentication = cms.string( DBAuth ) process.L1TMuonOverlapParamsOnlineProd.onlineAuthentication = cms.string( DBAuth ) + process.L1TMuonOverlapFwVersionOnlineProd.onlineAuthentication = cms.string( DBAuth ) process.L1TUtmTriggerMenuOnlineProd.onlineAuthentication = cms.string( DBAuth ) process.l1caloparProtodb.connect = cms.string( protoDBConnect ) process.l1bmtfparProtodb.connect = cms.string( protoDBConnect ) process.l1emtfparProtodb.connect = cms.string( protoDBConnect ) +# process.l1omtfparProtodb.connect = cms.string( protoDBConnect ) process.l1gmtparProtodb.connect = cms.string( protoDBConnect ) process.l1caloparProtodb.DBParameters.authenticationPath = cms.untracked.string( protoDBAuth ) process.l1bmtfparProtodb.DBParameters.authenticationPath = cms.untracked.string( protoDBAuth ) process.l1emtfparProtodb.DBParameters.authenticationPath = cms.untracked.string( protoDBAuth ) +# process.l1omtfparProtodb.DBParameters.authenticationPath = cms.untracked.string( protoDBAuth ) process.l1gmtparProtodb.DBParameters.authenticationPath = cms.untracked.string( protoDBAuth ) def liftPayloadSafetyFor(process, systems): @@ -55,4 +60,5 @@ def liftPayloadSafetyFor(process, systems): if 'OMTF' in systems: process.L1TMuonOverlapParamsOnlineProd.transactionSafe = cms.bool(False) + process.L1TMuonOverlapFwVersionOnlineProd.transactionSafe = cms.bool(False) diff --git a/CondTools/L1TriggerExt/python/L1O2OTagsExt_cfi.py b/CondTools/L1TriggerExt/python/L1O2OTagsExt_cfi.py index 05bd22acd8757..d63fdbc495aca 100644 --- a/CondTools/L1TriggerExt/python/L1O2OTagsExt_cfi.py +++ b/CondTools/L1TriggerExt/python/L1O2OTagsExt_cfi.py @@ -11,6 +11,7 @@ def initL1O2OTagsExt(): initL1O2OTagsExt.tagBaseVec[ L1CondEnumExt.L1TUtmTriggerMenu ] = "Stage2v0_hlt" initL1O2OTagsExt.tagBaseVec[ L1CondEnumExt.L1TGlobalPrescalesVetosFract ] = "Stage2v0_hlt" initL1O2OTagsExt.tagBaseVec[ L1CondEnumExt.L1TMuonBarrelParams ] = "Stage2v1_hlt" + initL1O2OTagsExt.tagBaseVec[ L1CondEnumExt.L1TMuonOverlapFwVersion ] = "Stage2v0_hlt" initL1O2OTagsExt.tagBaseVec[ L1CondEnumExt.L1TMuonOverlapParams ] = "Stage2v0_hlt" initL1O2OTagsExt.tagBaseVec[ L1CondEnumExt.L1TMuonEndCapParams ] = "Stage2v3_hlt" initL1O2OTagsExt.tagBaseVec[ L1CondEnumExt.L1TMuonEndCapForest ] = "Stage2v1_hlt" diff --git a/CondTools/L1TriggerExt/python/L1SubsystemParamsExt_cfi.py b/CondTools/L1TriggerExt/python/L1SubsystemParamsExt_cfi.py index e9f8009a17a74..2c6b8bf6ed7a4 100644 --- a/CondTools/L1TriggerExt/python/L1SubsystemParamsExt_cfi.py +++ b/CondTools/L1TriggerExt/python/L1SubsystemParamsExt_cfi.py @@ -41,6 +41,12 @@ def initL1SubsystemsExt( tagBaseVec = [], type = cms.string('L1TMuonEndCapForest'), key = cms.string(objectKey) ), + cms.PSet( + record = cms.string('L1TMuonOverlapFwVersionO2ORcd'), + tag = cms.string('L1TMuonOverlapFwVersion_' + tagBaseVec[ L1CondEnumExt.L1TMuonOverlapFwVersion ]), + type = cms.string('L1TMuonOverlapFwVersion'), + key = cms.string(objectKey) + ), cms.PSet( record = cms.string('L1TMuonOverlapParamsO2ORcd'), tag = cms.string('L1TMuonOverlapParams_' + tagBaseVec[ L1CondEnumExt.L1TMuonOverlapParams ]), diff --git a/L1Trigger/L1TMuonOverlap/plugins/L1TMuonOverlapFwVersionESProducer.cc b/L1Trigger/L1TMuonOverlap/plugins/L1TMuonOverlapFwVersionESProducer.cc new file mode 100644 index 0000000000000..82ca9f64334ac --- /dev/null +++ b/L1Trigger/L1TMuonOverlap/plugins/L1TMuonOverlapFwVersionESProducer.cc @@ -0,0 +1,35 @@ +#include "sstream" + +// user include files +#include "FWCore/Framework/interface/ModuleFactory.h" +#include "FWCore/Framework/interface/ESProducer.h" +#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Framework/interface/ESProducts.h" + +#include "CondFormats/L1TObjects/interface/L1TMuonOverlapFwVersion.h" +#include "CondFormats/DataRecord/interface/L1TMuonOverlapFwVersionRcd.h" + +#include "L1Trigger/L1TMuonOverlap/plugins/L1TMuonOverlapFwVersionESProducer.h" + +L1TMuonOverlapFwVersionESProducer::L1TMuonOverlapFwVersionESProducer(const edm::ParameterSet& theConfig) { + setWhatProduced(this, &L1TMuonOverlapFwVersionESProducer::produceFwVersion); + + unsigned algoV = theConfig.getParameter("algoVersion"); + unsigned layersV = theConfig.getParameter("layersVersion"); + unsigned patternsV = theConfig.getParameter("patternsVersion"); + std::string sDate = theConfig.getParameter("synthDate"); + params.setAlgoVersion(algoV); + params.setLayersVersion(layersV); + params.setPatternsVersion(patternsV); + params.setSynthDate(sDate); +} + +L1TMuonOverlapFwVersionESProducer::~L1TMuonOverlapFwVersionESProducer() {} + +L1TMuonOverlapFwVersionESProducer::ReturnType L1TMuonOverlapFwVersionESProducer::produceFwVersion( + const L1TMuonOverlapFwVersionRcd& iRecord) { + return std::make_unique(params); +} + +#include "FWCore/Framework/interface/MakerMacros.h" +DEFINE_FWK_EVENTSETUP_MODULE(L1TMuonOverlapFwVersionESProducer); diff --git a/L1Trigger/L1TMuonOverlap/plugins/L1TMuonOverlapFwVersionESProducer.h b/L1Trigger/L1TMuonOverlap/plugins/L1TMuonOverlapFwVersionESProducer.h new file mode 100644 index 0000000000000..5bba71f1d1d29 --- /dev/null +++ b/L1Trigger/L1TMuonOverlap/plugins/L1TMuonOverlapFwVersionESProducer.h @@ -0,0 +1,24 @@ +// system include files +#include + +// user include files +#include "FWCore/Framework/interface/ModuleFactory.h" +#include "FWCore/Framework/interface/ESProducer.h" +#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Framework/interface/ESProducts.h" + +#include "CondFormats/L1TObjects/interface/L1TMuonOverlapFwVersion.h" +#include "CondFormats/DataRecord/interface/L1TMuonOverlapFwVersionRcd.h" + +class L1TMuonOverlapFwVersionESProducer : public edm::ESProducer { +public: + L1TMuonOverlapFwVersionESProducer(const edm::ParameterSet&); + ~L1TMuonOverlapFwVersionESProducer() override; + + using ReturnType = std::unique_ptr; + + ReturnType produceFwVersion(const L1TMuonOverlapFwVersionRcd&); + +private: + L1TMuonOverlapFwVersion params; +}; diff --git a/L1Trigger/L1TMuonOverlap/python/fakeOmtfFwVersion_cff.py b/L1Trigger/L1TMuonOverlap/python/fakeOmtfFwVersion_cff.py new file mode 100644 index 0000000000000..db476ed9048fe --- /dev/null +++ b/L1Trigger/L1TMuonOverlap/python/fakeOmtfFwVersion_cff.py @@ -0,0 +1,18 @@ +import FWCore.ParameterSet.Config as cms + +omtfFwVersionSource = cms.ESSource( + "EmptyESSource", + recordName = cms.string('L1TMuonOverlapFwVersionRcd'), + iovIsRunNotTime = cms.bool(True), + firstValid = cms.vuint32(1) +) + +###OMTF FW ESProducer. +omtfFwVersion = cms.ESProducer( + "L1TMuonOverlapFwVersionESProducer", + algoVersion = cms.uint32(0x110), + layersVersion = cms.uint32(6), + patternsVersion = cms.uint32(3), + synthDate = cms.string("2001-01-01 00:00") +) + diff --git a/L1TriggerConfig/L1TConfigProducers/python/L1TMuonOverlapFwVersionOnline_cfi.py b/L1TriggerConfig/L1TConfigProducers/python/L1TMuonOverlapFwVersionOnline_cfi.py new file mode 100644 index 0000000000000..cd7f616b3d9ef --- /dev/null +++ b/L1TriggerConfig/L1TConfigProducers/python/L1TMuonOverlapFwVersionOnline_cfi.py @@ -0,0 +1,10 @@ +import FWCore.ParameterSet.Config as cms + +from L1Trigger.L1TMuonOverlap.fakeOmtfFwVersion_cff import * + +L1TMuonOverlapFwVersionOnlineProd = cms.ESProducer("L1TMuonOverlapFwVersionOnlineProd", + onlineAuthentication = cms.string('.'), + forceGeneration = cms.bool(False), + onlineDB = cms.string('oracle://CMS_OMDS_LB/CMS_TRG_R'), + transactionSafe = cms.bool(True) # nothrow guarantee if set to False: carry on no matter what +) diff --git a/L1TriggerConfig/L1TConfigProducers/src/L1TMuonOverlapFwVersionOnlineProd.cc b/L1TriggerConfig/L1TConfigProducers/src/L1TMuonOverlapFwVersionOnlineProd.cc new file mode 100644 index 0000000000000..9023a8f3b321f --- /dev/null +++ b/L1TriggerConfig/L1TConfigProducers/src/L1TMuonOverlapFwVersionOnlineProd.cc @@ -0,0 +1,151 @@ +#include +#include + +#include "CondTools/L1TriggerExt/interface/L1ConfigOnlineProdBaseExt.h" +#include "CondFormats/L1TObjects/interface/L1TMuonOverlapFwVersion.h" +#include "CondFormats/DataRecord/interface/L1TMuonOverlapFwVersionRcd.h" +#include "CondFormats/DataRecord/interface/L1TMuonOverlapFwVersionO2ORcd.h" +#include "L1Trigger/L1TCommon/interface/TriggerSystem.h" +#include "L1Trigger/L1TCommon/interface/XmlConfigParser.h" +#include "OnlineDBqueryHelper.h" + +#include "xercesc/util/PlatformUtils.hpp" +using namespace XERCES_CPP_NAMESPACE; + +class L1TMuonOverlapFwVersionOnlineProd + : public L1ConfigOnlineProdBaseExt { +private: + const bool transactionSafe; + const edm::ESGetToken baseSettings_token; + +public: + std::unique_ptr newObject(const std::string& objectKey, + const L1TMuonOverlapFwVersionO2ORcd& record) override; + + L1TMuonOverlapFwVersionOnlineProd(const edm::ParameterSet&); + ~L1TMuonOverlapFwVersionOnlineProd(void) override = default; +}; + +void replaceAll(std::string& str, const std::string& from, const std::string& to) { + if (from.empty()) + return; + size_t start_pos = 0; + while ((start_pos = str.find(from, start_pos)) != std::string::npos) { + str.replace(start_pos, from.length(), to); + start_pos += to.length(); + } +} + +void removeAll(std::string& str, const std::string& from, const std::string& to) { + if (from.empty()) + return; + size_t start_pos = 0; + while ((start_pos = str.find(from, start_pos)) != std::string::npos) { + size_t end_pos = str.find(to) + to.length(); + int length = end_pos - start_pos; + str.replace(start_pos, length, ""); + } +} + +L1TMuonOverlapFwVersionOnlineProd::L1TMuonOverlapFwVersionOnlineProd(const edm::ParameterSet& iConfig) + : L1ConfigOnlineProdBaseExt(iConfig), + transactionSafe(iConfig.getParameter("transactionSafe")), + baseSettings_token(wrappedSetWhatProduced(iConfig).consumes()) {} + +std::unique_ptr L1TMuonOverlapFwVersionOnlineProd::newObject( + const std::string& objectKey, const L1TMuonOverlapFwVersionO2ORcd& record) { + const L1TMuonOverlapFwVersionRcd& baseRcd = record.template getRecord(); + auto const& baseSettings = baseRcd.get(baseSettings_token); + + if (objectKey.empty()) { + edm::LogError("L1-O2O: L1TMuonOverlapFwVersionOnlineProd") + << "Key is empty, returning empty L1TMuonOverlapFwVersion"; + if (transactionSafe) + throw std::runtime_error("SummaryForFunctionManager: OMTF | Faulty | Empty objectKey"); + else { + edm::LogError("L1-O2O: L1TMuonOverlapFwVersionOnlineProd") + << "returning unmodified prototype of L1TMuonOverlapFwVersion"; + return std::make_unique(baseSettings); + } + } + + edm::LogInfo("L1-O2O: L1TMuonOverlapFwVersionOnlineProd") + << "Producing L1TMuonOverlapFwVersion for key = " << objectKey; + + std::string payload, hw_fake; + std::string algoV_string, layersV_string, patternsV_string, synthDate; + + try { + payload = l1t::OnlineDBqueryHelper::fetch({"CONF"}, "OMTF_CLOBS", objectKey, m_omdsReader)["CONF"]; + + } catch (std::runtime_error& e) { + edm::LogError("L1-O2O: L1TMuonOverlapFwVersionOnlineProd") << e.what(); + if (transactionSafe) + throw std::runtime_error(std::string("SummaryForFunctionManager: OMTF | Faulty | ") + e.what()); + else { + edm::LogError("L1-O2O: L1TMuonOverlapFwVersionOnlineProd") + << "returning unmodified prototype of L1TMuonOverlapFwVersion"; + return std::make_unique(baseSettings); + } + } + // for debugging dump the configs to local files + { + std::ofstream output(std::string("/tmp/").append(objectKey.substr(0, objectKey.find('/'))).append(".xml")); + output << objectKey; + output.close(); + } + + // finally push all payloads to the XML parser and construct the TrigSystem object + l1t::XmlConfigParser xmlRdr; + l1t::TriggerSystem parsedXMLs; + + try { + // no need to read all the HW settings, just define a dummy processor + hw_fake = " "; + xmlRdr.readDOMFromString(hw_fake); + parsedXMLs.addProcessor("processors", "processors", "all_crates", "all_slots"); + xmlRdr.readRootElement(parsedXMLs); + + // INFRA payload needs some editing to be suitable for the standard XML parser + replaceAll(payload, "infra", "algo"); + removeAll(payload, ""); + removeAll(payload, ""); + xmlRdr.readDOMFromString(payload); + xmlRdr.readRootElement(parsedXMLs); + + parsedXMLs.setConfigured(); + + } catch (std::runtime_error& e) { + edm::LogError("L1-O2O: L1TMuonOverlapFwVersionOnlineProd") << e.what(); + if (transactionSafe) + throw std::runtime_error(std::string("SummaryForFunctionManager: OMTF | Faulty at parsing XML | ") + e.what()); + else { + edm::LogError("L1-O2O: L1TMuonOverlapFwVersionOnlineProd") + << "returning unmodified prototype of L1TMuonOverlapFwVersion"; + return std::make_unique(baseSettings); + } + } + + std::map conf = parsedXMLs.getParameters("processors"); + algoV_string = conf["algorithmVer"].getValueAsStr(); + layersV_string = conf["layersVer"].getValueAsStr(); + patternsV_string = conf["patternsVer"].getValueAsStr(); + synthDate = conf["synthDate"].getValueAsStr(); + + unsigned algoV, layersV, patternsV; + std::stringstream ssalgoV, sslayersV, sspatternsV; + ssalgoV << std::hex << algoV_string.c_str(); + ssalgoV >> algoV; + sslayersV << std::hex << layersV_string.c_str(); + sslayersV >> layersV; + sspatternsV << std::hex << patternsV_string.c_str(); + sspatternsV >> patternsV; + auto retval = std::make_unique(algoV, layersV, patternsV, synthDate); + + edm::LogInfo("L1-O2O: L1TMuonOverlapFwVersionOnlineProd") + << "SummaryForFunctionManager: OMTF | OK | All looks good"; + return retval; +} + +//define this as a plug-in +DEFINE_FWK_EVENTSETUP_MODULE(L1TMuonOverlapFwVersionOnlineProd); diff --git a/L1TriggerConfig/L1TConfigProducers/src/L1TMuonOverlapObjectKeysOnlineProd.cc b/L1TriggerConfig/L1TConfigProducers/src/L1TMuonOverlapObjectKeysOnlineProd.cc index 39e591c74b39d..e6f7c45463b98 100644 --- a/L1TriggerConfig/L1TConfigProducers/src/L1TMuonOverlapObjectKeysOnlineProd.cc +++ b/L1TriggerConfig/L1TConfigProducers/src/L1TMuonOverlapObjectKeysOnlineProd.cc @@ -1,6 +1,7 @@ #include #include "CondTools/L1TriggerExt/interface/L1ObjectKeysOnlineProdBaseExt.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "OnlineDBqueryHelper.h" class L1TMuonOverlapObjectKeysOnlineProd : public L1ObjectKeysOnlineProdBaseExt { private: @@ -10,7 +11,7 @@ class L1TMuonOverlapObjectKeysOnlineProd : public L1ObjectKeysOnlineProdBaseExt void fillObjectKeys(L1TriggerKeyExt* pL1TriggerKey) override; L1TMuonOverlapObjectKeysOnlineProd(const edm::ParameterSet&); - ~L1TMuonOverlapObjectKeysOnlineProd(void) override {} + ~L1TMuonOverlapObjectKeysOnlineProd(void) override = default; }; L1TMuonOverlapObjectKeysOnlineProd::L1TMuonOverlapObjectKeysOnlineProd(const edm::ParameterSet& iConfig) @@ -21,25 +22,26 @@ L1TMuonOverlapObjectKeysOnlineProd::L1TMuonOverlapObjectKeysOnlineProd(const edm void L1TMuonOverlapObjectKeysOnlineProd::fillObjectKeys(L1TriggerKeyExt* pL1TriggerKey) { std::string OMTFKey = pL1TriggerKey->subsystemKey(L1TriggerKeyExt::kOMTF); - std::string stage2Schema = "CMS_TRG_L1_CONF"; - std::string tscKey = OMTFKey.substr(0, OMTFKey.find(':')); + std::string algo_key, infra_key; - std::vector queryStrings; - queryStrings.push_back("ALGO"); - - std::string algo_key; + // L1TMuonOverlapFwVersion and L1TMuonOverlapParams keys to be found from INFRA and ALGO, respectively - // select ALGO from CMS_TRG_L1_CONF.OMTF_KEYS where ID = tscKey ; - l1t::OMDSReader::QueryResults queryResult = m_omdsReader.basicQuery( - queryStrings, stage2Schema, "OMTF_KEYS", "OMTF_KEYS.ID", m_omdsReader.singleAttribute(tscKey)); + try { + std::map keys = + l1t::OnlineDBqueryHelper::fetch({"ALGO", "INFRA"}, "OMTF_KEYS", tscKey, m_omdsReader); + algo_key = keys["ALGO"]; + infra_key = keys["INFRA"]; - if (queryResult.queryFailed() || queryResult.numberRows() != 1 || !queryResult.fillVariable("ALGO", algo_key)) { - edm::LogError("L1-O2O L1TMuonOverlapObjectKeysOnlineProd") << "Cannot get OMTF_KEYS.ALGO "; + } catch (std::runtime_error& e) { + edm::LogError("L1-O2O L1TMuonOverlapObjectKeysOnlineProd") << "Cannot get OMTF_KEYS "; if (transactionSafe) throw std::runtime_error("SummaryForFunctionManager: OMTF | Faulty | Broken key"); else { + edm::LogError("L1-O2O: L1TMuonOverlapObjectKeysOnlineProd") + << "forcing L1TMuonOverlapFwVersion key to be = 'OMTF_INFRA_EMPTY' with baseline settings"; + pL1TriggerKey->add("L1TMuonOverlapFwVersionO2ORcd", "L1TMuonOverlapFwVersion", "OMTF_INFRA_EMPTY"); edm::LogError("L1-O2O: L1TMuonOverlapObjectKeysOnlineProd") << "forcing L1TMuonOverlapParams key to be = 'OMTF_ALGO_EMPTY' (known to exist)"; pL1TriggerKey->add("L1TMuonOverlapParamsO2ORcd", "L1TMuonOverlapParams", "OMTF_ALGO_EMPTY"); @@ -47,7 +49,8 @@ void L1TMuonOverlapObjectKeysOnlineProd::fillObjectKeys(L1TriggerKeyExt* pL1Trig } } - // simply assign the algo key to the record + pL1TriggerKey->add("L1TMuonOverlapFwVersionO2ORcd", "L1TMuonOverlapFwVersion", infra_key); + pL1TriggerKey->add("L1TMuonOverlapParamsO2ORcd", "L1TMuonOverlapParams", algo_key); } diff --git a/L1TriggerConfig/Utilities/src/L1TMuonOverlapFwVersionTester.cc b/L1TriggerConfig/Utilities/src/L1TMuonOverlapFwVersionTester.cc new file mode 100644 index 0000000000000..e6785afc8bf0b --- /dev/null +++ b/L1TriggerConfig/Utilities/src/L1TMuonOverlapFwVersionTester.cc @@ -0,0 +1,66 @@ +#include +#include + +#include "FWCore/Framework/interface/one/EDAnalyzer.h" + +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" + +#include "FWCore/Framework/interface/EventSetup.h" + +#include "CondFormats/DataRecord/interface/L1TMuonOverlapFwVersionRcd.h" +#include "CondFormats/DataRecord/interface/L1TMuonOverlapFwVersionO2ORcd.h" +#include "CondFormats/L1TObjects/interface/L1TMuonOverlapFwVersion.h" +#include "FWCore/ServiceRegistry/interface/Service.h" +#include "CondCore/DBOutputService/interface/PoolDBOutputService.h" +#include "CondCore/CondDB/interface/Session.h" + +using namespace std; + +class L1TMuonOverlapFwVersionTester : public edm::one::EDAnalyzer<> { +private: + bool isO2Opayload; + bool writeToDB; + edm::ESGetToken esToken; + edm::ESGetToken esToken_O2O; + +public: + void analyze(const edm::Event &, const edm::EventSetup &) override; + + explicit L1TMuonOverlapFwVersionTester(const edm::ParameterSet &pset) : edm::one::EDAnalyzer<>() { + isO2Opayload = pset.getUntrackedParameter("isO2Opayload", false); + writeToDB = pset.getUntrackedParameter("writeToDB", false); + esToken = esConsumes(); + esToken_O2O = esConsumes(); + } + ~L1TMuonOverlapFwVersionTester(void) override = default; +}; + +void L1TMuonOverlapFwVersionTester::analyze(const edm::Event &iEvent, const edm::EventSetup &evSetup) { + L1TMuonOverlapFwVersion data; + if (isO2Opayload) + data = evSetup.getData(esToken_O2O); + else + data = evSetup.getData(esToken); + + edm::LogInfo("L1TMuonOverlapFwVersionTester") + << "*** Contents of L1TMuonOverlapFwVersion: algoVersion() = " << data.algoVersion() + << ", layersVersion() = " << data.layersVersion() << ", patternsVersion() = " << data.patternsVersion() + << ", synthDate() = " << data.synthDate(); + + if (writeToDB) { + edm::Service poolDb; + if (poolDb.isAvailable()) { + edm::LogInfo("L1TMuonOverlapFwVersionTester") << "*** Writing payload to DB"; + cond::Time_t firstSinceTime = poolDb->beginOfTime(); + poolDb->writeOneIOV( + data, firstSinceTime, (isO2Opayload ? "L1TMuonOverlapFwVersionO2ORcd" : "L1TMuonOverlapFwVersionRcd")); + } + } +} + +#include "FWCore/PluginManager/interface/ModuleDef.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/Framework/interface/ModuleFactory.h" + +DEFINE_FWK_MODULE(L1TMuonOverlapFwVersionTester); diff --git a/L1TriggerConfig/Utilities/test/dumpL1TMuonOverlapFwVersion.py b/L1TriggerConfig/Utilities/test/dumpL1TMuonOverlapFwVersion.py new file mode 100644 index 0000000000000..d2734c02269b2 --- /dev/null +++ b/L1TriggerConfig/Utilities/test/dumpL1TMuonOverlapFwVersion.py @@ -0,0 +1,121 @@ +from __future__ import print_function +# to test the communication with DBS and produce the csctf configuration +import FWCore.ParameterSet.Config as cms + +process = cms.Process("QWE") +process.load("FWCore.MessageLogger.MessageLogger_cfi") +process.MessageLogger.cout.enable = cms.untracked.bool(True) +process.MessageLogger.cout.threshold = cms.untracked.string('INFO') +process.MessageLogger.debugModules = cms.untracked.vstring('*') + +import FWCore.ParameterSet.VarParsing as VarParsing +options = VarParsing.VarParsing() +options.register('topKey', + '', # empty default value +# 'TSCKEY_DUMMY:RSKEY_DUMMY', + VarParsing.VarParsing.multiplicity.singleton, + VarParsing.VarParsing.varType.string, + "object key") +options.register('systemKey', +# '', # empty default value + 'L1TMuonOverlapFwVersion_DUMMY', + VarParsing.VarParsing.multiplicity.singleton, + VarParsing.VarParsing.varType.string, + "object key") +options.register('outputDBConnect', + 'sqlite_file:./l1config.db', # default value + VarParsing.VarParsing.multiplicity.singleton, + VarParsing.VarParsing.varType.string, + "Connection string for output DB") +options.register('DBConnect', + 'oracle://cms_omds_adg/CMS_TRG_R', # default value + VarParsing.VarParsing.multiplicity.singleton, + VarParsing.VarParsing.varType.string, + "OMDS connect string") +options.register('DBAuth', + '.', # default value + VarParsing.VarParsing.multiplicity.singleton, + VarParsing.VarParsing.varType.string, + "Authentication path for the DB") +options.parseArguments() + +# sanity checks +if ( len(options.topKey) and len(options.systemKey) ) or ( len(options.topKey)==0 and len(options.systemKey)==0 ) : + print("Specify either the topKey (top-level tsc:rs key) or systemKey (system specific tsc:rs key), but not both") + exit(1) + +# standard CMSSW stuff +process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1) ) +process.source = cms.Source("EmptySource") + +# add dummy L1TriggerKeyList so as to suppress framework related warning +process.load("CondTools.L1TriggerExt.L1TriggerKeyListDummyExt_cff") + +# produce L1TriggerKey for the subsystem online producers +if len(options.topKey) : + # parent L1TriggerKey that will seed system-specific key to be automatically generated below + process.load("CondTools.L1TriggerExt.L1TriggerKeyRcdSourceExt_cfi") + process.load("CondTools.L1TriggerExt.L1SubsystemKeysOnlineExt_cfi") + process.L1SubsystemKeysOnlineExt.tscKey = cms.string( options.topKey.split(':')[0] ) + process.L1SubsystemKeysOnlineExt.rsKey = cms.string( options.topKey.split(':')[1] ) + process.L1SubsystemKeysOnlineExt.onlineAuthentication = cms.string( options.DBAuth ) + process.L1SubsystemKeysOnlineExt.forceGeneration = cms.bool(True) + # using the parent L1TriggerKey above start generation of system-specific (labeled) L1TriggerKeys and pack them the main (unlabeled) L1TriggerKey (just one subsystem here) + process.load("CondTools.L1TriggerExt.L1TriggerKeyOnlineExt_cfi") + process.L1TriggerKeyOnlineExt.subsystemLabels = cms.vstring('OMTF') + # include the system-specific subkeys ESProducer (generates OMTF labeled L1TriggerKey) + process.load("L1TriggerConfig.L1TConfigProducers.L1TMuonOverlapObjectKeysOnline_cfi") + process.L1TMuonOverlapObjectKeysOnline.onlineAuthentication = cms.string( options.DBAuth ) + process.L1TMuonOverlapObjectKeysOnline.onlineDB = cms.string( options.DBConnect ) +else : + # instantiate manually the system-specific L1TriggerKey using the subsystemKey option + process.load("CondTools.L1TriggerExt.L1TriggerKeyDummyExt_cff") + process.L1TriggerKeyDummyExt.tscKey = cms.string('TSCKEY_DUMMY') + process.L1TriggerKeyDummyExt.objectKeys = cms.VPSet( + cms.PSet( + record = cms.string('L1TMuonOverlapFwVersionO2ORcd'), + type = cms.string('L1TMuonOverlapFwVersion'), + key = cms.string(options.systemKey) + ) + ) + +# Online producer for the payload +process.load("L1TriggerConfig.L1TConfigProducers.L1TMuonOverlapFwVersionOnline_cfi") +#process.load("L1Trigger.L1TMuonOverlap.fakeOmtfFwVersion_cff") +#process.L1TMuonOverlapFwVersionOnlineProd.onlineAuthentication = cms.string( options.DBAuth ) +#process.L1TMuonOverlapFwVersionOnlineProd.onlineDB = cms.string( options.DBConnect ) +# +process.getter = cms.EDAnalyzer("EventSetupRecordDataGetter", + toGet = cms.VPSet(cms.PSet( + record = cms.string('L1TMuonOverlapFwVersionO2ORcd'), +# record = cms.string('L1TMuonOverlapFwVersionRcd'), + data = cms.vstring('L1TMuonOverlapFwVersion') + )), + verbose = cms.untracked.bool(True) +) + +process.l1mow = cms.EDAnalyzer("L1TMuonOverlapFwVersionTester", writeToDB = cms.untracked.bool(True), isO2Opayload = cms.untracked.bool(False)) + +from CondCore.CondDB.CondDB_cfi import CondDB +CondDB.connect = cms.string(options.outputDBConnect) + +outputDB = cms.Service("PoolDBOutputService", + CondDB, + toPut = cms.VPSet( + cms.PSet( +# record = cms.string('L1TMuonOverlapFwVersionO2ORcd'), + record = cms.string('L1TMuonOverlapFwVersionRcd'), + tag = cms.string('L1TMuonOverlapFwVersion_Stage2v0_hlt') + ), + cms.PSet( + record = cms.string("L1TriggerKeyListExtRcd"), + tag = cms.string("L1TriggerKeyListExt_Stage2v0_hlt") + ) + ) +) + +outputDB.DBParameters.authenticationPath = options.DBAuth +process.add_(outputDB) + +process.p = cms.Path(process.getter + process.l1mow) + diff --git a/L1TriggerConfig/Utilities/test/uploadOmtfFwVersion.py b/L1TriggerConfig/Utilities/test/uploadOmtfFwVersion.py new file mode 100644 index 0000000000000..5ff6d02b91ee2 --- /dev/null +++ b/L1TriggerConfig/Utilities/test/uploadOmtfFwVersion.py @@ -0,0 +1,42 @@ +import FWCore.ParameterSet.Config as cms + +process = cms.Process("tester") +process.load("FWCore.MessageLogger.MessageLogger_cfi") +process.MessageLogger.cout.enable = cms.untracked.bool(True) +process.MessageLogger.cout.threshold = cms.untracked.string('DEBUG') +process.MessageLogger.debugModules = cms.untracked.vstring('*') + +process.source = cms.Source("EmptySource", firstRun = cms.untracked.uint32(3)) +process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1) ) + +process.load("L1Trigger.L1TMuonOverlap.fakeOmtfFwVersion_cff") + +process.getter = cms.EDAnalyzer("EventSetupRecordDataGetter", + toGet = cms.VPSet( + cms.PSet( + record = cms.string('L1TMuonOverlapFwVersionRcd'), + data = cms.vstring('L1TMuonOverlapFwVersion') + ) + ), + verbose = cms.untracked.bool(True) +) + +from CondCore.CondDB.CondDB_cfi import CondDB +CondDB.connect = cms.string('sqlite:l1config.db') + +outputDB = cms.Service("PoolDBOutputService", + CondDB, + toPut = cms.VPSet( + cms.PSet( + record = cms.string('L1TMuonOverlapFwVersionRcd'), + tag = cms.string('L1TMuonOverlapFwVersionPrototype_Stage2v0_hlt') + ) + ) +) +outputDB.DBParameters.authenticationPath = '.' +process.add_(outputDB) + +process.l1opw = cms.EDAnalyzer("L1TMuonOverlapFwVersionTester", isO2Opayload = cms.untracked.bool(False), writeToDB = cms.untracked.bool(True)) + +process.p = cms.Path(process.getter + process.l1opw) + diff --git a/L1TriggerConfig/Utilities/test/viewOmtfFwVersion.py b/L1TriggerConfig/Utilities/test/viewOmtfFwVersion.py new file mode 100644 index 0000000000000..00328d27479f9 --- /dev/null +++ b/L1TriggerConfig/Utilities/test/viewOmtfFwVersion.py @@ -0,0 +1,57 @@ +from __future__ import print_function +import FWCore.ParameterSet.Config as cms + +process = cms.Process("tester") +process.load("FWCore.MessageLogger.MessageLogger_cfi") +process.MessageLogger.cout.enable = cms.untracked.bool(True) +process.MessageLogger.cout.threshold = cms.untracked.string('DEBUG') +process.MessageLogger.debugModules = cms.untracked.vstring('*') + +import FWCore.ParameterSet.VarParsing as VarParsing +options = VarParsing.VarParsing() +options.register('db', + 'static', + VarParsing.VarParsing.multiplicity.singleton, + VarParsing.VarParsing.varType.string, + "Source DB: prod/prep/static/sqlite" +) +options.register('run', + 1, + VarParsing.VarParsing.multiplicity.singleton, + VarParsing.VarParsing.varType.int, + "Run (IOV)" +) +options.parseArguments() + +if options.db == "static" : + process.load('L1Trigger.L1TMuonOverlap.fakeOmtfFwVersion_cff') +else : + if options.db == "prod" : + sourceDB = "frontier://FrontierProd/CMS_CONDITIONS" + elif options.db == "prep" : + sourceDB = "frontier://FrontierPrep/CMS_CONDITIONS" + elif "sqlite" in options.db : + sourceDB = options.db + else : + print("Unknown input DB: ", options.db, " should be static/prod/prep/sqlite:...") + exit(0) + + from CondCore.CondDB.CondDB_cfi import CondDB + CondDB.connect = cms.string(sourceDB) + process.l1conddb = cms.ESSource("PoolDBESSource", + CondDB, + toGet = cms.VPSet( + cms.PSet( + record = cms.string('L1TMuonOverlapFwVersionRcd'), + tag = cms.string("L1TMuonOverlapFwVersionPrototype_Stage2v0_hlt") + ) + ) + ) + +process.source = cms.Source("EmptySource", firstRun = cms.untracked.uint32(options.run)) +process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1) ) + +process.l1mor = cms.EDAnalyzer("L1TMuonOverlapFwVersionTester", isO2Opayload = cms.untracked.bool(False), writeToDB = cms.untracked.bool(False)) + +process.p = cms.Path(process.l1mor) +