Belle II Software  release-05-01-25
CurvRep.test.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2015 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Oliver Frost, Thomas Hauth <thomas.hauth@kit.edu> *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #include <tracking/trackFindingCDC/hough/perigee/Phi0Rep.h>
12 #include <tracking/trackFindingCDC/hough/perigee/CurvRep.h>
13 #include <tracking/trackFindingCDC/hough/boxes/Box.h>
14 
15 #include <gtest/gtest.h>
16 
17 using namespace Belle2;
18 using namespace TrackFindingCDC;
19 
20 namespace {
21 
22  TEST(TrackFindingCDCTest, hough_perigee_getCurvBounds)
23  {
24  DiscretePhi0::Array phi0Bounds{{0, M_PI}};
25  DiscreteCurv::Array discreteCurvBounds{{2.0, 4.0}};
26  ContinuousCurv::Array continuousCurvBounds{{2.0, 4.0}};
27 
28  Box<DiscretePhi0, DiscreteCurv> phi0DiscreteCurvBox(DiscretePhi0::getRange(phi0Bounds),
29  DiscreteCurv::getRange(discreteCurvBounds));
30 
31  EXPECT_EQ(2.0, getLowerCurv(phi0DiscreteCurvBox));
32  EXPECT_EQ(4.0, getUpperCurv(phi0DiscreteCurvBox));
33 
34  Box<DiscretePhi0, ContinuousCurv> phi0ContinuousCurvBox(DiscretePhi0::getRange(phi0Bounds),
35  ContinuousCurv::getRange(continuousCurvBounds));
36 
37  EXPECT_EQ(2.0, getLowerCurv(phi0ContinuousCurvBox));
38  EXPECT_EQ(4.0, getUpperCurv(phi0ContinuousCurvBox));
39 
40 
41  Box<DiscretePhi0> phi0Box(DiscretePhi0::getRange(phi0Bounds));
42 
43  EXPECT_EQ(0.0, getLowerCurv(phi0Box));
44  EXPECT_EQ(0.0, getUpperCurv(phi0Box));
45 
46  }
47 }
Belle2::TrackFindingCDC::ContinuousValue::getRange
static std::array< This, 2 > getRange(const Array &bounds)
Extract the range from an array providing the discrete values.
Definition: ContinuousValue.h:50
Belle2::TrackFindingCDC::ContinuousValue::Array
std::array< T, 2 > Array
Mock array type to be a drop in replacement for the discrete values.
Definition: ContinuousValue.h:46
Belle2::TrackFindingCDC::DiscreteValue::getRange
static std::array< This, 2 > getRange(Array &values)
Extract the range from an array providing the discrete values.
Definition: DiscreteValue.h:69
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TEST
TEST(TestgetDetectorRegion, TestgetDetectorRegion)
Test Constructors.
Definition: utilityFunctions.cc:18
Belle2::TrackFindingCDC::DiscreteValue::Array
std::vector< T > Array
The type of the array which contains the underlying values.
Definition: DiscreteValue.h:65