CbmRoot
Loading...
Searching...
No Matches
CaMcPoint.cxx
Go to the documentation of this file.
1/* Copyright (C) 2022 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Sergei Zharko [committer] */
4
9
10
11#include "CaMcPoint.h"
12
13#include <iomanip>
14#include <sstream>
15
17
18// ---------------------------------------------------------------------------------------------------------------------
19//
20std::string McPoint::ToString(int verbose, bool printHeader) const
21{
22 if (verbose < 1) {
23 return std::string();
24 }
25
26 std::stringstream msg;
27 msg.precision(4);
28 if (printHeader) {
29 if (verbose > 0) {
30 msg << std::setw(10) << "track ID" << ' ';
31 msg << std::setw(10) << "mother ID" << '|';
32 msg << std::setw(10) << "active station ID" << '|';
33 msg << std::setw(10) << "PDG" << ' ';
34 if (verbose > 3) {
35 msg << std::setw(10) << "m [GeV/c2]" << ' ';
36 msg << std::setw(10) << "q [e]" << '|';
37 }
38 msg << std::setw(14) << "t [ns]" << ' ';
39 msg << std::setw(14) << "x [cm]" << ' ';
40 msg << std::setw(14) << "y [cm]" << ' ';
41 msg << std::setw(14) << "z [cm]" << '|';
42 if (verbose > 1) {
43 msg << std::setw(14) << "zIn [cm]" << ' ';
44 msg << std::setw(14) << "zOut [cm]" << '|';
45 msg << std::setw(14) << "p [GeV/c]" << '|';
46 msg << std::setw(10) << "point ID" << ' ';
47 msg << std::setw(10) << "point ID (ext)" << ' ';
48 if (verbose > 3) {
49 msg << std::setw(10) << "event ID" << ' ';
50 msg << std::setw(10) << "file ID" << ' ';
51 }
52 msg << std::setw(16) << "hit indices" << ' ';
53 }
54 }
55 }
56 else {
57 if (verbose > 0) {
58 msg << std::setw(10) << fTrackId << ' ';
59 msg << std::setw(10) << fMotherId << '|';
60 msg << std::setw(10) << fActiveStationId << '|';
61 msg << std::setw(10) << fPdgCode << ' ';
62 if (verbose > 3) {
63 msg << std::setw(10) << fMass << ' ';
64 msg << std::setw(10) << fCharge << '|';
65 }
66 msg << std::setw(14) << fTime << ' ';
67 msg << std::setw(14) << fPos[0] << ' ';
68 msg << std::setw(14) << fPos[1] << ' ';
69 msg << std::setw(14) << fPos[2] << '|';
70 if (verbose > 1) {
71 msg << std::setw(14) << fPosIn[2] << ' ';
72 msg << std::setw(14) << fPosOut[2] << '|';
73 msg << std::setw(14) << this->GetP() << '|';
74 msg << std::setw(10) << fId << ' ';
75 msg << std::setw(10) << fLinkKey.fIndex << ' ';
76 if (verbose > 3) {
77 msg << std::setw(10) << fLinkKey.fEvent << ' ';
78 msg << std::setw(10) << fLinkKey.fFile << ' ';
79 }
80 std::stringstream msgHits;
81 for (int iH : fvHitIndexes) {
82 msgHits << iH << ' ';
83 }
84 msg << std::setw(16) << msgHits.str() << ' ';
85 }
86 }
87 }
88 return msg.str();
89}
Internal class describing a MC point for CA tracking QA and performance (header)
std::string ToString(int verbose, bool printHeader=false) const
Prints content for a given verbosity level.
Definition CaMcPoint.cxx:20
Class describes a unified MC-point, used in CA tracking QA analysis.
Definition CaMcPoint.h:33
double fMass
Particle mass [GeV/c2].
Definition CaMcPoint.h:380
double fCharge
Particle charge [e].
Definition CaMcPoint.h:381
std::array< double, 3 > fPosOut
Position at exit of station [cm].
Definition CaMcPoint.h:372
int fId
Index of MC point in the external MC point container.
Definition CaMcPoint.h:387
int fMotherId
Index of mother track in CA internal data structures (within event/TS)
Definition CaMcPoint.h:390
double GetP() const
Gets track momentum absolute value at reference z of station [GeV/c].
Definition CaMcPoint.h:120
McLinkKey fLinkKey
Link key of point.
Definition CaMcPoint.h:384
int fPdgCode
Particle PDG code.
Definition CaMcPoint.h:386
double fTime
Point time [ns].
Definition CaMcPoint.h:382
std::array< double, 3 > fPosIn
Position at entrance to station [cm].
Definition CaMcPoint.h:370
int fActiveStationId
Global index of active tracking station.
Definition CaMcPoint.h:394
int fTrackId
Index of associated MC track in CA internal track container within TS/event.
Definition CaMcPoint.h:388
ca::Vector< int > fvHitIndexes
Indexes of hits, assigned to this point.
Definition CaMcPoint.h:399
std::array< double, 3 > fPos
Position at reference z of station [cm].
Definition CaMcPoint.h:368