35 struct JParameters_t {
37 static const char SKIPLINE =
'#';
43 number_of_entries (0),
44 number_of_outliers(0),
45 range(JRange<double>::DEFAULT_RANGE())
56 friend inline std::istream&
operator>>(std::istream& in, JParameters_t&
object)
58 return in >>
object.number_of_entries >>
object.number_of_outliers >>
object.range;
69 friend inline std::ostream&
operator<<(std::ostream& out,
const JParameters_t&
object)
74 return out <<
setw(5) <<
object.number_of_entries <<
' '
75 <<
setw(3) <<
object.number_of_outliers <<
' '
76 <<
FIXED(15,3) <<
object.range.getLowerLimit() <<
' '
77 <<
FIXED(15,3) <<
object.range.getUpperLimit();
80 int number_of_entries;
81 int number_of_outliers;
106 JParser<> zap(
"Auxiliary program to apply test criteria to file.");
108 zap[
'f'] =
make_field(inputFile,
"<input file>:<object name>");
111 zap[
'F'] =
make_field(facet,
"Color facet") = get_keys(color_facets);
116 catch(
const exception &error) {
132 JParameters_t parameters;
134 for (
string buffer; getline(in, buffer); ) {
136 if (!buffer.empty() && buffer[0] != JParameters_t::SKIPLINE) {
140 if (is >> key >> parameters) {
141 zmap [key] = parameters;
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;
169 cout.imbue(locale(
cout.getloc(), color_facets[facet]->
clone()));
180 const TString tag(key->GetName());
186 if (tag.Contains(
regexp) && isTObject(key) &&
strcmp(key->GetClassName(),TGraph::Class_Name()) == 0) {
188 TGraph*
g1 =
dynamic_cast<TGraph*
>(key->ReadObj());
194 map_type::const_iterator p = zmap.find(
g1->GetName());
196 if (p != zmap.end()) {
200 const JParameters_t& parameters = p->second;
202 const int number_of_entries =
g1->GetN();
204 int number_of_outliers = 0;
206 for (
int i = 0; i !=
g1->GetN(); ++i) {
207 if (!parameters.range(
g1->GetY()[i])) {
208 ++number_of_outliers;
212 const bool status = (number_of_entries >= parameters.number_of_entries &&
213 number_of_outliers <= parameters.number_of_outliers);
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") <<
'.'
221 if (out !=
NULL && !status) {
227 out->WriteTObject(
g1);
238 if (i->second == 0) {
240 cout << RED <<
"Test " << i->first <<
" missing data." << RESET <<
endl;
I/O coloring auxiliaries.
std::istream & operator>>(std::istream &in, JAANET::JHead &header)
Read header from input.
General purpose messaging.
#define DEBUG(A)
Message macros.
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
I/O formatting auxiliaries.
#define MAKE_CSTRING(A)
Make C-string.
Double_t g1(const Double_t x)
Function.
Auxiliary class to define a range between two values.
int main(int argc, char **argv)
Auxiliary methods to convert data members or return values of member methods of a set of objects to a...
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.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for floating point format specification.
virtual clone_type clone() const override
Get clone of this object.