A TimeInterval is used to represent time elapsed between two events. More...
#include "utl/TimeInterval.h"
Static Public Member Functions | |
static TimeInterval | Max () |
static TimeInterval | Min () |
Private Attributes | |
double | fInterval |
Friends | |
TimeInterval | operator* (const double &d, const TimeInterval &ti) |
[double] * [TimeInterval] = [TimeInterval] More... | |
std::ostream & | operator<< (std::ostream &os, const TimeInterval &ti) |
stream output More... | |
A TimeInterval is used to represent time elapsed between two events.
For information on how to use TimeInterval's together with TimeStamp's in your code, see the documentation in utl::TimeStamp.
From a TimeInterval, one can extract the lower bound on the number of seconds in the interval (the seconds floor) as well as the number of nanoseconds past the seconds floor. When subracting TimeInvervals or TimeStamps to yield a TimeInterval, there are two cases to consider:
Note that this class uses a double precision floating point to represent the elapsed time between two events. 52 bits are allocated for the mantissa of a double precision number, this interval is precise to about 1 part in 5.4e15. If for example 1 ns precision were required, one could use this class to describe intervals up to about 62 days. Basic arithmetic operations are defined for TimeInterval. See the documentation for utl::TimeStamp for some examples.
Definition at line 43 of file TimeInterval.h.
|
inline |
Definition at line 46 of file TimeInterval.h.
Referenced by operator*(), operator+(), operator-(), and operator/().
|
inline |
Definition at line 49 of file TimeInterval.h.
|
inline |
Get the time interval as a double (in Auger base units)
Definition at line 69 of file TimeInterval.h.
References fInterval.
Referenced by MultipleScatterer::AddPhotons(), FdCalibratorOG::FdCalibrator::ApplyTimeCorrections(), FdAxisFinderOG::FdAxisFinder::AxisFirstGuess(), FastTankSimulatorOG::FastTankSimulator::CalculatePhotoElectrons(), LightAtDiaphragmSimulatorKG::LightAtDiaphragmSimulator::EvaluateDirectCherenkovHits(), otoa::Detector2ADST::FillDetector(), otoa::FD2ADST::FillTimeFit(), G4StationSimulatorOG::G4StationPrimaryGenerator::GeneratePrimaries(), FdProfileConstrainedGeometryFitPG::FdProfileConstrainedGeometryFit::GetDataFromPreviousFit(), HybridGeometryFinderWG::HybridGeometryFinder::GetDataFromPreviousFit(), RdAirplane::RdAirplaneTiming::Init(), RdAirplane::RdTransformAds_bLogFile::Init(), FdEyeMergerKG::FdEyeMerger::MergeEyes(), HdAxisFinderUU::HdAxisFinder::MinuitFitFunc(), FdAxisFinderOG::FdAxisFinder::MinuitFitFunc(), HybridGeometryFinderWG::HybridGeometryFinder::MinuitFitFuncAxis(), HybridGeometryFinderOG::HybridGeometryFinder::MinuitFitFuncHybrid(), FdAxisFinderOG::FdAxisFinder::MinuitFitFuncLaser(), StereoGeometryFinderOG::StereoGeometryFinder::MinuitFitFuncStereo(), StereoGeometryFinderOG::StereoGeometryFinder::MinuitFitFuncStereoHybrid(), FdProfileConstrainedGeometryFitPG::ChiZeroRegression::PrepParams(), MdOptoElectronicSimulatorAG::MdOptoElectronicSimulator::ProcessPulses(), MdCounterSimulatorAG::MdCounterSimulator::ProcessPulses(), MdOptoElectronicSimulatorAG::MdOptoElectronicSimulator::ProcessPulsesIntegrator(), MdCounterSimulatorAG::MdCounterSimulator::ProcessPulsesIntegrator(), FdAxisFinderOG::FdAxisFinder::ReadmitPixel(), HybridGeometryFinderOG::HybridGeometryFinder::ReadmitPixel(), HybridGeometryFinderWG::HybridGeometryFinder::RecalculateChiSquare(), FdAxisFinderOG::FdAxisFinder::RejectPixel(), HybridGeometryFinderOG::HybridGeometryFinder::RejectPixel(), FdAxisFinderOG::FdAxisFinder::RemoveOutliers(), HybridGeometryFinderWG::HybridGeometryFinder::RemovePixel(), SdMonteCarloPropagatorKVI::SdMonteCarloPropagator::Run(), SdAccidentalInjectorKG::SdAccidentalInjector::Run(), RPCSimulatorLX::RPCSimulator::Run(), FdLightCollectionEfficiencyKG::CorrectedApLightCalculator::Run(), MdShowerRegeneratorAG::MdShowerRegenerator::Run(), MdMuonCounterAG::MdMuonCounter::Run(), TelescopeSimulatorLX::TelescopeSimulator::Run(), TelescopeSimulatorKG::TelescopeSimulator::Run(), TelescopeSimulatorKG2::TelescopeSimulator::Run(), SdSimpleSimKG::SdSimpleSim::Run(), CachedXShowerRegeneratorAG::CachedXShowerRegenerator::Run(), CachedShowerRegeneratorASCII::CachedShowerRegenerator::Run(), CachedDirectInjectorOG::CachedDirectInjector::Run(), MdOptoElectronicSimulatorAG::MdOptoElectronicSimulator::SampleTrace(), MdCounterSimulatorAG::MdCounterSimulator::SampleTrace(), MdOptoElectronicSimulatorAG::MdOptoElectronicSimulator::SampleTraceADC(), MdCounterSimulatorAG::MdCounterSimulator::SampleTraceADC(), utl::FFTDataContainerAlgorithm::ShiftTimeSeries(), MdCounterSimulatorAG::MdCounterSimulator::SimulatePulses(), TestTime::TestArithmetic(), RdStationBeamFormer::RdStationBeamFormer::timeShift(), and TelescopeSimulatorKG2::RayTracer::Trace().
double TimeInterval::GetNanoSecond | ( | ) | const |
Get integer number of nanoseconds past seconds boundary.
This number is always positive
Calculates integer number of nanoseconds past the lower seconds boundary, determined by GetSeconds() method
Definition at line 25 of file TimeInterval.cc.
Referenced by FdAxisFinderOG::FdAxisFinder::AxisFirstGuess(), otoa::FD2ADST::FillRecPixel(), otoa::FD2ADST::FillTimeFit(), HdAxisFinderUU::HdAxisFinder::MinuitFitFunc(), FdAxisFinderOG::FdAxisFinder::MinuitFitFunc(), HybridGeometryFinderWG::HybridGeometryFinder::MinuitFitFuncAxis(), HybridGeometryFinderOG::HybridGeometryFinder::MinuitFitFuncHybrid(), FdAxisFinderOG::FdAxisFinder::MinuitFitFuncLaser(), StereoGeometryFinderOG::StereoGeometryFinder::MinuitFitFuncStereo(), StereoGeometryFinderOG::StereoGeometryFinder::MinuitFitFuncStereoHybrid(), utl::TimeStamp::operator+(), utl::TimeStamp::operator+=(), utl::TimeStamp::operator-(), utl::TimeStamp::operator-=(), FdProfileConstrainedGeometryFitPG::ChiZeroRegression::PrepParams(), FdAxisFinderOG::FdAxisFinder::ReadmitPixel(), HybridGeometryFinderOG::HybridGeometryFinder::ReadmitPixel(), HybridGeometryFinderWG::HybridGeometryFinder::RecalculateChiSquare(), FdAxisFinderOG::FdAxisFinder::RejectPixel(), HybridGeometryFinderOG::HybridGeometryFinder::RejectPixel(), FdAxisFinderOG::FdAxisFinder::RemoveOutliers(), FdSDPFinderOG::FdSDPFinder::RemoveOutliers(), HybridGeometryFinderWG::HybridGeometryFinder::RemovePixel(), RdStationNoiseAnalyser::Run(), and TestTime::TestTimeIntervalInitialization().
long TimeInterval::GetSecond | ( | ) | const |
Get the seconds floor for the interval.
This number is positive if the interval is positive, and negative if the interval is negative
Calculates the integer lower boundary in seconds for the time interval.
Definition at line 13 of file TimeInterval.cc.
References utl::s.
Referenced by utl::TimeStamp::operator+(), utl::TimeStamp::operator+=(), utl::TimeStamp::operator-(), utl::TimeStamp::operator-=(), RdStationNoiseAnalyser::Run(), and TestTime::TestTimeIntervalInitialization().
|
inlinestatic |
Definition at line 145 of file TimeInterval.h.
Referenced by TestTime::TestTimeIntervalInitialization().
|
inlinestatic |
Definition at line 144 of file TimeInterval.h.
|
inlineexplicit |
Definition at line 137 of file TimeInterval.h.
References fInterval.
|
inline |
Implicitly convert TimeInterval to double.
Definition at line 72 of file TimeInterval.h.
References fInterval.
|
inline |
Definition at line 134 of file TimeInterval.h.
References fInterval.
|
inline |
[TimeInterval] * [double] = [TimeInterval]
Definition at line 84 of file TimeInterval.h.
References fInterval, and TimeInterval().
|
inline |
[TimeInterval] *= [TimeInterval] = [TimeInterval]
Definition at line 108 of file TimeInterval.h.
References fInterval.
|
inline |
[TimeInterval] + [TimeInterval] = [TimeInterval]
Definition at line 76 of file TimeInterval.h.
References fInterval, and TimeInterval().
|
inline |
[TimeInterval] += [TimeInterval] = [TimeInterval]
Definition at line 100 of file TimeInterval.h.
References fInterval.
|
inline |
[TimeInterval] - [TimeInterval] = [TimeInterval]
Definition at line 80 of file TimeInterval.h.
References fInterval, and TimeInterval().
|
inline |
unary sign reversal
Definition at line 116 of file TimeInterval.h.
References fInterval, and TimeInterval().
|
inline |
[TimeInterval] -= [TimeInterval] = [TimeInterval]
Definition at line 104 of file TimeInterval.h.
References fInterval.
|
inline |
[TimeInterval] / [TimeInterval] = [double]
Definition at line 92 of file TimeInterval.h.
References fInterval.
|
inline |
[TimeInterval] / [double] = [TimeInterval]
Definition at line 96 of file TimeInterval.h.
References fInterval, and TimeInterval().
|
inline |
[TimeInterval] /= [double] = [TimeInterval]
Definition at line 112 of file TimeInterval.h.
References fInterval.
|
inline |
Definition at line 125 of file TimeInterval.h.
References fInterval.
|
inline |
Definition at line 128 of file TimeInterval.h.
References fInterval.
|
inline |
Definition at line 52 of file TimeInterval.h.
References fInterval.
|
inline |
|
inline |
Definition at line 131 of file TimeInterval.h.
References fInterval.
|
inline |
Definition at line 119 of file TimeInterval.h.
References fInterval.
|
inline |
Definition at line 122 of file TimeInterval.h.
References fInterval.
|
friend |
[double] * [TimeInterval] = [TimeInterval]
Definition at line 88 of file TimeInterval.h.
|
friend |
stream output
Definition at line 140 of file TimeInterval.h.
|
private |
stored in Auger base time units (see Utilities/Units/include/utl/AugerUnits.h)
Definition at line 151 of file TimeInterval.h.
Referenced by GetInterval(), operator bool(), operator double(), operator!=(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator<(), operator<=(), operator=(), operator==(), operator>(), and operator>=().