All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SpacePointTestUtils.h
Go to the documentation of this file.
1 /**
2  * @file SpacePointTestUtils.h
3  * @brief Utilities for tests based on space points
4  * @author Gianluca Petrillo (petrillo@fnal.gov)
5  * @date June 3, 2016
6  * @see SpacePointTestUtils.cxx
7  * @ingroup RemoveIsolatedSpacePoints
8  *
9  * This file offers:
10  *
11  * * MakeSpacePoint(): helper to create a new space point
12  * * FillSpacePointGrid(): helper to create a grid of space points
13  *
14  */
15 
16 #ifndef LAREXAMPLES_TEST_ALGORITHMS_REMOVEISOLATEDSPACEPOINTS_SPACEPOINTTESTUTILS_H
17 #define LAREXAMPLES_TEST_ALGORITHMS_REMOVEISOLATEDSPACEPOINTS_SPACEPOINTTESTUTILS_H
18 
19 // LArSoft libraries
22 
23 // C/C++ standard libraries
24 #include <vector>
25 
26 
27 namespace lar {
28  namespace example {
29  namespace tests {
30 
31  // BEGIN RemoveIsolatedSpacePoints group ---------------------------------
32  /// @ingroup RemoveIsolatedSpacePoints
33  /// @{
34  /**
35  * @brief Creates and returns a new space point
36  * @param ID space point identifier
37  * @param pos space point position: { x, y, z } [cm]
38  * @param error uncertainty on position (applies to all the coordinates)
39  * @return a new space point
40  *
41  * Points are uncorrelated.
42  */
44  (int ID, double const* pos, double error = 0.);
45 
46  /**
47  * @brief Creates space points distributed in a grid
48  * @param spacePoints the container to be filled
49  * @param box the extend of volume to be filled
50  * @param stepSize the spacing between points
51  * @return the number of space points added
52  *
53  * The function adds space points to the specified collection.
54  * The centre of the box hosts a space point. The other space points are
55  * added shifting by multiples of stepSize in all directions.
56  * The IDs are incremental, starting from the ID next to the one from the
57  * last space point in the collection, or 1 if the collection is empty.
58  *
59  * Points have an uncertainty of @f$ s/\sqrt{12} @f$, with @f$ s @f$
60  * the step size.
61  */
62  unsigned int FillSpacePointGrid(
63  std::vector<recob::SpacePoint>& spacePoints,
64  geo::BoxBoundedGeo const& box,
65  double stepSize
66  );
67 
68  /// @}
69  // END RemoveIsolatedSpacePoints group -----------------------------------
70 
71  } // namespace tests
72  } // namespace example
73 } // namespace lar
74 
75 
76 #endif // LAREXAMPLES_TEST_ALGORITHMS_REMOVEISOLATEDSPACEPOINTS_SPACEPOINTTESTUTILS_H
recob::SpacePoint MakeSpacePoint(int ID, double const *pos, double error=0.)
Creates and returns a new space point.
unsigned int FillSpacePointGrid(std::vector< recob::SpacePoint > &spacePoints, geo::BoxBoundedGeo const &box, double stepSize)
Creates space points distributed in a grid.
Provides a base class aware of world box coordinates.
A base class aware of world box coordinatesAn object describing a simple shape can inherit from this ...
Definition: BoxBoundedGeo.h:33