Public Member Functions | Private Member Functions | Private Attributes | List of all members
mono::SlowMonopoleTrigger Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N21-02-24/DDTMonopole/SlowMonopoleTrigger.h"

Public Member Functions

 SlowMonopoleTrigger (novaddt::HitList const &h, unsigned long long const &event_time, Configuration const &c)
 
std::vector< novaddt::TriggerDecisiontrigger_decisions () const
 
std::map< std::string, novaddt::HitListessential_hit_lists () const
 
unsigned trigger_decision_time_buffer () const
 
bool parameter_exists (std::string const name) const
 
double parameter (std::string const name)
 

Private Member Functions

bool algorithm ()
 
novaddt::HitList::const_iterator find (novaddt::HitList::const_iterator begin, novaddt::HitList::const_iterator end, novaddt::TDC tdc) const
 
novaddt::HitList::const_iterator find (novaddt::HitList const &hits, novaddt::TDC tdc) const
 
int find_max_gap (std::set< int > const &collection) const
 
void find_view_matched_hits (std::map< std::string, novaddt::HitList > &hitmap) const
 
bool gap_exceeds_cut (std::set< int > collection, int const &object, int const &max_gap_cut) const
 
bool good_track (Track const &track) const
 
bool hit_is_between_track_end_points (novaddt::DAQHit const &hit, Track const &track) const
 
bool hit_is_in_time_with_road (novaddt::DAQHit const &hit, Track const &track) const
 
bool hit_is_on_road (novaddt::DAQHit const &hit, Track const &track) const
 
bool hit_is_on_surface (novaddt::DAQHit const &hit) const
 
bool hits_are_view_matched (novaddt::DAQHit const &x_hit, novaddt::DAQHit const &y_hit) const
 
void split_by_view (novaddt::HitList hits, std::map< std::string, novaddt::HitList > &hitmap) const
 

Private Attributes

novaddt::HitList const & hits_
 
unsigned long long event_time_
 
int max_plane_gap_cut_
 
unsigned sparsification_factor_
 
int max_cell_gap_cut_
 
double track_max_beta_
 
double track_min_beta_
 
unsigned trigger_time_buffer_
 
std::map< std::string, novaddt::HitListessential_hit_lists_
 
std::vector< novaddt::TriggerDecisiontrigger_decisions_
 
std::map< std::string, double > parameter_
 

Detailed Description

Definition at line 30 of file SlowMonopoleTrigger.h.

Constructor & Destructor Documentation

mono::SlowMonopoleTrigger::SlowMonopoleTrigger ( novaddt::HitList const &  h,
unsigned long long const &  event_time,
Configuration const &  c 
)

Definition at line 20 of file SlowMonopoleTrigger.cxx.

References confusionMatrixTree::count, om::cout, e, allTimeWatchdog::endl, recentWatchdog::now, getGoodRuns4SAM::t0, and getGoodRuns4SAM::t1.

21  :
22  hits_(h),
23  event_time_(event_time),
24  max_plane_gap_cut_(c.max_plane_gap_cut),
25  sparsification_factor_(c.sparsification_factor)
26 {
27  max_cell_gap_cut_ = 20;
28  track_max_beta_ = 5e-3;
29  track_min_beta_ = 4e-5;
31 
33  algorithm();
35 
36  parameter_["algorithm_time"] = duration_cast<milliseconds>(t1-t0).count();
37 
38  std::cout << "MF: Algorithm Time: "
39  << duration_cast<milliseconds>(t1-t0).count() << " ms"
40  << std::endl;
41 }
novaddt::HitList const & hits_
unsigned long long event_time_
std::map< std::string, double > parameter_
OStream cout
Definition: OStream.cxx:6
Float_t e
Definition: plot.C:35

Member Function Documentation

bool mono::SlowMonopoleTrigger::algorithm ( )
private

Definition at line 93 of file SlowMonopoleTrigger.cxx.

