CbmRoot
Loading...
Searching...
No Matches
CaHit.cxx
Go to the documentation of this file.
1/* Copyright (C) 2023 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Sergei Zharko [committer] */
4
9
10#include "CaHit.h"
11
12#include <iomanip>
13#include <sstream>
14
16
17std::string Hit::ToString() const
18{
19 std::stringstream ss;
20 ss << "Hit " << fId << " station " << fStation << " front key " << fFrontKey << " back key " << fBackKey << " X "
21 << fX << " Y " << fY << " Z " << fZ << " T " << fT << " dX2 " << fDx2 << " dY2 " << fDy2 << " dXY " << fDxy
22 << " dT2 " << fDt2 << " rangeX " << fRangeX << " rangeY " << fRangeY << " rangeT " << fRangeT;
23 return ss.str();
24}
25
26std::string Hit::ToString(int verbose, bool bHeader) const
27{
28 if (verbose < 1) {
29 return "";
30 }
31 using std::setw;
32 constexpr int widthF = 12;
33 constexpr int widthI = 4;
34 std::stringstream msg;
35 if (bHeader) {
36 msg << setw(widthI) << "IDe" << ' ';
37 msg << setw(widthI) << "st." << ' ';
38 if (verbose > 1) {
39 msg << setw(widthI) << "keyF" << ' ';
40 msg << setw(widthI) << "keyB" << ' ';
41 }
42 msg << setw(widthF) << "x [cm]" << ' ';
43 msg << setw(widthF) << "y [cm]" << ' ';
44 msg << setw(widthF) << "z [cm]" << ' ';
45 msg << setw(widthF) << "t [ns]" << ' ';
46 if (verbose > 1) {
47 msg << setw(widthF) << "dx2 [cm2]" << ' ';
48 msg << setw(widthF) << "dy2 [cm2]" << ' ';
49 msg << setw(widthF) << "dxy [cm2]" << ' ';
50 msg << setw(widthF) << "dt2 [ns2]" << ' ';
51 if (verbose > 2) {
52 msg << setw(widthF) << "rangeX [cm]" << ' ';
53 msg << setw(widthF) << "rangeY [cm]" << ' ';
54 msg << setw(widthF) << "rangeT [ns]" << ' ';
55 }
56 }
57 }
58 else {
59 msg << setw(widthI) << fId << ' ';
60 msg << setw(widthI) << fStation << ' ';
61 if (verbose > 1) {
62 msg << setw(widthI) << fFrontKey << ' ';
63 msg << setw(widthI) << fBackKey << ' ';
64 }
65 msg << setw(widthF) << fX << ' ';
66 msg << setw(widthF) << fY << ' ';
67 msg << setw(widthF) << fZ << ' ';
68 msg << setw(widthF) << fT << ' ';
69 if (verbose > 1) {
70 msg << setw(widthF) << fDx2 << ' ';
71 msg << setw(widthF) << fDy2 << ' ';
72 msg << setw(widthF) << fDxy << ' ';
73 msg << setw(widthF) << fDt2 << ' ';
74 if (verbose > 2) {
75 msg << setw(widthF) << fRangeX << ' ';
76 msg << setw(widthF) << fRangeY << ' ';
77 msg << setw(widthF) << fRangeT << ' ';
78 }
79 }
80 }
81 return msg.str();
82}
A generic hit for the CA tracker (header)
ca::Hit class describes a generic hit for the CA tracker
Definition CaHit.h:32
fscal fRangeT
+/- range of uncertainty of time [ns]
Definition CaHit.h:169
fscal fDx2
rms^2 of uncertainty of X coordinate [cm2]
Definition CaHit.h:163
int fStation
index of station in the active stations array
Definition CaHit.h:172
fscal fDt2
measured uncertainty of time [ns2]
Definition CaHit.h:166
HitIndex_t fId
id of the hit
Definition CaHit.h:171
std::string ToString() const
Simple string representation of the hit class.
Definition CaHit.cxx:17
fscal fDy2
rms^2 of uncertainty of Y coordinate [cm2]
Definition CaHit.h:164
fscal fRangeX
+/- range of uncertainty of X coordinate [cm]
Definition CaHit.h:167
fscal fZ
fixed Z coordinate [cm]
Definition CaHit.h:161
HitKeyIndex_t fFrontKey
front hit key index
Definition CaHit.h:156
fscal fY
measured Y coordinate [cm]
Definition CaHit.h:160
fscal fRangeY
+/- range of uncertainty of Y coordinate [cm]
Definition CaHit.h:168
fscal fDxy
X/Y covariance [cm2].
Definition CaHit.h:165
HitKeyIndex_t fBackKey
back hit key index
Definition CaHit.h:157
fscal fT
measured time [ns]
Definition CaHit.h:162
fscal fX
measured X coordinate [cm]
Definition CaHit.h:159