diff --git a/core/data/trd/CbmTrdCluster.cxx b/core/data/trd/CbmTrdCluster.cxx index ef978d75e56c3a284df49bb567f50ee4658ead5e..702c9152466bd5e3a1f77c7d400a8e7a9b325309 100644 --- a/core/data/trd/CbmTrdCluster.cxx +++ b/core/data/trd/CbmTrdCluster.cxx @@ -198,8 +198,8 @@ string CbmTrdCluster::ToString() const { stringstream ss; ss << CbmCluster::ToString(); - ss << "CbmTrdCluster: mod=" << GetAddress() << " t0=" << fStartTime << " row=" << (int32_t) GetRow() << " " - << (HasFaspDigis() ? "Fasp " : "Spadic ") << "Chs="; + ss << "CbmTrdCluster: mod=" << GetAddress() << " row=" << (int32_t) GetRow() << " " + << (HasFaspDigis() ? "Fasp_" : "Spadic_") << "Chs="; ss << (HasOpenStart() ? "/" : "|"); for (int32_t i(0); i < fNCols; i++) ss << fStartCh + i << " "; diff --git a/core/data/trd/CbmTrdCluster.h b/core/data/trd/CbmTrdCluster.h index 127bd67a1b27b852b1e85bf60cae0f483a58a749..a597001142295a8388ee6a07f23286290fc78e57 100644 --- a/core/data/trd/CbmTrdCluster.h +++ b/core/data/trd/CbmTrdCluster.h @@ -107,11 +107,11 @@ public: virtual std::string ToString() const; protected: - uint8_t fNCols = 0; //! number of columns with charge above threshold - uint8_t fNRows = 0x1f; //! cluster row info plus extra meta data. Use dedicated getters for the correct value - uint16_t fStartCh = 0xffff; //! channel address of first channel + uint8_t fNCols = 0; //< number of columns with charge above threshold + uint8_t fNRows = 0x1f; //< cluster row info plus extra meta data. Use dedicated getters for the correct value + uint16_t fStartCh = 0xffff; //< channel address of first channel uint32_t fStartTime = 0xffffffff; //! start time of cluster in clk units wrt buffer start - ClassDef(CbmTrdCluster, 5) // cluster of digi for the TRD detector + ClassDef(CbmTrdCluster, 6) // cluster of digi for the TRD detector }; #endif diff --git a/core/data/trd/CbmTrdHit.cxx b/core/data/trd/CbmTrdHit.cxx index 8dd24d972ae433dfc54d1b007f16ba4c07f7a248..e07956e3b2e28a8a0af0ec072231d9f818cc7f49 100644 --- a/core/data/trd/CbmTrdHit.cxx +++ b/core/data/trd/CbmTrdHit.cxx @@ -43,10 +43,8 @@ std::string CbmTrdHit::ToString() const { stringstream ss; ss << CbmPixelHit::ToString(); - ss << "CbmTrdHit: time[ns]=" << GetTime() << "+-" << GetTimeError() << " eloss=" << GetELoss(); - if (GetClassType()) ss << " typ[T]" << (GetMaxType() ? "Max{T}" : "Max{R}"); - else - ss << " typ[R]"; + ss << "CbmTrdHit" << (GetClassType() ? "2" : "1")<< "D: time[ns]=" << GetTime() << "+-" << GetTimeError() << " eloss=" << GetELoss(); + if (GetClassType()) ss << " Max=" << (GetMaxType() ? "T" : "R"); ss << " RC=" << (IsRowCross() ? 'y' : 'n') << " Ovf=" << (HasOverFlow() ? 'y' : 'n') << endl; return ss.str(); } diff --git a/core/data/trd/CbmTrdPoint.cxx b/core/data/trd/CbmTrdPoint.cxx index 04e50958389e682d89b8901cb312f93db811847d..523cd523f88de82be6550a0c87abe8ede1bbb3f8 100644 --- a/core/data/trd/CbmTrdPoint.cxx +++ b/core/data/trd/CbmTrdPoint.cxx @@ -51,5 +51,19 @@ void CbmTrdPoint::Print(const Option_t* /*opt*/) const } // ------------------------------------------------------------------------- +// ----- Public method Print ------------------------------------------- +std::string CbmTrdPoint::ToString() const +{ + std::stringstream ss; + ss << "CbmTrdPoint: Track " << fTrackID << " Detector " << fDetectorID << "\n"; + ss << " Position In (" << fX << ", " << fY << ", " << fZ << ") cm" << "\n"; + ss << " Momentum In (" << fPx << ", " << fPy << ", " << fPz << ") GeV" << "\n"; + ss << " Position Out (" << fX_out << ", " << fY_out << ", " << fZ_out << ") cm" << "\n"; + ss << " Momentum Out (" << fPx_out << ", " << fPy_out << ", " << fPz_out << ") GeV" << "\n"; + ss << " Time " << fTime << " ns, Length " << fLength << " cm, Energy loss " << fELoss * 1.0e06 << " keV" << "\n"; + return ss.str(); +} +// ------------------------------------------------------------------------- + ClassImp(CbmTrdPoint) diff --git a/core/data/trd/CbmTrdPoint.h b/core/data/trd/CbmTrdPoint.h index 5ff3453d6a279ef0b70e13e91f74e52baa9510a9..adaee41f76c952a453e52c6ed7f1620e5cd381fe 100644 --- a/core/data/trd/CbmTrdPoint.h +++ b/core/data/trd/CbmTrdPoint.h @@ -25,6 +25,7 @@ #include <TVector3.h> // for TVector3 #include <cstdint> +#include <string> class CbmTrdPoint : public FairMCPoint { @@ -55,8 +56,10 @@ public: /** Destructor **/ virtual ~CbmTrdPoint(); - /** Output to screen **/ + /** \brief Output to screen **/ virtual void Print(const Option_t* opt) const; + /** \brief Output to string.**/ + virtual std::string ToString() const; /** Accessors **/ double GetXIn() const { return fX; }