MpdEmcDigitKI.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #ifndef MPDEMCDIGITKI_H
  2. #define MPDEMCDIGITKI_H 1
  3. #include <map>
  4. #include "TObject.h"
  5. class MpdEmcPointKI;
  6. class MpdEmcDigitKI : public TObject
  7. {
  8. public:
  9. /** Default constructor **/
  10. MpdEmcDigitKI();
  11. MpdEmcDigitKI(MpdEmcPointKI* point);
  12. MpdEmcDigitKI(int cellId, float energy, float time, int trackId);
  13. virtual ~MpdEmcDigitKI();
  14. // Check, if point can be added (hits from the same Tower)
  15. Bool_t CanAdd(MpdEmcPointKI* point) const;
  16. // Adds point (add energy, change time if necessary, add primary)
  17. void AddPoint(MpdEmcPointKI* point);
  18. int GetDetId() const { return fDetId; }
  19. Float_t GetE() const { return fE; }
  20. Float_t GetTime() const { return fTime; };
  21. void SetE(Double_t e) { fE = e; }
  22. void SetTime(Double_t t) { fTime = t; }
  23. void Print(const Option_t* opt = 0) const;
  24. // Methods used for event display
  25. double GetZcenter();
  26. double GetPhiCenter();
  27. /// To allow sorting
  28. Bool_t IsSortable() const { return kTRUE; }
  29. /// \brief Method ised for sorting Hits
  30. // \param Another ModEmcDigit
  31. // \return
  32. Int_t Compare(const TObject* obj) const;
  33. Int_t GetNPrimaries() const { return fNprimary; }
  34. void GetPrimary(Int_t i, Int_t& primId, Float_t& primEdep) const
  35. {
  36. if (i >= fNprimary) {
  37. primId = -1;
  38. primEdep = 0;
  39. return;
  40. } else {
  41. primId = fPrimary[i];
  42. primEdep = fPrimEdep[i];
  43. }
  44. }
  45. protected:
  46. UInt_t fDetId; // Tower index
  47. Float_t fE; // Full energy
  48. Float_t fTime; // hit mean time
  49. Int_t fNprimary; // Number of primaries
  50. Int_t* fPrimary; //[fNprimary] Array of primaries
  51. Float_t* fPrimEdep; //[fNprimary] Array of deposited energies
  52. std::map<int, float> fEdep; // energy deposit for each track ID
  53. ClassDef(MpdEmcDigitKI, 1)
  54. };
  55. #endif