LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
CBAlgoStartNearEnd.cxx
Go to the documentation of this file.
2 
3 namespace cmtool {
4 
5  //----------------------------------------
7  //----------------------------------------
8  {
9  SetMaxStartEndSeparation(10); //cm^2
10  SetMinHits(40); //cm^2
11  SetMaxAngle(20 * (3.14 / 180)); //rad: max angle of end-point cluster
12  // Nothing to be done in the base class
13  }
14 
15  //--------------------------------------------------------
16  bool CBAlgoStartNearEnd::Bool(const ::cluster::ClusterParamsAlg& cluster1,
17  const ::cluster::ClusterParamsAlg& cluster2)
18  //--------------------------------------------------------
19  {
20 
21  double start_w1 = cluster1.GetParams().start_point.w;
22  double start_t1 = cluster1.GetParams().start_point.t;
23  double end_w1 = cluster1.GetParams().end_point.w;
24  double end_t1 = cluster1.GetParams().end_point.t;
25 
26  double start_w2 = cluster2.GetParams().start_point.w;
27  double start_t2 = cluster2.GetParams().start_point.t;
28  double end_w2 = cluster2.GetParams().end_point.w;
29  double end_t2 = cluster2.GetParams().end_point.t;
30 
31  double angle_1 = cluster1.GetParams().opening_angle;
32  double angle_2 = cluster2.GetParams().opening_angle;
33 
34  size_t hits_1 = cluster1.GetHitVector().size();
35  size_t hits_2 = cluster2.GetHitVector().size();
36 
37  if ((angle_1 < _maxopeningangle) and (hits_1 > _MinHits) and
38  (((start_w2 - end_w1) * (start_w2 - end_w1) + (start_t2 - end_t1) * (start_t2 - end_t1)) <
39  _separation)) {
40  if (_verbose) std::cout << "Start in End!" << std::endl;
41  return true;
42  }
43 
44  if ((angle_2 < _maxopeningangle) and (hits_2 > _MinHits) and
45  (((start_w1 - end_w2) * (start_w1 - end_w2) + (start_t1 - end_t2) * (start_t1 - end_t2)) <
46  _separation)) {
47  if (_verbose) std::cout << "Start in End!" << std::endl;
48  return true;
49  }
50 
51  return false;
52  }
53 
54  //-----------------------
56  //-----------------------
57  {}
58 
59 }
virtual bool Bool(const ::cluster::ClusterParamsAlg &cluster1, const ::cluster::ClusterParamsAlg &cluster2)
Class def header for a class CBAlgoStartNearEnd.
void SetMaxStartEndSeparation(double d)
CBAlgoStartNearEnd()
Default constructor.
virtual void Report()
Function to report what&#39;s going on per merging.
bool _verbose
Boolean to choose verbose mode. Turned on if CMergeManager/CMatchManager&#39;s verbosity level is >= kPer...
Definition: CMAlgoBase.h:82