47std::vector<CbmTrdDigi*>
PermutateDigis(std::vector<CbmTrdDigi*> digis,
double timeSeparation = 3000)
49 std::vector<CbmTrdDigi*> digisPermutated;
52 for (
size_t i = 0; i < digis.size(); ++i)
59 digisPermutated.push_back(digis.at(e));
60 digisPermutated.back()->SetTime(digis.at(e)->GetTime() + timeAdd);
62 timeAdd += timeSeparation;
63 }
while (std::next_permutation(
v.begin(),
v.end()));
65 std::sort(digisPermutated.begin(), digisPermutated.end(),
68 return digisPermutated;
74 std::vector<std::pair<CbmTrdDigi, int32_t>> inVec;
77 for (
auto digi : digis)
78 inVec.push_back(std::make_pair<CbmTrdDigi, int32_t>(std::move(*digi), idx++));
94TEST(_GTestTrdClusterizer, Check3PadCluster)
98 std::vector<CbmTrdDigi*> digis;
105 int nPermutations = digisPermutated.size() / digis.size();
111 EXPECT_EQ(clusters.size(), nPermutations);
112 EXPECT_EQ(std::count(clusterSizes.begin(), clusterSizes.end(), 3), nPermutations);
143TEST(_GTestTrdClusterizer, Check2PadLeftNTCluster)
147 std::vector<CbmTrdDigi*> digis;
157 EXPECT_EQ(clusters.size(), 2);
158 EXPECT_EQ(std::count(clusterSizes.begin(), clusterSizes.end(), 2), 2);
162TEST(_GTestTrdClusterizer, Check2PadRightNTCluster)
166 std::vector<CbmTrdDigi*> digis;
176 EXPECT_EQ(clusters.size(), 2);
177 EXPECT_EQ(std::count(clusterSizes.begin(), clusterSizes.end(), 2), 2);
182TEST(_GTestTrdClusterizer, Check2PadWithSTOnNextRowCluster)
186 std::vector<CbmTrdDigi*> digis;
194 int nPermutations = digisPermutated.size() / digis.size();
200 EXPECT_EQ(clusters.size(), nPermutations * 2);
201 EXPECT_EQ(std::count(clusterSizes.begin(), clusterSizes.end(), 2), nPermutations);
202 EXPECT_EQ(std::count(clusterSizes.begin(), clusterSizes.end(), 1), nPermutations);
205TEST(_GTestTrdClusterizer, Check2PadWithNTOnNextRowCluster)
209 std::vector<CbmTrdDigi*> digis;
217 int nPermutations = digisPermutated.size() / digis.size();
223 EXPECT_EQ(clusters.size(), nPermutations);
224 EXPECT_EQ(std::count(clusterSizes.begin(), clusterSizes.end(), 2), nPermutations);
227TEST(_GTestTrdClusterizer, Check2PadWithSTOnPrevRowCluster)
231 std::vector<CbmTrdDigi*> digis;
239 int nPermutations = digisPermutated.size() / digis.size();
245 EXPECT_EQ(clusters.size(), nPermutations * 2);
246 EXPECT_EQ(std::count(clusterSizes.begin(), clusterSizes.end(), 2), nPermutations);
247 EXPECT_EQ(std::count(clusterSizes.begin(), clusterSizes.end(), 1), nPermutations);
250TEST(_GTestTrdClusterizer, Check2PadWithNTOnPrevRowCluster)
254 std::vector<CbmTrdDigi*> digis;
262 int nPermutations = digisPermutated.size() / digis.size();
268 EXPECT_EQ(clusters.size(), nPermutations);
269 EXPECT_EQ(std::count(clusterSizes.begin(), clusterSizes.end(), 2), nPermutations);
272TEST(_GTestTrdClusterizer, CheckAdjacent3PadClusters)
276 std::vector<CbmTrdDigi*> digis;
286 int nPermutations = digisPermutated.size() / digis.size();
292 EXPECT_EQ(clusters.size(), nPermutations * 2);
293 EXPECT_EQ(std::count(clusterSizes.begin(), clusterSizes.end(), 3), nPermutations * 2);
296TEST(_GTestTrdClusterizer, Check3PadWithSingleNTCluster)
300 std::vector<CbmTrdDigi*> digis;
308 int nPermutations = digisPermutated.size() / digis.size();
314 EXPECT_EQ(clusters.size(), nPermutations);
315 EXPECT_EQ(std::count(clusterSizes.begin(), clusterSizes.end(), 3), nPermutations);
318TEST(_GTestTrdClusterizer, CheckLeftAndRightBordersFullyTriggered)
322 std::vector<CbmTrdDigi*> digis;
324 for (
int row = 0; row < 24; ++row) {
334 EXPECT_EQ(clusters.size(), 48);
335 EXPECT_EQ(std::count(clusterSizes.begin(), clusterSizes.end(), 1), 48);
394TEST(_GTestTrdClusterizer, CheckTimeDistanceSmallEnough)
398 std::vector<CbmTrdDigi*> digis;
407 int nPermutations = digisPermutated.size() / digis.size();
413 EXPECT_EQ(clusters.size(), nPermutations);
414 EXPECT_EQ(std::count(clusterSizes.begin(), clusterSizes.end(), 4), nPermutations);
417TEST(_GTestTrdClusterizer, CheckTimeDistanceTooHigh)
421 std::vector<CbmTrdDigi*> digis;
430 int nPermutations = digisPermutated.size() / digis.size();
436 EXPECT_EQ(clusters.size(), nPermutations * 2);
437 EXPECT_EQ(std::count(clusterSizes.begin(), clusterSizes.end(), 2), nPermutations * 2);