MpdTgemPoint.cxx 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //------------------------------------------------------------------------------------------------------------------------
  2. // -------------------------------------------------------------------------
  3. // ----- MpdTgemPoint source file -----
  4. // -------------------------------------------------------------------------
  5. #include <iostream>
  6. #include "MpdTgemPoint.h"
  7. //------------------------------------------------------------------------------------------------------------------------
  8. MpdTgemPoint::MpdTgemPoint() : FairMCPoint() { }
  9. //------------------------------------------------------------------------------------------------------------------------
  10. MpdTgemPoint::MpdTgemPoint(Int_t trackID, Int_t detID, TVector3 pos, Double_t radius, TVector3 mom, Double_t tof,
  11. Double_t length, Double_t eLoss, Int_t isPrimary, Double_t charge, Int_t pdgId, TVector3 trackPos)
  12. : FairMCPoint(trackID, detID, pos, mom, tof, length, eLoss),
  13. fIsPrimary(isPrimary), fCharge(charge), fRadius(radius), fPdgId(pdgId)
  14. {
  15. fTX = trackPos.X();
  16. fTY = trackPos.Y();
  17. fTZ = trackPos.Z();
  18. }
  19. //------------------------------------------------------------------------------------------------------------------------
  20. MpdTgemPoint::~MpdTgemPoint() { }
  21. //------------------------------------------------------------------------------------------------------------------------
  22. Double_t MpdTgemPoint::GetDistance() {
  23. TVector3 dist = TVector3(fX, fY, fZ) - TVector3(fTX,fTY,fTZ);
  24. return dist.Mag();
  25. }
  26. //------------------------------------------------------------------------------------------------------------------------
  27. void MpdTgemPoint::Print(const Option_t* opt) const
  28. {
  29. cout << "-I- MpdTgemPoint: Tgem point for track " << fTrackID
  30. << " in detector " << fDetectorID << endl;
  31. cout << " Position (" << fX << ", " << fY << ", " << fZ
  32. << ") cm" << endl;
  33. cout << " Momentum (" << fPx << ", " << fPy << ", " << fPz
  34. << ") GeV" << endl;
  35. cout << " Time " << fTime << " ns, Length " << fLength
  36. << " cm, Energy loss " << fELoss*1.0e06 << " keV" << endl;
  37. }
  38. //------------------------------------------------------------------------------------------------------------------------
  39. ClassImp(MpdTgemPoint)