MpdSft.h 3.3 KB

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