1 #ifndef CondTools_L1TriggerExt_L1ConfigOnlineProdBaseExt_h
2 #define CondTools_L1TriggerExt_L1ConfigOnlineProdBaseExt_h
31 template <
class TRcd,
class TData>
37 std::unique_ptr<const TData>
produce(
const TRcd& iRecord);
39 virtual std::unique_ptr<const TData>
newObject(
const std::string& objectKey,
const TRcd& iRecord) = 0;
62 template <
class TRcd,
class TData>
65 m_forceGeneration(iConfig.getParameter<
bool>(
"forceGeneration")),
67 m_copyFromCondDB(
false) {
76 if (iConfig.
exists(
"copyFromCondDB")) {
92 template <
class TRcd,
class TData>
95 auto collector = setWhatProduced(
this);
96 keyList_token = collector.consumes();
97 key_token = collector.consumes();
101 template <
class TRcd,
class TData>
107 template <
class TRcd,
class TData>
109 std::unique_ptr<const TData> pData;
113 if (getObjectKey(iRecord,
key) || m_forceGeneration) {
114 if (m_copyFromCondDB) {
119 iRecord.template getRecord<L1TriggerKeyListExtRcd>();
123 auto const& keyList = keyListRcd.
get(keyList_token);
136 if (!payloadToken.empty()) {
137 m_dbSession.transaction().start();
138 pData = m_dbSession.fetchPayload<TData>(payloadToken);
139 m_dbSession.transaction().commit();
142 pData = newObject(
key, iRecord);
146 if (pData == std::unique_ptr<const TData>()) {
160 template <
class TRcd,
class TData>
173 keyRcd.
get(key_token);
196 edm::LogError(
"L1-O2O") <<
"Problem getting last L1TriggerKeyListExt";