Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
larreco
larreco
RecoAlg
CMTool
CMTAlgMerge
CBAlgoAngleIncompat.cxx
Go to the documentation of this file.
1
#include "
CBAlgoAngleIncompat.h
"
2
3
#include <math.h>
4
5
namespace
cmtool
{
6
7
//-------------------------------------------------------
8
CBAlgoAngleIncompat::CBAlgoAngleIncompat
() :
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
}
23
24
//----------------------------------------------------------------
25
bool
CBAlgoAngleIncompat::Bool
(const ::cluster::ClusterParamsAlg &cluster1,
26
const ::cluster::ClusterParamsAlg &cluster2)
27
//----------------------------------------------------------------
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
50
if
(
_use_opening_angle
)
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
54
if
(
_allow_180_ambig
)
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
}
74
75
}
cmtool::CBoolAlgoBase
Definition:
CBoolAlgoBase.h:27
cmtool::CBAlgoAngleIncompat::_allow_180_ambig
bool _allow_180_ambig
Definition:
CBAlgoAngleIncompat.h:58
cmtool::CBAlgoAngleIncompat::_debug
bool _debug
Definition:
CBAlgoAngleIncompat.h:57
cmtool::CBAlgoAngleIncompat::_use_opening_angle
bool _use_opening_angle
Definition:
CBAlgoAngleIncompat.h:61
cmtool::CBAlgoAngleIncompat::SetMinLength
void SetMinLength(double l)
Definition:
CBAlgoAngleIncompat.h:51
cmtool::CBAlgoAngleIncompat::SetAllow180Ambig
void SetAllow180Ambig(bool on)
Definition:
CBAlgoAngleIncompat.h:43
cmtool::CBAlgoAngleIncompat::SetMinHits
void SetMinHits(int n)
Definition:
CBAlgoAngleIncompat.h:49
abs
T abs(T value)
Definition:
sparse_vector_test.cc:30
CBAlgoAngleIncompat.h
Class def header for a class CBAlgoAngleIncompat.
cmtool::CBAlgoAngleIncompat::SetAngleCut
void SetAngleCut(double angle)
Definition:
CBAlgoAngleIncompat.h:45
cmtool::CBAlgoAngleIncompat::SetUseOpeningAngle
void SetUseOpeningAngle(bool on)
Definition:
CBAlgoAngleIncompat.h:47
cmtool::CBAlgoAngleIncompat::CBAlgoAngleIncompat
CBAlgoAngleIncompat()
Default constructor.
Definition:
CBAlgoAngleIncompat.cxx:8
cmtool::CBAlgoAngleIncompat::Bool
virtual bool Bool(const ::cluster::ClusterParamsAlg &cluster1, const ::cluster::ClusterParamsAlg &cluster2)
Definition:
CBAlgoAngleIncompat.cxx:25
cmtool::CBAlgoAngleIncompat::_min_length
double _min_length
Definition:
CBAlgoAngleIncompat.h:60
cet::sqlite::min
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition:
statistics.h:55
cmtool
Definition:
CFAlgoQRatio.cxx:3
cmtool::CBAlgoAngleIncompat::SetDebug
void SetDebug(bool on)
Definition:
CBAlgoAngleIncompat.h:53
cmtool::CBAlgoAngleIncompat::_max_allowed_2D_angle_diff
double _max_allowed_2D_angle_diff
Definition:
CBAlgoAngleIncompat.h:59
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
cmtool::CBAlgoAngleIncompat::_minHits
size_t _minHits
Definition:
CBAlgoAngleIncompat.h:62
Generated by
1.8.11