FairRoot/PandaRoot
Public Member Functions | Private Attributes | List of all members
PndFtsLineComparator Class Reference

#include <PndFtsLineComparator.h>

Public Member Functions

 PndFtsLineComparator (Double_t maxDistance, Double_t maxAngle, Double_t z=0)
 
virtual ~PndFtsLineComparator ()
 
Bool_t areEqual (PndLine l1, PndLine l2)
 
Bool_t areEqual2D (PndLine l1, PndLine l2)
 
Double_t getQuality3D (PndLine l1, PndLine l2)
 
Double_t getQuality (PndLine l1, PndLine l2)
 
void setZValue (Double_t z)
 
Double_t getAngle (TVector3 d1, TVector3 d2)
 
Double_t getDist (TVector3 b1, TVector3 b2, TVector3 d1, TVector3 d2)
 
Double_t getAngle2D (TVector3 d1, TVector3 d2)
 
Double_t getDist2D (TVector3 b1, TVector3 b2, TVector3 d1, TVector3 d2)
 
void setMaxDistance (Double_t d)
 
void setMaxAngle (Double_t a)
 
Double_t getMaxDist ()
 
Double_t getMaxAngle ()
 

Private Attributes

Double_t fMaxDistance
 
Double_t fMaxAngle
 
Double_t zValue
 

Detailed Description

Definition at line 19 of file PndFtsLineComparator.h.

Constructor & Destructor Documentation

PndFtsLineComparator::PndFtsLineComparator ( Double_t  maxDistance,
Double_t  maxAngle,
Double_t  z = 0 
)
inline

Definition at line 21 of file PndFtsLineComparator.h.

22  : fMaxDistance(maxDistance), fMaxAngle(maxAngle), zValue(z){}
Double_t z
PndFtsLineComparator::~PndFtsLineComparator ( )
virtual

Definition at line 10 of file PndFtsLineComparator.cxx.

10  {
11  // TODO Auto-generated destructor stub
12 }

Member Function Documentation

Bool_t PndFtsLineComparator::areEqual ( PndLine  l1,
PndLine  l2 
)

Definition at line 14 of file PndFtsLineComparator.cxx.

References b1, b2, Double_t, fMaxAngle, fMaxDistance, getAngle(), PndLine::getDir(), getDist(), and PndLine::getP1().

14  {
15  //base vectors
16  TVector3 b1 = l1.getP1();
17  TVector3 b2 = l2.getP1();
18 
19  //direction vectors
20  TVector3 d1 = l1.getDir();
21  TVector3 d2 = l2.getDir();
22 
23  if(getAngle(d1,d2)>fMaxAngle) return kFALSE;
24  Double_t dist = getDist(b1,b2,d1,d2);
25  if(dist>fMaxDistance) return kFALSE;
26  return kTRUE;
27 }
TVector3 getDir()
Definition: PndLine.h:34
Double_t getAngle(TVector3 d1, TVector3 d2)
Double_t
Double_t getDist(TVector3 b1, TVector3 b2, TVector3 d1, TVector3 d2)
TVector3 getP1()
Definition: PndLine.h:32
Bool_t PndFtsLineComparator::areEqual2D ( PndLine  l1,
PndLine  l2 
)

Definition at line 29 of file PndFtsLineComparator.cxx.

References b1, b2, Double_t, fMaxAngle, fMaxDistance, getAngle2D(), PndLine::getDir(), getDist2D(), and PndLine::getP1().

Referenced by PndFtsLineApproximator::addLine(), PndTrackCombiner::addLineOld(), PndTrackCombiner::combine(), and PndModuleCombiner::combineModules().

29  {
30  //base vectors
31  TVector3 b1 = l1.getP1();
32  TVector3 b2 = l2.getP1();
33 
34  //direction vectors
35  TVector3 d1 = l1.getDir();
36  TVector3 d2 = l2.getDir();
37  if(getAngle2D(d1,d2)>fMaxAngle) return kFALSE;
38  Double_t dist = getDist2D(b1,b2,d1,d2);
39  if(dist>fMaxDistance) return kFALSE;
40  return kTRUE;
41 }
Double_t getDist2D(TVector3 b1, TVector3 b2, TVector3 d1, TVector3 d2)
TVector3 getDir()
Definition: PndLine.h:34
Double_t getAngle2D(TVector3 d1, TVector3 d2)
Double_t
TVector3 getP1()
Definition: PndLine.h:32
Double_t PndFtsLineComparator::getAngle ( TVector3  d1,
TVector3  d2 
)

Definition at line 73 of file PndFtsLineComparator.cxx.

References angle, Double_t, and CAMath::Min().

Referenced by areEqual(), getAngle2D(), and getQuality3D().

73  {
74  Double_t angle = d1.Angle(d2)*TMath::RadToDeg();
75  angle= TMath::Min(angle,180-angle);
76  return angle;
77 }
static T Min(const T &x, const T &y)
Definition: PndCAMath.h:35
Double_t
Double_t angle
Double_t PndFtsLineComparator::getAngle2D ( TVector3  d1,
TVector3  d2 
)

Definition at line 87 of file PndFtsLineComparator.cxx.

References getAngle().

Referenced by areEqual2D(), PndForwardTrackFinderTask::createStatictcs(), and getQuality().

