1 #ifndef CondTools_L1TriggerExt_L1ConfigOnlineProdBaseExt_h
2 #define CondTools_L1TriggerExt_L1ConfigOnlineProdBaseExt_h
32 template<
class TRcd,
class TData >
38 std::shared_ptr< TData >
produce(
const TRcd& iRecord);
40 virtual std::shared_ptr< TData >
newObject(
41 const std::string& objectKey,
const TRcd& iRecord) = 0 ;
55 std::shared_ptr< TData >
data,
64 template<
class TRcd,
class TData >
67 m_forceGeneration( iConfig.getParameter< bool >(
"forceGeneration" ) ),
69 m_copyFromCondDB(
false )
77 if( iConfig.
exists(
"copyFromCondDB" ) )
99 template<
class TRcd,
class TData >
108 template<
class TRcd,
class TData >
109 std::shared_ptr< TData >
112 using namespace edm::es;
113 std::shared_ptr< TData > pData ;
117 if( getObjectKey( iRecord, pData,
key ) || m_forceGeneration )
119 if( m_copyFromCondDB )
125 iRecord.template getRecord< L1TriggerKeyListExtRcd >() ;
130 keyListRcd.
get( keyList ) ;
136 keyList->token( recordName, dataType,
key ) ;
139 <<
"Copying payload for " << recordName
140 <<
"@" << dataType <<
" obj key " <<
key
143 <<
"TOKEN " << payloadToken ;
147 if( !payloadToken.empty() )
149 m_dbSession.transaction().start() ;
150 pData = m_dbSession.fetchPayload<TData>( payloadToken ) ;
151 m_dbSession.transaction().commit ();
156 pData = newObject(
key, iRecord ) ;
160 if( pData == std::shared_ptr< TData >() )
165 dataType +
" for key " +
key +
174 " for key " +
key +
" already in CondDB." ) ;
181 template<
class TRcd,
class TData >
185 std::shared_ptr< TData >
data,
190 record.template getRecord< L1TriggerKeyExtRcd >() ;
213 objectKey = key->get( recordName, dataType ) ;
228 <<
"Problem getting last L1TriggerKeyListExt" ;
T getParameter(std::string const &) const
bool fillLastTriggerKeyList(L1TriggerKeyListExt &output)
virtual std::shared_ptr< TData > newObject(const std::string &objectKey, const TRcd &iRecord)=0
cond::persistency::Session m_dbSession
bool exists(std::string const ¶meterName) const
checks if a parameter exists
bool getObjectKey(const TRcd &record, std::shared_ptr< TData > data, std::string &objectKey)
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
l1t::OMDSReader m_omdsReader
L1ConfigOnlineProdBaseExt(const edm::ParameterSet &)
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()
char data[epos_bytes_allocation]
volatile std::atomic< bool > shutdown_flag false
void setAuthenticationPath(const std::string &p)
std::shared_ptr< TData > produce(const TRcd &iRecord)
std::string token(const std::string &tscKey) const