MpdIts5spd.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. // -------------------------------------------------------------------------
  2. // ----- MpdItsspd header file -----
  3. // ----- 13.12.2016 -----
  4. // -------------------------------------------------------------------------
  5. #ifndef MPDITS5spd_H
  6. #define MPDITS5spd_H
  7. #include "TClonesArray.h"
  8. #include "TLorentzVector.h"
  9. #include "TVector3.h"
  10. #include "FairDetector.h"
  11. class MpdStsPoint;
  12. class FairVolume;
  13. //-------------------------------------------------------------------------------
  14. class MpdIts5spd : public FairDetector
  15. {
  16. public:
  17. // *@param name detector name
  18. // *@param active sensitivity flag
  19. MpdIts5spd(const char* name, Bool_t active);
  20. MpdIts5spd();
  21. virtual ~MpdIts5spd();
  22. // Defines the action to be taken when a step is inside the
  23. // active volume. Creates MpdStsPoints and adds them to the collection.
  24. // @param vol Pointer to the active volume
  25. virtual Bool_t ProcessHits(FairVolume* vol = 0);
  26. // If verbosity level is set, print hit collection at the
  27. // end of the event and resets it afterwards.
  28. virtual void EndOfEvent();
  29. // Registers the hit collection in the ROOT manager.
  30. virtual void Register();
  31. // Accessor to the hit collection
  32. virtual TClonesArray* GetCollection(Int_t iColl) const;
  33. // Screen output of hit collection.
  34. virtual void Print() const;
  35. // Clears the hit collection
  36. virtual void Reset();
  37. // *@param cl1 Origin
  38. // *@param cl2 Target
  39. // *@param offset Index offset
  40. virtual void CopyClones(TClonesArray* cl1, TClonesArray* cl2, Int_t offset);
  41. // Constructs the STS geometry
  42. virtual void ConstructGeometry();
  43. private:
  44. // Track information to be stored until the track leaves the active volume.
  45. Int_t fTrackID; //! track index
  46. Int_t fVolumeID; //! volume id
  47. TLorentzVector fPos; //! position
  48. TLorentzVector fMom; //! momentum
  49. Double32_t fTime; //! time
  50. Double32_t fLength; //! length
  51. Double32_t fELoss; //! energy loss
  52. Int_t fPosIndex; //!
  53. TClonesArray* fStsCollection; //! Hit collection
  54. // Adds a MpdStsPoint to the HitCollection
  55. MpdStsPoint* AddHit(Int_t trackID, Int_t detID, TVector3 posIn,
  56. TVector3 momIn, TVector3 posOut, Double_t time,
  57. Double_t length, Double_t eLoss);
  58. // Resets the private members for the track parameters
  59. void ResetParameters();
  60. ClassDef(MpdIts5spd,1)
  61. };
  62. //--------------------------------------------------------------------------------
  63. inline void MpdIts5spd::ResetParameters()
  64. {
  65. fTrackID = fVolumeID = 0;
  66. fPos.SetXYZM(0.0, 0.0, 0.0, 0.0);
  67. fMom.SetXYZM(0.0, 0.0, 0.0, 0.0);
  68. fTime = fLength = fELoss = 0;
  69. fPosIndex = 0;
  70. };
  71. //--------------------------------------------------------------------------------
  72. #endif