CbmRoot
Loading...
Searching...
No Matches
CbmL1Track.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 "CbmL1Track.h"
11
12#include <sstream>
13
14// ---------------------------------------------------------------------------------------------------------------------
15//
16std::string CbmL1Track::ToString(int verbose, bool header) const
17{
18 using std::setfill;
19 using std::setw;
20 std::stringstream msg;
21 if (header) {
22 msg << setw(12) << setfill(' ') << "p [GeV/c]" << ' ';
23 msg << setw(12) << setfill(' ') << "Tx" << ' ';
24 msg << setw(8) << setfill(' ') << "N hits" << ' ';
25 msg << setw(8) << setfill(' ') << "N MC tracks" << ' ';
26 msg << setw(12) << setfill(' ') << "MC tr" << ' ';
27 msg << setw(8) << setfill(' ') << "IsGhost" << ' ';
28 msg << setw(8) << setfill(' ') << "Max.pur." << ' ';
29 msg << '\n';
30 }
31 else {
32
33
34 msg << setw(12) << setfill(' ') << GetP() << ' ';
35 msg << setw(12) << setfill(' ') << GetTx() << ' ';
36 msg << setw(8) << setfill(' ') << GetNofHits() << ' ';
37 msg << setw(8) << setfill(' ') << GetNofMCTracks() << ' ';
38 msg << setw(12) << setfill(' ') << GetMatchedMCTrackIndex() << ' ';
39 msg << setw(8) << setfill(' ') << IsGhost() << ' ';
40 msg << setw(8) << setfill(' ') << GetMaxPurity() << ' ';
41 msg << '\n';
42 if (verbose > 0) {
43 msg << "\thits: ";
44 for (int iH : GetHitIndexes()) {
45 msg << iH << ' ';
46 }
47 msg << "\n\tmc tracks:";
48 for (int iT : GetMCTrackIndexes()) {
49 msg << iT << ' ';
50 }
51 }
52 }
53 return msg.str();
54}
const auto & GetMCTrackIndexes() const
Gets a reference to MC track indexes.
Definition CbmL1Track.h:68
double GetMaxPurity() const
Gets max purity.
Definition CbmL1Track.h:71
const auto & GetHitIndexes() const
Gets hit indexes.
Definition CbmL1Track.h:64
int GetNofHits() const
Gets number of hits of the track.
Definition CbmL1Track.h:79
std::string ToString(int verbose=10, bool header=false) const
Provides a string representation of object.
bool IsGhost() const
Definition CbmL1Track.h:55
int GetMatchedMCTrackIndex() const
Gets index of matched MC track.
Definition CbmL1Track.h:76
int GetNofMCTracks() const
Gets number of associated MC tracks.
Definition CbmL1Track.h:82