Belle II Software  release-08-01-10
overlapMatrixCreator.cc
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 #include <gtest/gtest.h>
10 
11 #include <tracking/trackFindingVXD/trackSetEvaluator/OverlapMatrixCreator.h>
12 
13 using namespace std;
14 using namespace Belle2;
15 
16 
18 class OverlapMatrixCreatorTest : public ::testing::Test {
19 protected:
21  vector<vector <unsigned short> > hitRelatedTracks =
22  //hit 0 1 2 3 4 5 6 7 8 9
23  {{1, 2, 3}, {0, 5, 7}, {5}, {1, 5, 9}, {1}, {4}, {4}, {7, 8, 9}, {8}, {0, 1}};
25  vector<vector <unsigned short> > smallOverlapTestMatrix =
26  //track 0 1 2 3 4 5 6 7 8 9
27  {{1, 5, 7}, {0, 2, 3, 5, 9}, {1, 3}, {1, 2}, {}, {0, 1, 7, 9}, {}, {0, 5, 8, 9}, {7, 9}, {1, 5, 7, 8}};
28 
30  vector<vector <unsigned short> > hitRelatedTracks2 =
31  {{0, 1, 2, 3}, {1, 2, 3}, {3, 4, 5, 6}, {2, 4}, {3, 5}};
33  vector<vector <unsigned short> > allowOneOverlapTestMatrix =
34  {{}, {2, 3}, {1, 3}, {1, 2, 5}, {}, {3}, {}};
35 
37  vector<vector <unsigned short> > hitRelatedTracks3 =
38  {{0, 1, 2, 3}, {1, 2, 3}, {3, 4, 5, 6}, {2, 3, 4}, {3, 5}};
40  vector<vector <unsigned short> > allowTwoOverlapTestMatrix =
41  {{}, {}, {3}, {2}, {}, {}, {}};
42 };
43 
45 {
46  OverlapMatrixCreator overlapMatrixCreator(hitRelatedTracks, 10);
47  EXPECT_EQ(smallOverlapTestMatrix, overlapMatrixCreator.getOverlapMatrix());
48 
49  OverlapMatrixCreator overlapMatrixCreator2(hitRelatedTracks2, 7);
50  EXPECT_EQ(allowOneOverlapTestMatrix, overlapMatrixCreator2.getOverlapMatrix(1));
51 
52  OverlapMatrixCreator overlapMatrixCreator3(hitRelatedTracks3, 7);
53  EXPECT_EQ(allowTwoOverlapTestMatrix, overlapMatrixCreator3.getOverlapMatrix(2));
54 }
Creates a vector of vectors, that knows which track is conflicting with which other.
Test the overlap-matrix creator using known input.
TEST_F(GlobalLabelTest, LargeNumberOfTimeDependentParameters)
Test large number of time-dep params for registration and retrieval.
Definition: globalLabel.cc:72
Abstract base class for different kinds of events.