94{
97
101 string facet;
103
104 try {
105
106 JParser<> zap(
"Auxiliary program to apply test criteria to file.");
107
108 zap[
'f'] =
make_field(inputFile,
"<input file>:<object name>");
113
115 }
116 catch(const exception &error) {
118 }
119
120
122
124
125 map_type zmap;
126
128
129 if (in) {
130
132 JParameters_t parameters;
133
134 for (
string buffer;
getline(in, buffer); ) {
135
136 if (!buffer.empty() && buffer[0] != JParameters_t::SKIPLINE) {
137
139
140 if (is >> key >> parameters) {
141 zmap [
key] = parameters;
143 }
144 }
145 }
146
147 in.close();
148
149 } else {
151 }
152
153 if (
debug >= debug_t) {
154 for (map_type::const_iterator i = zmap.begin(); i != zmap.end(); ++i) {
155 cout <<
setw(48) << left << i->first <<
' ' << i->second <<
endl;
156 }
157 }
158
159
161
164 }
165
166
168
169 cout.imbue(locale(
cout.getloc(), color_facets[facet]->
clone()));
170
173
175
177
179
180 const TString tag(
key->GetName());
181
183
184
185
187
188 TGraph*
g1 =
dynamic_cast<TGraph*
>(
key->ReadObj());
189
191
193
194 map_type::const_iterator p = zmap.find(
g1->GetName());
195
196 if (p != zmap.end()) {
197
199
200 const JParameters_t& parameters = p->second;
201
202 const int number_of_entries =
g1->GetN();
203
204 int number_of_outliers = 0;
205
206 for (
int i = 0; i !=
g1->GetN(); ++i) {
207 if (!parameters.range(
g1->GetY()[i])) {
208 ++number_of_outliers;
209 }
210 }
211
212 const bool status = (number_of_entries >= parameters.number_of_entries &&
213 number_of_outliers <= parameters.number_of_outliers);
214
215 cout << (status ? GREEN : RED) <<
"Test " <<
g1->GetName() <<
' '
216 << (status ? "passed" : "failed") << ' '
217 << (number_of_entries >= parameters.number_of_entries ? "" : "too few entries") << ' '
218 << (number_of_outliers <= parameters.number_of_outliers ? "" : "too many outliers") << '.'
220
221 if (out !=
NULL && !status) {
222
224
227 out->WriteTObject(
g1);
228 }
229
232 }
233 }
234 }
235 }
236
238 if (i->second == 0) {
239
240 cout << RED <<
"Test " << i->first <<
" missing data." << RESET <<
endl;
241
244 }
245 }
246
248
250
251 out->Write();
252 out->Close();
253
254 delete out;
255 }
256}
#define DEBUG(A)
Message macros.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
#define MAKE_CSTRING(A)
Make C-string.
Double_t g1(const Double_t x)
Function.
Auxiliary class to handle file name, ROOT directory and object name.
TString getObjectName() const
Get object name.
TString getFullFilename() const
Get full file name, including path.
Template definition of a multi-dimensional oscillation probability interpolation table.
Utility class to parse command line options.
TDirectory * getDirectory(const JRootObjectID &id)
Get TDirectory pointer.
bool isTObject(const TKey *key)
Check if given key corresponds to a TObject.
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line.
const array_type< JKey_t > & get_keys(const std::map< JKey_t, JValue_t, JComparator_t, JAllocator_t > &data)
Method to create array of keys of map.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
virtual clone_type clone() const override
Get clone of this object.