ShowerCalibrationGaloreScaleTestHelpers.h
Go to the documentation of this file.
1 /**
2  * @file ShowerCalibrationGaloreScaleTestHelpers.h
3  * @brief Specialization of helper classes for LArSoft tests
4  * @author Gianluca Petrillo (petrillo@fnal.gov)
5  * @date May 11, 2016
6  * @see ShowerCalibrationGaloreScale.h
7  * @ingroup ShowerCalibrationGalore
8  *
9  * This is a header-only library that does not require additional linking.
10  *
11  */
12 
13 
14 #ifndef LAREXAMPLES_SERVICES_SHOWERCALIBRATIONGALORE_PROVIDERS_SHOWERCALIBRATIONGALORESCALETESTHELPERS_H
15 #define LAREXAMPLES_SERVICES_SHOWERCALIBRATIONGALORE_PROVIDERS_SHOWERCALIBRATIONGALORESCALETESTHELPERS_H
16 
17 /// LArSoft libraries
20 
21 // C/C++ standard libraries
22 #include <string>
23 
24 
25 namespace testing {
26 
27  // BEGIN ShowerCalibrationGalore ---------------------------------------------
28  /// @ingroup ShowerCalibrationGalore
29  /// @{
30 
31  // instantiation of the standard ProviderSetupClass for this provider
32  template
33  struct ProviderSetupClass<lar::example::ShowerCalibrationGaloreScale>;
34 
35 
36  /**
37  * @brief Environment setup helper for ShowerCalibrationGaloreScale
38  * @tparam TestEnv type of environment to set up
39  * @see SimpleEnvironmentSetupClass, simpleEnvironmentSetup
40  *
41  * A service provider is set up in the environment, associated with the types
42  * lar::example::ShowerCalibrationGaloreScale.
43  * Its configuration is read from "services.ShowerCalibrationGaloreService".
44  *
45  * The environment is expected to expose an interface equivalent to the one
46  * of `testing::TesterEnvironment`.
47  *
48  * This class specialisation enables the support of `SimpleProviderSetup()`
49  * methods of `testing::TesterEnvironment`.
50  * It should be possible to set up a testing environment by calling:
51  *
52  * env.SimpleProviderSetup<lar::example::ShowerCalibrationGaloreScale>();
53  *
54  * The provider will be available from any of these two calls:
55  *
56  * env.Provider<lar::example::ShowerCalibrationGaloreScale>();
57  * env.Provider<lar::example::ShowerCalibrationGalore>();
58  *
59  */
60  template <typename TestEnv>
63  {
64  static lar::example::ShowerCalibrationGaloreScale* setup(TestEnv& env)
65  {
67  lar::example::ShowerCalibrationGaloreScale, // provider class
68  lar::example::ShowerCalibrationGalore, // provider interface
69  TestEnv
70  >
71  (env, "ShowerCalibrationGaloreService"); // configuration key
72  }
73  }; // SimpleEnvironmentSetupClass<ShowerCalibrationGaloreScale>
74 
75 
76  /// @}
77  // END ShowerCalibrationGalore -----------------------------------------------
78 
79 } // namespace testing
80 
81 
82 #endif // LAREXAMPLES_SERVICES_SHOWERCALIBRATIONGALORE_PROVIDERS_SHOWERCALIBRATIONGALORESCALETESTHELPERS_H
LArSoft test utilities.
A shower calibration service provider applying a uniform scale.
Environment helper to set up a service provider.
Shower calibration service provider applying a uniform energy scale.
Prov * SimpleEnvironmentStandardSetupByName(TestEnv &env, std::string service_name)
Basic implementation of a environment setup helper.
Interface for a shower calibration service provider.