@@ -35,29 +35,40 @@ class TimeEstBC : public o2::dataformats::TimeStampWithError<TimeStampType, Time
3535 public:
3636 GPUhdDefault () TimeEstBC() = default ;
3737 GPUhdi () TimeEstBC(TimeStampType t, TimeStampErrorType e) : Base(t, e) {}
38+
3839 // convert to symmetric center+-half representation
3940 GPUhdi () its::TimeStamp makeSymmetrical () const noexcept
4041 {
4142 const auto start = static_cast <float >(this ->getTimeStamp ());
4243 const float half = (float )this ->getTimeStampError () / 2 .f ;
4344 return {start + half, half};
4445 }
46+
4547 // check if timestamps overlap within their interval
4648 GPUhdi () bool isCompatible (const TimeEstBC& o) const noexcept
4749 {
4850 return this ->upper () > o.lower () && o.upper () > this ->lower ();
4951 }
52+
53+ // check if this time interval is fully contained within o
54+ GPUhdi () bool isContainedIn (const TimeEstBC& o) const noexcept
55+ {
56+ return this ->lower () >= o.lower () && this ->upper () <= o.upper ();
57+ }
58+
5059 GPUhdi () TimeEstBC& operator +=(const TimeEstBC& o) noexcept
5160 {
5261 add (o);
5362 return *this ;
5463 }
64+
5565 GPUhdi () TimeEstBC operator +(const TimeEstBC& o) const noexcept
5666 {
5767 TimeEstBC res = *this ;
5868 res += o;
5969 return res;
6070 }
71+
6172 // upper bound of interval t0+tE
6273 GPUhdi () TimeStampType upper () const noexcept
6374 {
@@ -66,6 +77,7 @@ class TimeEstBC : public o2::dataformats::TimeStampWithError<TimeStampType, Time
6677 constexpr TimeStampType max = std::numeric_limits<TimeStampType>::max ();
6778 return (t > (max - e)) ? max : t + e;
6879 }
80+
6981 // lower bound of interval t0
7082 GPUhdi () TimeStampType lower () const noexcept
7183 {
0 commit comments