All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Attributes | List of all members
cmtool::CBAlgoStartTrack Class Reference

#include <CBAlgoStartTrack.h>

Inheritance diagram for cmtool::CBAlgoStartTrack:
cmtool::CBoolAlgoBase cmtool::CMAlgoBase

Public Member Functions

 CBAlgoStartTrack ()
 Default constructor. More...
 
virtual ~CBAlgoStartTrack ()
 Default destructor. More...
 
virtual bool Bool (const ::cluster::ClusterParamsAlg &cluster1, const ::cluster::ClusterParamsAlg &cluster2)
 
virtual void Report ()
 
virtual void Reset ()
 Function to reset the algorithm instance ... maybe implemented via child class. More...
 
bool IsStartTrack (const ::cluster::ClusterParamsAlg &cluster)
 
bool IsOverlappingBlob (const ::cluster::ClusterParamsAlg &cluster)
 
void SetMinWidth (double value)
 
void SetMinOpeningAngle (double value)
 
void SetMinEP (double value)
 
void SetMinHits (size_t value)
 
void SetDebug (bool flag)
 
- Public Member Functions inherited from cmtool::CBoolAlgoBase
 CBoolAlgoBase ()
 Default constructor. More...
 
virtual ~CBoolAlgoBase ()
 Default destructor. More...
 
- Public Member Functions inherited from cmtool::CMAlgoBase
 CMAlgoBase ()
 
virtual ~CMAlgoBase ()=default
 
virtual void EventBegin (const std::vector< cluster::ClusterParamsAlg > &)
 
virtual void EventEnd ()
 
virtual void IterationBegin (const std::vector< cluster::ClusterParamsAlg > &)
 
virtual void IterationEnd ()
 
void SetAnaFile (TFile *fout)
 Setter function for an output plot TFile pointer. More...
 
virtual void SetVerbose (bool doit=true)
 Setter function for verbosity. More...
 

Protected Attributes

size_t _min_hits
 
double _min_width
 
double _min_opening_angle
 
double _min_EP
 
bool _debug
 
- Protected Attributes inherited from cmtool::CMAlgoBase
TFile * _fout
 TFile pointer to an output file. More...
 
bool _verbose
 Boolean to choose verbose mode. Turned on if CMergeManager/CMatchManager's verbosity level is >= kPerMerging. More...
 

Detailed Description

User implementation for CBoolAlgoBase class doxygen documentation!

Definition at line 28 of file CBAlgoStartTrack.h.

Constructor & Destructor Documentation

cmtool::CBAlgoStartTrack::CBAlgoStartTrack ( )

Default constructor.

Definition at line 6 of file CBAlgoStartTrack.cxx.

6  : CBoolAlgoBase()
7  //-------------------------------------------------------
8  {
9 
10  SetMinHits(10);
11  SetMinWidth(1.00000);
12  SetMinOpeningAngle(0.15000);
13  SetMinEP(0.99000);
14  SetDebug(false);
15 
16  }
void SetMinWidth(double value)
CBoolAlgoBase()
Default constructor.
Definition: CBoolAlgoBase.h:32
void SetMinOpeningAngle(double value)
void SetMinEP(double value)
void SetMinHits(size_t value)
virtual cmtool::CBAlgoStartTrack::~CBAlgoStartTrack ( )
inlinevirtual

Default destructor.

Definition at line 36 of file CBAlgoStartTrack.h.

36 {};

Member Function Documentation

bool cmtool::CBAlgoStartTrack::Bool ( const ::cluster::ClusterParamsAlg cluster1,
const ::cluster::ClusterParamsAlg cluster2 
)
virtual

Optional function: called at the beginning of 1st iteration. This is called per event. Optional function: called at the end of event ... after the last merging iteration is over. Optional function: called at the beggining of each iteration over all pairs of clusters. This provides all clusters' information in case the algorithm need them. Note this is called per iteration which may be more than once per event. Optional function: called at the end of each iteration over all pairs of clusters. Core function: given the CPAN input, return whether a cluster should be merged or not.

Reimplemented from cmtool::CBoolAlgoBase.

