MpdNDet.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. /** MpdNDet.h
  2. *@author Mikhail Prokudin
  3. **
  4. ** Defines the active detector NDet with geometry coded here.
  5. **/
  6. #ifndef MPDNDET_H
  7. #define MPDNDET_H
  8. #include "FairDetector.h"
  9. #include "TClonesArray.h"
  10. #include "TLorentzVector.h"
  11. #include "TVector3.h"
  12. #include <list>
  13. class MpdNDetPoint;
  14. class MpdNDetPointLite;
  15. class FairVolume;
  16. class TGeoTranslation;
  17. #define kNumberOfNdetSensitiveVolumes 2
  18. class MpdNDet : public FairDetector
  19. {
  20. public:
  21. /** Default constructor **/
  22. MpdNDet();
  23. /** Standard constructor.
  24. *@param name detetcor name
  25. *@param active sensitivity flag
  26. **/
  27. MpdNDet(const char* name, Bool_t active,
  28. const char* fileGeo="ecal_FastMC.geo");
  29. /** Destructor **/
  30. virtual ~MpdNDet();
  31. /** Virtual method ProcessHits
  32. **
  33. ** Defines the action to be taken when a step is inside the
  34. ** active volume. Creates MpdNDet and adds them to the
  35. ** collection.
  36. *@param vol Pointer to the active volume
  37. **/
  38. virtual Bool_t ProcessHits(FairVolume* vol = NULL);
  39. /** Virtual method Construct geometry
  40. **
  41. ** Constructs the NDet geometry
  42. **/
  43. virtual void ConstructGeometry();
  44. virtual void EndOfEvent();
  45. virtual void BeginEvent();
  46. virtual void Reset();
  47. virtual void Print() const;
  48. virtual void CopyClones(TClonesArray* cl1, TClonesArray* cl2, Int_t offset);
  49. virtual void Register();
  50. virtual void ChangeHit(MpdNDetPointLite* oldHit=NULL);
  51. virtual void FinishPrimary();
  52. virtual void Initialize();
  53. /** Accessor to the hit collection **/
  54. virtual TClonesArray* GetCollection(Int_t iColl) const;
  55. virtual void SetSpecialPhysicsCuts();
  56. /** Get cell coordinates according
  57. ** to parameter container **/
  58. static Bool_t GetCellCoord(Int_t fVolumeID, Float_t &x, Float_t &y, Int_t& tenergy);
  59. /** Get cell coordinates according
  60. ** to current MpdNdetInf **/
  61. static Bool_t GetCellCoordInf(Int_t fVolumeID, Float_t &x, Float_t &y, Int_t& tenergy);
  62. protected:
  63. MpdNDetPoint* AddHit(Int_t trackID, Int_t detID, TVector3 pos,
  64. TVector3 mom, Double_t time, Double_t length,
  65. Double_t eLoss);
  66. MpdNDetPointLite* AddLiteHit(Int_t trackID, Int_t detID, Double32_t time, Double32_t eLoss);
  67. private:
  68. Bool_t FillLitePoint(Int_t volnum);
  69. void FillWallPoint();
  70. /** Private method ResetParameters
  71. **
  72. ** Resets the private members for the track parameters
  73. **/
  74. void ResetParameters();
  75. void SetNdetCuts(Int_t medium);
  76. MpdNDetPointLite* FindHit(Int_t VolId, Int_t TrackId);
  77. private:
  78. Option_t* fDebug; //!
  79. /** returns type of volume **/
  80. Int_t GetVolType(Int_t volnum);
  81. /** Track information to be stored until the track leaves the
  82. active volume. **/
  83. /** track index **/
  84. Int_t fTrackID; //!
  85. /** volume id **/
  86. Int_t fVolumeID; //!
  87. /** position **/
  88. TLorentzVector fPos; //!
  89. /** momentum **/
  90. TLorentzVector fMom; //!
  91. /** time **/
  92. Double32_t fTime; //!
  93. /** length **/
  94. Double32_t fLength; //!
  95. /** energy loss **/
  96. Double32_t fELoss; //!
  97. /** **/
  98. Int_t fPosIndex; //!
  99. /** MC point collection on NDET wall **/
  100. TClonesArray* fNDetCollection; //!
  101. /** MC point collection inside NDET **/
  102. TClonesArray* fLiteCollection; //!
  103. /** Number of first hit for current primary **/
  104. Int_t fFirstNumber; //!
  105. /** Map of volumes in NDET
  106. ** fVolArr[0]==code of sensivite wall
  107. ** fVolArr[1]==code of Scin
  108. **/
  109. Int_t fVolArr[kNumberOfNdetSensitiveVolumes];
  110. /** Inner radius of air **/
  111. Double_t fZSize;
  112. Double_t fAirInnerRad;
  113. Double_t fAirThickness;
  114. Double_t fScinThickness;
  115. Double_t fECut;
  116. Double_t fHCut;
  117. Int_t fZDivisions;//along beam
  118. Int_t fRDivisions;//phi divisions
  119. /** Volume ID of calorimeter structure **/
  120. Int_t fStructureId; //!
  121. Int_t fScinId; //!
  122. /** Initialize medium with given name **/
  123. Int_t InitMedium(const char* name);
  124. /** Initialize all calorimter media **/
  125. void InitMedia();
  126. ClassDef(MpdNDet,1)
  127. };
  128. inline void MpdNDet::ResetParameters()
  129. {
  130. fTrackID = fVolumeID = 0;
  131. fPos.SetXYZM(0.0, 0.0, 0.0, 0.0);
  132. fMom.SetXYZM(0.0, 0.0, 0.0, 0.0);
  133. fTime = fLength = fELoss = 0;
  134. fPosIndex = 0;
  135. };
  136. #endif