114 ElecClock(
double time,
double frame_period,
double frequency)
150 { fTime =
Time(sample, frame); }
162 {
SetTime(
int(sample),
int(frame)); }
172 { fTime =
Time(ticks,0); }
204 double Time(
int sample,
int frame)
const {
return (sample / fFrequency + frame * fFramePeriod); }
int Ticks(int sample, int frame) const
Returns the number of tick the specified sample falls in.
int Frame(double time) const
Returns the number of the frame containing the specified time.
bool operator<=(const ElecClock &rhs) const
Compares the current time of this clock with the one of rhs.
double Time(int ticks) const
Returns the absolute start time of the specified tick.
ElecClock & operator-=(const unsigned int &rhs)
Decreases the current clock time by the specified number of ticks.
double Time(double time) const
Returns the discretized value of the specified time.
int Sample(int tick) const
Returns the number of the sample containing the specified tick.
void SetTime(double time)
Directly sets the current time on the clock.
void SetTime(unsigned int sample, unsigned int frame)
Sets the current time on the clock from frame and sample number.
double Time(int sample, int frame) const
Returns the absolute time of the start of the specified sample.
void SetTime(unsigned int ticks)
Sets the current time on the clock from tick number.
bool operator<(const ElecClock &rhs) const
Compares the current time of this clock with the one of rhs.
ElecClock & operator-=(const float &rhs)
Decreases the current clock time by the specified time in microseconds.
int Ticks() const
Current clock tick (that is, the number of tick Time() falls in).
Class def header for exception classes in DetectorClocks data provider.
ElecClock & operator+=(const unsigned int &rhs)
Increases the current clock time by the specified number of ticks.
void SetTime(int sample, int frame)
Sets the current time on the clock from frame and sample number.
double fFrequency
Clock speed in MHz.
int Frame(int tick) const
Returns the number of the frame containing the specified tick.
void SetTime(int ticks)
Sets the current time on the clock from tick number.
int Frame() const
Returns the number of the frame containing the clock current time.
ElecClock operator-(const ElecClock &rhs)
ElecClock operator++(int)
Increases the current clock time by a full tick time.
int Sample(double time) const
Returns the number of the sample containing the specified time.
ElecClock(double time, double frame_period, double frequency)
Constructor: sets all values.
General LArSoft Utilities.
ElecClock operator--(int)
Decreases the current clock time by a full tick time.
ElecClock & operator--()
Decreases the current clock time by a full tick time.
double fTime
Time in microseconds.
bool operator>(const ElecClock &rhs) const
Compares the current time of this clock with the one of rhs.
double FramePeriod() const
A single frame period in microseconds.
ElecClock & operator++()
Increases the current clock time by a full tick time.
ElecClock operator+(const ElecClock &rhs)
double TickPeriod() const
A single tick period in microseconds.
ElecClock & operator-=(const int &rhs)
Decreases the current clock time by the specified number of ticks.
ElecClock & operator+=(const float &rhs)
Increases the current clock time by the specified time in microseconds.
unsigned int FrameTicks() const
Number ticks in a frame.
ElecClock & operator-=(const double &rhs)
Decreases the current clock time by the specified time in microseconds.
ElecClock & operator+=(const ElecClock &rhs)
Increases the current clock time by the current time of another clock.
ElecClock & operator+=(const double &rhs)
Increases the current clock time by the specified time in microseconds.
double Time() const
Current time (as stored) in microseconds.
Class representing the time measured by an electronics clock.
bool operator>=(const ElecClock &rhs) const
Compares the current time of this clock with the one of rhs.
int Sample() const
Returns number of the sample containing the clock current time.
ElecClock()
Default constructor.
ElecClock & operator+=(const int &rhs)
Increases the current clock time by the specified number of ticks.
double Frequency() const
Frequency in MHz.
int Ticks(double time) const
Returns the number of tick the specified time falls in.
const double kTIME_MAX
Maximum time in microseconds.
double fFramePeriod
Frame period in microseconds.
ElecClock & operator-=(const ElecClock &rhs)
Decreases the current clock time by the current time of another clock.