MpdSts.h 3.1 KB

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