18 #include "cetlib_except/exception.h" 20 #include "nuevdb/IFDatabase/Util.h" 21 #include <boost/tokenizer.hpp> 28 if (detid > 0 && detid < kNDUNEDetectors && run > 0) {
71 std::cout << __PRETTY_FUNCTION__ <<
": Error in line " << __LINE__ <<
". Detector name is undefined." <<
std::endl;
80 int chanNameIdx = t.
AddCol(
"chan_name",
"text");
87 std::cout <<
"Error in " << __PRETTY_FUNCTION__ <<
", line " << __LINE__ <<
". Load from database failed." <<
std::endl;
92 std::cout <<
"Error in " << __PRETTY_FUNCTION__ <<
", line " << __LINE__ <<
". Number of rows in table is 0. This should never be the case!" <<
std::endl;
99 for (
int i=0; i<t.
NRow(); ++i) {
102 row->
Col(chanNameIdx).
Get(chanName);
120 std::vector<uint64_t> chanList =
fSCDataTable->VldChannels();
122 for (
size_t ichan=0; ichan<chanList.size(); ++ichan) {
123 std::vector<nutools::dbi::Row*> vldRow =
fSCDataTable->GetVldRows(chanList[ichan]);
126 for (
size_t irow=0; irow<vldRow.size(); ++irow) {
127 vldRow[irow]->Col(rvIdx).Get(rv);
128 std::cout <<
", (" << rv <<
"," << vldRow[irow]->VldTime()-
fTStart <<
")";
140 int chan = i.first%100000;
141 int asic = i.first/100000;
142 std::cout <<
"ASIC " << asic <<
", " << chan <<
": " << i.second.gain <<
" mV/fC, " << i.second.shape <<
" us, " << i.second.base <<
" mV" <<
std::endl;
167 std::cout <<
"Error in " << __PRETTY_FUNCTION__ <<
", line " << __LINE__ <<
". Load from database failed." <<
std::endl;
172 std::cout <<
"WARNING! " << __PRETTY_FUNCTION__ <<
", no ASIC settings found for this run." <<
std::endl;
210 std::cout <<
"Error in " << __PRETTY_FUNCTION__ <<
", line " << __LINE__ <<
". Load from database failed." <<
std::endl;
222 if (run == 0)
return false;
234 int runIdx = t.
AddCol(
"run",
"integer");
235 int cfgLabelIdx = t.
AddCol(
"configuration_label",
"integer");
236 int runTypeIdx = t.
AddCol(
"run_type",
"text");
237 int compListIdx = t.
AddCol(
"component_list",
"text");
238 int startIdx = t.
AddCol(
"start",
"timestamp");
239 int stopIdx = t.
AddCol(
"stop",
"timestamp");
255 row->
Col(runIdx).
Get(runNum);
257 row->
Col(compListIdx).
Get(compList);
258 row->
Col(runTypeIdx).
Get(runTypeStr);
262 if (runNum !=
int(run)) abort();
264 boost::tokenizer< boost::escaped_list_separator<char> > tok(compList);
Pedestal provider class for DUNE.
virtual bool Update(uint64_t ts=0) override
std::unordered_map< int, std::string > fSCInvChanMap
virtual ~RunHistoryDUNE()
std::unique_ptr< nutools::dbi::Table > fASICSettingsTable
std::unordered_map< std::string, int > fSCChanMap
RunHistoryDUNE(int detid, int runnum)
std::unique_ptr< nutools::dbi::Table > fSCDataTable
unsigned __int64 uint64_t
virtual std::string RunTypeAsString() const override
std::unordered_map< int, ASICSetting > fASICSettingsMap
std::vector< std::string > fComponents
QTextStream & endl(QTextStream &s)