MpdEmcDigit.h 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. //--------------------------------------------------------------------
  2. //
  3. // Description:
  4. // MPD EMC Digit
  5. //
  6. //
  7. // Author List:
  8. // Alexander Zinchenko LHEP, JINR, Dubna - 8-May-2016
  9. //
  10. //--------------------------------------------------------------------
  11. #ifndef MPDEMCDIGIT_H
  12. #define MPDEMCDIGIT_H 1
  13. #include "FairHit.h"
  14. #include <map>
  15. class MpdEmcDigit : public FairHit
  16. {
  17. public:
  18. enum Shifts {kSideS = 0, kChannelS = 1, kRowS = 7, kSectorS = 13};
  19. enum Masks {kSideM = 1, kChannelM = 63, kRowM = 63, kSectorM = 15};
  20. public:
  21. /** Default constructor **/
  22. MpdEmcDigit();
  23. /** Constructor with hit parameters (1)**/
  24. MpdEmcDigit(Int_t detectorID, TVector3 pos, TVector3 dpos, Int_t refIndex, Int_t flag);
  25. /** Constructor with hit parameters (2) [not the flag]**/
  26. MpdEmcDigit(Int_t detectorID, TVector3 pos, TVector3 dpos, Int_t refIndex);
  27. MpdEmcDigit(UInt_t side, UInt_t sector, UInt_t row, UInt_t channel);
  28. /** Destructor **/
  29. virtual ~MpdEmcDigit();
  30. void Print(const Option_t* opt = 0) const;
  31. void IncreaseEnergy(Float_t e, Int_t trId);
  32. UInt_t SetDetId(UInt_t side, UInt_t sector, UInt_t module, UInt_t channel);
  33. UInt_t Side() const { return fDetectorID % 2; }
  34. UInt_t Channel() const { return (fDetectorID >> kChannelS) & kChannelM; }
  35. UInt_t Row() const { return (fDetectorID >> kRowS) & kRowM; }
  36. UInt_t Sector() const { return (fDetectorID >> kSectorS) & kSectorM; }
  37. /** Accessors **/
  38. Int_t GetFlag() const { return fFlag; }
  39. Int_t GetChanZId() const { return fChanZId; }
  40. Int_t GetChanPhiId() const { return fChanPhiId; }
  41. Float_t GetE() const { return fE; }
  42. Float_t GetZcenter() const { return fZCenter; }
  43. Float_t GetPhiCenter() const { return fPhiCenter; }
  44. Int_t GetTrackId() const { return fTrackID; }
  45. Int_t GetPdg() const { return fPDG; }
  46. Int_t GetNumTracks() const { return fNumTracks; }
  47. //std::map<Int_t,Float_t>& GetContrib() { return fContrib; }
  48. std::map<Int_t,Float_t> GetContrib() { return fContrib; }
  49. /** Modifiers **/
  50. void SetFlag(Int_t flag) { fFlag = flag; }
  51. void SetEnergy(Float_t e) { fE = e; }
  52. void IncreaseEnergy(Float_t e) { fE += e; }
  53. void SetTrackId(Int_t id) { fTrackID = id; }
  54. void SetPdg(Int_t pdg) { fPDG = pdg; }
  55. void SetNumTracks(Int_t n) { fNumTracks = n; }
  56. void SetZCenter(Float_t z) { fZCenter = z; }
  57. void SetPhiCenter(Float_t phi) { fPhiCenter = phi; }
  58. void SetChanZId(UInt_t zId) { fChanZId = zId; }
  59. void SetChanPhiId(UInt_t phiId) { fChanPhiId = phiId; }
  60. protected:
  61. // base digi-part
  62. Int_t fChanZId; // channel number along Z
  63. Int_t fChanPhiId; // channel number along phi
  64. Float_t fE; //energy
  65. //extra reco-part
  66. Int_t fTrackID; // -1 if more than one track in module
  67. Int_t fFlag; // Flag for general purposes [TDC, event tagging...]
  68. Int_t fPDG; // code of particle if only one track presented in module
  69. UInt_t fNumTracks; // number of tracks, which have contribution in module
  70. Float_t fZCenter; // z-coordinate of the center of module
  71. Float_t fPhiCenter; // phi-angle of the center of module
  72. std::map<Int_t,Float_t> fContrib; // energy deposit for each track ID
  73. ClassDef(MpdEmcDigit, 1);
  74. };
  75. #endif