All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
geometry_unit_test_icarus.h
Go to the documentation of this file.
1 /**
2  * @file geometry_unit_test_icarus.h
3  * @brief Class for objects initializing ICARUS geometry
4  * @date October 10, 2017
5  * @author Gianluca Petrillo (petrillo@fnal.gov)
6  *
7  * Provides an environment for easy set up of ICARUS-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 icarusalg/test/Geometry/geometry_test_icarus.cxx
13  */
14 
15 #ifndef TEST_GEOMETRY_UNIT_TEST_ICARUS_H
16 #define TEST_GEOMETRY_UNIT_TEST_ICARUS_H
17 
18 // LArSoft libraries
21 
22 // C/C++ standard libraries
23 #include <string>
24 
25 
26 namespace icarus {
27 
28  /// Namespace including ICARUS-specific testing
29  namespace testing {
30 
31  /** ************************************************************************
32  * @brief Class holding the configuration for a ICARUS fixture
33  * @tparam CHANNELMAP the class used for channel mapping
34  * @see BasicGeometryEnvironmentConfiguration
35  *
36  * This class needs to be fully constructed by the default constructor
37  * in order to be useful as Boost unit test fixture.
38  * It is supposed to be passed as a template parameter to another class
39  * that can store an instance of it and extract configuration information
40  * from it.
41  *
42  * This class should be used with `icarus::ICARUSChannelMapAlg`.
43  *
44  * We reuse BasicGeometryEnvironmentConfiguration as base class and then we
45  * fix its setup.
46  */
47  template <typename CHANNELMAP = icarus::ICARUSChannelMapAlg>
50  {
51  // remember that BasicGeometryEnvironmentConfiguration is not polymorphic
52  using base_t
54 
55  /// Default constructor
57 
58  /// Constructor; accepts the name as parameter
62 
63 
64  private:
66  {
67  // overwrite the configuration that happened in the base class:
68  base_t::SetApplicationName("IcarusGeometryTest");
69  base_t::SetDefaultGeometryConfiguration(R"( SurfaceY: 130e2 # in cm, vertical distance to the surface Name: "icarus" GDML: "test_27Sep.gdml" ROOT: "test_27Sep.gdml" SortingParameters: {} )");
70  }
71  }; // class IcarusGeometryEnvironmentConfiguration<>
72 
73 
74  } // namespace testing
75 } // namespace icarus
76 
77 #endif // TEST_GEOMETRY_UNIT_TEST_ICARUS_H
78 
Base class for objects initializing a geometry.
Channel mapping algorithms for ICARUS detector.
void SetApplicationName(std::string name)
Sets the name of the application.
void SetDefaultGeometryConfiguration(std::string cfg)
Sets a string describing the default parameter set to configure geometry.
Class holding a configuration for a test environment.
Class holding the configuration for a ICARUS fixture.
then echo fcl name
IcarusGeometryEnvironmentConfiguration(std::string name)
Constructor; accepts the name as parameter.