1 #ifndef CondTools_L1Trigger_L1ConfigOnlineProdBase_h 2 #define CondTools_L1Trigger_L1ConfigOnlineProdBase_h 51 template <
class TRcd,
class TData>
57 virtual std::unique_ptr<TData>
produce(
const TRcd& iRecord);
81 template <
class TRcd,
class TData>
84 m_forceGeneration(iConfig.getParameter<
bool>(
"forceGeneration")),
86 m_copyFromCondDB(
false) {
95 if (iConfig.
exists(
"copyFromCondDB")) {
111 template <
class TRcd,
class TData>
117 template <
class TRcd,
class TData>
119 std::unique_ptr<TData> pData;
123 if (getObjectKey(iRecord,
key) || m_forceGeneration) {
124 if (m_copyFromCondDB) {
125 auto keyList = iRecord.getHandle(l1TriggerKeyListToken_);
138 if (!payloadToken.empty()) {
139 m_dbSession.transaction().start();
140 pData = m_dbSession.fetchPayload<TData>(payloadToken);
141 m_dbSession.transaction().commit();
144 pData = newObject(
key);
148 if (pData == std::unique_ptr<TData>()) {
162 template <
class TRcd,
class TData>
172 key = iRecord.getHandle(l1TriggerKeyToken_);
188 edm::LogError(
"L1-O2O") <<
"Problem getting last L1TriggerKeyList";
Log< level::Info, true > LogVerbatim
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
T getParameter(std::string const &) const
bool getObjectKey(const TRcd &record, std::string &objectKey)
cond::persistency::Session m_dbSession
bool exists(std::string const ¶meterName) const
checks if a parameter exists
std::string token(const std::string &tscKey) const
Log< level::Error, false > LogError
Session createSession(const std::string &connectionString, bool writeCapable=false)
l1t::OMDSReader m_omdsReader
bool fillLastTriggerKeyList(L1TriggerKeyList &output)
void connect(const std::string &connectString, const std::string &authenticationPath)
edm::ESGetToken< L1TriggerKey, TRcd > l1TriggerKeyToken_
L1ConfigOnlineProdBase(const edm::ParameterSet &)
edm::ESGetToken< L1TriggerKeyList, TRcd > l1TriggerKeyListToken_
~L1ConfigOnlineProdBase() override
virtual std::unique_ptr< TData > produce(const TRcd &iRecord)
virtual std::unique_ptr< TData > newObject(const std::string &objectKey)=0
void setAuthenticationPath(const std::string &p)