PandaRoot
PndRiemannHit.h
Go to the documentation of this file.
1 //-----------------------------------------------------------
2 // File and Version Information:
3 // $Id$
4 //
5 // Description:
6 // Conformal Mapping of a PndTpc Cluster (x,y)->(r,phi)-> riemann sphere
7 //
8 //
9 // Environment:
10 // Software developed for the PANDA Detector at FAIR.
11 //
12 // Author List:
13 // Sebastian Neubert TUM (original author)
14 //
15 //
16 //-----------------------------------------------------------
17 
18 #ifndef PNDRIEMANNHIT_HH
19 #define PNDRIEMANNHIT_HH
20 
21 // Base Class Headers ----------------
22 #include "TObject.h"
23 
24 // Collaborating Class Headers -------
25 #include <ostream> // remove if you do not need streaming op
26 #include "TVector3.h"
27 #include "TMatrixD.h"
28 #include "FairHit.h"
29 #include "TMath.h"
30 
31 // Collaborating Class Declarations --
32 // class PndTpcCluster;
33 class PndRiemannTrack;
34 
35 class PndRiemannHit : public TObject {
36  public:
37  // Constructors/Destructors ---------
38  PndRiemannHit() : fX(0., 0., 0.), fSigmaX(0., 0., 0.), fCovX(3, 3), fHit(0), fHitID(-1), fS(-1.), fZ(-1.), fDeltaZ(-1.), fAlpha(-1.), fVerbose(0){};
39  PndRiemannHit(double x, double y, double z, double dx, double dy, double dz);
40  PndRiemannHit(FairHit *cl, int hitID = -1);
42 
43  // Copy-/Assignment-Operator
45  : TObject(myHit), fX(myHit.fX), fSigmaX(myHit.fSigmaX), fCovX(myHit.fCovX), fHit(myHit.fHit), fHitID(myHit.fHitID), fS(myHit.fS), fZ(myHit.fZ), fDeltaZ(myHit.fDeltaZ),
46  fAlpha(myHit.fAlpha), fVerbose(myHit.fVerbose)
47  {
48  }
49 
51  {
52  if (this != &myHit) {
53  fX = myHit.fX;
54  fSigmaX = myHit.fSigmaX;
55  fCovX = myHit.fCovX;
56  fHit = myHit.fHit;
57  fHitID = myHit.fHitID;
58  fS = myHit.fS;
59  fZ = myHit.fZ;
60  fDeltaZ = myHit.fDeltaZ;
61  fAlpha = myHit.fAlpha;
62  fVerbose = myHit.fVerbose;
63  }
64  return *this;
65  }
66 
67  // Accessors -----------------------
68  void setXYZ(double x, double y, double z);
69  void setDXYZ(double dx, double dy, double dz);
70  void setHit(FairHit *cl);
71  const TVector3 &x() const { return fX; }
72  const FairHit *hit() const { return fHit; }
73  int hitID() const { return fHitID; }
74  double s() const { return fS; }
75  double z() const;
76  double alpha() const { return fAlpha; }
77  double sigmaXY() const;
78  double sigmaX() const { return TMath::Sqrt(fCovX[0][0]); }
79  double sigmaY() const { return TMath::Sqrt(fCovX[1][1]); }
80  double sigmaW() const { return TMath::Sqrt(TMath::Power(2 * x().x() * sigmaX(), 2) + TMath::Power(2 * x().y() * sigmaY(), 2)); } // error of z-Coordinate (x2+y2) in RiemannSpace
81  const TMatrixD &covX() const { return fCovX; }
82  double covX(int row, int col) const { return fCovX[row][col]; }
83  bool operator<(const PndRiemannHit &aHit) const
84  {
85  if (s() >= 0 && aHit.s() >= 0) {
86  return s() < aHit.s();
87  } else if (s() <= 0 && aHit.s() <= 0) {
88  return -s() < -aHit.s();
89  } else
90  return s() < aHit.s();
91  }
92 
93  // Modifiers -----------------------
94  // Operations ----------------------
95  void calcPosOnTrk(PndRiemannTrack *trk);
96 
97  private:
98  // Private Data Members ------------
99  TVector3 fX;
100  TVector3 fSigmaX;
101  TMatrixD fCovX;
102  FairHit *fHit; //-> //no ownership over this pointer!
103  int fHitID;
104  double fS;
105  double fZ;
106  double fDeltaZ;
107  double fAlpha;
108  int fVerbose;
109 
110  // Private Methods -----------------
111 
112  public:
113  ClassDef(PndRiemannHit, 2)
114 };
115 
116 #endif
117 
118 //--------------------------------------------------------------
119 // $Log$
120 //--------------------------------------------------------------
double covX(int row, int col) const
Definition: PndRiemannHit.h:82
double sigmaX() const
Definition: PndRiemannHit.h:78
const TMatrixD & covX() const
Definition: PndRiemannHit.h:81
static T Sqrt(const T &x)
Definition: PndCAMath.h:45
double alpha() const
Definition: PndRiemannHit.h:76
double sigmaW() const
Definition: PndRiemannHit.h:80
double sigmaY() const
Definition: PndRiemannHit.h:79
double z() const
double s() const
Definition: PndRiemannHit.h:74
PndRiemannHit & operator=(const PndRiemannHit &myHit)
Definition: PndRiemannHit.h:50
void setDXYZ(double dx, double dy, double dz)
void setXYZ(double x, double y, double z)
PndRiemannHit(const PndRiemannHit &myHit)
Definition: PndRiemannHit.h:44
const FairHit * hit() const
Definition: PndRiemannHit.h:72
double sigmaXY() const
void setHit(FairHit *cl)
void calcPosOnTrk(PndRiemannTrack *trk)
const TVector3 & x() const
Definition: PndRiemannHit.h:71
bool operator<(const PndRiemannHit &aHit) const
Definition: PndRiemannHit.h:83
TMatrixT< double > TMatrixD
Definition: PndLmdDim.h:52
int hitID() const
Definition: PndRiemannHit.h:73