1 #ifndef CondTools_L1TriggerExt_L1ConfigOnlineProdBaseExt_h
2 #define CondTools_L1TriggerExt_L1ConfigOnlineProdBaseExt_h
6 #include "boost/shared_ptr.hpp"
33 template<
class TRcd,
class TData >
39 boost::shared_ptr< TData >
produce(
const TRcd& iRecord);
41 virtual boost::shared_ptr< TData >
newObject(
56 boost::shared_ptr< TData >
data,
65 template<
class TRcd,
class TData >
68 m_forceGeneration( iConfig.getParameter< bool >(
"forceGeneration" ) ),
70 m_copyFromCondDB(
false )
78 if( iConfig.
exists(
"copyFromCondDB" ) )
100 template<
class TRcd,
class TData >
109 template<
class TRcd,
class TData >
110 boost::shared_ptr< TData >
113 using namespace edm::es;
114 boost::shared_ptr< TData > pData ;
118 if( getObjectKey( iRecord, pData,
key ) || m_forceGeneration )
120 if( m_copyFromCondDB )
126 iRecord.template getRecord< L1TriggerKeyListExtRcd >() ;
131 keyListRcd.
get( keyList ) ;
137 keyList->token( recordName, dataType,
key ) ;
140 <<
"Copying payload for " << recordName
141 <<
"@" << dataType <<
" obj key " <<
key
144 <<
"TOKEN " << payloadToken ;
148 if( !payloadToken.empty() )
150 m_dbSession.transaction().start() ;
151 pData = m_dbSession.fetchPayload<TData>( payloadToken ) ;
152 m_dbSession.transaction().commit ();
157 pData = newObject(
key ) ;
161 if( pData == boost::shared_ptr< TData >() )
166 dataType +
" for key " +
key +
175 " for key " +
key +
" already in CondDB." ) ;
182 template<
class TRcd,
class TData >
186 boost::shared_ptr< TData >
data,
191 record.template getRecord< L1TriggerKeyExtRcd >() ;
214 objectKey = key->get( recordName, dataType ) ;
229 <<
"Problem getting last L1TriggerKeyListExt" ;
T getParameter(std::string const &) const
bool fillLastTriggerKeyList(L1TriggerKeyListExt &output)
cond::persistency::Session m_dbSession
bool exists(std::string const ¶meterName) const
checks if a parameter exists
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
l1t::OMDSReader m_omdsReader
L1ConfigOnlineProdBaseExt(const edm::ParameterSet &)
boost::shared_ptr< TData > produce(const TRcd &iRecord)
void get(HolderT &iHolder) const
Session createSession(const std::string &connectionString, bool writeCapable=false)
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
void connect(const std::string &connectString, const std::string &authenticationPath)
~L1ConfigOnlineProdBaseExt()
virtual boost::shared_ptr< TData > newObject(const std::string &objectKey)=0
volatile std::atomic< bool > shutdown_flag false
void setAuthenticationPath(const std::string &p)
bool getObjectKey(const TRcd &record, boost::shared_ptr< TData > data, std::string &objectKey)
std::string token(const std::string &tscKey) const