All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
geometry_unit_test_sbnd.h
Go to the documentation of this file.
1 /**
2  * @file geometry_unit_test_sbnd.h
3  * @brief Class for objects initializing SBND geometry
4  * @date June 6, 2016
5  * @author petrillo@fnal.gov
6  *
7  * Provides an environment for easy set up of SBND-aware tests.
8  * Keep in mind that the channel mapping algorithm must be hard-coded and, if
9  * using Boost unit test, the configuration file location must be hard coded too
10  * (or you can use the provided configuration).
11  *
12  * For an example of usage, see larcore/test/Geometry/geometry_test.cxx
13  */
14 
15 #ifndef TEST_GEOMETRY_UNIT_TEST_SBND_H
16 #define TEST_GEOMETRY_UNIT_TEST_SBND_H
17 
18 // LArSoft libraries
20 // #include "sbndcode/Geometry/ChannelMapSBNDAlg.h"
22 
23 // C/C++ standard libraries
24 #include <string>
25 
26 
27 namespace geo {
28  class ChannelMapStandardAlg;
29 } // namespace geo
30 
31 namespace sbnd {
32 
33  /// Namespace including SBND-specific testing
34  namespace testing {
35 
36  /** ************************************************************************
37  * @brief Class holding the configuration for a SBND fixture
38  * @tparam CHANNELMAP the class used for channel mapping
39  * @see BasicGeometryEnvironmentConfiguration
40  *
41  * This class needs to be fully constructed by the default constructor
42  * in order to be useful as Boost unit test fixture.
43  * It is supposed to be passed as a template parameter to another class
44  * that can store an instance of it and extract configuration information
45  * from it.
46  *
47  * This class should be used with ChannelMapStandardAlg.
48  *
49  * We reuse BasicGeometryEnvironmentConfiguration as base class and then we
50  * fix its setup.
51  */
52  template <typename CHANNELMAP = geo::ChannelMapStandardAlg>
55  {
56  // remember that BasicGeometryEnvironmentConfiguration is not polymorphic
57  using base_t
59 
60  /// Default constructor
62 
63  /// Constructor; accepts the name as parameter
67 
68 
69  private:
71  {
72  // overwrite the configuration that happened in the base class:
73  base_t::SetApplicationName("SBNDGeometryTest");
74  base_t::SetDefaultGeometryConfiguration(R"( SurfaceY: 130e2 # in cm, vertical distance to the surface Name: "sbndv2" GDML: "sbnd_v02_00.gdml" ROOT: "sbnd_v02_00.gdml" SortingParameters: {} )");
75  }
76  }; // class SBNDGeometryEnvironmentConfiguration<>
77 
78 
79  } // namespace testing
80 } // namespace sbnd
81 
82 #endif // TEST_GEOMETRY_UNIT_TEST_SBND_H
83 
Base class for objects initializing a geometry.
void SetApplicationName(std::string name)
Sets the name of the application.
SBNDGeometryEnvironmentConfiguration(std::string name)
Constructor; accepts the name as parameter.
void SetDefaultGeometryConfiguration(std::string cfg)
Sets a string describing the default parameter set to configure geometry.
Class holding a configuration for a test environment.
Interface to algorithm class for a specific detector channel mapping.
Class holding the configuration for a SBND fixture.
stream1 can override from command line with o or output services user sbnd
then echo fcl name