|
|
Go to the documentation of this file. 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);
79 template <
class TRcd,
class TData>
82 m_forceGeneration(iConfig.getParameter<
bool>(
"forceGeneration")),
84 m_copyFromCondDB(
false) {
91 if (iConfig.
exists(
"copyFromCondDB")) {
107 template <
class TRcd,
class TData>
113 template <
class TRcd,
class TData>
115 std::unique_ptr<TData> pData;
119 if (getObjectKey(iRecord,
key) || m_forceGeneration) {
120 if (m_copyFromCondDB) {
124 keyListRcd.
get(keyList);
137 if (!payloadToken.empty()) {
138 m_dbSession.transaction().start();
139 pData = m_dbSession.fetchPayload<TData>(payloadToken);
140 m_dbSession.transaction().commit();
143 pData = newObject(
key);
147 if (pData == std::unique_ptr<TData>()) {
161 template <
class TRcd,
class TData>
194 edm::LogError(
"L1-O2O") <<
"Problem getting last L1TriggerKeyList";
l1t::OMDSReader m_omdsReader
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
~L1ConfigOnlineProdBase() override
Session createSession(const std::string &connectionString, bool writeCapable=false)
virtual std::unique_ptr< TData > produce(const TRcd &iRecord)
virtual std::unique_ptr< TData > newObject(const std::string &objectKey)=0
L1ConfigOnlineProdBase(const edm::ParameterSet &)
void connect(const std::string &connectString, const std::string &authenticationPath)
bool getObjectKey(const TRcd &record, std::string &objectKey)
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
bool exists(std::string const ¶meterName) const
checks if a parameter exists
void setAuthenticationPath(const std::string &p)
Log< level::Error, false > LogError
cond::persistency::Session m_dbSession
bool fillLastTriggerKeyList(L1TriggerKeyList &output)
Log< level::Info, true > LogVerbatim
T getParameter(std::string const &) const
PRODUCT const & get(ESGetToken< PRODUCT, T > const &iToken) const
std::string token(const std::string &tscKey) const