Belle II Software development
CurvRep.test.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 <tracking/trackFindingCDC/hough/perigee/Phi0Rep.h>
10#include <tracking/trackFindingCDC/hough/perigee/CurvRep.h>
11#include <tracking/trackFindingCDC/hough/boxes/Box.h>
12
13#include <gtest/gtest.h>
14
15using namespace Belle2;
16using namespace TrackFindingCDC;
17
18namespace {
19
20 TEST(TrackFindingCDCTest, hough_perigee_getCurvBounds)
21 {
22 DiscretePhi0::Array phi0Bounds{{0, M_PI}};
23 DiscreteCurv::Array discreteCurvBounds{{2.0, 4.0}};
24 ContinuousCurv::Array continuousCurvBounds{{2.0, 4.0}};
25
26 Box<DiscretePhi0, DiscreteCurv> phi0DiscreteCurvBox(DiscretePhi0::getRange(phi0Bounds),
27 DiscreteCurv::getRange(discreteCurvBounds));
28
29 EXPECT_EQ(2.0, getLowerCurv(phi0DiscreteCurvBox));
30 EXPECT_EQ(4.0, getUpperCurv(phi0DiscreteCurvBox));
31
32 Box<DiscretePhi0, ContinuousCurv> phi0ContinuousCurvBox(DiscretePhi0::getRange(phi0Bounds),
33 ContinuousCurv::getRange(continuousCurvBounds));
34
35 EXPECT_EQ(2.0, getLowerCurv(phi0ContinuousCurvBox));
36 EXPECT_EQ(4.0, getUpperCurv(phi0ContinuousCurvBox));
37
38
39 Box<DiscretePhi0> phi0Box(DiscretePhi0::getRange(phi0Bounds));
40
41 EXPECT_EQ(0.0, getLowerCurv(phi0Box));
42 EXPECT_EQ(0.0, getUpperCurv(phi0Box));
43
44 }
45}
The base class for all boxes.
Definition: Box.h:33
std::array< T, 2 > Array
Mock array type to be a drop in replacement for the discrete values.
static std::array< This, 2 > getRange(const Array &bounds)
Extract the range from an array providing the discrete values.
static std::array< This, 2 > getRange(Array &values)
Extract the range from an array providing the discrete values.
Definition: DiscreteValue.h:59
std::vector< T > Array
The type of the array which contains the underlying values.
Definition: DiscreteValue.h:55
Abstract base class for different kinds of events.