19     static double FRAME_TIME_NS =  100000000.0;     
 
   20     static double RESET_TIME_NS =  FRAME_TIME_NS;   
 
   77       switch (this->
clock) {
 
   80         FRAME_TIME_NS =  100000000.0;
 
   81         RESET_TIME_NS =  FRAME_TIME_NS;
 
   85         FRAME_TIME_NS =  (1<<27);
 
   86         RESET_TIME_NS =  FRAME_TIME_NS;
 
   90         FRAME_TIME_NS =  13107200.0 * 8;
 
   91         RESET_TIME_NS = 419430400.0;
 
  118       catch(
const std::exception& error) {
 
  119         in.setstate(ios_base::badbit);
 
  135       return out << 
clock.clock;
 
  153     return first.
get() == second.
get();
 
  164     return FRAME_TIME_NS; 
 
  175     return RESET_TIME_NS; 
 
  187     if (frame_index != 0)
 
  188       return (
double) (frame_index - 1) * FRAME_TIME_NS;
 
  202     if (frame_index != 0)
 
  203       return (
double) (frame_index - 1) * FRAME_TIME_NS;
 
  217     return std::floor(t_ns/RESET_TIME_NS) * RESET_TIME_NS;
 
  229     return std::floor(
getTimeOfFrame(frame_index)/RESET_TIME_NS) * RESET_TIME_NS;
 
  241     return std::floor(
getTimeOfFrame(frame_index)/RESET_TIME_NS) * RESET_TIME_NS;
 
  253     return (
int) (t_ns / FRAME_TIME_NS) + 1;
 
  289     return std::fmod(t_ns, RESET_TIME_NS);
 
Auxiliary class to set DAQ system clock parameters.
 
friend std::ostream & operator<<(std::ostream &out, const JDAQClock &clock)
Write clock to output.
 
friend std::istream & operator>>(std::istream &in, JDAQClock &clock)
Read clock from input.
 
JDAQClock(const JDAQClock_t clock=KM3NET)
Constructor.
 
JDAQClock_t get() const
Get clock type.
 
void set()
Set DAQ clock parameters.
 
void set(const JDAQClock_t clock)
Set clock type.
 
KM3NeT DAQ data structures and auxiliaries.
 
int getFrameIndex(const double t_ns)
Get frame index for a given time in ns.
 
double getFrameTime()
Get frame time duration.
 
double getTimeOfFrame(const int frame_index)
Get start time of frame in ns since start of run for a given frame index.
 
double getTimeSinceRTS(const int frame_index)
Get time in ns since last RTS for a given frame index.
 
double getRTS()
Get TDC dynamic range.
 
double getTimeOfRTS(const JDAQChronometer &chronometer)
Get time of last RTS in ns since start of run for a given chronometer.
 
bool operator==(const JDAQChronometer &first, const JDAQChronometer &second)
Equal operator for DAQ chronometers.
 
void setClock()
Set clock.