Public Member Functions | Private Member Functions | Private Attributes | List of all members
novaddt::smt::Track Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N21-04-12/SlowMonopoleTrigger/Track.h"

Public Member Functions

 Track (novaddt::DAQHit const &start, novaddt::DAQHit const &end)
 
double time () const
 
double distance () const
 
double velocity () const
 
double beta () const
 
bool slope_plane_is_valid () const
 
double slope_cell_plane () const
 
double slope_time_plane () const
 
bool slope_time_is_valid () const
 
double slope_cell_time () const
 
double slope_plane_time () const
 
bool slope_cell_is_valid () const
 
double slope_time_cell () const
 
novaddt::DAQHit start () const
 
novaddt::DAQHit end () const
 
unsigned max_plane () const
 
unsigned min_plane () const
 
int plane_difference () const
 
unsigned max_cell () const
 
unsigned min_cell () const
 
int cell_difference () const
 

Private Member Functions

double calculate_distance () const
 
double calculate_velocity () const
 
void calculate_slopes ()
 

Private Attributes

double dp_
 
double dc_
 
double dt_
 
double distance_
 
double velocity_
 
double beta_
 
double slope_cell_plane_
 
double slope_time_plane_
 
double slope_cell_time_
 
double slope_plane_time_
 
double slope_time_cell_
 
bool slope_plane_is_valid_
 
bool slope_time_is_valid_
 
bool slope_cell_is_valid_
 
novaddt::DAQHit start_
 
novaddt::DAQHit end_
 

Detailed Description

Definition at line 18 of file Track.h.

Constructor & Destructor Documentation

novaddt::smt::Track::Track ( novaddt::DAQHit const &  start,
novaddt::DAQHit const &  end 
)

Definition at line 8 of file Track.cxx.

References moonshadowana::SPEED_OF_LIGHT.

9  : start_(start), end_(end)
10 {
11  dp_ = static_cast<double>(end_.Plane().val) -
12  static_cast<double>(start_.Plane().val);
13  dc_ = static_cast<double>(end_.Cell().val) -
14  static_cast<double>(start_.Cell().val);
15 
16  dt_ = static_cast<int64_t>(end_.TDC().val) -
17  static_cast<int64_t>(start_.TDC().val);
18 
22 
24 }
double calculate_velocity() const
Definition: Track.cxx:38
value_type val
Definition: BaseProducts.h:34
novaddt::Plane const & Plane() const
Definition: DAQHit.h:70
novaddt::DAQHit start_
Definition: Track.h:61
novaddt::TDC const & TDC() const
Definition: DAQHit.h:74
novaddt::DAQHit start() const
Definition: Track.cxx:202
value_type val
Definition: BaseProducts.h:109
double beta_
Definition: Track.h:54
void calculate_slopes()
Definition: Track.cxx:47
double velocity_
Definition: Track.h:54
const double SPEED_OF_LIGHT
Definition: Constants.h:14
double calculate_distance() const
Definition: Track.cxx:28
novaddt::DAQHit end() const
Definition: Track.cxx:209
novaddt::DAQHit end_
Definition: Track.h:61
value_type val
Definition: BaseProducts.h:84
double distance_
Definition: Track.h:54
novaddt::Cell const & Cell() const
Definition: DAQHit.h:71

Member Function Documentation

double novaddt::smt::Track::beta ( ) const

Definition at line 99 of file Track.cxx.

References beta_.

Referenced by novaddt::smt::Trigger::good_track().

100 {
101  return beta_;
102 }
double beta_
Definition: Track.h:54
double novaddt::smt::Track::calculate_distance ( ) const
private

Definition at line 28 of file Track.cxx.

References novaddt::smt::Constants::CELL_WIDTH, dc_, dp_, dx, dz, novaddt::smt::Constants::PLANE_WIDTH, and std::sqrt().

29 {
30  double dx = Constants::CELL_WIDTH * dc_;
31  double dz = Constants::PLANE_WIDTH * dp_;
32 
33  return sqrt(dx*dx + dz*dz);
34 }
T sqrt(T number)
Definition: d0nt_math.hpp:156
const double CELL_WIDTH
Definition: Constants.h:12
double dx[NP][NC]
double dz[NP][NC]
const double PLANE_WIDTH
Definition: Constants.h:11
void novaddt::smt::Track::calculate_slopes ( )
private

Definition at line 47 of file Track.cxx.

References dc_, dp_, dt_, slope_cell_is_valid_, slope_cell_plane_, slope_cell_time_, slope_plane_is_valid_, slope_plane_time_, slope_time_cell_, slope_time_is_valid_, and slope_time_plane_.

