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