Public Member Functions | Protected Attributes | List of all members
cmtool::CBAlgoAngleIncompat Class Reference

#include <CBAlgoAngleIncompat.h>

Inheritance diagram for cmtool::CBAlgoAngleIncompat:
cmtool::CBoolAlgoBase cmtool::CMAlgoBase

Public Member Functions

 CBAlgoAngleIncompat ()
 Default constructor. More...
 
virtual ~CBAlgoAngleIncompat ()
 Default destructor. More...
 
virtual bool Bool (const ::cluster::ClusterParamsAlg &cluster1, const ::cluster::ClusterParamsAlg &cluster2)
 
void SetAllow180Ambig (bool on)
 
void SetAngleCut (double angle)
 
void SetUseOpeningAngle (bool on)
 
void SetMinHits (int n)
 
void SetMinLength (double l)
 
void SetDebug (bool on)
 
- 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 Reset ()
 Function to reset the algorithm instance called within CMergeManager/CMatchManager's Reset() ... maybe implemented via child class. More...
 
virtual void EventBegin (const std::vector< cluster::ClusterParamsAlg > &)
 
virtual void EventEnd ()
 
virtual void IterationBegin (const std::vector< cluster::ClusterParamsAlg > &)
 
virtual void IterationEnd ()
 
virtual void Report ()
 
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

bool _debug
 
bool _allow_180_ambig
 
double _max_allowed_2D_angle_diff
 
double _min_length
 
bool _use_opening_angle
 
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

User implementation for CBoolAlgoBase class doxygen documentation!

Definition at line 26 of file CBAlgoAngleIncompat.h.

Constructor & Destructor Documentation

cmtool::CBAlgoAngleIncompat::CBAlgoAngleIncompat ( )

Default constructor.

Definition at line 8 of file CBAlgoAngleIncompat.cxx.

8  : CBoolAlgoBase()
9  //-------------------------------------------------------
10  {
11  SetAngleCut(30.);
12 
13  SetMinHits(0);
14 
15  SetAllow180Ambig(false);
16 
17  SetUseOpeningAngle(false);
18 
19  SetMinLength(20);
20 
21  SetDebug(false);
22  }
CBoolAlgoBase()
Default constructor.
Definition: CBoolAlgoBase.h:32
virtual cmtool::CBAlgoAngleIncompat::~CBAlgoAngleIncompat ( )
inlinevirtual

Default destructor.

Definition at line 34 of file CBAlgoAngleIncompat.h.

34 {};

Member Function Documentation

bool cmtool::CBAlgoAngleIncompat::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 25 of file CBAlgoAngleIncompat.cxx.

28  {
29  //if either cluster is too small, do not prohibit them
30  if (cluster1.GetNHits() < _minHits || cluster2.GetNHits() < _minHits)
31  return false;
32 
33  //if either cluster is too short, do not prohibit them
34  if (cluster1.GetParams().length < _min_length ||
35  cluster2.GetParams().length < _min_length)
36  return false;
37 
38 
39  double angle1 = cluster1.GetParams().angle_2d;
40  double angle2 = cluster2.GetParams().angle_2d;
41 
42  if(angle1 < -998 || angle2 < -998)
43  return false;
44 
45  bool compatible = false;
46 
47  double my_cut_value = _max_allowed_2D_angle_diff;
48 
49  //if using opening angle, have angle cutoff be the smaller of the two opening angles
51  my_cut_value = std::min(cluster1.GetParams().opening_angle, cluster2.GetParams().opening_angle);
52 
53  //if you don't care if clusters have been reconstructed backwards
55  compatible = ( abs(angle1-angle2) < my_cut_value ||
56  abs(angle1-angle2-180) < my_cut_value ||
57  abs(angle1-angle2+180) < my_cut_value );
58  else
59  compatible = ( abs(angle1-angle2) < my_cut_value );
60 
61 
62  if(_debug){
63  if(!compatible)
64 
65  std::cout<<"CBAlgoAngleIncompat is PROHIBITING clusters with angles "
66  <<angle1<<" and "<<angle2<<std::endl;
67 
68  }
69 
70 
71 
72  return !compatible;
73  }
T abs(T value)
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55
QTextStream & endl(QTextStream &s)
void cmtool::CBAlgoAngleIncompat::SetAllow180Ambig ( bool  on)
inline

Definition at line 43 of file CBAlgoAngleIncompat.h.

void cmtool::CBAlgoAngleIncompat::SetAngleCut ( double  angle)
inline

Definition at line 45 of file CBAlgoAngleIncompat.h.

void cmtool::CBAlgoAngleIncompat::SetDebug ( bool  on)
inline

Definition at line 53 of file CBAlgoAngleIncompat.h.

void cmtool::CBAlgoAngleIncompat::SetMinHits ( int  n)
inline

Definition at line 49 of file CBAlgoAngleIncompat.h.

49 { _minHits = n; }
std::void_t< T > n
void cmtool::CBAlgoAngleIncompat::SetMinLength ( double  l)
inline

Definition at line 51 of file CBAlgoAngleIncompat.h.

51 { _min_length = l; }
static QStrList * l
Definition: config.cpp:1044
void cmtool::CBAlgoAngleIncompat::SetUseOpeningAngle ( bool  on)
inline

Definition at line 47 of file CBAlgoAngleIncompat.h.

Member Data Documentation

bool cmtool::CBAlgoAngleIncompat::_allow_180_ambig
protected

Definition at line 58 of file CBAlgoAngleIncompat.h.

bool cmtool::CBAlgoAngleIncompat::_debug
protected

Definition at line 57 of file CBAlgoAngleIncompat.h.

double cmtool::CBAlgoAngleIncompat::_max_allowed_2D_angle_diff
protected

Definition at line 59 of file CBAlgoAngleIncompat.h.

double cmtool::CBAlgoAngleIncompat::_min_length
protected

Definition at line 60 of file CBAlgoAngleIncompat.h.

size_t cmtool::CBAlgoAngleIncompat::_minHits
protected

Definition at line 62 of file CBAlgoAngleIncompat.h.

bool cmtool::CBAlgoAngleIncompat::_use_opening_angle
protected

Definition at line 61 of file CBAlgoAngleIncompat.h.


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