15 #include "cetlib_except/exception.h"
16 #include "messagefacility/MessageLogger/MessageLogger.h"
46 tup = getTuple(dataset, 0);
56 tup = getTuple(dataset, 1);
58 if ( 0 == strcmp(buf,
"-") )
69 tup = getTuple(dataset, 2);
70 size_t ncols = getNfields(tup);
73 for (
size_t col=0; col<
ncols; ++col) {
82 tup = getTuple(dataset, 3);
84 for (
size_t col=0; col <
ncols; ++col) {
93 fData.reserve(nrows * ncols);
100 for(
size_t col = 0; col <
ncols; ++col) {
106 long value = strtol(buf, 0, 10);
116 double value = strtod(buf, 0);
121 mf::LogError(
"DBDataset") <<
"First column has wrong type real." <<
"\n";
122 throw cet::exception(
"DBDataset") <<
"First column has wrong type real.";
126 fData.emplace_back(std::make_unique<std::string>(buf));
130 mf::LogError(
"DBDataset") <<
"First column has wrong type text." <<
"\n";
131 throw cet::exception(
"DBDataset") <<
"First column has wrong type text.";
136 std::string
s = std::string(buf);
137 if(s ==
"true" || s ==
"True" || s ==
"TRUE" || s ==
"1")
139 else if(s ==
"false" || s ==
"False" || s ==
"FALSE" || s ==
"0")
142 mf::LogError(
"DBDataset") <<
"Unknown string representation of boolean " << s <<
"\n";
143 throw cet::exception(
"DBDataset") <<
"Unknown string representation of boolean " << s
150 mf::LogError(
"DBDataset") <<
"First column has wrong type boolean." <<
"\n";
151 throw cet::exception(
"DBDataset") <<
"First column has wrong type boolean.";
155 mf::LogError(
"DBDataset") <<
"Unknown datatype = " <<
fColTypes[col] <<
"\n";
156 throw cet::exception(
"DBDataset") <<
"Unknown datatype = " <<
fColTypes[col]
157 <<
": " << buf <<
"\n";
166 releaseDataset(dataset);
173 std::vector<std::string>&& col_names,
174 std::vector<std::string>&& col_types,
175 std::vector<DBChannelID_t>&& channels,
176 std::vector<value_type>&& data) :
177 fBeginTime(begin_time),
179 fColNames(
std::move(col_names)),
180 fColTypes(
std::move(col_types)),
181 fChannels(
std::move(channels)),
182 fData(
std::move(data))
195 int high = fChannels.size() - 1;
196 while(high-low > 1) {
197 int mid = (low + high) / 2;
198 if(fChannels[mid] < ch)
200 else if(fChannels[mid] > ch)
214 if(fChannels[low] == ch)
216 else if(fChannels[high] == ch)
234 for(
size_t i=0; i<fColNames.size(); ++i) {
235 if(fColNames[i] == name) {
const unsigned int kNUMBER_HEADER_ROWS
double std(const std::vector< short > &wf, const double ped_mean, size_t start, size_t nsample)
std::variant< long, double, std::unique_ptr< std::string > > value_type
std::uint32_t DBChannelID_t
EResult err(const char *call)
std::vector< std::string > fColNames
int getRowNumber(DBChannelID_t ch) const
standard_dbscan3dalg useful for diagnostics hits not in a line will not be clustered on on only for track like only for track like on on the smaller the less shower like tracks low
std::vector< std::string > fColTypes
then echo fcl sbnd_project sbnd_project sbnd_project sbnd_project production production end_time
std::vector< value_type > fData
const unsigned int kBUFFER_SIZE
std::vector< DBChannelID_t > fChannels
then echo File list $list not found else cat $list while read file do echo $file sed s
int getColNumber(const std::string &name) const
static IOVTimeStamp GetFromString(const std::string &ts)
static IOVTimeStamp MaxTimeStamp()