Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:14:23

0001 #include <iostream>
0002 #include <fstream>
0003 #include <stdexcept>
0004 
0005 #include "CondTools/L1TriggerExt/interface/L1ConfigOnlineProdBaseExt.h"
0006 #include "CondFormats/L1TObjects/interface/L1TMuonOverlapParams.h"
0007 #include "CondFormats/DataRecord/interface/L1TMuonOverlapParamsRcd.h"
0008 #include "CondFormats/DataRecord/interface/L1TMuonOverlapParamsO2ORcd.h"
0009 
0010 class L1TMuonOverlapParamsOnlineProd
0011     : public L1ConfigOnlineProdBaseExt<L1TMuonOverlapParamsO2ORcd, L1TMuonOverlapParams> {
0012 private:
0013   bool transactionSafe;
0014 
0015 public:
0016   std::unique_ptr<const L1TMuonOverlapParams> newObject(const std::string& objectKey,
0017                                                         const L1TMuonOverlapParamsO2ORcd& record) override;
0018 
0019   L1TMuonOverlapParamsOnlineProd(const edm::ParameterSet&);
0020   ~L1TMuonOverlapParamsOnlineProd(void) override {}
0021 };
0022 
0023 L1TMuonOverlapParamsOnlineProd::L1TMuonOverlapParamsOnlineProd(const edm::ParameterSet& iConfig)
0024     : L1ConfigOnlineProdBaseExt<L1TMuonOverlapParamsO2ORcd, L1TMuonOverlapParams>(iConfig) {
0025   wrappedSetWhatProduced(iConfig);
0026   transactionSafe = iConfig.getParameter<bool>("transactionSafe");
0027 }
0028 
0029 std::unique_ptr<const L1TMuonOverlapParams> L1TMuonOverlapParamsOnlineProd::newObject(
0030     const std::string& objectKey, const L1TMuonOverlapParamsO2ORcd& record) {
0031   edm::LogError("L1-O2O") << "L1TMuonOverlapParams object with key " << objectKey << " not in ORCON!";
0032 
0033   if (transactionSafe)
0034     throw std::runtime_error(
0035         "SummaryForFunctionManager: OMTF  | Faulty  | You are never supposed to get OMTF online producer running!");
0036 
0037   auto retval = std::make_unique<const L1TMuonOverlapParams>();
0038 
0039   edm::LogError("L1-O2O: L1TMuonOverlapParamsOnlineProd")
0040       << "SummaryForFunctionManager: OMTF  | Faulty  | You are never supposed to get OMTF online producer running; "
0041          "returning empty L1TMuonOverlapParams";
0042   return retval;
0043 }
0044 
0045 //define this as a plug-in
0046 DEFINE_FWK_EVENTSETUP_MODULE(L1TMuonOverlapParamsOnlineProd);