MpdFsa.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. //------------------------------------------------------------------------------------------------------------------------
  2. // -------------------------------------------------------------------------
  3. // ----- MpdFsa header file -----
  4. // -------------------------------------------------------------------------
  5. /** MpdFsa.h
  6. **
  7. ** Defines the active detector FSA. Constructs the geometry and
  8. ** registeres MCPoints.
  9. **/
  10. #ifndef MPDFSA_H
  11. #define MPDFSA_H
  12. #include "TClonesArray.h"
  13. #include "TLorentzVector.h"
  14. #include "TVector3.h"
  15. #include "FairDetector.h"
  16. class MpdFsaPoint;
  17. class FairVolume;
  18. //------------------------------------------------------------------------------------------------------------------------
  19. class MpdFsa : public FairDetector
  20. {
  21. public:
  22. // *@param name detector name
  23. // *@param active sensitivity flag
  24. MpdFsa(const char* name, Bool_t active);
  25. MpdFsa();
  26. virtual ~MpdFsa();
  27. // Defines the action to be taken when a step is inside the
  28. // active volume. Creates MpdFsaPoints 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 FSA 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* fFsaCollection; //! Hit collection
  59. // Adds a MpdFsaPoint to the HitCollection
  60. MpdFsaPoint* AddHit(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss);
  61. // Resets the private members for the track parameters
  62. void ResetParameters();
  63. ClassDef(MpdFsa,1)
  64. };
  65. //------------------------------------------------------------------------------------------------------------------------
  66. inline void MpdFsa::ResetParameters()
  67. {
  68. fTrackID = fVolumeID = 0;
  69. fPos.SetXYZM(0.0, 0.0, 0.0, 0.0);
  70. fMom.SetXYZM(0.0, 0.0, 0.0, 0.0);
  71. fTime = fLength = fELoss = 0;
  72. fPosIndex = 0;
  73. };
  74. //------------------------------------------------------------------------------------------------------------------------
  75. #endif