All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ShowerCalibrationGaloreFromPIDTestHelpers.h
Go to the documentation of this file.
1 /**
2  * @file ShowerCalibrationGaloreFromPIDTestHelpers.h
3  * @brief Specialization of helper classes for LArSoft tests
4  * @author Gianluca Petrillo (petrillo@fnal.gov)
5  * @date May 11, 2016
6  * @see ShowerCalibrationGaloreFromPID.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_SHOWERCALIBRATIONGALOREFROMPIDTESTHELPERS_H
15 #define LAREXAMPLES_SERVICES_SHOWERCALIBRATIONGALORE_PROVIDERS_SHOWERCALIBRATIONGALOREFROMPIDTESTHELPERS_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::ShowerCalibrationGaloreFromPID>;
34 
35 
36  /**
37  * @brief Environment setup helper for ShowerCalibrationGaloreFromPID
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::ShowerCalibrationGaloreFromPID.
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::ShowerCalibrationGaloreFromPID>();
53  *
54  * The provider will be available from any of these two calls:
55  *
56  * env.Provider<lar::example::ShowerCalibrationGaloreFromPID>();
57  * env.Provider<lar::example::ShowerCalibrationGalore>();
58  *
59  *
60  */
61  template <typename TestEnv>
64  {
66  {
69  lar::example::ShowerCalibrationGalore, // providet interface
70  TestEnv
71  >
72  (env, "ShowerCalibrationGaloreService"); // configuration key
73  }
74  }; // SimpleEnvironmentSetupClass<ShowerCalibrationGaloreFromPID>
75 
76  /// @}
77  // END ShowerCalibrationGalore -----------------------------------------------
78 
79 } // namespace testing
80 
81 
82 #endif // LAREXAMPLES_SERVICES_SHOWERCALIBRATIONGALORE_PROVIDERS_SHOWERCALIBRATIONGALOREFROMPIDTESTHELPERS_H
Helper classes to be used together with LArSoft&#39;s unit test.
Environment helper to set up a service provider.
Shower calibration service provider correcting according to PID.
Prov * SimpleEnvironmentStandardSetupByName(TestEnv &env, std::string service_name)
Basic implementation of a environment setup helper.
Shower energy calibration according to particle type.
Interface for a shower calibration service provider.