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