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

#include <PndLine.h>

Public Member Functions

 PndLine ()
 
 PndLine (FairHit *h1, FairHit *h2)
 
 PndLine (TVector3 &base, TVector3 &dir)
 
 PndLine (TVector3 h1, Int_t layer)
 
virtual ~PndLine ()
 
void Print (Bool_t withDirVec=kFALSE)
 
FairTrackParP plot (Double_t zVal1, Double_t zVal2)
 
TVector3 getP1 ()
 
TVector3 getP2 ()
 
TVector3 getDir ()
 
bool operator< (const PndLine &) const
 
Double_t getZAngle ()
 
Int_t getRating ()
 
void incrementRating ()
 
void setRating (Int_t r)
 
TVector3 getPerpendicular (PndLine l2)
 
Double_t getDistTo (TVector3 p)
 

Private Attributes

TVector3 fP1
 
TVector3 fP2
 
Int_t fRating
 

Detailed Description

Definition at line 23 of file PndLine.h.

Constructor & Destructor Documentation

PndLine::PndLine ( )
inline

Definition at line 25 of file PndLine.h.

25 :fP1(), fP2(), fRating(1){}
TVector3 fP1
Definition: PndLine.h:49
TVector3 fP2
Definition: PndLine.h:50
Int_t fRating
Definition: PndLine.h:51
PndLine::PndLine ( FairHit *  h1,
FairHit *  h2 
)

Definition at line 10 of file PndLine.cxx.

References fP1, fP2, and fRating.

10  {
11  h1->Position(fP1);
12  h2->Position(fP2);
13  fRating = 1;
14 }
TVector3 fP1
Definition: PndLine.h:49
TVector3 fP2
Definition: PndLine.h:50
Int_t fRating
Definition: PndLine.h:51
PndLine::PndLine ( TVector3 &  base,
TVector3 &  dir 
)

Definition at line 16 of file PndLine.cxx.

References fP1, fP2, and fRating.

16  {
17  fP1=base;
18  fP2=base+dir;
19  fRating = 1;
20 }
TVector3 fP1
Definition: PndLine.h:49
TVector3 fP2
Definition: PndLine.h:50
Int_t fRating
Definition: PndLine.h:51
PndLine::PndLine ( TVector3  h1,
Int_t  layer 
)

Definition at line 22 of file PndLine.cxx.

References CAMath::Cos(), fP1, fP2, fRating, h1, and CAMath::Sin().

22  {
23  fP1 = h1;
24  if(layer%4==1){
25  fP2 = fP1+TVector3(TMath::Sin(-5*TMath::DegToRad()),TMath::Cos(-5*TMath::DegToRad()),0);
26  }else if(layer%4==2){
27  fP2 = fP1+TVector3(TMath::Sin(5*TMath::DegToRad()),TMath::Cos(5*TMath::DegToRad()),0);
28  } else {
29  fP2 = fP1+TVector3(0,1,0);
30  }
31  fRating = 1;
32 }
static T Sin(const T &x)
Definition: PndCAMath.h:42
static T Cos(const T &x)
Definition: PndCAMath.h:43
TVector3 fP1
Definition: PndLine.h:49
TVector3 fP2
Definition: PndLine.h:50
Int_t fRating
Definition: PndLine.h:51
PndLine::~PndLine ( )
virtual

Definition at line 34 of file PndLine.cxx.

34  {
35  // TODO Auto-generated destructor stub
36 }

Member Function Documentation

TVector3 PndLine::getDir ( )
inline
Double_t PndLine::getDistTo ( TVector3  p)

Definition at line 81 of file PndLine.cxx.

References Double_t, fP1, and getDir().

81  {
82  TVector3 p3 = (p-fP1).Cross(getDir());
83  Double_t dist = p3.Mag()/getDir().Mag();
84  return dist;
85 }
TVector3 getDir()
Definition: PndLine.h:34
Double_t p
Definition: anasim.C:58
TVector3 fP1
Definition: PndLine.h:49
Double_t
TVector3 PndLine::getP1 ( )
inline
TVector3 PndLine::getP2 ( )
inline

