HARPO  5.1.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HarpoTimeStamp.cxx
Go to the documentation of this file.
1 //
2 // File HarpoTimeStamp.cxx
3 //
9 #include "HarpoTimeStamp.h"
10 #include <iostream>
11 #include <limits>
12 #include <cstdlib>
13 
14 ClassImp(HarpoTimeStamp)
15 
16 const Long_t TheSameTS = 0002; // max allowed diffrens between the planes
17 
18 const ULong_t tmax = std::numeric_limits<unsigned int>::max();
19 
20 Long_t HarpoTimeStamp::TSoffset = 0;
21 
22 Long_t HarpoTimeStamp::CompareTimeStamps(ULong_t curr[2],ULong_t prev[2])
23 {
24  for (int i=0; i<2; i++) {
25  // Time Stamp saturation between 2 events
26  if ( curr[i] < prev[i] ) curr[i] += ( tmax + 1 );
27  }
28  Long_t tdiff = curr[0] - curr[1];
29  if ( std::abs(tdiff) < TheSameTS ) tdiff = 0; // The same events ?
30 
31 
32  // return tdiff;
33  return tdiff - TSoffset;
34 }
35 
37 {
38  std::cout << "---HarpoTimeStamp " << std::endl;
39 }
40 
Calculate Time Stams diffrences.
virtual void print()
const ULong_t tmax