CbmRoot
compareCluster.h
Go to the documentation of this file.
1 #ifndef COMPARECLUSTER_H
2 #define COMPARECLUSTER_H 1
3 
4 #include "CbmCluster.h"
5 #include "CbmMatch.h"
6 
7 #include "compareMatch.h"
8 
10  Int_t vectorsize,
11  std::vector<Int_t> indices,
12  Int_t address,
13  CbmMatch* match) {
14  Int_t retValInt {-111};
15 
16  retValInt = test.GetNofDigis();
17  EXPECT_EQ(vectorsize, retValInt);
18 
19  if (vectorsize > 0) {
20  for (Int_t counter = 0; counter < vectorsize; ++counter) {
21  retValInt = test.GetDigi(counter);
22  EXPECT_EQ(indices[counter], retValInt);
23  }
24  std::vector<Int_t> compare = test.GetDigis();
25  EXPECT_TRUE(std::equal(indices.begin(), indices.end(), compare.begin()));
26  }
27 
28  retValInt = test.GetAddress();
29  EXPECT_EQ(address, retValInt);
30 
31  if (match != nullptr) {
33  *test.GetMatch(), match->GetNofLinks(), match->GetTotalWeight());
34  } else {
35  EXPECT_EQ(match, test.GetMatch());
36  }
37 }
38 
39 #endif // COMPARECLUSTER_H
CbmMatch
Definition: CbmMatch.h:22
compareMatch.h
CbmMatch::GetNofLinks
Int_t GetNofLinks() const
Definition: CbmMatch.h:38
CbmMatch.h
CbmCluster::GetNofDigis
Int_t GetNofDigis() const
Number of digis in cluster.
Definition: CbmCluster.h:69
CbmMatch::GetTotalWeight
Double_t GetTotalWeight() const
Definition: CbmMatch.h:39
compareClusterDataMembers
void compareClusterDataMembers(CbmCluster &test, Int_t vectorsize, std::vector< Int_t > indices, Int_t address, CbmMatch *match)
Definition: compareCluster.h:9
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
compareMatchDataMembers
void compareMatchDataMembers(CbmMatch &testMatch, Int_t noflinks, Double_t weight)
Definition: compareMatch.h:7
counter
int counter
Definition: CbmMvdSensorDigiToHitTask.cxx:72
CbmCluster
Base class for cluster objects.
Definition: CbmCluster.h:26
CbmCluster.h
Base class for cluster objects.
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