Definition at line 54 of file CBAlgoStartTrack.cxx.

57  {
58 
59  if(cluster1.GetHitVector().size() < _min_hits ||
60  cluster2.GetHitVector().size() < _min_hits )
61  return false;
62 
63  bool FirstTrackSecondBlob = false;
64  bool SecondTrackFirstBlob = false;
65 
66  if(IsStartTrack(cluster1) && IsOverlappingBlob(cluster2))
67  FirstTrackSecondBlob = true;
68  if(IsStartTrack(cluster2) && IsOverlappingBlob(cluster1))
69  SecondTrackFirstBlob = true;
70 
71  if(_debug){
72  if(FirstTrackSecondBlob){
73  std::cout<<"*********************************************"<<std::endl;
74  std::cout<<"First track second blob! First has params:"<<std::endl;
75  std::cout<<"Angle 2D = "<<cluster1.GetParams().angle_2d<<std::endl;
76  std::cout<<"Opening Angle = "<<cluster1.GetParams().opening_angle<<std::endl;
77  std::cout<<"Sum charge = "<<cluster1.GetParams().sum_charge<<std::endl;
78  std::cout<<"Length = "<<cluster1.GetParams().length<<std::endl;
79  std::cout<<"Width = "<<cluster1.GetParams().width<<std::endl;
80  std::cout<<"N_Hits = "<<cluster1.GetHitVector().size()<<std::endl;
81  std::cout<<"eigenvalue_principal = "<<cluster1.GetParams().eigenvalue_principal<<std::endl;
82  std::cout<<"Second has params:"<<std::endl;
83  std::cout<<"Angle 2D = "<<cluster2.GetParams().angle_2d<<std::endl;
84  std::cout<<"Opening Angle = "<<cluster2.GetParams().opening_angle<<std::endl;
85  std::cout<<"Sum charge = "<<cluster2.GetParams().sum_charge<<std::endl;
86  std::cout<<"Length = "<<cluster2.GetParams().length<<std::endl;
87  std::cout<<"Width = "<<cluster2.GetParams().width<<std::endl;
88  std::cout<<"N_Hits = "<<cluster2.GetHitVector().size()<<std::endl;
89  std::cout<<"eigenvalue_principal = "<<cluster2.GetParams().eigenvalue_principal<<std::endl;
90 
91  }
92 
93 
94  }
95 
96  //if cluster1 looks like a track and cluster2 looks like a blob
97  if (FirstTrackSecondBlob)
98  {
99  std::pair<float,float> trackEndPoint =
100  std::pair<float,float>( cluster1.GetParams().end_point.w, cluster1.GetParams().end_point.t );
101 
102  //if the tracklike cluster's endpoint is inside polygon of blob
103  if(cluster2.GetParams().PolyObject.PointInside(trackEndPoint))
104  return true;
105  else
106  return false;
107  }
108 
109  //if cluster2 looks like a track and cluster1 looks like a blob
110  else if (SecondTrackFirstBlob)
111  {
112  std::pair<float,float> trackEndPoint =
113  std::pair<float,float>( cluster2.GetParams().end_point.w, cluster2.GetParams().end_point.t );
114 
115  //if the tracklike cluster's endpoint is inside polygon of blob
116  if(cluster1.GetParams().PolyObject.PointInside(trackEndPoint))
117  return true;
118  else
119  return false;
120  }
121 
122  else
123  return false;
124 
125  //the reason for not just using (one track one blob) and
126  //polyoverlap for this is that
127  //this was merging BNB events where the track is clearly in a different
128  //direction than the blob
129 
130  //this will fail when the tracklike cluster is reconstructed backwards
131  //(looks like it's a track going into a blob, rather than exiting)
132 
133 
134  }
Polygon2D PolyObject
Polygon Object...see Polygon2D.hh.
Definition: ClusterParams.h:21
double eigenvalue_principal
the principal eigenvalue from PCA
Definition: ClusterParams.h:46
const cluster_params & GetParams() const
double sum_charge
Sum charge of hits in ADC.
Definition: ClusterParams.h:26
double t
Definition: PxUtils.h:11
const std::vector< util::PxHit > & GetHitVector() const
double angle_2d
Angle of axis in wire/hit view.
Definition: ClusterParams.h:39
double w
Definition: PxUtils.h:10
bool IsStartTrack(const ::cluster::ClusterParamsAlg &cluster)
util::PxPoint end_point
end point
Definition: ClusterParams.h:24
bool PointInside(const std::pair< float, float > &point) const
Definition: Polygon2D.cxx:252
double opening_angle
Width of angular distubtion wrt vertx.
Definition: ClusterParams.h:40
BEGIN_PROLOG could also be cout
bool IsOverlappingBlob(const ::cluster::ClusterParamsAlg &cluster)
bool cmtool::CBAlgoStartTrack::IsOverlappingBlob ( const ::cluster::ClusterParamsAlg cluster)

