CbmRoot
CbmCluster.h
Go to the documentation of this file.
1 
8 #ifndef CBMCLUSTER_H_
9 #define CBMCLUSTER_H_
10 
11 #include <Rtypes.h> // for THashConsistencyHolder, ClassDef
12 #include <RtypesCore.h> // for Int_t
13 #include <TObject.h> // for TObject
14 
15 #include <string> // for string
16 #include <vector> // for vector
17 
18 class CbmMatch;
19 
26 class CbmCluster : public TObject {
27 public:
31  CbmCluster();
32  CbmCluster(const std::vector<Int_t>& indices, Int_t address);
33  CbmCluster(const CbmCluster&);
34  CbmCluster(CbmCluster&& other) noexcept;
36  CbmCluster& operator=(CbmCluster&&) noexcept;
37 
41  virtual ~CbmCluster();
42 
47  void AddDigi(Int_t index) { fDigis.push_back(index); }
48 
53  void AddDigis(const std::vector<Int_t>& indices) {
54  fDigis.insert(fDigis.end(), indices.begin(), indices.end());
55  }
56 
61  void SetDigis(const std::vector<Int_t>& indices) {
62  fDigis.assign(indices.begin(), indices.end());
63  }
64 
69  Int_t GetNofDigis() const { return fDigis.size(); }
70 
76  Int_t GetDigi(Int_t index) const { return fDigis[index]; }
77 
82  const std::vector<Int_t>& GetDigis() const { return fDigis; }
83 
87  void ClearDigis() { fDigis.clear(); }
88 
90  Int_t GetAddress() const { return fAddress; }
91  CbmMatch* GetMatch() const { return fMatch; }
92 
94  void SetAddress(Int_t address) { fAddress = address; }
95  void SetMatch(CbmMatch* match);
96 
101  virtual std::string ToString() const;
102 
103 private:
104  std::vector<Int_t> fDigis;
105  Int_t fAddress;
107 
109 };
110 
111 #endif /* CBMCLUSTER_H_ */
CbmCluster::fDigis
std::vector< Int_t > fDigis
Array of digi indices.
Definition: CbmCluster.h:104
CbmMatch
Definition: CbmMatch.h:22
CbmCluster::AddDigi
void AddDigi(Int_t index)
Add digi to cluster.
Definition: CbmCluster.h:47
CbmCluster::SetMatch
void SetMatch(CbmMatch *match)
Definition: CbmCluster.cxx:68
CbmCluster::fMatch
CbmMatch * fMatch
link to Monte-Carlo information
Definition: CbmCluster.h:106
CbmCluster::GetNofDigis
Int_t GetNofDigis() const
Number of digis in cluster.
Definition: CbmCluster.h:69
CbmCluster::ToString
virtual std::string ToString() const
Return string representation of the object.
Definition: CbmCluster.cxx:74
CbmCluster::ClassDef
ClassDef(CbmCluster, 2)
CbmCluster::ClearDigis
void ClearDigis()
Remove all digis.
Definition: CbmCluster.h:87
CbmCluster::GetDigis
const std::vector< Int_t > & GetDigis() const
Get array of digi indices.
Definition: CbmCluster.h:82
CbmCluster::GetAddress
Int_t GetAddress() const
Definition: CbmCluster.h:90
CbmCluster::~CbmCluster
virtual ~CbmCluster()
Destructor.
Definition: CbmCluster.cxx:66
CbmCluster::SetDigis
void SetDigis(const std::vector< Int_t > &indices)
Set array of digi to cluster. Overwrites existing array.
Definition: CbmCluster.h:61
CbmCluster::operator=
CbmCluster & operator=(const CbmCluster &)
Definition: CbmCluster.cxx:43
CbmCluster::SetAddress
void SetAddress(Int_t address)
Definition: CbmCluster.h:94
CbmCluster
Base class for cluster objects.
Definition: CbmCluster.h:26
CbmCluster::AddDigis
void AddDigis(const std::vector< Int_t > &indices)
Add array of digi to cluster.
Definition: CbmCluster.h:53
CbmCluster::GetDigi
Int_t GetDigi(Int_t index) const
Get digi at position index.
Definition: CbmCluster.h:76
CbmCluster::GetMatch
CbmMatch * GetMatch() const
Definition: CbmCluster.h:91
CbmCluster::CbmCluster
CbmCluster()
Constructor.
Definition: CbmCluster.cxx:18
CbmCluster::fAddress
Int_t fAddress
Unique detector ID.
Definition: CbmCluster.h:105