95{
   99 
  101  JLimit_t &         numberOfEvents = inputFile.getLimit();
 
  104  int                N;
  105  double             rate_Hz;
  107 
  108  try { 
  109 
  110    JParser<> zap(
"Example program to check timeslice data for errors.");
 
  111    
  116    zap[
'N'] = 
make_field(N,       
"number of rows to print")  = 10;
 
  117    zap[
'R'] = 
make_field(rate_Hz, 
"high-rate veto [Hz]")      = 0.0;
 
  119    
  120    zap(argc, argv);
  121  }
  122  catch(const exception& error) {
  123    FATAL(error.what() << endl);
 
  124  }
  125 
  126 
  128 
  129 
  130  if (rate_Hz > 0.0) {
  132  }
  133 
  135 
  137 
  138  const Long64_t nx   = frame_index.
second  -  frame_index.
first  +  1;
 
  139  const Double_t 
xmin = (Double_t) frame_index.
first  - 0.5;
 
  140  const Double_t 
xmax = (Double_t) frame_index.second + 0.5;
 
  141 
  143 
  144  for (
counter_type counter = 0; in.hasNext(); ++counter) {
 
  145 
  146    STATUS(
"event: " << setw(10) << counter << 
'\r'); 
DEBUG(endl);
 
  147 
  149 
  150    for (JDAQTimeslice::const_iterator frame = timeslice->begin(); frame != timeslice->end(); ++frame) {
  151      
  153 
  155 
  156        errors[error->type] += 1;
  157 
  158        H1[error->type]->Fill((Double_t) frame->getFrameIndex());
  159      }
  160      
  162 
  164 
  165          if (error->pos >= 0) {
  166 
  167            const int pmt = (*frame)[error->pos].getPMT();
  168        
  169            cout << "Module "
  170                 << setw(10) << frame->getModuleID() << '.' << setw(2) << setfill('0') << pmt << setfill(' ')  << ' '
  171                 << setw(8)  << frame->getFrameIndex()                                                         << ' ' 
  172                 << setw(6)  << error->pos           << '/' << setw(8)  << frame->size()                       << ' '
  173                 << setw(2)  << error->type                                                                    << ' ';
  174 
  175            if (pmt < NUMBER_OF_PMTS) {
  176              cout << setw(1)  << frame->testHighRateVeto(pmt)
  177                   << setw(1)  << frame->testFIFOStatus  (pmt)                                                 << ' ';
  178            }
  179 
  180            cout << setw(4)  << frame->getUDPNumberOfReceivedPackets()                                         << '/' 
  181                 << setw(4)  << frame->getUDPMaximalSequenceNumber();
  182 
  183            cout << "  ";
  184 
  185            print(cout, error->type);
 
  186 
  187            cout << endl << endl;
  188 
  189            deque<JDAQHit> buffer;
  190 
  191            for (
int i = error->pos - 1, 
n = 0; i >= 0 && 
n <= N; --i) {
 
  192              if ((*frame)[i].getPMT() == (*frame)[error->pos].getPMT()) {
  193                buffer.push_front((*frame)[i]);
  195              }
  196            }
  197 
  198            for (deque<JDAQHit>::const_iterator i = buffer.begin(); i != buffer.end(); ++i) {
  199              print(cout, *i); cout << endl;
 
  200            }
  201 
  202            print(cout, (*frame)[error->pos]);
 
  203 
  204            cout << " <<< " << endl;
  205 
  206            for (
int i = error->pos + 1, 
n = 0; i < frame->size() && 
n <= N; ++i) {
 
  207              if ((*frame)[i].getPMT() == (*frame)[error->pos].getPMT()) {
  208                print(cout, (*frame)[i]); cout << endl;
 
  210              }
  211            }
  212 
  213          } else {
  214 
  215            cout << "Module "
  216                 << setw(10) << frame->getModuleID() << ' ' << setw(2) << ' '                                  << ' '
  217                 << setw(8)  << frame->getFrameIndex()                                                         << ' ' 
  218                 << setw(6)  << error->pos           << '/' << setw(8)  << frame->size()                       << ' '
  219                 << setw(2)  << error->type                                                                    << ' ';
  220 
  221            cout << setw(1)  << ' '                                   
  222                 << setw(1)  << ' '                                                                            << ' ';
  223 
  224            cout << setw(4)  << frame->getUDPNumberOfReceivedPackets()                                         << '/' 
  225                 << setw(4)  << frame->getUDPMaximalSequenceNumber();
  226 
  227            cout << "  ";
  228 
  229            print(cout, error->type);
 
  230 
  231            cout << endl << endl;
  232          }
  233        }
  234      }
  235    }
  236  }
  238 
  240 
  241    print(cout, i->first);
 
  242 
  243    cout << ' ' << setw(8) << i->second << endl;
  244  }
  245 
  247}
#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.
 
Auxiliary class to manage set of compatible ROOT objects (e.g. histograms) using unique keys.
 
Object reading from a list of files.
 
std::ostream & print(std::ostream &out, const JTestSummary &summary, const char delimiter=' ', const bool useColors=true)
Print test summary.
 
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
 
std::set< JROOTClassSelector > getROOTClassSelection(const bool option=false)
Get ROOT class selection.
 
Long64_t counter_type
Type definition for counter.
 
JFrameIndexRange getFrameIndexRange(JTreeScannerInterface< T, KM3NETDAQ::JDAQEvaluator > &in)
Get range of frame indices.
 
static const JChecksum checksum
Function object to perform check-sum of raw data.
 
static int MAXIMAL_FRAME_SIZE
Maximal frame size.
 
KM3NeT DAQ data structures and auxiliaries.
 
double getFrameTime()
Get frame time duration.
 
Auxiliary class to select ROOT class based on class name.
 
Auxiliary class for defining the range of iterations of objects.
 
static counter_type max()
Get maximum counter value.
 
Auxiliary data structure for result of checksum.
 
result_type::const_iterator const_iterator