53 TRG_MSG_INFO(
"Started loading data with HLT PSK: " << hltpss.
id());
62 unique_ptr< coral::IQuery > q(
m_session.nominalSchema().newQuery() );
65 q->addToTableList (
"HLT_PRESCALE_SET",
"PS" );
66 q->addToTableList (
"HLT_PRESCALE",
"PR" );
71 coral::AttributeList bindList;
72 bindList.extend<
int>(
"psid");
73 bindList[0].data<
int>() = (
int)hltpss.
id();
76 string theCondition =
" PS.HPS_ID = :psid";
77 theCondition +=
" AND PS.HPS_ID = PR.HPR_PRESCALE_SET_ID";
78 q->setCondition( theCondition, bindList );
81 coral::AttributeList attList;
82 attList.extend<
string>(
"PS.HPS_NAME" );
83 attList.extend<
int> (
"PS.HPS_VERSION" );
85 attList.extend<
string>(
"PR.HPR_L2_OR_EF" );
86 attList.extend<
string>(
"PR.HPR_PASS_THROUGH_RATE" );
87 attList.extend<
string>(
"PR.HPR_PRESCALE" );
89 attList.extend<
float> (
"PR.HPR_VALUE" );
90 attList.extend<
string> (
"PR.HPR_TYPE" );
91 attList.extend<
string> (
"PR.HPR_CONDITION" );
93 attList.extend<
int> (
"PR.HPR_CHAIN_COUNTER" );
100 theOrder =
" PR.HPR_L2_OR_EF DESC, PR.HPR_CHAIN_COUNTER ASC";
102 theOrder +=
"PR.HPR_CHAIN_COUNTER ASC";
104 q->addToOrderList( theOrder );
107 q->setRowCacheSize(1000);
111 coral::ICursor& cursor = q->execute();
113 bool pssnameset =
false;
117 while (cursor.next()) {
119 const coral::AttributeList& row = cursor.currentRow();
122 string pssname = CheckTilda(row[
"PS.HPS_NAME"].
data<string>());
123 int pssversion = row[
"PS.HPS_VERSION"].data<
int>();
129 string level =
isRun1() ? row[
"PR.HPR_L2_OR_EF"].data<
string>() :
"HLT";
130 int counter = row[
"PR.HPR_CHAIN_COUNTER"].data<
int>();
136 std::string prescaleStr = row[
"PR.HPR_PRESCALE"].data<
string>();
137 if(prescaleStr==
"-0" || prescaleStr==
"na" ) prescaleStr =
"-1";
138 if (!convert(prescaleStr, ps)) {
139 TRG_MSG_WARNING(
"Could not convert prescale string '" << prescaleStr <<
"' of chain " <<
counter <<
" to float");
142 std::string passThroughStr = row[
"PR.HPR_PASS_THROUGH_RATE"].data<
string>();
143 if (!convert(passThroughStr, pt)) {
144 TRG_MSG_WARNING(
"Could not convert passthrough string '" << passThroughStr <<
"' of chain " <<
counter <<
" to float");
147 if(level==
"L2" || level==
"l2" || level==
"EF" || level==
"ef" || level==
"hlt" || level==
"HLT" || level==
"") {
152 std::string streamnametype(std::move(level));
154 if(streamnametype.rfind(
':')==std::string::npos)
155 streamnametype +=
":" + streamnametype;
159 float value = row[
"PR.HPR_VALUE"].data<
float>();
160 string pstype = row[
"PR.HPR_TYPE"].data<
string>();
161 string pscondition = row[
"PR.HPR_CONDITION"].data<
string>();
163 TRG_MSG_DEBUG(
"Loaded prescales:"<< setw(4) << right <<
counter <<
" : " << pstype <<
" (" << pscondition <<
") => " << value );
167 if(pstype==
"Prescale") {
168 thePS.setPrescale(value);
169 }
else if (pstype==
"Pass_Through") {
170 thePS.setPassThrough(value);
171 }
else if (pstype==
"ReRun") {
172 if(pscondition==
"0") pscondition=
"";
173 thePS.setRerunPrescale(pscondition,value);
174 }
else if (pstype==
"Stream") {
176 thePS.setStreamPrescale(pscondition,value);
178 TRG_MSG_WARNING(
"Could not interpret this entry in the prescale set table: counter " <<
counter <<
" : " << pstype <<
" (" << pscondition <<
") => " << value);
190 catch (
const coral::SchemaException& e) {
191 TRG_MSG_ERROR(
"HLTPrescaleSetLoader >> IRelationalException: " << e.what());
195 catch (
const std::exception& e) {
196 TRG_MSG_ERROR(
"HLTPrescaleSetLoader >> Standard C++ exception: " << e.what());
201 TRG_MSG_ERROR(
"HLTPrescaleSetLoader >> unknown C++ exception");