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);
59 virtual std::unique_ptr< TData >
newObject(
82 template<
class TRcd,
class TData >
95 if( iConfig.
exists(
"copyFromCondDB" ) )
117 template<
class TRcd,
class TData >
126 template<
class TRcd,
class TData >
127 std::unique_ptr< TData >
130 std::unique_ptr< TData > pData ;
140 iRecord.template getRecord< L1TriggerKeyListRcd >() ;
142 keyListRcd.
get( keyList ) ;
148 keyList->token( recordName, dataType, key ) ;
151 <<
"Copying payload for " << recordName
152 <<
"@" << dataType <<
" obj key " << key
155 <<
"TOKEN " << payloadToken ;
159 if( !payloadToken.empty() )
172 if( pData == std::unique_ptr< TData >() )
177 dataType +
" for key " + key +
186 " for key " + key +
" already in CondDB." ) ;
193 template<
class TRcd,
class TData >
201 record.template getRecord< L1TriggerKeyRcd >() ;
224 objectKey = key->get( recordName, dataType ) ;
236 <<
"Problem getting last L1TriggerKeyList" ;
241 keyList.
token( recordName, dataType, objectKey ).empty() ;
T getParameter(std::string const &) const
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
bool getObjectKey(const TRcd &record, std::string &objectKey)
cond::persistency::Session m_dbSession
void start(bool readOnly=true)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
std::unique_ptr< T > fetchPayload(const cond::Hash &payloadHash)
Transaction & transaction()
virtual std::unique_ptr< TData > newObject(const std::string &objectKey)=0
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)
L1ConfigOnlineProdBase(const edm::ParameterSet &)
std::string token(const std::string &tscKey) const
~L1ConfigOnlineProdBase() override
virtual std::unique_ptr< TData > produce(const TRcd &iRecord)
void setAuthenticationPath(const std::string &p)
bool get(HolderT &iHolder) const