Belle II Software  release-05-01-25
overlapMatrixCreator.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2015 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Martin Heck *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #include <gtest/gtest.h>
12 
13 #include <tracking/trackFindingVXD/trackSetEvaluator/OverlapMatrixCreator.h>
14 
15 using namespace std;
16 using namespace Belle2;
17 
18 
20 class OverlapMatrixCreatorTest : public ::testing::Test {
21 protected:
23  vector<vector <unsigned short> > hitRelatedTracks =
24  //hit 0 1 2 3 4 5 6 7 8 9
25  {{1, 2, 3}, {0, 5, 7}, {5}, {1, 5, 9}, {1}, {4}, {4}, {7, 8, 9}, {8}, {0, 1}};
27  vector<vector <unsigned short> > smallOverlapTestMatrix =
28  //track 0 1 2 3 4 5 6 7 8 9
29  {{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}};
30 
32  vector<vector <unsigned short> > hitRelatedTracks2 =
33  {{0, 1, 2, 3}, {1, 2, 3}, {3, 4, 5, 6}, {2, 4}, {3, 5}};
35  vector<vector <unsigned short> > allowOneOverlapTestMatrix =
36  {{}, {2, 3}, {1, 3}, {1, 2, 5}, {}, {3}, {}};
37 
39  vector<vector <unsigned short> > hitRelatedTracks3 =
40  {{0, 1, 2, 3}, {1, 2, 3}, {3, 4, 5, 6}, {2, 3, 4}, {3, 5}};
42  vector<vector <unsigned short> > allowTwoOverlapTestMatrix =
43  {{}, {}, {3}, {2}, {}, {}, {}};
44 };
45 
47 {
48  OverlapMatrixCreator overlapMatrixCreator(hitRelatedTracks, 10);
49  EXPECT_EQ(smallOverlapTestMatrix, overlapMatrixCreator.getOverlapMatrix());
50 
51  OverlapMatrixCreator overlapMatrixCreator2(hitRelatedTracks2, 7);
52  EXPECT_EQ(allowOneOverlapTestMatrix, overlapMatrixCreator2.getOverlapMatrix(1));
53 
54  OverlapMatrixCreator overlapMatrixCreator3(hitRelatedTracks3, 7);
55  EXPECT_EQ(allowTwoOverlapTestMatrix, overlapMatrixCreator3.getOverlapMatrix(2));
56 }
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TEST_F
TEST_F(GlobalLabelTest, LargeNumberOfTimeDependentParameters)
Test large number of time-dep params for registration and retrieval.
Definition: globalLabel.cc:65
Belle2::OverlapMatrixCreator
Creates a vector of vectors, that knows which track is conflicting with which other.
Definition: OverlapMatrixCreator.h:29
OverlapMatrixCreatorTest
Test the overlap-matrix creator using known input.
Definition: overlapMatrixCreator.cc:20