87  {
88  d1[1]=0;
89  d2[1]=0;
90  return getAngle(d1,d2);
91 }
Double_t getAngle(TVector3 d1, TVector3 d2)
Double_t PndFtsLineComparator::getDist ( TVector3  b1,
TVector3  b2,
TVector3  d1,
TVector3  d2 
)

Definition at line 79 of file PndFtsLineComparator.cxx.

References Double_t, p1, p2, and zValue.

Referenced by areEqual(), getDist2D(), and getQuality3D().

79  {
80  Double_t lambda1 = (zValue-b1[2])/d1[2];
81  Double_t lambda2 = (zValue-b2[2])/d2[2];
82  TVector3 p1 = b1+lambda1*d1;
83  TVector3 p2 = b2+lambda2*d2;
84  return (p1-p2).Mag();
85 }
Double_t
TPad * p2
Definition: hist-t7.C:117
TPad * p1
Definition: hist-t7.C:116
Double_t PndFtsLineComparator::getDist2D ( TVector3  b1,
TVector3  b2,
TVector3  d1,
TVector3  d2 
)

Definition at line 93 of file PndFtsLineComparator.cxx.

References getDist().

Referenced by areEqual2D(), PndForwardTrackFinderTask::createStatictcs(), PndWayFollower::getBestApproxTo(), and getQuality().

93  {
94  d1[1]=0;
95  d2[1]=0;
96  b1[1]=0;
97  b2[1]=0;
98  return getDist(b1,b2,d1,d2);
99 }
Double_t getDist(TVector3 b1, TVector3 b2, TVector3 d1, TVector3 d2)
Double_t PndFtsLineComparator::getMaxAngle ( )
inline

Definition at line 36 of file PndFtsLineComparator.h.

36 {return fMaxAngle;}
Double_t PndFtsLineComparator::getMaxDist ( )
inline

Definition at line 35 of file PndFtsLineComparator.h.

35 {return fMaxDistance;}
Double_t PndFtsLineComparator::getQuality ( PndLine  l1,
PndLine  l2 
)

Definition at line 58 of file PndFtsLineComparator.cxx.

References b1, b2, Double_t, getAngle2D(), PndLine::getDir(), getDist2D(), PndLine::getP1(), and getQuality3D().

Referenced by PndTrackCombiner::addLine(), PndModuleCombiner::combineModules(), PndWayFollower::getBestApproxTo(), and PndWayFollower::getBestSkewedApproxTo().

58  {
59  //base vectors
60  TVector3 b1 = l1.getP1();
61  TVector3 b2 = l2.getP1();
62 
63  //direction vectors
64  TVector3 d1 = l1.getDir();
65  TVector3 d2 = l2.getDir();
66  Double_t angle2D =getAngle2D(d1,d2);
67  Double_t dist2D = getDist2D(b1,b2,d1,d2);
68  Double_t quality2D = 100*angle2D + 300*dist2D;
69  Double_t quality3D = getQuality3D(l1,l2);
70  return 0.1*quality3D + 0.9*quality2D;
71 }
Double_t getDist2D(TVector3 b1, TVector3 b2, TVector3 d1, TVector3 d2)
Double_t getQuality3D(PndLine l1, PndLine l2)
TVector3 getDir()
Definition: PndLine.h:34
Double_t getAngle2D(TVector3 d1, TVector3 d2)
Double_t
TVector3 getP1()
Definition: PndLine.h:32
Double_t PndFtsLineComparator::getQuality3D ( PndLine  l1,
PndLine  l2 
)

Definition at line 43 of file PndFtsLineComparator.cxx.

References b1, b2, Double_t, getAngle(), PndLine::getDir(), getDist(), and PndLine::getP1().

Referenced by PndWayFollower::getBestSkewedApproxTo(), and getQuality().

43  {
44  //base vectors
45  TVector3 b1 = l1.getP1();
46  TVector3 b2 = l2.getP1();
47 
48  //direction vectors
49  TVector3 d1 = l1.getDir();
50  TVector3 d2 = l2.getDir();
51 
52  Double_t angle3D =getAngle(d1,d2);
53  Double_t dist3D = getDist(b1,b2,d1,d2);
54  Double_t quality3D = 100*angle3D + 300*dist3D;
55  return quality3D;
56 }
TVector3 getDir()
Definition: PndLine.h:34
Double_t getAngle(TVector3 d1, TVector3 d2)
Double_t
Double_t getDist(TVector3 b1, TVector3 b2, TVector3 d1, TVector3 d2)
TVector3 getP1()
Definition: PndLine.h:32
void PndFtsLineComparator::setMaxAngle ( Double_t  a)
inline

Definition at line 34 of file PndFtsLineComparator.h.

References a.

34 {fMaxAngle=a;}
Int_t a
Definition: anaLmdDigi.C:126
void PndFtsLineComparator::setMaxDistance ( Double_t  d)
inline

Definition at line 33 of file PndFtsLineComparator.h.

References d.

33 {fMaxDistance=d;}
TObjArray * d
void PndFtsLineComparator::setZValue ( Double_t  z)
inline

Member Data Documentation

Double_t PndFtsLineComparator::fMaxAngle
private

Definition at line 39 of file PndFtsLineComparator.h.

Referenced by areEqual(), and areEqual2D().

Double_t PndFtsLineComparator::fMaxDistance
private

Definition at line 38 of file PndFtsLineComparator.h.

Referenced by areEqual(), and areEqual2D().

Double_t PndFtsLineComparator::zValue
private

Definition at line 40 of file PndFtsLineComparator.h.

Referenced by getDist().


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