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;
 
   93 int main(
int argc, 
char **argv)
 
   98   JRootObjectID  inputFile;
 
   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());
 
  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) {
 
  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; 
 
  163     FATAL(
"File: " << inputFile.getFullFilename() << 
" not opened." << endl);
 
  169   cout.imbue(locale(cout.getloc(), 
color_facets[facet]->clone()));
 
  171   int number_of_tests    = 0;
 
  172   int number_of_failures = 0;
 
  174   const TRegexp regexp(inputFile.getObjectName());
 
  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) && 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;
 
  202           const int N = g1->GetN();
 
  204           bool status = (N >= parameters.number_of_entries);
 
  206           int number_of_outliers = 0;
 
  208           for (
int i = 0; i != g1->GetN(); ++i) {
 
  209             if (!parameters.range(g1->GetY()[i])) {
 
  210               ++number_of_outliers;
 
  214           status = status && (number_of_outliers <= parameters.number_of_outliers);
 
  216           cout << (status ? 
GREEN : 
RED) << 
"Test " << g1->GetName() << 
" " << (status ? 
"passed" : 
"failed") << 
"." << 
RESET << endl;
 
  218           if (out != NULL && !status) {
 
  220             const JRange<double> 
range(g1->GetX(), g1->GetX() + g1->GetN());
 
  222             g1->GetListOfFunctions()->Add(
new TF1(
MAKE_CSTRING(g1->GetName() << 
":upper"), 
MAKE_CSTRING(parameters.range.getUpperLimit()), 
range.getLowerLimit(), 
range.getUpperLimit()));
 
  223             g1->GetListOfFunctions()->Add(
new TF1(
MAKE_CSTRING(g1->GetName() << 
":lower"), 
MAKE_CSTRING(parameters.range.getLowerLimit()), 
range.getLowerLimit(), 
range.getUpperLimit()));
 
  224             out->WriteTObject(g1);
 
  227           number_of_tests    +=  1;
 
  228           number_of_failures += (status ? 0 : 1);
 
  235     if (i->second == 0) {
 
  237       cout << 
RED << 
"Test " << i->first << 
" missing data." << 
RESET << endl;
 
  239       number_of_tests    +=  1;
 
  240       number_of_failures +=  1;
 
  244   cout << (number_of_tests > 0 && number_of_failures == 0 ? 
GREEN : 
RED) << 
"Number of tests/failures " << number_of_tests << 
"/" << number_of_failures << 
RESET << endl;
 
Utility class to parse command line options. 
 
int main(int argc, char *argv[])
 
*fatal Wrong number of arguments esac JCookie sh typeset Z DETECTOR typeset Z SOURCE_RUN typeset Z TARGET_RUN set_variable PARAMETERS_FILE $WORKDIR parameters
 
#define MAKE_CSTRING(A)
Make C-string. 
 
Auxiliary data structure for floating point format specification. 
 
static const JColorFacetMap_t color_facets
Color facets. 
 
I/O formatting auxiliaries. 
 
I/O coloring auxiliaries. 
 
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object 
 
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line. 
 
Auxiliary methods to convert data members or return values of member methods of a set of objects to a...
 
General purpose messaging. 
 
z range($ZMAX-$ZMIN)< $MINIMAL_DZ." fi fi typeset -Z 4 STRING typeset -Z 2 FLOOR JPlot1D -f $
 
std::istream & operator>>(std::istream &in, JAANET::JHead &header)
Read header from input. 
 
Auxiliary class to define a range between two values. 
 
Utility class to parse command line options. 
 
then usage $script< input_file >< detector_file > fi set_variable OUTPUT_DIR set_variable SELECTOR JDAQTimesliceL1 set_variable DEBUG case set_variable DEBUG
 
TDirectory * getDirectory(const JRootObjectID &id)
Get TDirectory pointer. 
 
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
 
then usage $script[input file[working directory[option]]] nWhere option can be N
 
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. 
 
Double_t g1(const Double_t x)
Function.