Definition at line 33 of file PndLine.h.

Referenced by PndPlane::PndPlane().

33 {return fP2;}
TVector3 fP2
Definition: PndLine.h:50
TVector3 PndLine::getPerpendicular ( PndLine  l2)

Definition at line 76 of file PndLine.cxx.

References fP1, getDir(), and PndPlane::getIntersection().

Referenced by PndLineApproximation::correctHits3DAndAdd(), and PndTrackCollection::getDistTo().

76  {//returns point on this line
77  PndPlane plane(l2.fP1,l2.getDir(),getDir().Cross(l2.getDir()));
78  return plane.getIntersection(*this);
79 }
TVector3 getDir()
Definition: PndLine.h:34
TVector3 fP1
Definition: PndLine.h:49
Int_t PndLine::getRating ( )
inline
Double_t PndLine::getZAngle ( )
inline

Definition at line 39 of file PndLine.h.

References CAMath::Abs(), and CAMath::ASin().

Referenced by PndTrackCombiner::combine().

39  {
40  return TMath::Abs(TMath::ASin(getDir()[2]/getDir().Mag())*TMath::RadToDeg());
41  }
static T ASin(const T &x)
TVector3 getDir()
Definition: PndLine.h:34
static T Abs(const T &x)
Definition: PndCAMath.h:39
void PndLine::incrementRating ( )
inline

Definition at line 43 of file PndLine.h.

Referenced by PndTrackCombiner::addLineOld().

43 {fRating++;}
Int_t fRating
Definition: PndLine.h:51
bool PndLine::operator< ( const PndLine ) const
inline

Definition at line 35 of file PndLine.h.

36  {
37  return kTRUE;//dummy sorting operator for map
38  }
FairTrackParP PndLine::plot ( Double_t  zVal1,
Double_t  zVal2 
)

Definition at line 49 of file PndLine.cxx.

References Double_t, fP1, getDir(), and v.

Referenced by PndLineApproximation::plot().

49  {
50  TVector3 dir = getDir();
51  Double_t lam1 = (zVal1 - fP1[2])/dir[2];
52  Double_t lam2 = (zVal2 - fP1[2])/dir[2];
53  TVector3 pointA = fP1+lam1*dir;
54  TVector3 pointB = fP1+lam2*dir;
55  TVector3 dir2 = pointB-pointA;
56  TVector3 v(1, 1, 1);
57  FairTrackParP tp(pointA, 2 * dir2.Unit(), v, v, 1, v, v, v);
58  return tp;
59 }
TVector3 getDir()
Definition: PndLine.h:34
__m128 v
Definition: P4_F32vec4.h:4
TVector3 fP1
Definition: PndLine.h:49
Double_t
void PndLine::Print ( Bool_t  withDirVec = kFALSE)

Definition at line 38 of file PndLine.cxx.

References d, fP1, and fP2.

38  {
39  cout << "Line:";
40  cout << "(" << fP1[0] << "," << fP1[1] << "," << fP1[2] << ")";
41  if(!withDirVec)
42  cout << ",(" << fP2[0] << "," << fP2[1] << "," << fP2[2] << ")";
43  else{
44  TVector3 d = fP2-fP1;
45  cout << "+l*(" << d[0] << "," << d[1] << "," << d[2] << ")";
46  }
47 }
TObjArray * d
TVector3 fP1
Definition: PndLine.h:49
TVector3 fP2
Definition: PndLine.h:50
void PndLine::setRating ( Int_t  r)
inline

Member Data Documentation

TVector3 PndLine::fP1
private

Definition at line 49 of file PndLine.h.

Referenced by getDistTo(), getPerpendicular(), plot(), PndLine(), and Print().

TVector3 PndLine::fP2
private

Definition at line 50 of file PndLine.h.

Referenced by PndLine(), and Print().

Int_t PndLine::fRating
private

Definition at line 51 of file PndLine.h.

Referenced by PndLine().


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