EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BinningDataTests.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file BinningDataTests.cpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2017-2018 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
9 #include <boost/test/unit_test.hpp>
10 
14 
15 #include <cmath>
16 
17 namespace Acts {
18 namespace Test {
19 
20 namespace tt = boost::test_tools;
21 
22 // the test positions in 3D
23 Vector3D xyzPosition(0.5, 1.5, 2.5);
24 Vector3D xyzPositionOutside(30., -30., 200.);
25 Vector3D phi0Position(0.5, 0., 2.5);
26 Vector3D phiPihPosition(0., 1.5, 2.5);
27 Vector3D eta0Position(0.5, 1.5, 0.);
28 // the test positions in 2D
29 Vector2D xyPosition(0.5, 1.5);
30 Vector2D rphizPosition(0.1, 2.5);
31 Vector2D rphiPosition(3.5, M_PI / 8.);
32 
33 // the binnings - equidistant
34 // x/y/zData
35 // bin boundaries
36 // | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
37 BinningData xData_eq(open, binX, 10, 0., 10.);
38 BinningData yData_eq(open, binY, 10, 0., 10.);
39 BinningData zData_eq(open, binZ, 10, 0., 10.);
40 // r/phi/rphiData
41 // bin boundaries
42 // | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
43 BinningData rData_eq(open, binR, 10, 0., 10.);
44 // bin boundaries
45 // > -M_PI | -3/5 M_PI | -1/5 M_PI | 1/5 M_PI | 3/5 M_PI | M_PI <
46 BinningData phiData_eq(closed, binPhi, 5, -M_PI, M_PI);
47 BinningData rPhiData_eq(closed, binRPhi, 5, -M_PI, M_PI);
48 // h/etaData
49 // bin boundaries
50 // | 0 | 2 | 4 | 6 | 8 | 10 |
51 BinningData hData_eq(open, binH, 5, 0., 10.);
52 // | -2.5 | -1.5 | -0.5 | 0.5 | 1.5 | 2.5 |
53 BinningData etaData_eq(open, binEta, 5, -2.5, 2.5);
54 
55 // the binnings - arbitrary
56 std::vector<float> values = {0., 1., 2., 3., 4., 10.};
57 // bin boundaries
58 // | 0 | 1 | 2 | 3 | 4 | 10 |
61 // | -M_PI | -2 | -1 | 1 | 2 | M_PI |
62 std::vector<float> phiValues = {-M_PI, -2., -1., 1., 2., M_PI};
64 
65 // the binnings - arbitrary when switching to binary search - for boundary
66 // sizes >= 50
67 size_t nBins_binary = 59;
68 double valueMin = 0.;
69 double phiMin = -M_PI;
70 double delta = 0.5;
71 double phiDelta = 0.1064;
72 
73 // the binning - substructure
74 std::vector<float> sstr = {0., 1., 1.5, 2., 3.};
75 // multiplicative
76 auto xData_sstr_mult = std::make_unique<const BinningData>(open, binX, sstr);
77 // | 0 | 1 | 1.5 | 2 | 3 | 4 | 4.5 | 5 | 6 | 7 | 7.5 | 8 | 9 |
78 BinningData xData_mult(open, binX, 3, 0., 9., std::move(xData_sstr_mult));
80 // | 0 | 1 | 1.5 | 2 | 3 | 4 | 5 |
81 std::vector<float> main_sstr = {0., 3., 4., 5.};
82 auto xData_sstr_add = std::make_unique<const BinningData>(open, binX, sstr);
84 
85 // enum BinningValue { binX, binY, binZ, binR, binPhi, binRPhi, binH, binEta }
86 //
87 // test the different binning values
88 BOOST_AUTO_TEST_CASE(BinningData_BinningValue) {
89  // the binnings - arbitrary when switching to binary search - for boundary
90  // sizes >= 50
91  std::vector<float> values_binary;
92  std::vector<float> phiValues_binary;
93  for (size_t i = 0; i <= nBins_binary; i++) {
94  values_binary.push_back(valueMin + i * delta);
95  phiValues_binary.push_back(phiMin + i * phiDelta);
96  }
97  // bin boundaries when switching to binary search - for boundary sizes >= 50
98  BinningData xData_arb_binary(open, binX, values_binary);
99  BinningData phiData_arb_binary(closed, binPhi, phiValues_binary);
102  // | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
103  BOOST_CHECK_EQUAL(xData_eq.bins(), size_t(10));
104  // | 0 | 1 | 2 | 3 | 4 | 10 |
105  BOOST_CHECK_EQUAL(xData_arb.bins(), size_t(5));
106  // | 0 | 1 | 1.5 | 2 | 3 | 4 | 4.5 | 5 | 6 | 7 | 7.5 | 8 | 9 |
107  BOOST_CHECK_EQUAL(xData_mult.bins(), size_t(12));
108  // | 0 | 1 | 1.5 | 2 | 3 | 4 | 5 |
109  BOOST_CHECK_EQUAL(xData_add.bins(), size_t(6));
110  BOOST_CHECK_EQUAL(xData_arb_binary.bins(), nBins_binary);
111 
113  BOOST_CHECK_EQUAL(xData_eq.value(xyzPosition), 0.5);
114  BOOST_CHECK_EQUAL(yData_eq.value(xyzPosition), 1.5);
115  BOOST_CHECK_EQUAL(zData_eq.value(xyzPosition), 2.5);
116  BOOST_CHECK_EQUAL(xData_arb.value(xyzPosition), 0.5);
117  BOOST_CHECK_EQUAL(xData_mult.value(xyzPosition), 0.5);
118  BOOST_CHECK_EQUAL(xData_add.value(xyzPosition), 0.5);
119  BOOST_CHECK_EQUAL(xData_arb_binary.value(xyzPosition), 0.5);
120 
122  BOOST_CHECK_EQUAL(xData_eq.value(xyPosition), 0.5);
123  BOOST_CHECK_EQUAL(yData_eq.value(xyPosition), 1.5);
124  BOOST_CHECK_EQUAL(zData_eq.value(rphizPosition), 2.5);
125  BOOST_CHECK_EQUAL(xData_arb.value(xyPosition), 0.5);
126  BOOST_CHECK_EQUAL(xData_mult.value(xyPosition), 0.5);
127  BOOST_CHECK_EQUAL(xData_add.value(xyPosition), 0.5);
128  BOOST_CHECK_EQUAL(xData_arb_binary.value(xyPosition), 0.5);
129 
130  // r/phi/rphiData
131  CHECK_CLOSE_REL(rData_eq.value(xyzPosition), sqrt(0.5 * 0.5 + 1.5 * 1.5),
132  1e-5);
133  BOOST_CHECK_EQUAL(rData_eq.value(rphiPosition), 3.5);
134 
137 
138  BOOST_CHECK_EQUAL(phiData_eq.bins(), size_t(5));
139  BOOST_CHECK_EQUAL(phiData_arb.bins(), size_t(5));
140  BOOST_CHECK_EQUAL(phiData_arb_binary.bins(), size_t(nBins_binary));
141 
142  // h/etaData
144 }
145 
146 // test bin values
147 BOOST_AUTO_TEST_CASE(BinningData_bins) {
148  // the binnings - arbitrary when switching to binary search - for boundary
149  // sizes >= 50
150  std::vector<float> values_binary;
151  std::vector<float> phiValues_binary;
152  for (size_t i = 0; i <= nBins_binary; i++) {
153  values_binary.push_back(valueMin + i * delta);
154  phiValues_binary.push_back(phiMin + i * phiDelta);
155  }
156  // bin boundaries when switching to binary search - for boundary sizes >= 50
157  BinningData xData_arb_binary(open, binX, values_binary);
158  BinningData phiData_arb_binary(closed, binPhi, phiValues_binary);
161  // | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
162  BOOST_CHECK_EQUAL(xData_eq.searchGlobal(xyzPosition), size_t(0));
163  BOOST_CHECK_EQUAL(yData_eq.searchGlobal(xyzPosition), size_t(1));
164  BOOST_CHECK_EQUAL(zData_eq.searchGlobal(xyzPosition), size_t(2));
165  // | 0 | 1 | 2 | 3 | 4 | 10 |
166  BOOST_CHECK_EQUAL(xData_arb.searchGlobal(xyzPosition), size_t(0));
167  BOOST_CHECK_EQUAL(xData_arb.search(6.), size_t(4));
168  BOOST_CHECK_EQUAL(xData_arb_binary.searchGlobal(xyzPosition), size_t(1));
169  BOOST_CHECK_EQUAL(xData_arb_binary.search(50.), (nBins_binary - 1));
170  // | 0 | 1 | 1.5 | 2 | 3 | 4 | 5 |
171  BOOST_CHECK_EQUAL(xData_add.searchGlobal(xyzPosition), size_t(0));
172  BOOST_CHECK_EQUAL(xData_add.searchGlobal(xyzPosition), size_t(0));
173  BOOST_CHECK_EQUAL(xData_add.search(0.2), size_t(0));
174  BOOST_CHECK_EQUAL(xData_add.search(1.2), size_t(1));
175  BOOST_CHECK_EQUAL(xData_add.search(1.7), size_t(2));
176  BOOST_CHECK_EQUAL(xData_add.search(2.5), size_t(3));
177  BOOST_CHECK_EQUAL(xData_add.search(3.5), size_t(4));
178  BOOST_CHECK_EQUAL(xData_add.search(4.2), size_t(5));
179  BOOST_CHECK_EQUAL(xData_add.search(7.), size_t(5));
180  // | 0 | 1 | 1.5 | 2 | 3 | 4 | 4.5 | 5 | 6 | 7 | 7.5 | 8 | 9 |
181  BOOST_CHECK_EQUAL(xData_mult.searchGlobal(xyzPosition), size_t(0));
182  BOOST_CHECK_EQUAL(xData_mult.search(0.2), size_t(0));
183  BOOST_CHECK_EQUAL(xData_mult.search(1.2), size_t(1));
184  BOOST_CHECK_EQUAL(xData_mult.search(1.7), size_t(2));
185  BOOST_CHECK_EQUAL(xData_mult.search(2.5), size_t(3));
186  BOOST_CHECK_EQUAL(xData_mult.search(3.5), size_t(4));
187  BOOST_CHECK_EQUAL(xData_mult.search(4.2), size_t(5));
188  BOOST_CHECK_EQUAL(xData_mult.search(4.7), size_t(6));
189  BOOST_CHECK_EQUAL(xData_mult.search(5.7), size_t(7));
190  BOOST_CHECK_EQUAL(xData_mult.search(6.5), size_t(8));
191  BOOST_CHECK_EQUAL(xData_mult.search(7.2), size_t(9));
192  BOOST_CHECK_EQUAL(xData_mult.search(7.7), size_t(10));
193  BOOST_CHECK_EQUAL(xData_mult.search(8.1), size_t(11));
194 
196  BOOST_CHECK_EQUAL(xData_eq.searchLocal(xyPosition), size_t(0));
197  BOOST_CHECK_EQUAL(yData_eq.searchLocal(xyPosition), size_t(1));
198  BOOST_CHECK_EQUAL(zData_eq.searchLocal(rphizPosition), size_t(2));
199  BOOST_CHECK_EQUAL(xData_arb.searchLocal(xyPosition), size_t(0));
200  BOOST_CHECK_EQUAL(xData_arb_binary.searchLocal(xyPosition), size_t(1));
201 
202  // r/phi/rphiData
203  BOOST_CHECK_EQUAL(rData_eq.searchGlobal(xyzPosition), size_t(1));
204  BOOST_CHECK_EQUAL(rData_eq.searchLocal(rphiPosition), size_t(3));
205  BOOST_CHECK_EQUAL(phiData_eq.searchGlobal(phi0Position), size_t(2));
206  BOOST_CHECK_EQUAL(phiData_eq.searchGlobal(phiPihPosition), size_t(3));
207  BOOST_CHECK_EQUAL(phiData_arb_binary.search(M_PI), size_t(0));
208 
209  // h/etaData
210  BOOST_CHECK_EQUAL(etaData_eq.searchGlobal(eta0Position), size_t(2));
211 }
212 
213 // test inside/outside
214 BOOST_AUTO_TEST_CASE(BinningData_inside_outside) {
215  // the binnings - arbitrary when switching to binary search - for boundary
216  // sizes >= 50
217  std::vector<float> values_binary;
218  std::vector<float> phiValues_binary;
219  for (size_t i = 0; i <= nBins_binary; i++) {
220  values_binary.push_back(valueMin + i * delta);
221  phiValues_binary.push_back(phiMin + i * phiDelta);
222  }
223  // bin boundaries when switching to binary search - for boundary sizes >= 50
224  BinningData xData_arb_binary(open, binX, values_binary);
225  BinningData phiData_arb_binary(closed, binPhi, phiValues_binary);
226  // check the global inside
227  BOOST_CHECK_EQUAL(xData_eq.inside(xyzPosition), true);
228  BOOST_CHECK_EQUAL(yData_eq.inside(xyzPosition), true);
229  BOOST_CHECK_EQUAL(zData_eq.inside(xyzPosition), true);
230  BOOST_CHECK_EQUAL(xData_arb.inside(xyzPosition), true);
231  BOOST_CHECK_EQUAL(xData_add.inside(xyzPosition), true);
232  BOOST_CHECK_EQUAL(xData_mult.inside(xyzPosition), true);
233  BOOST_CHECK_EQUAL(xData_arb_binary.inside(xyzPosition), true);
234 
235  // check the global outside
236  BOOST_CHECK_EQUAL(xData_eq.inside(xyzPositionOutside), false);
237  BOOST_CHECK_EQUAL(yData_eq.inside(xyzPositionOutside), false);
238  BOOST_CHECK_EQUAL(zData_eq.inside(xyzPositionOutside), false);
239  BOOST_CHECK_EQUAL(xData_arb.inside(xyzPositionOutside), false);
240  BOOST_CHECK_EQUAL(xData_add.inside(xyzPositionOutside), false);
241  BOOST_CHECK_EQUAL(xData_mult.inside(xyzPositionOutside), false);
242  BOOST_CHECK_EQUAL(xData_arb_binary.inside(xyzPositionOutside), false);
243 
244  // cthe local inside
245  BOOST_CHECK_EQUAL(xData_eq.inside(xyPosition), true);
246  BOOST_CHECK_EQUAL(yData_eq.inside(xyPosition), true);
247  BOOST_CHECK_EQUAL(zData_eq.inside(rphizPosition), true);
248 
249  // r/phi/rphiData inside
250  BOOST_CHECK_EQUAL(phiData_eq.inside(phi0Position), true);
251  BOOST_CHECK_EQUAL(phiData_eq.inside(phiPihPosition), true);
253  BOOST_CHECK_EQUAL(etaData_eq.inside(eta0Position), true);
254 }
255 
256 // test open/close
257 BOOST_AUTO_TEST_CASE(BinningData_open_close) {
258  // the binnings - arbitrary when switching to binary search - for boundary
259  // sizes >= 50
260  std::vector<float> values_binary;
261  std::vector<float> phiValues_binary;
262  for (size_t i = 0; i <= nBins_binary; i++) {
263  values_binary.push_back(valueMin + i * delta);
264  phiValues_binary.push_back(phiMin + i * phiDelta);
265  }
266  // bin boundaries when switching to binary search - for boundary sizes >= 50
267  BinningData xData_arb_binary(open, binX, values_binary);
268  BinningData phiData_arb_binary(closed, binPhi, phiValues_binary);
269  // open values
270  BOOST_CHECK_EQUAL(xData_eq.searchGlobal(xyzPositionOutside), size_t(9));
271  BOOST_CHECK_EQUAL(yData_eq.searchGlobal(xyzPositionOutside), size_t(0));
272  BOOST_CHECK_EQUAL(zData_eq.searchGlobal(xyzPositionOutside), size_t(9));
273  BOOST_CHECK_EQUAL(xData_arb.searchGlobal(xyzPositionOutside) + 1,
274  xData_arb.bins());
275  BOOST_CHECK_EQUAL(xData_arb_binary.searchGlobal(xyzPositionOutside) + 1,
276  xData_arb_binary.bins());
277  BOOST_CHECK_EQUAL(yData_arb.searchGlobal(xyzPositionOutside), size_t(0));
278 
279  // increment an open bin
280  // - for equidistant
281  size_t bin = 9;
282  xData_eq.increment(bin);
283  BOOST_CHECK_EQUAL(bin, size_t(9));
284  bin = 0;
285  xData_eq.decrement(bin);
286  BOOST_CHECK_EQUAL(bin, size_t(0));
287  // - for arbitrary
288  bin = 5;
289  xData_arb.increment(bin);
290  BOOST_CHECK_EQUAL(bin, size_t(5));
291  bin = 0;
292  xData_arb.decrement(bin);
293  BOOST_CHECK_EQUAL(bin, size_t(0));
294 
295  bin = nBins_binary;
296  xData_arb_binary.increment(bin);
297  BOOST_CHECK_EQUAL(bin, nBins_binary);
298  bin = 0;
299  xData_arb_binary.decrement(bin);
300  BOOST_CHECK_EQUAL(bin, size_t(0));
301 
302  // closed values
303  BOOST_CHECK_EQUAL(phiData_eq.search(-4.), size_t(4));
304  BOOST_CHECK_EQUAL(phiData_eq.search(4.), size_t(0));
305  BOOST_CHECK_EQUAL(phiData_arb.search(-4.), size_t(4));
306  BOOST_CHECK_EQUAL(phiData_arb.search(4.), size_t(0));
307  BOOST_CHECK_EQUAL(phiData_arb_binary.search(-4.), (nBins_binary - 1));
308  BOOST_CHECK_EQUAL(phiData_arb_binary.search(4.), size_t(0));
309 
310  bin = 4;
311  phiData_eq.increment(bin);
312  BOOST_CHECK_EQUAL(bin, size_t(0));
313  bin = 0;
314  phiData_eq.decrement(bin);
315  BOOST_CHECK_EQUAL(bin, size_t(4));
316 
317  bin = 4;
318  phiData_arb.increment(bin);
319  BOOST_CHECK_EQUAL(bin, size_t(0));
320  bin = 0;
321  phiData_arb.decrement(bin);
322  BOOST_CHECK_EQUAL(bin, size_t(4));
323 
324  bin = nBins_binary;
325  phiData_arb_binary.increment(bin);
326  BOOST_CHECK_EQUAL(bin, size_t(0));
327  bin = 0;
328  phiData_arb_binary.decrement(bin);
329  BOOST_CHECK_EQUAL(bin, (nBins_binary - 1));
330 }
331 
332 // test boundaries
333 BOOST_AUTO_TEST_CASE(BinningData_boundaries) {
334  // open values
335  std::vector<float> boundaries = {0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10.};
336  BOOST_CHECK_EQUAL_COLLECTIONS(xData_eq.boundaries().begin(),
337  xData_eq.boundaries().end(), boundaries.begin(),
338  boundaries.end());
339 
340  float phiStep = M_PI * 2. / 5.;
341  std::vector<float> phiBoundaries_eq = {-M_PI,
342  float(-M_PI + 1 * phiStep),
343  float(-M_PI + 2 * phiStep),
344  float(-M_PI + 3 * phiStep),
345  float(-M_PI + 4 * phiStep),
346  float(-M_PI + 5 * phiStep)};
347  CHECK_CLOSE_REL(phiData_eq.boundaries(), phiBoundaries_eq, 1e-5);
348 }
349 
350 // test bin center values
351 // test boundaries
352 BOOST_AUTO_TEST_CASE(BinningData_bincenter) {
353  // the binnings - arbitrary when switching to binary search - for boundary
354  // sizes >= 50
355  std::vector<float> values_binary;
356  std::vector<float> phiValues_binary;
357  for (size_t i = 0; i <= nBins_binary; i++) {
358  values_binary.push_back(valueMin + i * delta);
359  phiValues_binary.push_back(phiMin + i * phiDelta);
360  }
361  // bin boundaries when switching to binary search - for boundary sizes >= 50
362  BinningData xData_arb_binary(open, binX, values_binary);
363  BinningData phiData_arb_binary(closed, binPhi, phiValues_binary);
365  // | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
366  BOOST_CHECK_EQUAL(xData_eq.center(3), 3.5);
367  // | 0 | 1 | 2 | 3 | 4 | 10 |
368  BOOST_CHECK_EQUAL(xData_arb.center(4), 7.);
369  // | 0 | 1 | 1.5 | 2 | 3 | 4 | 5 |
370  BOOST_CHECK_EQUAL(xData_add.center(0), 0.5);
371  BOOST_CHECK_EQUAL(xData_add.center(1), 1.25);
372  BOOST_CHECK_EQUAL(xData_add.center(4), 3.5);
373  // | 0 | 1 | 1.5 | 2 | 3 | 4 | 4.5 | 5 | 6 | 7 | 7.5 | 8 | 9 |
374  BOOST_CHECK_EQUAL(xData_mult.center(0), 0.5);
375  BOOST_CHECK_EQUAL(xData_mult.center(1), 1.25);
376  BOOST_CHECK_EQUAL(xData_mult.center(4), 3.5);
377  BOOST_CHECK_EQUAL(xData_mult.center(10), 7.75);
378  BOOST_CHECK_EQUAL(xData_mult.center(11), 8.5);
379 
380  BOOST_CHECK_EQUAL(xData_arb_binary.center(0), 0.5 * delta);
381 
382  // open values
383  std::vector<float> center = {0.5, 1.5, 2.5, 3.5, 4.5,
384  5.5, 6.5, 7.5, 8.5, 9.5};
385  for (size_t ib = 0; ib < center.size(); ++ib) {
386  BOOST_CHECK_EQUAL(xData_eq.center(ib), center[ib]);
387  }
388 
389  // running into rounding errors here
390  float phiStep = M_PI * 2. / 5.;
391  std::vector<float> phiCenters_eq = {
392  float(-M_PI + 0.5 * phiStep), float(-M_PI + 1.5 * phiStep),
393  float(-M_PI + 2.5 * phiStep), float(-M_PI + 3.5 * phiStep),
394  float(-M_PI + 4.5 * phiStep)};
395 
396  for (size_t ib = 0; ib < phiCenters_eq.size(); ++ib) {
397  CHECK_CLOSE_ABS(phiData_eq.center(ib), phiCenters_eq[ib], 1e-3);
398  }
399 }
400 
401 // special test for phi binning
402 BOOST_AUTO_TEST_CASE(BinningData_phi_modules) {
403  // n phi modules with phi boundary at -M_Pi/+M_PI are checked above
404  // one module expands over -M_Pi/+M_PI
405  float deltaPhi = 0.1;
406  BinningData phiData_mod(closed, binPhi, 5, -M_PI + deltaPhi, M_PI + deltaPhi);
407  float phiStep = M_PI * 2. / 5.;
408  std::vector<float> phiBoundaries_mod = {
409  float(-M_PI + deltaPhi),
410  float(-M_PI + 1 * phiStep) + deltaPhi,
411  float(-M_PI + 2 * phiStep) + deltaPhi,
412  float(-M_PI + 3 * phiStep) + deltaPhi,
413  float(-M_PI + 4 * phiStep) + deltaPhi,
414  float(-M_PI + 5 * phiStep) + deltaPhi};
415  // this is the boundary test
416  CHECK_CLOSE_REL(phiData_mod.boundaries(), phiBoundaries_mod, 1e-5);
417 
418  // now test the bin jump 0/maxbin
419 
420  float firstAngle = (-M_PI + 1.5 * deltaPhi);
421  Vector3D firstBin(cos(firstAngle), sin(firstAngle), 0.);
422  BOOST_CHECK_EQUAL(phiData_mod.search(firstAngle), size_t(0));
423  BOOST_CHECK_EQUAL(phiData_mod.searchGlobal(firstBin), size_t(0));
424 
425  float firstAngleNeg = (-M_PI + 0.5 * deltaPhi);
426  Vector3D lastBinNeg(cos(firstAngleNeg), sin(firstAngleNeg), 0.);
427  BOOST_CHECK_EQUAL(phiData_mod.search(firstAngleNeg), size_t(4));
428  BOOST_CHECK_EQUAL(phiData_mod.searchGlobal(lastBinNeg), size_t(4));
429 
430  float lastAnglePos = (M_PI + 0.5 * deltaPhi);
431  Vector3D lastBinPos(cos(lastAnglePos), sin(lastAnglePos), 0.);
432  BOOST_CHECK_EQUAL(phiData_mod.search(lastAnglePos), size_t(4));
433  BOOST_CHECK_EQUAL(phiData_mod.searchGlobal(lastBinPos), size_t(4));
434 
435  // now test the (remaining) phi scaling
436  float underscaledAngle = -M_PI - 0.5 * deltaPhi;
437  Vector3D underscaledPos(cos(underscaledAngle), sin(underscaledAngle), 0.);
438  BOOST_CHECK_EQUAL(phiData_mod.search(underscaledAngle), size_t(4));
439  BOOST_CHECK_EQUAL(phiData_mod.searchGlobal(underscaledPos), size_t(4));
440 }
441 
442 } // namespace Test
443 } // namespace Acts