Classes | Macros | Typedefs | Functions
geometry_thirdplaneslope_test.cxx File Reference

Simple unit test on a standard detector. More...

#include "test/Geometry/geometry_unit_test_base.h"
#include "larcorealg/TestUtils/boost_unit_test_base.h"
#include "larcoreobj/SimpleTypesAndConstants/PhysicalConstants.h"
#include "larcorealg/Geometry/GeometryCore.h"
#include "larcorealg/Geometry/ChannelMapStandardAlg.h"

Go to the source code of this file.

Classes

struct  StandardGeometryConfiguration
 

Macros

#define BOOST_TEST_MODULE   GeometryThirdPlaneSlopeTest
 

Typedefs

using SimpleGeometryTestFixture = testing::GeometryTesterEnvironment< StandardGeometryConfiguration >
 

Functions

 BOOST_AUTO_TEST_CASE (AllTests)
 

Detailed Description

Simple unit test on a standard detector.

Date
June 2nd, 2015
Author
petri.nosp@m.llo@.nosp@m.fnal..nosp@m.gov

Usage: just run the executable. Boost unit testing environment keeps the arguments secret anyway.

Definition in file geometry_thirdplaneslope_test.cxx.

Macro Definition Documentation

#define BOOST_TEST_MODULE   GeometryThirdPlaneSlopeTest

Definition at line 12 of file geometry_thirdplaneslope_test.cxx.

Typedef Documentation

Definition at line 52 of file geometry_thirdplaneslope_test.cxx.

Function Documentation

BOOST_AUTO_TEST_CASE ( AllTests  )

Definition at line 73 of file geometry_thirdplaneslope_test.cxx.

74 {
75  geo::GeometryCore const& geom = *(Provider<geo::GeometryCore>());
76 
77  const double angle_u = 1. / 3. * util::pi<double>();
78  const double angle_v = 2. / 3. * util::pi<double>();
79  const double angle_w = 1. / 2. * util::pi<double>();
80 
81  BOOST_TEST_MESSAGE(
82  "Wire angles: u=" << angle_u << " v=" << angle_v << " => w=" << angle_w
83  );
84 
85  const double slope_u = 1. / std::sqrt(3);
86  const double slope_v = 1. / std::sqrt(3);
87 
88  const double expected_slope_w = 0.5;
89 
90  double slope_w = geom.ComputeThirdPlaneSlope
91  (angle_u, slope_u, angle_v, slope_v, angle_w);
92 
93  BOOST_TEST_MESSAGE(
94  "Slopes: s(u)=" << slope_u << " s(v)=" << slope_v << " => s(w)=" << slope_w
95  );
96 
97  BOOST_TEST(slope_w == expected_slope_w, 0.01% tolerance());
98 
99 } // BOOST_AUTO_TEST_CASE( AllTests )
auto const tolerance
Description of geometry of one entire detector.
static double ComputeThirdPlaneSlope(double angle1, double slope1, double angle2, double slope2, double angle_target)
Returns the slope on the third plane, given it in the other two.