42{
   46 
   48 
   49  string                  inputFile;
   52  string                  detectorFile;
   53  int                     deltaT;
   54  int                     multiplicity;
   56 
   57  try { 
   58 
   59    JParser<> zap(
"Program to search for sets of consecutive hits on a given PMT that are equidistant in time.");
 
   60    
   68    
   69    zap(argc, argv);
   70  }
   71  catch(const exception& error) {
   72    FATAL(error.what() << endl);
 
   73  }
   74 
   76 
   78 
   80  
   82 
   83  try {
   85  }
   87    cerr << "FATAL ERROR. Could not open detector file '" << detectorFile << "'." << endl;
   88    exit(1);
   89  }
   90 
   92 
   94 
   95  TH1D h1 ("MEvt", "", 50, 0.5, 50.5);
   96 
   97  TH2D h2 ("FEvt", NULL, 
   98           stringRouter.size() + 0, -0.5, stringRouter.size() - 0.5,
  100  
  101  TH1D h3 ("ML0" , "", 50, 0.5, 50.5);
  102 
  103  TH2D h4 ("FL0", NULL, 
  104           stringRouter.size() + 0, -0.5, stringRouter.size() - 0.5,
  106 
  107  for (Int_t i = 1; i <= h2.GetXaxis()->GetNbins(); ++i) {
  108    h2.GetXaxis()->SetBinLabel(i, 
MAKE_CSTRING(stringRouter.at(i-1)));
 
  109  }
  110 
  111  for (Int_t i = 1; i <= h2.GetXaxis()->GetNbins(); ++i) {
  112    h4.GetXaxis()->SetBinLabel(i, 
MAKE_CSTRING(stringRouter.at(i-1)));
 
  113  }
  114 
  116 
  117  {
  120 
  122 
  124      JHitBuffer& buffer = 
event->getHits<
JHit_t>();
 
  125 
  126      std::sort(buffer.begin(),buffer.end(),less<JDAQKeyHit>());
  127 
  128      for (JHitBuffer::const_iterator p = buffer.begin() ; p != buffer.end() ; ) {
  129 
  130        JHitBuffer::const_iterator q = p;
  131      
  133             (++q              != buffer.end()     && 
  134              q->getModuleID() == p->getModuleID() &&
  135              q->getPMT()      == p->getPMT()      &&
  136              q->getT()        == t1 + deltaT); 
  137             t1 = q->getT()) {}
  138        
  140      
  141        const JPMTChannel& channel = hitRouter.getPMTChannel(*p);
 
  142 
  143        if (d >= multiplicity) 
  144          h2.Fill((
double) stringRouter.getIndex(channel.
getString()), (
double) channel.
getFloor());
 
  145        
  146        if (d >= 2) 
  147          h1.Fill(d);           
  148        
  149        p=q;
  150      }   
  151    }
  152  }
  153 
  154  {
  158 
  160 
  162 
  164    
  165      for(JDAQTimeslice::iterator frame = slice->begin(); frame != slice->end() ; ++frame){
  166      
  167        const JModule&   module = moduleRouter.getModule(frame->getModuleID()); 
 
  168        JSuperFrame2D_t& buffer = JSuperFrame2D_t::demultiplex(*frame, module);
  169        
  170        for (JSuperFrame2D_t::iterator pmt = buffer.begin() ; pmt != buffer.end() ; ++pmt) {
  171          
  172          for (JHitBuffer::const_iterator p = pmt->begin() ; p != pmt->end() ;) {
  173 
  174            JHitBuffer::const_iterator q = p;
  175            
  177                 (++q              != pmt->end()     && 
  178                  q->getT()        == t1 + deltaT); 
  179                 t1 = q->getT()) {}
  180        
  182 
  184 
  185            if (d >= multiplicity) 
  186              h4.Fill((
double) stringRouter.getIndex(channel.
getString()), (
double) channel.
getFloor());
 
  187              
  188            if (d >= 2) 
  189              h3.Fill(d);               
  190 
  191            p=q;
  192          }
  193        }
  194      }
  195    }
  196  }
  197 
  202 
  204}
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
 
#define MAKE_CSTRING(A)
Make C-string.
 
Simple wrapper around JModuleRouter class for direct addressing of PMT data in detector data structur...
 
int getFloor() const
Get floor number.
 
int getString() const
Get string number.
 
Router for direct addressing of module data in detector data structure.
 
Data structure for a composite optical module.
 
Auxiliary class to uniquely identify PMT readout channel.
 
Utility class to parse command line options.
 
General purpose class for object reading from a list of file names.
 
virtual bool hasNext() override
Check availability of next element.
 
2-dimensional frame with time calibrated data from one optical module.
 
unsigned int JTDC_t
leading edge [ns]
 
JTriggerCounter_t next()
Increment trigger counter.
 
floor_range getRangeOfFloors(const JDetector &detector)
Get range of floors.
 
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
 
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
 
KM3NeT DAQ data structures and auxiliaries.
 
Router for mapping of string identifier to index.
 
Auxiliary class to set-up Hit.
 
Auxiliary class for defining the range of iterations of objects.
 
static counter_type max()
Get maximum counter value.