#include <string>
#include <iostream>
#include <iomanip>
#include "TROOT.h"
#include "TFile.h"
#include "TH1D.h"
#include "TH2D.h"
#include "TProfile2D.h"
#include "JTools/JRange.hh"
#include "JDAQ/JDAQSummaryslice.hh"
#include "JDetector/JDetector.hh"
#include "JDetector/JDetectorToolkit.hh"
#include "JDetector/JModuleRouter.hh"
#include "JSupport/JMultipleFileScanner.hh"
#include "JSupport/JSupport.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"
 
Go to the source code of this file.
 | 
| int  | main (int argc, char **argv) | 
|   | 
Example program to histogram string and floor rates. 
- Author
 - mdejong 
 
Definition in file JDAQModuleRouter.cc.
 
◆ main()
      
        
          | int main  | 
          ( | 
          int  | 
          argc,  | 
        
        
           | 
           | 
          char **  | 
          argv  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Definition at line 32 of file JDAQModuleRouter.cc.
   38   JMultipleFileScanner<JDAQSummaryslice> inputFile;
 
   46     JParser<> zap(
"Example program to histogram string and floor rates.");
 
   51     zap[
'n'] = 
make_field(numberOfEvents)      = JLimit::max();
 
   56   catch(
const exception& error) {
 
   57     FATAL(error.what() << endl);
 
   67     load(detectorFile, detector);
 
   69   catch(
const JException& error) {
 
   73   const JModuleRouter router(detector);
 
   78   const JRange_t string(detector.begin(), detector.end(), &JModule::getString);
 
   79   const JRange_t floor (detector.begin(), detector.end(), &JModule::getFloor);
 
   81   NOTICE(
"String  " << 
string.getLowerLimit() << 
" - " << 
string.getUpperLimit() << endl);
 
   82   NOTICE(
"Floor   " << floor .getLowerLimit() << 
" - " << floor .getUpperLimit() << endl);
 
   87   TProfile2D h2(
"h2", NULL, 
 
   88                 string.getLength() + 1,
 
   89                 string.getLowerLimit() - 0.5,
 
   90                 string.getUpperLimit() + 0.5,
 
   91                 floor.getLength() + 1,
 
   92                 floor.getLowerLimit() - 0.5,
 
   93                 floor.getUpperLimit() + 0.5);
 
   96   while (inputFile.hasNext()) {
 
   98     STATUS(
"event: " << setw(10) << inputFile.getCounter() << 
'\r'); 
DEBUG(endl);
 
  102     for (JDAQSummaryslice::const_iterator frame = summary->begin(); frame != summary->end(); ++frame) {
 
  104       const JModule& module = router.getModule(frame->getModuleID());
 
  107         if (!frame->testHighRateVeto(pmt) && !frame->testFIFOStatus(pmt)) {
 
  108           h2.Fill((
double) module.getString(), (double) module.getFloor(), frame->getRate(pmt) * 1.0e-3);