All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ExptGeoHelperInterface.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////
2 /// \file ExptGeoHelperInterface.h
3 /// \brief Interface to a service that handles any experiment-specific knowledge
4 /// that is needed by the Geometry service.
5 ///
6 /// This is an interface to a service that virtualizes detector or experiment-specific
7 /// knowledge that is required by the Geometry service. Experiments implement the
8 /// private virtual functions within a concrete service provider class to perform
9 /// the specified actions as appropriate for the particular experiment. It is
10 /// expected that such requests will occur infrequently within a job. Calculations
11 /// that occur frequently should be handled via interfaces that are passed
12 /// back to the Geometry service.
13 ///
14 /// Note that the public interface for this service cannot be overriden. The
15 /// experiment-specific sub-classes should implement only the private methods
16 /// without promoting their visibility.
17 ///
18 /// \author rs@fnal.gov
19 ////////////////////////////////////////////////////////////////////////////////
20 #ifndef GEO_ExptGeoHelperInterface_h
21 #define GEO_ExptGeoHelperInterface_h
22 
23 // LArSoft libraries
25 
26 // framework libraries
27 #include "art/Framework/Services/Registry/ServiceDeclarationMacros.h"
28 namespace fhicl { class ParameterSet; }
29 
30 // C/C++ standard libraries
31 #include <memory> // std::unique_ptr<>
32 #include <string>
33 
34 namespace geo
35 {
36 
37  /**
38  * @brief Interface to a service with detector-specific geometry knowledge
39  *
40  * This is an interface to a service that virtualizes detector or
41  * experiment-specific knowledge that is required by the Geometry service.
42  * Experiments implement the private virtual function within a concrete
43  * service provider class to perform the specified actions as appropriate for
44  * the particular experiment.
45  *
46  * It is expected that such requests will occur infrequently within a job.
47  * Calculations that occur frequently should be handled via interfaces that
48  * are passed back to the Geometry service.
49  *
50  * @note The public interface for this service cannot be overriden.
51  * The experiment-specific sub-classes should implement only the private
52  * methods without promoting their visibility.
53  */
55  {
56  public:
57  using ChannelMapAlgPtr_t = std::unique_ptr<ChannelMapAlg>;
58 
59  /// Virtual destructor; does nothing
60  virtual ~ExptGeoHelperInterface() = default;
61 
62  /**
63  * @brief Configure and initialize the channel map
64  * @param sortingParameters parameters for the channel map algorithm
65  * @param detectorName name of detector described by geometry
66  * @return a (shared) pointer to the channel mapping algorithm
67  *
68  * This method creates a new ChannelMapAlg according to the geometry and
69  * specified configuration.
70  */
72  ConfigureChannelMapAlg(fhicl::ParameterSet const& sortingParameters,
73  std::string const& detectorName) const
74  {
75  return doConfigureChannelMapAlg(sortingParameters, detectorName);
76  }
77 
78  private:
79 
80  virtual
82  doConfigureChannelMapAlg(fhicl::ParameterSet const& sortingParameters,
83  std::string const& detectorName) const = 0;
84 
85  }; // end ExptGeoHelperInterface class declaration
86 
87 }
88 
89 DECLARE_ART_SERVICE_INTERFACE(geo::ExptGeoHelperInterface, SHARED)
90 
91 #endif // GEO_ExptGeoHelperInterface_h
Interface to a service with detector-specific geometry knowledge.
virtual ~ExptGeoHelperInterface()=default
Virtual destructor; does nothing.
std::unique_ptr< ChannelMapAlg > ChannelMapAlgPtr_t
ChannelMapAlgPtr_t ConfigureChannelMapAlg(fhicl::ParameterSet const &sortingParameters, std::string const &detectorName) const
Configure and initialize the channel map.
virtual ChannelMapAlgPtr_t doConfigureChannelMapAlg(fhicl::ParameterSet const &sortingParameters, std::string const &detectorName) const =0
Interface to algorithm class for a specific detector channel mapping.