99   string         parametersFile;
 
  106     JParser<> zap(
"Auxiliary program to apply test criteria to file.");
 
  108     zap[
'f'] = 
make_field(inputFile,         
"<input file>:<object name>");
 
  109     zap[
'P'] = 
make_field(parametersFile,    
"ASCII formatted input file with test criteria");
 
  116   catch(
const exception &error) {
 
  117     FATAL(error.what() << endl);
 
  127   ifstream in(parametersFile.c_str());
 
  132     JParameters_t parameters;
 
  134     for (
string buffer; 
getline(in, buffer); ) {
 
  136       if (!buffer.empty() && buffer[0] != JParameters_t::SKIPLINE) {
 
  138         istringstream is(buffer);
 
  140         if (is >> key >> parameters) {
 
  141           zmap  [key] = parameters;
 
  150     FATAL(
"Error opening file: " << parametersFile << endl);
 
  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()));
 
  171   int number_of_tests    = 0;
 
  172   int number_of_failures = 0;
 
  176   TIter iter(dir->GetListOfKeys());
 
  178   for (TKey* key; (key = (TKey*) iter.Next()) != NULL; ) {
 
  180     const TString tag(key->GetName());
 
  182     DEBUG(
"Key: " << tag << 
" match = " << tag.Contains(regexp) << endl);
 
  186     if (tag.Contains(regexp) && 
isTObject(key) && strcmp(key->GetClassName(),TGraph::Class_Name()) == 0) {
 
  188       TGraph*  
g1 = 
dynamic_cast<TGraph*
>(key->ReadObj());
 
  190       DEBUG(key->GetName() << 
' ' << (
g1 != NULL) << endl);
 
  194         map_type::const_iterator p = zmap.find(
g1->GetName());
 
  196         if (p != zmap.end()) {
 
  198           counts[p->first] += 1;
 
  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) {
 
  225             g1->GetListOfFunctions()->Add(
new TF1(
MAKE_CSTRING(
g1->GetName() << 
":upper"), 
MAKE_CSTRING(parameters.range.getUpperLimit()), range.getLowerLimit(), range.getUpperLimit()));
 
  226             g1->GetListOfFunctions()->Add(
new TF1(
MAKE_CSTRING(
g1->GetName() << 
":lower"), 
MAKE_CSTRING(parameters.range.getLowerLimit()), range.getLowerLimit(), range.getUpperLimit()));
 
  227             out->WriteTObject(
g1);
 
  230           number_of_tests    +=  1;
 
  231           number_of_failures += (status ? 0 : 1);
 
  238     if (i->second == 0) {
 
  240       cout << 
RED << 
"Test " << i->first << 
" missing data." << 
RESET << endl;
 
  242       number_of_tests    +=  1;
 
  243       number_of_failures +=  1;
 
  247   cout << (number_of_tests > 0 && number_of_failures == 0 ? 
GREEN : 
RED) << 
"Number of tests/failures " << number_of_tests << 
"/" << number_of_failures << 
RESET << endl;
 
#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.
 
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.
 
static const JColorFacetMap_t color_facets
Color facets.
 
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.
 
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line.
 
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
 
std::map< int, range_type > map_type