48 {
49  if (dp_ == 0)
50  {
51  slope_plane_is_valid_ = false;
52  } else {
53  slope_plane_is_valid_ = true;
56  }
57 
58  if (dt_ == 0)
59  {
60  slope_time_is_valid_ = false;
61  } else {
62  slope_time_is_valid_ = true;
65  }
66 
67  if (dc_ == 0)
68  {
69  slope_cell_is_valid_ = false;
70  } else {
71  slope_cell_is_valid_ = true;
73  }
74 }
double slope_plane_time_
Definition: Track.h:54
bool slope_cell_is_valid_
Definition: Track.h:59
double slope_cell_time_
Definition: Track.h:54
bool slope_plane_is_valid_
Definition: Track.h:59
double slope_cell_plane_
Definition: Track.h:54
bool slope_time_is_valid_
Definition: Track.h:59
double slope_time_cell_
Definition: Track.h:54
double slope_time_plane_
Definition: Track.h:54
double novaddt::smt::Track::calculate_velocity ( ) const
private

Definition at line 38 of file Track.cxx.

References distance_, dt_, and novaddt::smt::Constants::TDC_TICK.

39 {
40  double dt_in_nanoseconds = Constants::TDC_TICK * dt_;
41 
42  return distance_ / dt_in_nanoseconds;
43 }
double distance_
Definition: Track.h:54
const double TDC_TICK
Definition: Constants.h:13
int novaddt::smt::Track::cell_difference ( ) const

Definition at line 251 of file Track.cxx.

References dc_.

252 {
253  return dc_;
254 }
double novaddt::smt::Track::distance ( ) const

Definition at line 78 of file Track.cxx.

References distance_.

Referenced by novaddt::smt::Trigger::good_track().

79 {
80  return distance_;
81 }
double distance_
Definition: Track.h:54
novaddt::DAQHit novaddt::smt::Track::end ( ) const

Definition at line 209 of file Track.cxx.

References end_.

210 {
211  return end_;
212 }
novaddt::DAQHit end_
Definition: Track.h:61
unsigned novaddt::smt::Track::max_cell ( ) const

Definition at line 244 of file Track.cxx.

References novaddt::DAQHit::Cell(), end_, std::max(), start_, and novaddt::Cell::val.

Referenced by novaddt::smt::Trigger::hit_is_between_track_end_points().

245 {
246  return std::max(start_.Cell().val, end_.Cell().val);
247 }
T max(const caf::Proxy< T > &a, T b)
novaddt::DAQHit start_
Definition: Track.h:61
value_type val
Definition: BaseProducts.h:109
novaddt::DAQHit end_
Definition: Track.h:61
novaddt::Cell const & Cell() const
Definition: DAQHit.h:71
unsigned novaddt::smt::Track::max_plane ( ) const

Definition at line 223 of file Track.cxx.

References end_, std::max(), novaddt::DAQHit::Plane(), start_, and novaddt::Plane::val.

Referenced by novaddt::smt::Trigger::hit_is_between_track_end_points().

224 {
225  return std::max(start_.Plane().val, end_.Plane().val);
226 }
T max(const caf::Proxy< T > &a, T b)
novaddt::Plane const & Plane() const
Definition: DAQHit.h:70
novaddt::DAQHit start_
Definition: Track.h:61
novaddt::DAQHit end_
Definition: Track.h:61
value_type val
Definition: BaseProducts.h:84
unsigned novaddt::smt::Track::min_cell ( ) const

Definition at line 237 of file Track.cxx.

References novaddt::DAQHit::Cell(), end_, std::min(), start_, and novaddt::Cell::val.

Referenced by novaddt::smt::Trigger::hit_is_between_track_end_points().

238 {
239  return std::min(start_.Cell().val, end_.Cell().val);
240 }
novaddt::DAQHit start_
Definition: Track.h:61
value_type val
Definition: BaseProducts.h:109
novaddt::DAQHit end_
Definition: Track.h:61
novaddt::Cell const & Cell() const
Definition: DAQHit.h:71
T min(const caf::Proxy< T > &a, T b)
unsigned novaddt::smt::Track::min_plane ( ) const

Definition at line 216 of file Track.cxx.

References end_, std::min(), novaddt::DAQHit::Plane(), start_, and novaddt::Plane::val.

Referenced by novaddt::smt::Trigger::hit_is_between_track_end_points().

