CbmSttTrack.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. // -------------------------------------------------------------------------
  2. // ----- CbmSttTrack header file -----
  3. // ----- Created 28/03/06 by R. Castelijns -----
  4. // -------------------------------------------------------------------------
  5. /** CbmSttTrack.h
  6. *@author R.Castelijns <r.castelijns@fz-juelich.de>
  7. **
  8. ** STT local track. Holds lists of CbmSttHits and the fitted
  9. ** track parameters. The fit parameters are of type FairTrackParam
  10. ** and can only be accesssed and modified via this class.
  11. **/
  12. #ifndef CBMSTTTRACK_H
  13. #define CBMSTTTRACK_H
  14. #include "TArrayI.h"
  15. #include "TObject.h"
  16. #include "FairTrackParam.h"
  17. #include "TClonesArray.h"
  18. #include <map>
  19. using namespace std;
  20. class CbmSttHit;
  21. class CbmSttTrack : public TObject
  22. {
  23. public:
  24. /** Default constructor **/
  25. CbmSttTrack();
  26. /** Destructor **/
  27. virtual ~CbmSttTrack();
  28. /** Public methods AddHit
  29. ** Adds the hit index to the index array
  30. **/
  31. void AddHit(Int_t hitID, CbmSttHit* mHit);
  32. /** Public method Print
  33. ** Output to screen
  34. **/
  35. void Print();
  36. /** Public method SortHits
  37. ** Sorts the hits in each array in downstream direction
  38. ** and writes the hit indizes into the member TArrayI
  39. **/
  40. void SortHits();
  41. /** Accessors **/
  42. Int_t GetNofHits() const { return fHits.GetSize(); };
  43. Int_t GetNHits() const;
  44. Int_t GetHitIndex(Int_t iHit) const { return fHits.At(iHit); };
  45. Int_t GetPidHypo() const { return fPidHypo; };
  46. Int_t GetFlag() const { return fFlag; };
  47. Double_t GetChi2Long() const { return fChi2Long; };
  48. Double_t GetChi2Rad() const { return fChi2Rad; };
  49. Int_t GetNDF() const { return fNDF; };
  50. // stt1
  51. // TClonesArray * GetHOT() const {return fHotArray;}
  52. FairTrackParam* GetParamFirst() { return &fParamFirst; };
  53. FairTrackParam* GetParamLast() { return &fParamLast ; };
  54. Bool_t AlreadyHasHit(Int_t iHit);
  55. /** Modifiers **/
  56. void SetPidHypo(Int_t pid) { fPidHypo = pid; };
  57. void SetParamFirst(FairTrackParam& par) { fParamFirst = par; };
  58. void SetParamLast(FairTrackParam& par) { fParamLast = par; };
  59. void SetFlag(Int_t flag) { fFlag = flag; };
  60. void SetChi2Long(Double_t chi2) { fChi2Long = chi2; };
  61. void SetChi2Rad(Double_t chi2) { fChi2Rad = chi2; };
  62. void SetNDF(Int_t ndf) { fNDF = ndf; };
  63. // stt1
  64. // void SetHOT(TClonesArray *hotarray) {fHotArray = hotarray;}
  65. private:
  66. Double_t fRefAngle;
  67. /** Arrays containg the indices of the hits attached to the track **/
  68. TArrayI fHits;
  69. /** PID hypothesis used by the track fitter **/
  70. Int_t fPidHypo;
  71. /** Track parameters at first and last fitted hit **/
  72. FairTrackParam fParamFirst;
  73. FairTrackParam fParamLast;
  74. /** Quality flag **/
  75. Int_t fFlag;
  76. /** RMS deviation of hit coordinates to track **/
  77. Double32_t fChi2Long;
  78. Int_t fNDF;
  79. Double32_t fChi2Rad;
  80. /** Maps from hit z position to hit index. STL map is used because it
  81. ** is automatically sorted. Temporary only; not for storgage.
  82. ** The Hit index arrys will be filled by the method SortHits.
  83. **/
  84. map<Double_t, Int_t> fHitMap; //!
  85. ClassDef(CbmSttTrack,1);
  86. };
  87. inline Int_t CbmSttTrack::GetNHits() const
  88. {
  89. return GetNofHits();
  90. }
  91. #endif