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

#include <CBAlgoStartNearEnd.h>

Inheritance diagram for cmtool::CBAlgoStartNearEnd:
cmtool::CBoolAlgoBase cmtool::CMAlgoBase

Public Member Functions

 CBAlgoStartNearEnd ()
 Default constructor. More...
 
virtual ~CBAlgoStartNearEnd ()
 Default destructor. More...
 
void SetMaxStartEndSeparation (double d)
 
void SetMaxAngle (double a)
 
void SetMinHits (size_t n)
 
virtual bool Bool (const ::cluster::ClusterParamsAlg &cluster1, const ::cluster::ClusterParamsAlg &cluster2)
 
virtual void Reset ()
 Function to reset the algorithm instance ... maybe implemented via child class. More...
 
virtual void Report ()
 Function to report what's going on per merging. More...
 
- 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

double _maxopeningangle
 
double _separation
 
size_t _MinHits
 
- 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

Merge if start point of one is near end point of another and require angle compatibility

Definition at line 26 of file CBAlgoStartNearEnd.h.

Constructor & Destructor Documentation

cmtool::CBAlgoStartNearEnd::CBAlgoStartNearEnd ( )

Default constructor.

Definition at line 6 of file CBAlgoStartNearEnd.cxx.

6  : CBoolAlgoBase()
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  }
CBoolAlgoBase()
Default constructor.
Definition: CBoolAlgoBase.h:32
void SetMaxStartEndSeparation(double d)
virtual cmtool::CBAlgoStartNearEnd::~CBAlgoStartNearEnd ( )
inlinevirtual

Default destructor.

Definition at line 34 of file CBAlgoStartNearEnd.h.

34 {};

Member Function Documentation

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

Core function: given the CPAN input, return whether a cluster should be merged or not.

Reimplemented from cmtool::CBoolAlgoBase.

Definition at line 16 of file CBAlgoStartNearEnd.cxx.

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 
38  if ( (angle_1 < _maxopeningangle) and (hits_1 > _MinHits) and
39  ( ((start_w2-end_w1)*(start_w2-end_w1) +
40  (start_t2-end_t1)*(start_t2-end_t1)) < _separation) ){
41  if (_verbose)
42  std::cout << "Start in End!" << std::endl;
43  return true;
44  }
45 
46  if ( (angle_2 < _maxopeningangle) and (hits_2 > _MinHits) and
47  ( ((start_w1-end_w2)*(start_w1-end_w2) +
48  (start_t1-end_t2)*(start_t1-end_t2)) < _separation) ){
49  if (_verbose)
50  std::cout << "Start in End!" << std::endl;
51  return true;
52  }
53 
54  return false;
55 
56  }
const cluster_params & GetParams() const
double t
Definition: PxUtils.h:11
const std::vector< util::PxHit > & GetHitVector() const
return match has_match and(match.match_pdg==11 or match.match_pdg==-11)
util::PxPoint start_point
start point
Definition: ClusterParams.h:23
double w
Definition: PxUtils.h:10
util::PxPoint end_point
end point
Definition: ClusterParams.h:24
double opening_angle
Width of angular distubtion wrt vertx.
Definition: ClusterParams.h:40
bool _verbose
Boolean to choose verbose mode. Turned on if CMergeManager/CMatchManager&#39;s verbosity level is &gt;= kPer...
Definition: CMAlgoBase.h:102
BEGIN_PROLOG could also be cout
void cmtool::CBAlgoStartNearEnd::Report ( )
virtual

Function to report what's going on per merging.

Reimplemented from cmtool::CMAlgoBase.

Definition at line 59 of file CBAlgoStartNearEnd.cxx.

61  {
62  }
virtual void cmtool::CBAlgoStartNearEnd::Reset ( )
inlinevirtual

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

Reimplemented from cmtool::CMAlgoBase.

Definition at line 51 of file CBAlgoStartNearEnd.h.

51 {}
void cmtool::CBAlgoStartNearEnd::SetMaxAngle ( double  a)
inline

Definition at line 43 of file CBAlgoStartNearEnd.h.

process_name gaushit a
void cmtool::CBAlgoStartNearEnd::SetMaxStartEndSeparation ( double  d)
inline

Core function: given the ClusterParamsAlg input, return whether a cluster should be merged or not.

Definition at line 41 of file CBAlgoStartNearEnd.h.

void cmtool::CBAlgoStartNearEnd::SetMinHits ( size_t  n)
inline

Member Data Documentation

double cmtool::CBAlgoStartNearEnd::_maxopeningangle
protected

Definition at line 58 of file CBAlgoStartNearEnd.h.

size_t cmtool::CBAlgoStartNearEnd::_MinHits
protected

Definition at line 60 of file CBAlgoStartNearEnd.h.

double cmtool::CBAlgoStartNearEnd::_separation
protected

Definition at line 59 of file CBAlgoStartNearEnd.h.


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