ShowerCalibrationGaloreScaleService.h
Go to the documentation of this file.
1 /**
2  * @file ShowerCalibrationGaloreScaleService.h
3  * @brief A shower calibration service providing a single calibration factor
4  * @author Gianluca Petrillo (petrillo@fnal.gov)
5  * @date April 28, 2016
6  * @see ShowerCalibrationGaloreScale.h
7  * @ingroup ShowerCalibrationGalore
8  */
9 
10 
11 #ifndef LAREXAMPLES_SERVICES_SHOWERCALIBRATIONGALORE_SERVICES_SHOWERCALIBRATIONGALORESCALESERVICE_H
12 #define LAREXAMPLES_SERVICES_SHOWERCALIBRATIONGALORE_SERVICES_SHOWERCALIBRATIONGALORESCALESERVICE_H
13 
14 
15 /// LArSoft libraries
18 #include "larcore/CoreUtils/ServiceUtil.h" // lar::providerFrom() (for includers)
19 
20 // framework libraries
23 
24 // C/C++ standard libraries
25 #include <memory> // std::unique_ptr<>, std::make_unique()
26 
27 
28 namespace lar {
29  namespace example {
30 
31  /**
32  * @brief A shower calibration art service returning a single factor
33  * @ingroup ShowerCalibrationGalore
34  * @see @ref ShowerCalibrationGalore "ShowerCalibrationGalore example overview"
35  *
36  * See the ShowerCalibrationGaloreScale provider documentation for
37  * configuration instructions and implementation details.
38  *
39  * See the ShowerCalibrationGalore provider class documentation for an
40  * explanation of the interface.
41  *
42  * Use this service and its provider by its interface only:
43  *
44  * lar::example::ShowerCalibrationGalore const* calib
45  * = lar::providerFrom<lar::example::ShowerCalibrationGaloreService>();
46  *
47  * The code does not need to mention, nor to include, nor to link to
48  * `ShowerCalibrationGaloreScaleService` service.
49  *
50  *
51  * Configuration parameters
52  * -------------------------
53  *
54  * In addition to the service provider:
55  *
56  * * *service_provider* must be set to
57  * `"ShowerCalibrationGaloreScaleService"` in order to tell _art_ to
58  * load this implementation.
59  *
60  */
63  {
64 
65  public:
66  /// type of service provider implementation
68 
69  /// art service interface class
71 
72  /// Type of configuration parameter (for art description)
73  using Parameters
75 
76 
77  /// Constructor (using a configuration table)
80  : prov(std::make_unique<ShowerCalibrationGaloreScale>(config()))
81  {}
82 
83 
84  private:
85  std::unique_ptr<ShowerCalibrationGaloreScale> prov; ///< service provider
86 
87  /// Returns a constant pointer to the service provider
88  virtual ShowerCalibrationGalore const* do_provider() const override
89  { return prov.get(); }
90 
91  }; // ShowerCalibrationGaloreScaleService
92 
93  } // namespace example
94 } // namespace lar
95 
96 
100  LEGACY
101  )
102 
103 
104 #endif // LAREXAMPLES_SERVICES_SHOWERCALIBRATIONGALORE_SERVICES_SHOWERCALIBRATIONGALORESCALESERVICE_H
105 
ShowerCalibrationGaloreScaleService(Parameters const &config, art::ActivityRegistry &)
Constructor (using a configuration table)
A shower calibration service provider applying a uniform scale.
DECLARE_ART_SERVICE_INTERFACE_IMPL(MySharedService, art::test::MyServiceInterface, SHARED) DEFINE_ART_SERVICE_INTERFACE_IMPL(MySharedService
lar::ServiceProviderInterfaceWrapper< ShowerCalibrationGalore > ShowerCalibrationGaloreService
Interface for a shower calibration art service.
static Config * config
Definition: config.cpp:1054
Shower calibration service provider applying a uniform energy scale.
A shower calibration art service returning a single factor.
Interface for a shower calibration art service.
virtual ShowerCalibrationGalore const * do_provider() const override
Returns a constant pointer to the service provider.
LArSoft-specific namespace.
std::unique_ptr< ShowerCalibrationGaloreScale > prov
service provider
Service returning a provider interface.
Interface for a shower calibration service provider.