CbmRoot
Loading...
Searching...
No Matches
CbmTrdPoint.cxx
Go to the documentation of this file.
1/* Copyright (C) 2004-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Volker Friese, Florian Uhlig, Denis Bertini [committer] */
4
5// -------------------------------------------------------------------------
6// ----- CbmTrdPoint source file -----
7// ----- Created 27/07/04 by V. Friese -----
8// -------------------------------------------------------------------------
9
10#include "CbmTrdPoint.h"
11
12#include <FairMCPoint.h> // for FairMCPoint
13#include <Logger.h> // for Logger, LOG
14
15#include <TVector3.h> // for TVector3
16
17// ----- Default constructor -------------------------------------------
18CbmTrdPoint::CbmTrdPoint() : FairMCPoint(), fX_out(0.), fY_out(0.), fZ_out(0.), fPx_out(0.), fPy_out(0.), fPz_out(0.) {}
19// -------------------------------------------------------------------------
20
21
22// ----- Standard constructor ------------------------------------------
23CbmTrdPoint::CbmTrdPoint(int32_t trackID, int32_t detID, const TVector3& posIn, const TVector3& momIn,
24 const TVector3& posOut, const TVector3& momOut, double tof, double length, double eLoss)
25 : FairMCPoint(trackID, detID, posIn, momIn, tof, length, eLoss)
26 , fX_out(posOut.X())
27 , fY_out(posOut.Y())
28 , fZ_out(posOut.Z())
29 , fPx_out(momOut.Px())
30 , fPy_out(momOut.Py())
31 , fPz_out(momOut.Pz())
32{
33}
34// -------------------------------------------------------------------------
35
36
37// ----- Destructor ----------------------------------------------------
39// -------------------------------------------------------------------------
40
41
42// ----- Public method Print -------------------------------------------
43void CbmTrdPoint::Print(const Option_t* /*opt*/) const
44{
45 LOG(info) << "TRD point for track " << fTrackID << " in detector " << fDetectorID;
46 LOG(info) << " Position In (" << fX << ", " << fY << ", " << fZ << ") cm";
47 LOG(info) << " Momentum In (" << fPx << ", " << fPy << ", " << fPz << ") GeV";
48 LOG(info) << " Position Out (" << fX_out << ", " << fY_out << ", " << fZ_out << ") cm";
49 LOG(info) << " Momentum Out (" << fPx_out << ", " << fPy_out << ", " << fPz_out << ") GeV";
50 LOG(info) << " Time " << fTime << " ns, Length " << fLength << " cm, Energy loss " << fELoss * 1.0e06 << " keV";
51}
52// -------------------------------------------------------------------------
53
54// ----- Public method Print -------------------------------------------
55std::string CbmTrdPoint::ToString() const
56{
57 std::stringstream ss;
58 ss << "CbmTrdPoint: Track " << fTrackID << " Detector " << fDetectorID << "\n";
59 ss << " Position In (" << fX << ", " << fY << ", " << fZ << ") cm"
60 << "\n";
61 ss << " Momentum In (" << fPx << ", " << fPy << ", " << fPz << ") GeV"
62 << "\n";
63 ss << " Position Out (" << fX_out << ", " << fY_out << ", " << fZ_out << ") cm"
64 << "\n";
65 ss << " Momentum Out (" << fPx_out << ", " << fPy_out << ", " << fPz_out << ") GeV"
66 << "\n";
67 ss << " Time " << fTime << " ns, Length " << fLength << " cm, Energy loss " << fELoss * 1.0e06 << " keV"
68 << "\n";
69 return ss.str();
70}
71// -------------------------------------------------------------------------
72
73
ClassImp(CbmConverterManager)
Double32_t fX_out
Definition CbmTrdPoint.h:84
Double32_t fZ_out
Definition CbmTrdPoint.h:84
virtual void Print(const Option_t *opt) const
Output to screen.
Double32_t fPx_out
Definition CbmTrdPoint.h:85
Double32_t fPy_out
Definition CbmTrdPoint.h:85
virtual std::string ToString() const
Output to string.
virtual ~CbmTrdPoint()
Double32_t fPz_out
Definition CbmTrdPoint.h:85
Double32_t fY_out
Definition CbmTrdPoint.h:84