Definition at line 153 of file CBAlgoStartTrack.cxx.

154  {
155  if(cluster.GetParams().width > _min_width &&
158  return true;
159  else
160  return false;
161  }
double eigenvalue_principal
the principal eigenvalue from PCA
Definition: ClusterParams.h:46
const cluster_params & GetParams() const
double opening_angle
Width of angular distubtion wrt vertx.
Definition: ClusterParams.h:40
bool cmtool::CBAlgoStartTrack::IsStartTrack ( const ::cluster::ClusterParamsAlg cluster)

Definition at line 144 of file CBAlgoStartTrack.cxx.

145  {
146  if(cluster.GetParams().eigenvalue_principal > _min_EP)
147  return true;
148  else
149  return false;
150 
151  }
double eigenvalue_principal
the principal eigenvalue from PCA
Definition: ClusterParams.h:46
const cluster_params & GetParams() const
void cmtool::CBAlgoStartTrack::Report ( )
virtual

Optional function: called after each Merge() function call by CMergeManager IFF CMergeManager is run with verbosity level kPerMerging. Maybe useful for debugging.

Reimplemented from cmtool::CMAlgoBase.

Definition at line 137 of file CBAlgoStartTrack.cxx.

139  {
140 
141  }
void cmtool::CBAlgoStartTrack::Reset ( )
virtual

Function to reset the algorithm instance ... maybe implemented via child class.

Reimplemented from cmtool::CMAlgoBase.

Definition at line 19 of file CBAlgoStartTrack.cxx.

21  {
22 
23  }
void cmtool::CBAlgoStartTrack::SetDebug ( bool  flag)
inline

Definition at line 88 of file CBAlgoStartTrack.h.

88 { _debug = flag; }
then echo unknown compiler flag
void cmtool::CBAlgoStartTrack::SetMinEP ( double  value)
inline

Definition at line 84 of file CBAlgoStartTrack.h.

84 { _min_EP = value; }
temporary value
void cmtool::CBAlgoStartTrack::SetMinHits ( size_t  value)
inline

Definition at line 86 of file CBAlgoStartTrack.h.

86 { _min_hits = value; }
temporary value
void cmtool::CBAlgoStartTrack::SetMinOpeningAngle ( double  value)
inline

Definition at line 82 of file CBAlgoStartTrack.h.

void cmtool::CBAlgoStartTrack::SetMinWidth ( double  value)
inline

Definition at line 80 of file CBAlgoStartTrack.h.

80 { _min_width = value; }
temporary value

Member Data Documentation

bool cmtool::CBAlgoStartTrack::_debug
protected

Definition at line 94 of file CBAlgoStartTrack.h.

double cmtool::CBAlgoStartTrack::_min_EP
protected

Definition at line 93 of file CBAlgoStartTrack.h.

size_t cmtool::CBAlgoStartTrack::_min_hits
protected

Definition at line 92 of file CBAlgoStartTrack.h.

double cmtool::CBAlgoStartTrack::_min_opening_angle
protected

Definition at line 93 of file CBAlgoStartTrack.h.

double cmtool::CBAlgoStartTrack::_min_width
protected

Definition at line 93 of file CBAlgoStartTrack.h.


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