13#include <CoralBase/Attribute.h>
14#include <CoralBase/AttributeList.h>
16#include "RelationalAccess/SchemaException.h"
17#include "RelationalAccess/ITransaction.h"
18#include "RelationalAccess/ITable.h"
19#include "RelationalAccess/ISchema.h"
20#include "RelationalAccess/ICursor.h"
21#include "RelationalAccess/IQuery.h"
32 unsigned int requestcounter,
36 vector< pair<unsigned int, unsigned int> > lb_psk;
42 unique_ptr< coral::IQuery > q(
m_session.nominalSchema().newQuery() );
45 q->addToTableList (
"HLT_PRESCALE_SET_COLL",
"PSC" );
48 coral::AttributeList bindings;
49 bindings.extend<
uint>(
"req");
50 bindings.extend<
string>(
"part");
51 bindings[0].data<
uint>() = requestcounter;
54 string theCondition =
"HPSC_PARTITION=:part and :req>=0";
56 q->setCondition( theCondition, bindings );
59 coral::AttributeList attList;
60 attList.extend<
int>(
"PSC.HPSC_LB" );
61 attList.extend<
int>(
"PSC.HPSC_HLTPSK" );
65 q->addToOrderList(
"PSC.HPSC_LB" );
71 coral::ICursor& cursor = q->execute();
74 while (cursor.next()) {
75 const coral::AttributeList& row = cursor.currentRow();
76 int lb = row[
"PSC.HPSC_LB"].data<
int>();
77 int psk = row[
"PSC.HPSC_HLTPSK"].data<
int>();
78 lb_psk.push_back( make_pair(
lb, psk) );
82 for(
uint i=0; i< lb_psk.size(); i++) {
83 TRG_MSG_INFO(
"For LB " << lb_psk[i].first <<
" onwards load psk " << lb_psk[i].second);
87 catch (
const std::exception& e) {
88 TRG_MSG_ERROR(
"HLTPrescaleSetCollectionLoader: caught exception: " << e.what());
105 bool loadsuccess =
true;
110 if(psinfo.pss!=0)
continue;
114 psinfo.pss->setId(psinfo.psk);
115 bool loadpss = pssloader.
load(*psinfo.pss);
118 TRG_MSG_ERROR(
"HLTPrescaleSetCollectionLoader::load(): Could not load HLT Prescales for key " << psinfo.psk);
StorageMgr & m_storageMgr
reference to the storage manager
virtual MSGTC::Level outputLevel() const override
void commitSession()
commit session if not already done
coral::ISessionProxy & m_session
CORAL interface to database session.
void startSession()
start session if not already active
virtual bool load(HLTPrescaleSetCollection &psc)
HLT chain configuration information.
void set_prescale_keys_to_load(const std::vector< std::pair< unsigned int, unsigned int > > &)
HLT chain configuration information.
virtual bool load(HLTPrescaleSet &hltpss)=0
virtual void setLevel(MSGTC::Level lvl)=0
Load the configuration data from the configuration source.
void fillQuery(coral::IQuery *q, coral::AttributeList &attList)
DataModel_detail::iterator< DVL > partition(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end, Predicate pred)
Specialization of partition for DataVector/List.