43{
47
51 string usr;
52 string pwd;
53 string cookie;
55
56 try {
57
58 JParser<> zap(
"Auxiliary program to check trigger parameters in a given ROOT files against the values from the database.");
59
67
68 zap(argc, argv);
69 }
70 catch(const exception& error) {
71 FATAL(error.what() << endl);
72 }
73
74
75 const double Dmax_m = 9999.0;
76
79
80
81 try {
83 }
85 ERROR(
"No trigger parameters from input." << endl);
86 }
87
88 parametersA.set(Dmax_m);
89
91
92
93 int detector_id = 0;
94 int run_number = 0;
95
97
98 if (in.hasNext()) {
99
100 detector_id = in.next()->getDetectorID();
101 run_number = in.next()->getRunNumber();
102
103 } else {
104
105 FATAL(
"File does not contain a valid run number." << endl);
106 }
107
108
109 try {
110 JDB::reset(usr, pwd, cookie);
111 }
112 catch(const exception& error) {
113 FATAL(error.what() << endl);
114 }
115
116
117 string rs_oid;
118
119 try {
120
122
124
125 if (rs >> buffer) {
127 }
128
129 rs.Close();
130 }
131 catch(const exception& error) {
132 FATAL(error.what() << endl);
133 }
134
135
137
138 try {
139
141
143
144 while (rs >> buffer) {
145
147
148 if (pos != string::npos) {
149
151
152 zmap[buffer.
OID] = buffer.
NAME.erase(0, pos + 1);
153 }
154 }
155
156 rs.Close();
157 }
158 catch(const exception& error) {
159 FATAL(error.what() << endl);
160 }
161
162
164
165 try {
166
168
170
171 while (rs >> buffer) {
172
174
175 if (i != zmap.end()) {
176 data << i->second <<
"=" << buffer.
VALUE <<
";\n";
177 }
178 }
179
180 rs.Close();
181 }
182 catch(const exception& error) {
183 FATAL(error.what() << endl);
184 }
185
186
188
189 parametersB.set(Dmax_m);
190 parametersB.actionAtFileRead();
191
193
194
196
198
200
202
204
206
208
210 }
211
212
213 const bool is_equal = (parametersA == parametersB);
214
215 if (is_equal)
216 NOTICE(GREEN <<
"The parameters for run " << run_number <<
" are equivalent." << RESET << endl);
217 else
218 ERROR (RED <<
"The parameters for run " << run_number <<
" are NOT equivalent." << RESET << endl);
219
220 return (is_equal ? 0 : 1);
221}
#define DEBUG(A)
Message macros.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Auxiliary class for multiplexing object iterators.
Utility class to parse command line options.
Object reading from a list of files.
ResultSet & getResultSet(const std::string &query)
Get result set.
const char * getTable()
Get table name.
JDetectorsHelper & getDetector()
Auxiliary function for helper object initialisation.
static const std::string PREFIX_DATAFILTER
This string is prepended to every parameter in the database output for the corresponding process.
std::vector< JServer > getServernames()
Get list of names of available database servers.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
JTriggerParameters getTriggerParameters(const JMultipleFileScanner_t &file_list)
Get trigger parameters.
KM3NeT DAQ data structures and auxiliaries.
Wrapper class for server name.
Template definition for getting table specific selector.