Classes | Macros | Functions
topology_test.cxx File Reference

Test for neighbourhood discovery in simple geometries. More...

#include "larcorealg/Geometry/BoxBoundedGeo.h"
#include <boost/test/unit_test.hpp>
#include <vector>
#include <iterator>
#include <algorithm>
#include <memory>
#include <cstdlib>

Go to the source code of this file.

Classes

struct  Neighbors_t
 

Macros

#define BOOST_TEST_MODULE   topology_test
 

Functions

void BoxedTopologyTest ()
 
 BOOST_AUTO_TEST_CASE (BoxedTopologyTestCase)
 

Detailed Description

Test for neighbourhood discovery in simple geometries.

Author
Gianluca Petrillo (petri.nosp@m.llo@.nosp@m.fnal..nosp@m.gov)
Date
July 12, 2017

Usage: just run the executable.

Definition in file topology_test.cxx.

Macro Definition Documentation

#define BOOST_TEST_MODULE   topology_test

Definition at line 12 of file topology_test.cxx.

Function Documentation

BOOST_AUTO_TEST_CASE ( BoxedTopologyTestCase  )

Definition at line 85 of file topology_test.cxx.

85  {
87 } // BoxedTopologyTestCase
void BoxedTopologyTest()
void BoxedTopologyTest ( )

Definition at line 46 of file topology_test.cxx.

46  {
47 
48  //
49  // definition of the topology; something simple here: a 3x3x3 cube
50  //
51  double const side = 2.0;
52  std::vector<geo::BoxBoundedGeo> boxes;
53  boxes.reserve(27);
54  for (int x = -1; x <= 1; ++x)
55  for (int y = -1; y <= 1; ++y)
56  for (int z = -1; z <= 1; ++z)
57  boxes.emplace_back(
58  side * (x - 0.5), side * (x + 0.5),
59  side * (y - 0.5), side * (y + 0.5),
60  side * (z - 0.5), side * (z + 0.5)
61  );
62  std::vector<geo::BoxBoundedGeo const*> volumes;
63  std::transform(boxes.cbegin(), boxes.cend(), std::back_inserter(volumes),
64  [](auto& obj){ return std::addressof(obj); });
65 
66  //
67  // discovery of the neighbourhood
68  //
69 
70  //
71  // verification of the result
72  //
73 
74 
75 
76 } // BoxedTopologyTest()
list x
Definition: train.py:276