MpdTpcFoundHit.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. // Class that holds TPC Hit information.
  2. //
  3. // Original author: Jonathan Paley 08/18/04 jpaley@indiana.edu
  4. // Edited by Artem Basalaev 03/18/13
  5. #ifndef MPDTPCFOUNDHIT_H
  6. #define MPDTPCFOUNDHIT_H
  7. #include <iostream>
  8. #include <iomanip>
  9. #include "TObject.h"
  10. #include "TRef.h"
  11. #include "MpdTpc2dCluster.h"
  12. using namespace std;
  13. class MpdTpcFoundHit : public TObject
  14. {
  15. public:
  16. typedef enum {
  17. kUnknown = 0,
  18. kWMPeak,
  19. kFitPeak,
  20. kMixFitWM
  21. } TpcFoundHitType_t;
  22. public:
  23. MpdTpcFoundHit();
  24. MpdTpcFoundHit(Float_t x, Float_t dx, Float_t y, Float_t dy, Float_t z, Float_t dz);
  25. MpdTpcFoundHit(Float_t p[3], Float_t dp[3]);
  26. MpdTpcFoundHit(const MpdTpcFoundHit& hit);
  27. MpdTpcFoundHit(const MpdTpc2dCluster* clus);
  28. ~MpdTpcFoundHit();
  29. public:
  30. const MpdTpc2dCluster* Cluster () const {
  31. //return dynamic_cast<const MpdTpc2dCluster*>(fCluster.GetObject());
  32. return fCluster;
  33. }
  34. void AttachCluster(const MpdTpc2dCluster*);
  35. const Int_t PadRow () const {return fPadRow;}
  36. const Float_t PadCol () const {return fPadCol;}
  37. const Float_t TimeBkt () const {return fTimeBkt;}
  38. const Float_t QFit () const {return fQFit;}
  39. const Float_t QFitSig () const {return fSigQFit;}
  40. const Float_t QADC () const {return fQADC;}
  41. const Float_t GetLocalX () const {return _xl;}
  42. const Float_t GetLocalY () const {return _yl;}
  43. const Float_t GetLocalZ () const {return _zl;}
  44. const Float_t GetGlobalX () const {return _xg;}
  45. const Float_t GetGlobalY () const {return _yg;}
  46. const Float_t GetGlobalZ () const {return _zg;}
  47. const Float_t errX () const {return _dx;}
  48. const Float_t errY () const {return _dy;}
  49. const Float_t errZ () const {return _dz;}
  50. const Int_t MaxCol () const {return this->Cluster()->MaxCol();}
  51. const Int_t MinCol () const {return this->Cluster()->MinCol();}
  52. const Int_t MaxBkt () const {return this->Cluster()->MaxBkt();}
  53. const Int_t MinBkt () const {return this->Cluster()->MinBkt();}
  54. const Int_t GetSect () const {return this->Cluster()->GetSect();}
  55. const Int_t NumHits () const {return fNumHits;}
  56. const Int_t Type () const {return fHitType;}
  57. const Int_t GetOrigin() const {return fOrigin;}
  58. void SetTimeBkt (Float_t val) {fTimeBkt = val;}
  59. void SetPadCol (Float_t col) {fPadCol = col; }
  60. void SetNumHits (Int_t val) {fNumHits = val;}
  61. void SetType (Int_t val) {fHitType = val;}
  62. void SetQFit (Float_t val) {fQFit = val;}
  63. void SetSigQFit (Float_t val) {fSigQFit = val;}
  64. void SetQADC (Float_t val) {fQADC = val;}
  65. void SetPos (Float_t *p, Float_t *dp);
  66. void SetGlobalX (Float_t x) {_xg = x;}
  67. void SetGlobalY (Float_t y) {_yg = y;}
  68. void SetGlobalZ (Float_t z) {_zg = z;}
  69. void SetXerr (Float_t errx) {_dx = errx;}
  70. void SetYerr (Float_t erry) {_dy = erry;}
  71. void SetZerr (Float_t errz) {_dz = errz;}
  72. void AddOrigin (Int_t Origin);
  73. const void Print () const;
  74. public:
  75. friend ostream& operator << (ostream& ostr, const MpdTpcFoundHit& h1);
  76. private:
  77. Int_t fOrigin;
  78. short fNumHits;
  79. short fHitType;
  80. short fPadRow; // Pad row; converted to y-position
  81. Float_t fPadCol; // Pad column; converted to x-position
  82. Float_t fTimeBkt; // Time bucket;
  83. // QFit is the total charge from cluster slices fit to Gamma
  84. // (area under fit curve)
  85. Float_t fQFit;
  86. // SigQFit is the "uncertainty" on the total charge from the Gamma fit
  87. // Note: this isn't a real uncertainty, since a true chi^2 was not calculated
  88. // but rather a goodness-of-fit
  89. Float_t fSigQFit;
  90. // QADC is the total charge from cluster slices that we failed to fit to
  91. // a Gamma (sum of ADC values)
  92. Float_t fQADC;
  93. //TRef fCluster; // poInt_ter to the cluster from which hit was formed
  94. const MpdTpc2dCluster* fCluster; // poInt_ter to the cluster from which hit was formed
  95. Float_t _xg,_yg,_zg, _xl, _yl, _zl, _dx,_dy,_dz;
  96. ClassDef(MpdTpcFoundHit, 4)
  97. };
  98. #endif // TPCRHIT