1 #ifndef CondTools_L1Trigger_L1ConfigOnlineProdBase_h 2 #define CondTools_L1Trigger_L1ConfigOnlineProdBase_h 52 template <
class TRcd,
class TData>
58 virtual std::unique_ptr<TData>
produce(
const TRcd& iRecord);
83 template <
class TRcd,
class TData>
86 m_forceGeneration(iConfig.getParameter<
bool>(
"forceGeneration")),
88 m_copyFromCondDB(
false) {
99 if (iConfig.
exists(
"copyFromCondDB")) {
115 template <
class TRcd,
class TData>
121 template <
class TRcd,
class TData>
123 std::unique_ptr<TData> pData;
127 if (getObjectKey(iRecord,
key) || m_forceGeneration) {
128 if (m_copyFromCondDB) {
129 auto keyList = iRecord.getHandle(l1TriggerKeyListToken_);
142 if (!payloadToken.empty()) {
143 m_dbSession.transaction().start();
144 pData = m_dbSession.fetchPayload<TData>(payloadToken);
145 m_dbSession.transaction().commit();
148 pData = newObject(
key);
152 if (pData == std::unique_ptr<TData>()) {
166 template <
class TRcd,
class TData>
176 key = iRecord.getHandle(l1TriggerKeyToken_);
192 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
uint32_t cc[maxCellsPerHit]
bool exists(std::string const ¶meterName) const
checks if a parameter exists
std::string token(const std::string &tscKey) const
std::optional< edm::ESConsumesCollectorT< TRcd > > m_consumesCollector
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)