41 int main(
const int argc,
const char *
const argv[])
45 using namespace KM3NETDAQ;
56 JParser<> zap(
"Auxiliary program to check trigger parameters in a given ROOT files against the values from the database.");
67 catch(
const exception& error) {
68 FATAL(error.what() << endl);
72 const double Dmax_m = 9999.0;
78 DEBUG(
"Get trigger parameters from input file." << endl);
84 FATAL(
"No trigger parameters from input." << endl);
87 parametersA.set(Dmax_m);
99 detector_id = in.
next()->getDetectorID();
100 run_number = in.
next()->getRunNumber();
104 FATAL(
"File does not contain a valid run number. Aborting" << endl);
111 catch(
const exception& error) {
112 FATAL(error.what() << endl);
130 DEBUG(
"Detector " << detector_id <<
" -> " << detid << endl);
132 catch(
const exception& error) {
133 FATAL(error.what() << endl);
151 DEBUG(
"Run setup " << rs_oid << endl);
153 catch(
const exception& error) {
154 FATAL(error.what() << endl);
167 while (rs >> buffer) {
169 umap[buffer.
OID] = buffer.
NAME;
173 if (pos != string::npos) {
177 while (pos + len != buffer.
NAME.length() && buffer.
NAME[pos + len] !=
'=') {
181 zmap[buffer.
OID] = buffer.
NAME.erase(pos, len + 1);
187 DEBUG(
"Parameters map " << zmap.size() << endl);
189 catch(
const exception& error) {
190 FATAL(error.what() << endl);
202 while (rs >> buffer) {
208 if (i != zmap.end()) {
209 data << i->second <<
"=" << buffer.
VALUE <<
";\n";
215 catch(
const exception& error) {
216 FATAL(error.what() << endl);
219 DEBUG(
"Raw data" << endl <<
"<<" << endl << data.str() <<
">>" << endl);
224 parametersB.set(Dmax_m);
225 parametersB.actionAtFileRead();
248 const bool is_equal = (parametersA == parametersB);
251 NOTICE(
GREEN <<
"The parameters for run " << run_number <<
" are equivalent." <<
RESET << endl);
253 ERROR (
RED <<
"The parameters for run " << run_number <<
" are NOT equivalent." <<
RESET << endl);
255 return (is_equal ? 0 : 1);
Utility class to parse command line options.
int main(int argc, char *argv[])
ROOT TTree parameter settings of various packages.
Recording of objects on file according a format that follows from the file name extension.
Auxiliary class for multiplexing object iterators.
Scanning of objects from a single file according a format that follows from the extension of each fil...
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
virtual const pointer_type & next() override
Get next element.
virtual bool hasNext() override
Check availability of next element.
General purpose messaging.
static const std::string PREFIX_DATAFILTER
This string is prepended to every parameter in the database output for the corresponding process...
Utility class to parse command line options.
ResultSet & getResultSet(const std::string &query)
Get result set.
Object reading from a list of files.
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Template definition for getting table specific selector.
JTriggerParameters getTriggerParameters(const JMultipleFileScanner_t &file_list)
Get trigger parameters.
#define DEBUG(A)
Message macros.