MpdTofPoint.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. //------------------------------------------------------------------------------------------------------------------------
  2. #ifndef __MPD_TOF_POINT_H
  3. #define __MPD_TOF_POINT_H 1
  4. #include<assert.h>
  5. #include "TObject.h"
  6. #include "TVector3.h"
  7. #include "FairMCPoint.h"
  8. //------------------------------------------------------------------------------------------------------------------------
  9. class MpdTofPoint : public FairMCPoint
  10. {
  11. public:
  12. /** Constructor with arguments
  13. *@param tid Index of MCTrack
  14. *@param suid strip unique ID
  15. *@param pos Ccoordinates at entrance to active volume [cm]
  16. *@param mom Momentum of track at entrance [GeV]
  17. *@param tof Time since event start [ns]
  18. *@param length Track length since creation [cm]
  19. *@param eLoss Energy deposit [GeV]
  20. **/
  21. MpdTofPoint(Int_t tid, Int_t suid, TVector3 pos, TVector3 mom, Double_t tof, Double_t length, Double_t eLoss);
  22. MpdTofPoint();
  23. virtual ~MpdTofPoint(){};
  24. // Output to screen
  25. virtual void Print(const Option_t* opt) const;
  26. // CAUTION: MAX_VALUE = 255(0xFF)
  27. // MpdTof --------------------------------
  28. // sector [1,...,14], 0xFF000000
  29. // detector [1,...,20], 0x00FF0000
  30. // gap [1,...,3], 0x0000FF00
  31. // strip [1,...,24], 0x000000FF
  32. // MpdEtof --------------------------------
  33. // strip [1,...,131],?? 0x000000FF
  34. // detector [1,...,1],?? 0x0000FF00
  35. // box [1,...,30],?? 0x00FF0000
  36. // sector [1,...,2],?? 0xFF000000
  37. inline Int_t GetSector() const { return ((fDetectorID & 0xFF000000) >> 24);};
  38. inline Int_t GetDetector() const { return ((fDetectorID & 0x00FF0000) >> 16);};
  39. inline Int_t GetGap() const { return ((fDetectorID & 0x0000FF00) >> 8);};
  40. inline Int_t GetStrip() const { return ( fDetectorID & 0x000000FF);};
  41. static Int_t GetSector(Int_t suid) { return ((suid & 0xFF000000) >> 24);};
  42. static Int_t GetDetector(Int_t suid) { return ((suid & 0x00FF0000) >> 16);};
  43. static Int_t GetGap(Int_t suid){ return ((suid & 0x0000FF00) >> 8);};
  44. static Int_t GetStrip(Int_t suid){ return ( suid & 0x000000FF);};
  45. static Int_t ClearGap(Int_t suid) { return ( suid & 0xFFFF00FF);}; // set gap = 0 for hit suid
  46. static Int_t SetCentralGap(Int_t suid){ return ( ClearGap(suid) | 0x00000200);}; // set gap = 2 for hit suid
  47. Int_t GetSuid() const {return fDetectorID;};
  48. static bool PrintSuid(Int_t suid, const char* comment = nullptr, std::ostream& os = std::cout);
  49. static bool IsSameDetector(Int_t suid1, Int_t suid2);
  50. static bool IsSameStrip(Int_t suid1, Int_t suid2);
  51. static bool IsSameGap(Int_t suid1, Int_t suid2);
  52. static void ParseSuid(Int_t suid, Int_t& sector, Int_t& detector, Int_t& gap, Int_t& strip);
  53. static Int_t GetSuid72(Int_t sector, Int_t detector, Int_t strip); // stripID [1,72]
  54. static Int_t GetSuid24(Int_t sector, Int_t detector, Int_t gap, Int_t strip); // stripID [1,24]
  55. ClassDef(MpdTofPoint,2)
  56. };
  57. //------------------------------------------------------------------------------------------------------------------------
  58. #endif