CbmRoot
Loading...
Searching...
No Matches
CbmL1HitId.h
Go to the documentation of this file.
1/* Copyright (C) 2010-2023 Frankfurt Institute for Advanced Studies, Goethe-Universitaet Frankfurt, Frankfurt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Igor Kulakov [committer], Valentina Akishina, Maksym Zyzak, Sergei Zharko */
4
5#ifndef _CbmL1HitId_h_
6#define _CbmL1HitId_h_
7
8#include <cmath>
9#include <iomanip>
10#include <sstream>
11#include <string>
12#include <vector>
13
14// TODO: SZh: Complete the rule of five
15// TODO: SZh: Make variables private
16// TODO: SZh: Move class to ca::tools (ca::tools::Hit)
17
18
23 public:
24 CbmL1HitId() = default;
25 CbmL1HitId(int det, int index) : detId(det), hitId(index){};
26
29 std::string ToString(bool header = false) const
30 {
31 std::stringstream msg;
32 if (header) {
33 msg << std::setw(8) << std::setfill(' ') << "det. id" << ' ';
34 msg << std::setw(8) << std::setfill(' ') << "ext. id";
35 }
36 else {
37 msg << std::setw(8) << std::setfill(' ') << detId << ' ';
38 msg << std::setw(8) << std::setfill(' ') << hitId;
39 }
40 return msg.str();
41 }
42
43 int detId = -1;
44 int hitId = -1;
45};
46
47#endif
CbmL1HitId(int det, int index)
Definition CbmL1HitId.h:25
int detId
detector ID
Definition CbmL1HitId.h:43
CbmL1HitId()=default
std::string ToString(bool header=false) const
String representation of class object.
Definition CbmL1HitId.h:29
int hitId
index of hit in the TClonesArray array
Definition CbmL1HitId.h:44