EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EicTrackingDigiHit.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file EicTrackingDigiHit.h
1 //
2 // AYK (ayk@bnl.gov), 2013/06/12
3 //
4 // Tracking digi hit class;
5 //
6 
7 #ifndef _EIC_TRACKING_DIGI_HIT_
8 #define _EIC_TRACKING_DIGI_HIT_
9 
10 #include <math.h>
11 
12 #include "TVector3.h"
13 #include "FairHit.h"
14 
15 #include <EicGeoParData.h>
16 #include <EicMoCaPoint.h>
17 
18 class KfMatrix;
19 class MatchCandidate;
20 
22 {
23  // FIXME: clean up here, eventually;
24  friend class EicTrackingRecoHit;
25  friend class EicPlanarRecoHit;
26  friend class EicSpaceRecoHit;
27  friend class EicHtcTask;
28  friend class SensitiveVolume;
29  friend class EicKfNodeTemplate1D;
32  friend class EicKfNodeTemplate;
33 
34  public:
35  EicTrackingDigiHit() { Clear(); ResetVars(); mXYmode = true; };
36 
47  EicTrackingDigiHit(TString cname, const EicMoCaPoint *point, unsigned kfNodeID,
48  // NB: 'global' is passed further down to the FairHit constructor
49  // and 'const' does not work there;
50  TVector3& global, const TVector3& local, bool xy_mode /*= true*/);
51 
52 #if _NEED_TO_BE_FIXED_
53  void Clear() { fTrackID = -1;};
54 #endif
55  virtual ~EicTrackingDigiHit() {};
56 
57  virtual void Print(const Option_t* opt = 0) const {;};
58 
59  ULong64_t GetMultiIndex() const { return mMultiIndex; };
60 
61  //TVector3 GetLocalCoordinates();
62  TVector3 GetLocalCoordinates() const { return mLocalCoord; };
63  //bool IsXY( void ) const { return true; };
64 
65  unsigned GetKfNodeID() const { return mKfNodeID; };
66 
67  virtual double _GetCoord(unsigned id) const = 0;
68  virtual unsigned GetMdim() const = 0;
69 
70 
71  protected:
72  virtual double GetCovariance(unsigned ip, unsigned iq) const = 0;
73 
74  TVector3 mLocalCoord;
75  bool mXYmode;
76 
77  // FIXME: pack into multi-index later;
78  UInt_t mKfNodeID;
79 
80  ULong64_t mMultiIndex;
81 
82  private:
83  void ResetVars() {
84  mKfNodeID = 0;
86  };
87 
89 };
90 
92 {
93  public:
95 
96  EicTrackingDigiHit1D(TString cname, const EicMoCaPoint *point, unsigned kfNodeID,
97  TVector3& global, const TVector3& local,
98  //double local,
99  double sigma):
100  EicTrackingDigiHit(cname, point, kfNodeID, global, local, true), /*mLocalCoord(local),*/ mSigma(sigma) {};
101  virtual ~EicTrackingDigiHit1D() {};
102 
103  unsigned GetMdim() const { return 1; };
104  //double GetCoord(unsigned id) const { return (id ? 0.0 : mLocalCoord); };
105  double _GetCoord(unsigned id) const { return (id ? 0.0 : mLocalCoord[0]); };
106  double GetCovariance(unsigned ip, unsigned iq) const { return (ip || iq ? 0.0 : mSigma*mSigma); };
107 
108  protected:
109 
110  private:
111  void ResetVars() { /*mLocalCoord =*/ mSigma = 0.0; };
112 
113  //Double_t mLocalCoord; // local 1D coordinate
114  Double_t mSigma; // gaussian sigma in all cases
115 
117 };
118 
120 {
121  public:
123 
124  EicTrackingDigiHitOrth2D(TString cname, const EicMoCaPoint *point, unsigned kfNodeID,
125  TVector3& global, const TVector3& local, bool xy_mode,
126  //double local[2],
127  double sigma[2]):
128  EicTrackingDigiHit(cname, point, kfNodeID, global, local, xy_mode) {
129  for(unsigned xy=0; xy<2; xy++) {
130  //mLocalCoord[xy] = local[xy];
131  mSigma [xy] = sigma[xy];
132  } //for xy
133  };
135 
136  unsigned GetMdim() const { return 2; };
137  double _GetCoord(unsigned id) const { /*assert(0);*/ return (id < 2 ? mLocalCoord[id] : 0.0); };
138  // check! double _GetCoord(unsigned id) const { /*assert(0);*/ return (id < 2 ? mLocalCoord[id] : 0.0); };
139  double GetCovariance(unsigned ip, unsigned iq) const {
140  return ((ip != iq || ip >= 2) ? 0.0 : mSigma[ip]*mSigma[ip]);
141  };
142 
143  protected:
144 
145  private:
146  void ResetVars() {
147  //memset(mLocalCoord, 0x00, sizeof(mLocalCoord));
148  memset(mSigma, 0x00, sizeof(mSigma));
149  };
150 
151  //Double_t mLocalCoord[2]; // local 2D coordinates
152  Double_t mSigma[2]; // gaussian sigma in all cases
153 
155 };
156 
157 //
158 // FIXME: unify with 2D case later;
159 //
160 
162 {
163  public:
165 
166  EicTrackingDigiHit3D(TString cname, const EicMoCaPoint *point, //unsigned kfNodeID,
167  TVector3& global, const TVector3& local,
168  //double local[3],
169  double covariance[3][3]):
170  EicTrackingDigiHit(cname, point, 0, global, local, true) {
171  //for(unsigned xy=0; xy<3; xy++)
172  //mLocalCoord[xy] = local[xy];
173  for(unsigned ip=0; ip<3; ip++)
174  for(unsigned iq=0; iq<3; iq++)
175  mCovariance[ip][iq] = covariance[ip][iq];
176  };
177  virtual ~EicTrackingDigiHit3D() {};
178 
179  unsigned GetMdim() const { return 3; };
180  double _GetCoord(unsigned id) const { return (id < 3 ? mLocalCoord[id] : 0.0); };
181  double GetCovariance(unsigned ip, unsigned iq) const {
182  return ((ip<3 && iq<3) ? mCovariance[ip][iq] : 0.0);
183  };
184 
185  protected:
186 
187  private:
188  void ResetVars() {
189  //memset(mLocalCoord, 0x00, sizeof(mLocalCoord));
190  memset(mCovariance, 0x00, sizeof(mCovariance));
191  };
192 
193  //Double_t mLocalCoord[3]; // local 3D coordinates
194  Double_t mCovariance[3][3]; // full covariance matrix
195 
197 };
198 
199 #endif