References std::abs(), mono::Track::beta(), novaddt::DAQHit::Cell(), om::cout, mono::Track::distance(), distance(), allTimeWatchdog::endl, srt_file_template::find_if, std::min(), novaddt::DAQHit::Plane(), ddthelpers::print(), fillBadChanDBTables::result, gen_hdf5record::size, mono::Track::slope_cell_is_valid(), mono::Track::slope_cell_time(), mono::Track::slope_plane_is_valid(), mono::Track::slope_plane_time(), mono::Track::slope_time_cell(), mono::Track::slope_time_is_valid(), mono::Track::slope_time_plane(), split_by_view(), mono::Track::start_ddt(), getGoodRuns4SAM::t0, novaddt::DAQHit::TDC(), track, novaddt::smt::Constants::TRACK_MIN_HITS, novaddt::smt::Constants::TRACK_MIN_UNIQUE_PLANES, daqdataformats::TRIG_ID_DATA_SLOWMONO, novaddt::TDC::val, novaddt::Plane::val, and novaddt::Cell::val.

94 {
95  // Timing Cheat Sheet
96  //
97  // std::map<std::string, double> dur =
98  // { {"setup", 0}, {"find", 0}, {"track", 0}, {"sets", 0} };
99  // auto t_start = high_resolution_clock::now();
100  // dur["setup"] +=
101  // duration_cast<nanoseconds>(high_resolution_clock::now() - t_start).count();
102 
103  bool result = false;
104  novaddt::DAQHit trigger_entry_hit, trigger_exit_hit;
105 
106  std::map<std::string, novaddt::HitList> hitmap;
107  split_by_view(hits_, hitmap);
108 
109  // std::cout << "MF: (x hits, y hits, min_hits) = ("
110  // << hitmap["x"].size()
111  // << ", " << hitmap["y"].size()
112  // << ", " << min_hits_
113  // << ")" << std::endl;
114 
115  if (hitmap["x"].size() < novaddt::smt::Constants::TRACK_MIN_HITS ||
117  return false;
118 
119  hitmap["x_surface"];
120  hitmap["x_contained"];
121 
122  find_view_matched_hits(hitmap);
123 
124  // std::cout << "MF: (x surface, x contained, min_hits) = ("
125  // << hitmap["x_surface"].size()
126  // << ", " << hitmap["x_contained"].size()
127  // << ", " << min_hits_
128  // << ")" << std::endl;
129 
130  // for (auto const& hit : hitmap["x_surface"])
131  // ddthelpers::print(hit, event_time_);
132 
133  // std::cout << "\n\n\nContained Hits:" << std::endl;
134  // for (auto const& hit : hitmap["x_contained"])
135  // ddthelpers::print(hit, event_time_);
136 
137  if(hitmap["x_contained"].size() < novaddt::smt::Constants::TRACK_MIN_HITS)
138  return false;
139 
140  unsigned n_good_track = 0;
141  for (auto entry_hit = hitmap["x_surface"].cbegin();
142  entry_hit != hitmap["x_surface"].cend() && !result;
143  ++entry_hit)
144  {
145  // we add 1, so that we avoid combinations between the same hit
146  novaddt::HitList::const_reverse_iterator until(entry_hit + 1);
147 
148  auto contained_first = find(hitmap["x_contained"], entry_hit->TDC());
149 
150  std::find_if(hitmap["x_surface"].crbegin(), until,
151  [&](novaddt::DAQHit const& exit_hit)
152  {
153  auto contained_last =
154  find(contained_first, hitmap["x_contained"].cend(), exit_hit.TDC());
155 
156  if (std::distance(contained_first, contained_last) <
158  return false;
159 
160  Track track(*entry_hit, exit_hit);
161 
162  // std::cout << "\nMF (Track): (distance, beta, good) = ("
163  // << track.distance_in_cm() << ", "
164  // << track.beta() << ", "
165  // << std::boolalpha << good_track(track) << ")" << std::endl;
166  // ddthelpers::print(*entry_hit, event_time_);
167  // ddthelpers::print(exit_hit, event_time_);
168 
169  if (!good_track(track))
170  return false;
171 
172  if (++n_good_track % sparsification_factor_)
173  return false;
174 
175  std::set<int> plane_set = {entry_hit->Plane().val};
176  std::set<int> cell_set = {entry_hit->Cell().val};
177 
178  unsigned long long t_max_plane_gap = track.start_ddt().TDC().val;
179  if (track.slope_plane_is_valid())
180  t_max_plane_gap += abs(track.slope_time_plane()) * max_plane_gap_cut_;
181 
182  unsigned long long t_max_cell_gap = track.start_ddt().TDC().val;
183  if (track.slope_cell_is_valid())
184  t_max_cell_gap += abs(track.slope_time_cell()) * max_cell_gap_cut_;
185  unsigned long long t_max_gap = std::min(t_max_plane_gap, t_max_cell_gap);
186 
187  unsigned n_contained_hit = 0;
188  bool contains_gap_exceeding_cut = std::any_of
189  (contained_first, contained_last,
190  [&](novaddt::DAQHit const& hit)
191  {
192  if (hit.TDC().val > t_max_gap)
193  {
194  int64_t time_difference =
195  static_cast<int64_t>(hit.TDC().val) -
196  static_cast<int64_t>(track.start_ddt().TDC().val);
197 
198  if (hit.TDC().val > t_max_cell_gap)
199  {
200  double expected_cell =
201  static_cast<double>(track.start_ddt().Cell().val);
202  if (track.slope_time_is_valid())
203  expected_cell += track.slope_cell_time() * time_difference;
204 
205  if (gap_exceeds_cut(cell_set, expected_cell, max_cell_gap_cut_))
206  return true;
207  }
208 
209  if (hit.TDC().val > t_max_plane_gap)
210  {
211  double expected_plane =
212  static_cast<double>(track.start_ddt().Plane().val);
213  if (track.slope_time_is_valid())
214  expected_plane += track.slope_plane_time() * time_difference;
215 
216  if (gap_exceeds_cut
217  (plane_set, expected_plane, max_plane_gap_cut_))
218  return true;
219  }
220  }
221 
223  {
224  cell_set.insert(hit.Cell().val);
225  plane_set.insert(hit.Plane().val);
226  }
227 
228  return false;
229  });
230 
231  // std::cout << "MF: contains_gap_exceeding_cut_ = "
232  // << std::boolalpha << contains_gap_exceeding_cut
233  // << std::endl;
234 
235  if (contains_gap_exceeding_cut)
236  return false;
237 
238  // std::cout << "MF: contains_gap_exceeding_cut_ = "
239  // << std::boolalpha << contains_gap_exceeding_cut
240  // << std::endl;
241 
242  plane_set.insert(exit_hit.Plane().val);
243  // std::cout << "MF: (plane_set_size, plane_max_gap) = ("
244  // << plane_set.size()
245  // << ", " << find_max_gap(plane_set)
246  // << ")" << std::endl;
247 
249  return false;
250 
251  if (find_max_gap(plane_set) > max_plane_gap_cut_)
252  return false;
253 
254  cell_set.insert(exit_hit.Cell().val);
255  // std::cout << "MF: (cell_set_size, cell_max_gap) = ("
256  // << cell_set.size()
257  // << ", " << find_max_gap(cell_set)
258  // << ")" << std::endl;
259 
260  if (find_max_gap(cell_set) > max_cell_gap_cut_)
261  return false;
262 
263  result = true;
264  trigger_entry_hit = *entry_hit;
265  trigger_exit_hit = exit_hit;
266 
267  std::cout << "MF: Trigger Decision Hits:" << std::endl;
268  ddthelpers::print(trigger_entry_hit, event_time_);
269  ddthelpers::print(trigger_exit_hit, event_time_);
270  std::cout << "MF: Trigger Decision Track:"
271  << "\nMF: (distance, velocity) = ("
272  << track.distance() << ", "
273  << track.beta() << ")" << std::endl;
274 
275  return true;
276  });
277  }
278 
279  // std::cout << "MF: n_good_track = " << n_good_track << std::endl;
280 
281 
282  if (result)
283  {
284  std::cout << "MF: Trigger Decision!" << std::endl;
285 
286  auto t0 = trigger_entry_hit.TDC().val;
287  auto dt = trigger_exit_hit.TDC().val - t0;
288 
290  emplace_back(t0 - 2 * trigger_time_buffer_,
291  dt + 4 * trigger_time_buffer_,
293 
294  essential_hit_lists_["mf_entry_exit"].push_back(trigger_entry_hit);
295  essential_hit_lists_["mf_entry_exit"].push_back(trigger_exit_hit);
296  }
297 
298  return result;
299 }
bool hit_is_in_time_with_road(novaddt::DAQHit const &hit, Track const &track) const
value_type val
Definition: BaseProducts.h:34
novaddt::Plane const & Plane() const
Definition: DAQHit.h:70
novaddt::TDC const & TDC() const
Definition: DAQHit.h:74
std::vector< novaddt::TriggerDecision > trigger_decisions_
value_type val
Definition: BaseProducts.h:109
void find_view_matched_hits(std::map< std::string, novaddt::HitList > &hitmap) const
Definition: event.h:19
void abs(TH1 *hist)
unsigned distance(const T &t1, const T &t2)
novaddt::HitList::const_iterator find(novaddt::HitList::const_iterator begin, novaddt::HitList::const_iterator end, novaddt::TDC tdc) const
int find_max_gap(std::set< int > const &collection) const
bool good_track(Track const &track) const
Definition: Cand.cxx:23
novaddt::HitList const & hits_
void print(novaddt::DAQHit const &h, unsigned long long const &event_time=0)
Definition: DDTHelpers.cxx:84
const unsigned TRACK_MIN_UNIQUE_PLANES
Definition: Constants.h:34
unsigned long long event_time_
value_type val
Definition: BaseProducts.h:84
OStream cout
Definition: OStream.cxx:6
void split_by_view(novaddt::HitList hits, std::map< std::string, novaddt::HitList > &hitmap) const
Definition: structs.h:12
bool gap_exceeds_cut(std::set< int > collection, int const &object, int const &max_gap_cut) const
novaddt::Cell const & Cell() const
Definition: DAQHit.h:71
T min(const caf::Proxy< T > &a, T b)
Float_t track
Definition: plot.C:35
const unsigned TRACK_MIN_HITS
Definition: Constants.h:33
std::map< std::string, novaddt::HitList > essential_hit_lists_
std::map< std::string, novaddt::HitList > mono::SlowMonopoleTrigger::essential_hit_lists ( ) const

Definition at line 62 of file SlowMonopoleTrigger.cxx.

Referenced by mono::SlowMonopoleFilt::filter().

63 {
64  return essential_hit_lists_;
65 }
std::map< std::string, novaddt::HitList > essential_hit_lists_
novaddt::HitList::const_iterator mono::SlowMonopoleTrigger::find ( novaddt::HitList::const_iterator  begin,
novaddt::HitList::const_iterator  end,
novaddt::TDC  tdc 
) const
private

Definition at line 559 of file SlowMonopoleTrigger.cxx.

Referenced by hit_is_between_track_end_points().

561 {
562  return std::lower_bound(begin, end, tdc,
564 }
novaddt::HitList::const_iterator mono::SlowMonopoleTrigger::find ( novaddt::HitList const &  hits,
novaddt::TDC  tdc 
) const
private

Definition at line 569 of file SlowMonopoleTrigger.cxx.

570 {
571  return find(hits.cbegin(), hits.cend(), tdc);
572 }
novaddt::HitList::const_iterator find(novaddt::HitList::const_iterator begin, novaddt::HitList::const_iterator end, novaddt::TDC tdc) const
void hits()
Definition: readHits.C:15
int mono::SlowMonopoleTrigger::find_max_gap ( std::set< int > const &  collection) const
private

Definition at line 517 of file SlowMonopoleTrigger.cxx.

References hit_is_between_track_end_points(), std::max(), and fillBadChanDBTables::result.

Referenced by gap_exceeds_cut().

518 {
519  int result = -9999;
520 
521  std::adjacent_find
522  (collection.begin(), collection.end(), [&](int object, int next_object)
523  {
524  int gap = next_object - object;
525  result = std::max(gap, result);
526 
527  // This return is meaningless, but a boolean return is required by
528  // adjacent find. We choose false, so the loop goes until the end.
529  return false;
530  });
531 
532  return result;
533 }
T max(const caf::Proxy< T > &a, T b)
void mono::SlowMonopoleTrigger::find_view_matched_hits ( std::map< std::string, novaddt::HitList > &  hitmap) const
private

Definition at line 322 of file SlowMonopoleTrigger.cxx.

References srt_file_template::find_if, hits_are_view_matched(), and novaddt::smt::Constants::VIEW_MATCH_TDC_CUT.

Referenced by split_by_view().

323 {
324  for (auto const& x_hit : hitmap["x"])
325  {
326  auto y_first =
327  find(hitmap["y"],
329  auto y_last =
330  find(hitmap["y"],
332 
333  auto y_match = std::find_if
334  (y_first, y_last, [&](novaddt::DAQHit const& y_hit)
335  {
336  return hits_are_view_matched(x_hit, y_hit);
337  });
338 
339  if (y_match != y_last)
340  {
341  // we found a matched hit
342  hitmap["x_contained"].push_back(x_hit);
343 
344  // is this hit on the surface?
345  if (hit_is_on_surface(x_hit))
346  {
347  hitmap["x_surface"].push_back(x_hit);
348  } else {
349  // now we need to look for additional matched y-hits and check whether
350  // they are on the surface
351  auto surface_y_match = std::find_if
352  (y_match, y_last, [&](novaddt::DAQHit const& y_hit)
353  {
354  if (!hits_are_view_matched(x_hit, y_hit))
355  return false;
356 
357  if (!hit_is_on_surface(y_hit))
358  return false;
359 
360  return true;
361  });
362 
363  if (surface_y_match != y_last)
364  hitmap["x_surface"].push_back(x_hit);
365  }
366  }
367  }
368 }
bool hits_are_view_matched(novaddt::DAQHit const &x_hit, novaddt::DAQHit const &y_hit) const
bool hit_is_on_surface(novaddt::DAQHit const &hit) const
novaddt::HitList::const_iterator find(novaddt::HitList::const_iterator begin, novaddt::HitList::const_iterator end, novaddt::TDC tdc) const
const unsigned VIEW_MATCH_TDC_CUT
Definition: Constants.h:30
bool mono::SlowMonopoleTrigger::gap_exceeds_cut ( std::set< int collection,
int const &  object,
int const &  max_gap_cut 
) const
private

Definition at line 491 of file SlowMonopoleTrigger.cxx.

References find_max_gap().

Referenced by hit_is_in_time_with_road().

492 {
493  // Note that we copy the collection in here on purpose, so that we do not
494  // accidentally alter it.
495  collection.insert(object);
496 
497  // std::cout << "MF: Collection = ";
498  // for (auto const& element : collection)
499  // std::cout << element << " ";
500  // std::cout << std::endl;
501  // std::cout << "MF: (max_gap, max_gap_cut) = ("
502  // << find_max_gap(collection)
503  // << ", " << max_gap_cut
504  // << ")" << std::endl;
505 
506  // We need to encode the max_plane cut differently here, so as to keep
507  // this method as general as possible.
508  if (find_max_gap(collection) > max_gap_cut)
509  return true;
510 
511  return false;
512 }
int find_max_gap(std::set< int > const &collection) const
bool mono::SlowMonopoleTrigger::good_track ( Track const &  track) const
private

Definition at line 407 of file SlowMonopoleTrigger.cxx.

References std::abs(), mono::Track::distance(), hit_is_on_road(), mono::Track::plane_difference(), novaddt::smt::Constants::TRACK_MIN_DISTANCE, and mono::Track::velocity().

408 {
410  return false;
411 
412  if (track.velocity() < track_min_beta_)
413  return false;
414 
415  if (track.velocity() > track_max_beta_)
416  return false;
417 
418  // For simplicity, let's punt on all events that cross fewer planes
419  // than the maximum gap cut:
420  if (abs(track.plane_difference()) <= max_plane_gap_cut_)
421  return false;
422 
423  return true;
424 }
Definition: event.h:19
void abs(TH1 *hist)
const double TRACK_MIN_DISTANCE
Definition: Constants.h:35
bool mono::SlowMonopoleTrigger::hit_is_between_track_end_points ( novaddt::DAQHit const &  hit,
Track const &  track 
) const
private

Definition at line 538 of file SlowMonopoleTrigger.cxx.

References novaddt::DAQHit::Cell(), find(), mono::Track::max_cell(), mono::Track::max_plane(), mono::Track::min_cell(), mono::Track::min_plane(), novaddt::DAQHit::Plane(), novaddt::Plane::val, and novaddt::Cell::val.

Referenced by find_max_gap().

539 {
540  if (hit.Plane().val < track.min_plane())
541  return false;
542 
543  if (hit.Plane().val > track.max_plane())
544  return false;
545 
546  if (hit.Cell().val < track.min_cell())
547  return false;
548 
549  if (hit.Cell().val > track.max_cell())
550  return false;
551 
552  return true;
553 }
Definition: event.h:19
Definition: structs.h:12
bool mono::SlowMonopoleTrigger::hit_is_in_time_with_road ( novaddt::DAQHit const &  hit,
Track const &  track 
) const
private

Definition at line 458 of file SlowMonopoleTrigger.cxx.

References gap_exceeds_cut(), novaddt::DAQHit::Plane(), novaddt::smt::Constants::ROAD_TIME_VARIATION, mono::Track::slope_plane_is_valid(), mono::Track::slope_time_plane(), mono::Track::start_ddt(), novaddt::DAQHit::TDC(), novaddt::TDC::val, and novaddt::Plane::val.

Referenced by hit_is_on_road().

459 {
460  if (!hit_is_on_road(hit, track))
461  return false;
462 
463  // If the plane of the hit and track end points are all equal,
464  // we cannot calculate the time_slope and make no statement on the time.
465  if (!track.slope_plane_is_valid())
466  return false;
467 
468 
469  int64_t relative_hit_time =
470  static_cast<int64_t>(hit.TDC().val) -
471  static_cast<int64_t>(track.start_ddt().TDC().val);
472 
473  double expected_time = track.slope_time_plane() *
474  (static_cast<double>(hit.Plane().val) -
475  static_cast<double>(track.start_ddt().Plane().val));
476 
477  if (relative_hit_time >
479  return false;
480 
481  if (relative_hit_time <
483  return false;
484 
485  return true;
486 }
Definition: event.h:19
const double ROAD_TIME_VARIATION
Definition: Constants.h:38
bool hit_is_on_road(novaddt::DAQHit const &hit, Track const &track) const
Definition: structs.h:12
bool mono::SlowMonopoleTrigger::hit_is_on_road ( novaddt::DAQHit const &  hit,
Track const &  track 
) const
private

Definition at line 429 of file SlowMonopoleTrigger.cxx.

References novaddt::DAQHit::Cell(), hit_is_in_time_with_road(), novaddt::DAQHit::Plane(), novaddt::smt::Constants::ROAD_HALF_WIDTH, mono::Track::slope_cell_plane(), mono::Track::slope_plane_is_valid(), mono::Track::start_ddt(), novaddt::Plane::val, and novaddt::Cell::val.

Referenced by good_track().

430 {
432  return false;
433 
434  // If the plane of the hit and track end points are all equal,
435  // the hit is on the road.
436  if (!track.slope_plane_is_valid())
437  return true;
438 
439  double road_center_cell = track.slope_cell_plane() *
440  (static_cast<double>(hit.Plane().val) -
441  static_cast<double>(track.start_ddt().Plane().val)) +
442  static_cast<double>(track.start_ddt().Cell().val);
443 
444  if (hit.Cell().val >
445  road_center_cell + novaddt::smt::Constants::ROAD_HALF_WIDTH)
446  return false;
447 
448  if (hit.Cell().val <
449  road_center_cell - novaddt::smt::Constants::ROAD_HALF_WIDTH)
450  return false;
451 
452  return true;
453 }
const unsigned ROAD_HALF_WIDTH
Definition: Constants.h:37
Definition: event.h:19
Definition: structs.h:12
bool hit_is_between_track_end_points(novaddt::DAQHit const &hit, Track const &track) const
bool mono::SlowMonopoleTrigger::hit_is_on_surface ( novaddt::DAQHit const &  hit) const
private

Definition at line 388 of file SlowMonopoleTrigger.cxx.

References novaddt::DAQHit::Cell(), novaddt::DAQHit::Plane(), novaddt::smt::Constants::SURFACE_MAX_CELL, novaddt::smt::Constants::SURFACE_MAX_PLANE, novaddt::smt::Constants::SURFACE_MIN_CELL, novaddt::smt::Constants::SURFACE_MIN_PLANE, novaddt::Plane::val, and novaddt::Cell::val.

Referenced by hits_are_view_matched().

389 {
391  return true;
392 
394  return true;
395 
397  return true;
398 
400  return true;
401 
402  return false;
403 }
const unsigned SURFACE_MAX_CELL
Definition: Constants.h:24
const unsigned SURFACE_MAX_PLANE
Definition: Constants.h:28
const unsigned SURFACE_MIN_PLANE
Definition: Constants.h:27
Definition: structs.h:12
const unsigned SURFACE_MIN_CELL
Definition: Constants.h:23
bool mono::SlowMonopoleTrigger::hits_are_view_matched ( novaddt::DAQHit const &  x_hit,
novaddt::DAQHit const &  y_hit 
) const
private

Definition at line 373 of file SlowMonopoleTrigger.cxx.

References std::abs(), hit_is_on_surface(), novaddt::DAQHit::Plane(), novaddt::Plane::val, and novaddt::smt::Constants::VIEW_MATCH_PLANE_CUT.

Referenced by find_view_matched_hits().

374 {
375  int plane_difference =
376  static_cast<int>(x_hit.Plane().val) - static_cast<int>(y_hit.Plane().val);
377 
378  if (std::abs(plane_difference) <
380  return true;
381 
382  return false;
383 }
float abs(float number)
Definition: d0nt_math.hpp:39
const unsigned VIEW_MATCH_PLANE_CUT
Definition: Constants.h:31
double mono::SlowMonopoleTrigger::parameter ( std::string const  name)

Definition at line 79 of file SlowMonopoleTrigger.cxx.

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

80 {
81  if (parameter_.find(name) == parameter_.end())
82  {
83  std::cerr << "\n\tParameter " << name << " is not available.\n"
84  << std::endl;
85  assert(false);
86  }
87 
88  return parameter_[name];
89 }
const XML_Char * name
Definition: expat.h:151
OStream cerr
Definition: OStream.cxx:7
std::map< std::string, double > parameter_
assert(nhit_max >=nhit_nbins)
bool mono::SlowMonopoleTrigger::parameter_exists ( std::string const  name) const

Definition at line 69 of file SlowMonopoleTrigger.cxx.

70 {
71  if (parameter_.find(name) == parameter_.end())
72  return false;
73 
74  return true;
75 }
const XML_Char * name
Definition: expat.h:151
std::map< std::string, double > parameter_
void mono::SlowMonopoleTrigger::split_by_view ( novaddt::HitList  hits,
std::map< std::string, novaddt::HitList > &  hitmap 
) const
private

Definition at line 304 of file SlowMonopoleTrigger.cxx.

References distance(), find_view_matched_hits(), make_syst_table_plots::h, and daqchannelmap::X_VIEW.

Referenced by algorithm().

306 {
307  auto bound = std::stable_partition
308  (hits.begin(), hits.end(),
309  [](novaddt::DAQHit const& h)
310  { return h.View().val == daqchannelmap::X_VIEW; });
311 
312  hitmap["x"] = novaddt::HitList(std::distance(hits.begin(), bound));
313  std::move(hits.begin(), bound, hitmap["x"].begin());
314 
315  hitmap["y"] = novaddt::HitList(std::distance(bound, hits.end()));
316  std::move(bound, hits.end(), hitmap["y"].begin());
317 }
std::vector< DAQHit > HitList
Definition: HitList.h:15
unsigned distance(const T &t1, const T &t2)
void hits()
Definition: readHits.C:15
Identifier for the X measuring view of the detector (top)
unsigned mono::SlowMonopoleTrigger::trigger_decision_time_buffer ( ) const

Definition at line 53 of file SlowMonopoleTrigger.cxx.

Referenced by mono::SlowMonopoleFilt::filter().

54 {
55  return trigger_time_buffer_;
56 }
std::vector< novaddt::TriggerDecision > mono::SlowMonopoleTrigger::trigger_decisions ( ) const

Definition at line 46 of file SlowMonopoleTrigger.cxx.

Referenced by mono::SlowMonopoleFilt::filter().

47 {
48  return trigger_decisions_;
49 }
std::vector< novaddt::TriggerDecision > trigger_decisions_

Member Data Documentation

std::map<std::string, novaddt::HitList> mono::SlowMonopoleTrigger::essential_hit_lists_
private

Definition at line 86 of file SlowMonopoleTrigger.h.

unsigned long long mono::SlowMonopoleTrigger::event_time_
private

Definition at line 76 of file SlowMonopoleTrigger.h.

novaddt::HitList const& mono::SlowMonopoleTrigger::hits_
private

Definition at line 75 of file SlowMonopoleTrigger.h.

int mono::SlowMonopoleTrigger::max_cell_gap_cut_
private

Definition at line 80 of file SlowMonopoleTrigger.h.

int mono::SlowMonopoleTrigger::max_plane_gap_cut_
private

Definition at line 77 of file SlowMonopoleTrigger.h.

std::map<std::string, double> mono::SlowMonopoleTrigger::parameter_
private

Definition at line 89 of file SlowMonopoleTrigger.h.

unsigned mono::SlowMonopoleTrigger::sparsification_factor_
private

Definition at line 78 of file SlowMonopoleTrigger.h.

double mono::SlowMonopoleTrigger::track_max_beta_
private

Definition at line 82 of file SlowMonopoleTrigger.h.

double mono::SlowMonopoleTrigger::track_min_beta_
private

Definition at line 83 of file SlowMonopoleTrigger.h.

std::vector<novaddt::TriggerDecision> mono::SlowMonopoleTrigger::trigger_decisions_
private

Definition at line 87 of file SlowMonopoleTrigger.h.

unsigned mono::SlowMonopoleTrigger::trigger_time_buffer_
private

Definition at line 84 of file SlowMonopoleTrigger.h.


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