ChannelStatusService.h
Go to the documentation of this file.
1 /**
2  * @file ChannelStatusService.h
3  * @brief Interface for experiment-specific service for channel quality info
4  * @author Gianluca Petrillo (petrillo@fnal.gov)
5  * @date November 24th, 2014
6  *
7  * The schema is the same as for ExptGeoHelperInterface in Geometry library
8  * (larcore repository).
9  * The implementations of this interface can be directly used as art services.
10  */
11 
12 #ifndef CHANNELSTATUSSERVICE_H
13 #define CHANNELSTATUSSERVICE_H
14 
15 // LArSoft libraries
16 #include "larcore/CoreUtils/ServiceUtil.h" // ServiceRequirementsChecker<>
18 
19 // Framework libraries
21 
22 //forward declarations
23 namespace lariov {
24  class ChannelStatusProvider;
25 }
26 
27 namespace lariov {
28 
29  /**
30  * @brief Service providing information about the quality of channels
31  *
32  * This service provides only a simple interface.
33  * Experiments need to implement and configure their own service implementing
34  * this interface.
35  * The simplest implementation is provided in LArSoft:
36  * SimpleChannelStatusService.
37  *
38  * Currently, the service provides interface for the following information:
39  * - goodness of the channel: good or bad (dead or unusable)
40  * - noisiness of the channel: good or noisy (or compromised in some way)
41  * - presence of the channel: connected to a wire or not
42  *
43  * The use of this service replaces the deprecated ChannelFilter class.
44  * An algorithm that used to use ChannelFilter class can be updated. From:
45  *
46  * filter::ChannelFilter* chanFilt = new filter::ChannelFilter();
47  *
48  * to
49  *
50  * art::ServiceHandle<lariov::ChannelStatusService const> chanFilt;
51  *
52  * (include files CalibrationDBI/Interface/ChannelStatusService.h instead of
53  * Filters/ChannelFilter.h) or
54  *
55  * lariov::ChannelStatusProvider const& chanFilt
56  * = art::ServiceHandle<lariov::ChannelStatusService const>()
57  * ->GetProvider();
58  *
59  * (include files CalibrationDBI/Interface/ChannelStatusService.h and
60  * CalibrationDBI/Interface/ChannelStatusProvider.h instead of
61  * Filters/ChannelFilter.h).
62  * The latter object can in principle be passed to algorithms that are not
63  * art-aware.
64  *
65  */
67 
68  public:
69 
71 
72  /// Destructor
73  virtual ~ChannelStatusService() = default;
74 
75  //
76  // Actual interface here
77  //
78 
79  //@{
80  /// Returns a reference to the service provider
82  { return DoGetProvider(); }
83  // will be deprecated:
84  ChannelStatusProvider const& GetFilter() const { return GetProvider(); }
85  //@}
86 
87  //@{
88  /// Returns a pointer to the service provider
90  { return DoGetProviderPtr(); }
91  // will be deprecated:
93  { return GetProviderPtr(); }
94  //@}
95 
96 
98  { return GetProviderPtr(); }
99 
100  //
101  // end of interface
102  //
103 
104  private:
105 
106  /// Returns a pointer to the service provider
107  virtual ChannelStatusProvider const* DoGetProviderPtr() const = 0;
108 
109  /// Returns a reference to the service provider
110  virtual ChannelStatusProvider const& DoGetProvider() const = 0;
111 
112 
113 
114  }; // class ChannelStatusService
115 
116 } // namespace lariov
117 
118 
120 
121 
122 // check that the requirements for lariov::ChannelStatusService are satisfied
124 
125 
126 #endif // CHANNELSTATUSSERVICE_H
ChannelStatusProvider const & GetProvider() const
Returns a reference to the service provider.
ChannelStatusProvider const & GetFilter() const
virtual ChannelStatusProvider const & DoGetProvider() const =0
Returns a reference to the service provider.
virtual ChannelStatusProvider const * DoGetProviderPtr() const =0
Returns a pointer to the service provider.
Class providing information about the quality of channels.
ChannelStatusProvider const * provider() const
Filters for channels, events, etc.
virtual ~ChannelStatusService()=default
Destructor.
Interface for experiment-specific channel quality info provider.
ChannelStatusProvider const * GetProviderPtr() const
Returns a pointer to the service provider.
#define DECLARE_ART_SERVICE_INTERFACE(svc, scope)
ChannelStatusProvider const * GetFilterPtr() const
Service providing information about the quality of channels.