217 {
218  return std::min(start_.Plane().val, end_.Plane().val);
219 }
novaddt::Plane const & Plane() const
Definition: DAQHit.h:70
novaddt::DAQHit start_
Definition: Track.h:61
novaddt::DAQHit end_
Definition: Track.h:61
value_type val
Definition: BaseProducts.h:84
T min(const caf::Proxy< T > &a, T b)
int novaddt::smt::Track::plane_difference ( ) const

Definition at line 230 of file Track.cxx.

References dp_.

Referenced by novaddt::smt::Trigger::good_track().

231 {
232  return dp_;
233 }
bool novaddt::smt::Track::slope_cell_is_valid ( ) const

Definition at line 120 of file Track.cxx.

References slope_cell_is_valid_.

Referenced by novaddt::smt::Trigger::run_algorithm(), and slope_time_cell().

121 {
122  return slope_cell_is_valid_;
123 }
bool slope_cell_is_valid_
Definition: Track.h:59
double novaddt::smt::Track::slope_cell_plane ( ) const

Definition at line 127 of file Track.cxx.

References ana::assert(), om::cerr, allTimeWatchdog::endl, slope_cell_plane_, and slope_plane_is_valid().

Referenced by novaddt::smt::Trigger::hit_is_on_road().

128 {
129  if (!slope_plane_is_valid())
130  {
131  std::cerr << "\n\tThe slope is invalid.\n\n"
132  << "Please check Track::slope_is_valid() "
133  << "before accessing Track::slope()." << std::endl;
134  assert(false);
135  }
136 
137  return slope_cell_plane_;
138 }
OStream cerr
Definition: OStream.cxx:7
bool slope_plane_is_valid() const
Definition: Track.cxx:106
double slope_cell_plane_
Definition: Track.h:54
assert(nhit_max >=nhit_nbins)
double novaddt::smt::Track::slope_cell_time ( ) const

Definition at line 157 of file Track.cxx.

References ana::assert(), om::cerr, allTimeWatchdog::endl, slope_cell_time_, and slope_time_is_valid().

Referenced by novaddt::smt::Trigger::run_algorithm().

158 {
159  if (!slope_time_is_valid())
160  {
161  std::cerr << "\n\tThe slope is invalid.\n\n"
162  << "Please check Track::slope_is_valid() "
163  << "before accessing Track::slope()." << std::endl;
164  assert(false);
165  }
166 
167  return slope_cell_time_;
168 }
OStream cerr
Definition: OStream.cxx:7
bool slope_time_is_valid() const
Definition: Track.cxx:113
double slope_cell_time_
Definition: Track.h:54
assert(nhit_max >=nhit_nbins)
bool novaddt::smt::Track::slope_plane_is_valid ( ) const
double novaddt::smt::Track::slope_plane_time ( ) const

Definition at line 172 of file Track.cxx.

References ana::assert(), om::cerr, allTimeWatchdog::endl, slope_plane_time_, and slope_time_is_valid().

Referenced by novaddt::smt::Trigger::run_algorithm().

173 {
174  if (!slope_time_is_valid())
175  {
176  std::cerr << "\n\tThe slope is invalid.\n\n"
177  << "Please check Track::slope_is_valid() "
178  << "before accessing Track::slope()." << std::endl;
179  assert(false);
180  }
181 
182  return slope_plane_time_;
183 }
double slope_plane_time_
Definition: Track.h:54
OStream cerr
Definition: OStream.cxx:7
bool slope_time_is_valid() const
Definition: Track.cxx:113
assert(nhit_max >=nhit_nbins)
double novaddt::smt::Track::slope_time_cell ( ) const

Definition at line 187 of file Track.cxx.

References ana::assert(), om::cerr, allTimeWatchdog::endl, slope_cell_is_valid(), and slope_time_cell_.

Referenced by novaddt::smt::Trigger::run_algorithm().

188 {
189  if (!slope_cell_is_valid())
190  {
191  std::cerr << "\n\tThe slope is invalid.\n\n"
192  << "Please check Track::slope_is_valid() "
193  << "before accessing Track::slope()." << std::endl;
194  assert(false);
195  }
196 
197  return slope_time_cell_;
198 }
OStream cerr
Definition: OStream.cxx:7
bool slope_cell_is_valid() const
Definition: Track.cxx:120
assert(nhit_max >=nhit_nbins)
double slope_time_cell_
Definition: Track.h:54
bool novaddt::smt::Track::slope_time_is_valid ( ) const

Definition at line 113 of file Track.cxx.

References slope_time_is_valid_.

