LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
CBAlgoStartNearEnd.cxx
Go to the documentation of this file.
1 #ifndef RECOTOOL_CBALGOSTARTNEAREND_CXX
2 #define RECOTOOL_CBALGOSTARTNEAREND_CXX
3 
4 #include "CBAlgoStartNearEnd.h"
5 
6 namespace cmtool {
7 
8  //----------------------------------------
10  //----------------------------------------
11  {
12  SetMaxStartEndSeparation(10); //cm^2
13  SetMinHits(40); //cm^2
14  SetMaxAngle(20*(3.14/180)); //rad: max angle of end-point cluster
15  // Nothing to be done in the base class
16  }
17 
18  //--------------------------------------------------------
19  bool CBAlgoStartNearEnd::Bool(const ::cluster::ClusterParamsAlg &cluster1,
20  const ::cluster::ClusterParamsAlg &cluster2)
21  //--------------------------------------------------------
22  {
23 
24  double start_w1 = cluster1.GetParams().start_point.w;
25  double start_t1 = cluster1.GetParams().start_point.t;
26  double end_w1 = cluster1.GetParams().end_point.w;
27  double end_t1 = cluster1.GetParams().end_point.t;
28 
29  double start_w2 = cluster2.GetParams().start_point.w;
30  double start_t2 = cluster2.GetParams().start_point.t;
31  double end_w2 = cluster2.GetParams().end_point.w;
32  double end_t2 = cluster2.GetParams().end_point.t;
33 
34  double angle_1 = cluster1.GetParams().opening_angle;
35  double angle_2 = cluster2.GetParams().opening_angle;
36 
37  size_t hits_1 = cluster1.GetHitVector().size();
38  size_t hits_2 = cluster2.GetHitVector().size();
39 
40 
41  if ( (angle_1 < _maxopeningangle) and (hits_1 > _MinHits) and
42  ( ((start_w2-end_w1)*(start_w2-end_w1) +
43  (start_t2-end_t1)*(start_t2-end_t1)) < _separation) ){
44  if (_verbose)
45  std::cout << "Start in End!" << std::endl;
46  return true;
47  }
48 
49  if ( (angle_2 < _maxopeningangle) and (hits_2 > _MinHits) and
50  ( ((start_w1-end_w2)*(start_w1-end_w2) +
51  (start_t1-end_t2)*(start_t1-end_t2)) < _separation) ){
52  if (_verbose)
53  std::cout << "Start in End!" << std::endl;
54  return true;
55  }
56 
57  return false;
58 
59  }
60 
61  //-----------------------
63  //-----------------------
64  {
65  }
66 
67 }
68 
69 #endif
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:88