CbmRoot
Loading...
Searching...
No Matches
CaToolsMCPoint.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 "CaToolsMCPoint.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) << "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) << fStationId << '|';
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)
Class describes a unified MC-point, used in CA tracking QA analysis.
int fStationId
Global index of active tracking station.
std::array< double, 3 > fPosOut
Position at exit of station [cm].
int fPdgCode
Particle PDG code.
double fMass
Particle mass [GeV/c2].
double fCharge
Particle charge [e].
std::array< double, 3 > fPos
Position at reference z of station [cm].
LinkKey fLinkKey
Link key of point.
std::string ToString(int verbose, bool printHeader=false) const
Prints content for a given verbosity level.
double fTime
Point time [ns].
int fId
Index of MC point in the external MC point container.
int fTrackId
Index of associated MC track in CA internal track container within TS/event.
double GetP() const
Gets track momentum absolute value at reference z of station [GeV/c].
int fMotherId
Index of mother track in CA internal data structures (within event/TS)
std::array< double, 3 > fPosIn
Position at entrance to station [cm].
ca::Vector< int > fvHitIndexes
Indexes of hits, assigned to this point.
int fEvent
Index of MC event.
int fFile
Index of MC file.
int fIndex
Index of MC point/track in external data structures.