#include <NormDML.h>
|
void | normById (const coral::ISchema &schema, unsigned long long normid, std::map< unsigned int, normData > &result) |
|
| NormDML () |
|
unsigned long long | normIdByName (const coral::ISchema &schema, const std::string &normtagname) |
|
void | normIdByType (const coral::ISchema &schema, std::map< std::string, unsigned long long > &resultMap, LumiType=HF, bool defaultonly=true) |
|
void | parseAfterglows (const std::string &afterglowStr, std::map< unsigned int, float > &afterglowmap) |
|
void | parseLumiCorrector (const std::string &correctorStr, std::vector< std::string > &correctorParams) |
|
| ~NormDML () |
|
Definition at line 25 of file NormDML.h.
◆ LumiType
◆ NormDML()
◆ ~NormDML()
lumi::NormDML::~NormDML |
( |
| ) |
|
|
inline |
◆ normById()
void NormDML::normById |
( |
const coral::ISchema & |
schema, |
|
|
unsigned long long |
normid, |
|
|
std::map< unsigned int, normData > & |
result |
|
) |
| |
select * from luminormsv2data where data_id=normid
Definition at line 97 of file NormDML.cc.
101 coral::IQuery* qHandle = schema.newQuery();
104 coral::AttributeList qCondition;
105 qCondition.extend(
"normid",
typeid(
unsigned long long));
106 qCondition[
"normid"].data<
unsigned long long>() = normid;
107 qHandle->setCondition(qConditionStr, qCondition);
108 coral::AttributeList qResult;
109 coral::ICursor& cursor = qHandle->execute();
110 while (cursor.next()) {
111 const coral::AttributeList& row = cursor.currentRow();
112 unsigned int since = row[
"SINCE"].data<
unsigned int>();
118 if (!row[
"AMODETAG"].isNull()) {
121 if (!row[
"NOMINALEGEV"].isNull()) {
122 result[
since].beamegev = row[
"NOMINALEGEV"].data<
unsigned int>();
125 std::vector<std::string> correctorParams;
127 result[
since].corrfunc = *(correctorParams.begin());
128 for (std::vector<std::string>::iterator corrIt = correctorParams.begin() + 1; corrIt != correctorParams.end();
130 std::string paramName = boost::to_upper_copy(*corrIt);
135 float param = row[paramName].data<
float>();
136 result[
since].coefficientmap.insert(std::make_pair(paramName, param));
References lumi::LumiNames::luminormv2dataTableName(), mps_fire::result, writeEcalDQMStatus::since, and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by LumiCorrectionSource::fillparamcache().
◆ normIdByName()
unsigned long long NormDML::normIdByName |
( |
const coral::ISchema & |
schema, |
|
|
const std::string & |
normtagname |
|
) |
| |
select max(DATA_ID) FROM LUMINORMSV2 WHERE ENTRY_NAME=:normname
Definition at line 16 of file NormDML.cc.
18 unsigned long long result = 0;
19 std::vector<unsigned long long> luminormids;
20 coral::IQuery* qHandle = schema.newQuery();
22 qHandle->addToOutputList(
"DATA_ID");
23 if (!normtagname.empty()) {
24 std::string qConditionStr(
"ENTRY_NAME=:normtagname");
25 coral::AttributeList qCondition;
26 qCondition.extend(
"normtagname",
typeid(
std::string));
27 qCondition[
"normtagname"].data<
std::string>() = normtagname;
28 qHandle->setCondition(qConditionStr, qCondition);
30 coral::AttributeList qResult;
31 qResult.extend(
"DATA_ID",
typeid(
unsigned long long));
32 qHandle->defineOutput(qResult);
33 coral::ICursor& cursor = qHandle->execute();
34 while (cursor.next()) {
35 const coral::AttributeList& row = cursor.currentRow();
36 luminormids.push_back(row[
"DATA_ID"].data<unsigned long long>());
39 std::vector<unsigned long long>::iterator resultIt;
40 for (resultIt = luminormids.begin(); resultIt != luminormids.end(); ++resultIt) {
41 if ((*resultIt) >
result) {
References lumi::LumiNames::luminormv2TableName(), mps_fire::result, and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by LumiCorrectionSource::fillparamcache().
◆ normIdByType()
void NormDML::normIdByType |
( |
const coral::ISchema & |
schema, |
|
|
std::map< std::string, unsigned long long > & |
resultMap, |
|
|
LumiType |
lumitype = HF , |
|
|
bool |
defaultonly = true |
|
) |
| |
select max(DATA_ID) FROM LUMINORMSV2 WHERE LUMITYPE=:lumitype and ISTYPEDEFAULT=1
Definition at line 47 of file NormDML.cc.
52 coral::IQuery* qHandle = schema.newQuery();
54 qHandle->addToOutputList(
"DATA_ID");
55 qHandle->addToOutputList(
"ENTRY_NAME");
56 coral::AttributeList qCondition;
61 lumitypeStr =
"PIXEL";
63 qCondition[
"lumitype"].data<
std::string>() = lumitypeStr;
65 qConditionStr +=
" AND ISTYPEDEFAULT=:istypedefault";
66 qCondition.extend(
"istypedefault",
typeid(
unsigned int));
67 qCondition[
"istypedefault"].data<
unsigned int>() = 1;
69 qHandle->setCondition(qConditionStr, qCondition);
70 coral::AttributeList qResult;
71 qResult.extend(
"DATA_ID",
typeid(
unsigned long long));
73 qHandle->defineOutput(qResult);
75 coral::ICursor& cursor = qHandle->execute();
76 while (cursor.next()) {
77 const coral::AttributeList& row = cursor.currentRow();
79 unsigned long long normid = row[
"DATA_ID"].data<
unsigned long long>();
80 if (resultMap.find(normname) == resultMap.end()) {
81 resultMap.insert(std::make_pair(normname, normid));
83 if (resultMap[normname] < normid) {
84 resultMap.insert(std::make_pair(normname, normid));
89 std::cout <<
"database error in NormDML::normIdByType " << er.what() << std::endl;
References gather_cfg::cout, Exception, HF, lumi::LumiNames::luminormv2TableName(), and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by LumiCorrectionSource::fillparamcache().
◆ parseAfterglows()
void NormDML::parseAfterglows |
( |
const std::string & |
afterglowStr, |
|
|
std::map< unsigned int, float > & |
afterglowmap |
|
) |
| |
◆ parseLumiCorrector()
void NormDML::parseLumiCorrector |
( |
const std::string & |
correctorStr, |
|
|
std::vector< std::string > & |
correctorParams |
|
) |
| |