Referenced by novaddt::smt::Trigger::run_algorithm(), slope_cell_time(), and slope_plane_time().

114 {
115  return slope_time_is_valid_;
116 }
bool slope_time_is_valid_
Definition: Track.h:59
double novaddt::smt::Track::slope_time_plane ( ) const

Definition at line 142 of file Track.cxx.

References ana::assert(), om::cerr, allTimeWatchdog::endl, slope_plane_is_valid(), and slope_time_plane_.

Referenced by novaddt::smt::Trigger::hit_is_in_time_with_road(), and novaddt::smt::Trigger::run_algorithm().

143 {
144  if (!slope_plane_is_valid())
145  {
146  std::cerr << "\n\tThe slope is invalid.\n\n"
147  << "Please check Track::slope_is_valid() "
148  << "before accessing Track::slope()." << std::endl;
149  assert(false);
150  }
151 
152  return slope_time_plane_;
153 }
OStream cerr
Definition: OStream.cxx:7
bool slope_plane_is_valid() const
Definition: Track.cxx:106
assert(nhit_max >=nhit_nbins)
double slope_time_plane_
Definition: Track.h:54
novaddt::DAQHit novaddt::smt::Track::start ( ) const

Definition at line 202 of file Track.cxx.

References start_.

Referenced by novaddt::smt::Trigger::hit_is_in_time_with_road(), novaddt::smt::Trigger::hit_is_on_road(), and novaddt::smt::Trigger::run_algorithm().

203 {
204  return start_;
205 }
novaddt::DAQHit start_
Definition: Track.h:61
double novaddt::smt::Track::time ( ) const

Definition at line 85 of file Track.cxx.

References dt_.

86 {
87  return dt_;
88 }
double novaddt::smt::Track::velocity ( ) const

Definition at line 92 of file Track.cxx.

References velocity_.

93 {
94  return velocity_;
95 }
double velocity_
Definition: Track.h:54

Member Data Documentation

double novaddt::smt::Track::beta_
private

Definition at line 54 of file Track.h.

Referenced by beta().

double novaddt::smt::Track::dc_
private

Definition at line 54 of file Track.h.

Referenced by calculate_distance(), calculate_slopes(), and cell_difference().

double novaddt::smt::Track::distance_
private

Definition at line 54 of file Track.h.

Referenced by calculate_velocity(), and distance().

double novaddt::smt::Track::dp_
private

Definition at line 54 of file Track.h.

Referenced by calculate_distance(), calculate_slopes(), and plane_difference().

double novaddt::smt::Track::dt_
private

Definition at line 54 of file Track.h.

Referenced by calculate_slopes(), calculate_velocity(), and time().

novaddt::DAQHit novaddt::smt::Track::end_
private

Definition at line 61 of file Track.h.

Referenced by end(), max_cell(), max_plane(), min_cell(), and min_plane().

bool novaddt::smt::Track::slope_cell_is_valid_
private

Definition at line 59 of file Track.h.

Referenced by calculate_slopes(), and slope_cell_is_valid().

double novaddt::smt::Track::slope_cell_plane_
private

Definition at line 54 of file Track.h.

Referenced by calculate_slopes(), and slope_cell_plane().

double novaddt::smt::Track::slope_cell_time_
private

Definition at line 54 of file Track.h.

Referenced by calculate_slopes(), and slope_cell_time().

bool novaddt::smt::Track::slope_plane_is_valid_
private

Definition at line 59 of file Track.h.

Referenced by calculate_slopes(), and slope_plane_is_valid().

double novaddt::smt::Track::slope_plane_time_
private

Definition at line 54 of file Track.h.

Referenced by calculate_slopes(), and slope_plane_time().

double novaddt::smt::Track::slope_time_cell_
private

Definition at line 54 of file Track.h.

Referenced by calculate_slopes(), and slope_time_cell().

bool novaddt::smt::Track::slope_time_is_valid_
private

Definition at line 59 of file Track.h.

Referenced by calculate_slopes(), and slope_time_is_valid().

double novaddt::smt::Track::slope_time_plane_
private

Definition at line 54 of file Track.h.

Referenced by calculate_slopes(), and slope_time_plane().

novaddt::DAQHit novaddt::smt::Track::start_
private

Definition at line 61 of file Track.h.

Referenced by max_cell(), max_plane(), min_cell(), min_plane(), and start().

double novaddt::smt::Track::velocity_
private

Definition at line 54 of file Track.h.

Referenced by velocity().


The documentation for this class was generated from the following files: