geometry_unit_test_dune.h
Go to the documentation of this file.
1 /**
2  * @file geometry_unit_test_dune.h
3  * @brief Class for objects initializing DUNE geometries
4  * @date May 11th, 2015
5  * @author petrillo@fnal.gov
6  *
7  * Provides an environment for easy set up of DUNE-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  */
13 
14 #ifndef TEST_GEOMETRY_UNIT_TEST_DUNE_H
15 #define TEST_GEOMETRY_UNIT_TEST_DUNE_H
16 
17 // LArSoft libraries
18 #include "test/Geometry/geometry_unit_test_base.h"
19 
20 // C/C++ standard libraries
21 #include <string>
22 
23 
24 namespace dune {
25 
26  /// Namespace including DUNE-specific testing
27  namespace testing {
28 
29  // The old geometry objects foor 35t and FD have been removed because the new
30  // initialisation scheme of their mapping is not compatible with the geometry
31  // support infrastructure in LArSoft unit tests.
32  // The reason is that that system does not use ExptGeoInterfaceHelper but
33  // instead replicates it, which was possible as long as the code would be
34  // common between experiments, that is not any more.
35 
36  // This file is left here as placeholder, waiting for Dual Phase support
37  // to be ready. That one still uses the old scheme.
38 
39  /** ************************************************************************
40  * @brief Class holding the configuration for a DUNE FD Dual Phase fixture
41  * @tparam CHANNELMAP the class used for channel mapping
42  * @see BasicGeometryEnvironmentConfiguration, GeometryTesterEnvironment
43  *
44  * This class needs to be fully constructed by the default constructor
45  * in order to be useful as Boost unit test fixture.
46  * It is supposed to be passed as a template parameter to another class
47  * that can store an instance of it and extract configuration information
48  * from it.
49  *
50  * This class should be used with ChannelMapCRMAlg.
51  *
52  * We reuse BasicGeometryEnvironmentConfiguration as base class and we
53  * override its setup.
54  */
55  template <typename CHANNELMAP>
57  public ::testing::BasicGeometryEnvironmentConfiguration<CHANNELMAP>
58  {
59  // remember that BasicGeometryEnvironmentConfiguration is not polymorphic
60  using base_t
61  = ::testing::BasicGeometryEnvironmentConfiguration<CHANNELMAP>;
62 
63  /// Default constructor; this is what is used in Boost unit test
65  {
66  // overwrite the configuration that happened in the base class:
67  base_t::SetApplicationName("DUNEFDDPGeometryTest");
68  base_t::SetDefaultGeometryConfiguration(R"(
69  Name: "dunedphase10kt_v2"
70  GDML: "dunedphase10kt_v2.gdml"
71  ROOT: "dunedphase10kt_v2.gdml"
72  SortingParameters: { ChannelsPerOpDet: 1 }
73  SurfaceY: 147828 # Underground option. 4850 feet to cm. from DocDb-3833
74  )");
75  } // DUNEFDDPGeometryEnvironmentConfiguration()
76 
77  /// Constructor; accepts the name as parameter
81 
82  }; // class DUNEFDDPGeometryEnvironmentConfiguration<>
83 
84 
85  } // namespace testing
86 } // namespace dune
87 
88 #endif // TEST_GEOMETRY_UNIT_TEST_DUNE_H
static QCString name
Definition: declinfo.cpp:673
::testing::BasicGeometryEnvironmentConfiguration< CHANNELMAP > base_t
LArSoft test utilities.
std::string string
Definition: nybbler.cc:12
DUNEFDDPGeometryEnvironmentConfiguration(std::string name)
Constructor; accepts the name as parameter.
DUNEFDDPGeometryEnvironmentConfiguration()
Default constructor; this is what is used in Boost unit test.
void SetApplicationName(string const &applicationName)
Class holding the configuration for a DUNE FD Dual Phase fixture.