AuxDetExptGeoHelperInterface.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////
2 /// \file AuxDetExptGeoHelperInterface.h
3 /// \brief Interface to a service that handles any experiment-specific knowledge
4 /// that is needed by the AuxDetGeometry 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 
21 
22 #ifndef GEO_AuxDetExptGeoHelperInterface_h
23 #define GEO_AuxDetExptGeoHelperInterface_h
24 
25 
26 // framework libraries
29 #include "fhiclcpp/ParameterSet.h"
30 
31 // C/C++ standard libraries
32 #include <memory> // std::shared_ptr<>
33 #include <vector>
34 
35 
36 // prototypes of geometry classes
37 namespace gar {
38  namespace geo{
39 
40  class AuxDetChannelMapAlg;
41  class AuxDetGeometryCore;
42 
43  /**
44  * @brief Interface to a service with detector-specific geometry knowledge
45  *
46  * This is an interface to a service that virtualizes detector or
47  * experiment-specific knowledge that is required by the Geometry service.
48  * Experiments implement the private virtual functions within a concrete
49  * service provider class to perform the specified actions as appropriate for
50  * the particular experiment.
51  * It is expected that such requests will occur infrequently within a job.
52  * Calculations that occur frequently should be handled via interfaces that
53  * are passed back to the Geometry service.
54  *
55  * @note The public interface for this service cannot be overriden.
56  * The experiment-specific sub-classes should implement only the private
57  * methods without promoting their visibility.
58  */
60  {
61  public:
62  using AuxDetChannelMapAlgPtr_t = std::shared_ptr<const seg::AuxDetChannelMapAlg>;
63 
64  /// Virtual destructor; does nothing
65  virtual ~AuxDetExptGeoHelperInterface() = default;
66 
67  /**
68  * @brief Configure and initialize the channel map
69  * @param sortingParameters parameters for the channel map algorithm
70  * @param geom pointer to a geometry description object
71  * @return a (shared) pointer to the channel mapping algorithm
72  *
73  * This method creates a new ChannelMapAlg according to the geometry and
74  * specified configuration, then it configures the geometry itself
75  * according to the channel map (usually, it resorts the data).
76  */
77  void ConfigureAuxDetChannelMapAlg(fhicl::ParameterSet const & sortingParameters,
79 
80  /// Returns null pointer if the initialization failed
81  /// NOTE: the sub-class owns the ChannelMapAlg object
82  ///
84 
85  private:
86 
87  /// Implementation of ConfigureChannelMapAlg (pure virtual)
88  virtual
89  void doConfigureAuxDetChannelMapAlg(fhicl::ParameterSet const & sortingParameters,
90  geo::AuxDetGeometryCore* geom) = 0;
91 
92  /// Returns the ChannelMapAlg
93  virtual
95 
96  }; // end ExptGeoHelperInterface class declaration
97 
98 
99  //-------------------------------------------------------------------------------------------
102  {
103  doConfigureAuxDetChannelMapAlg(sortingParameters, geom);
104  }
105 
107  {
108  return doGetAuxDetChannelMapAlg();
109  }
110  }
111 } // gar
112 
114 
115 #endif // GEO_ExptGeoHelperInterface_h
virtual void doConfigureAuxDetChannelMapAlg(fhicl::ParameterSet const &sortingParameters, geo::AuxDetGeometryCore *geom)=0
Implementation of ConfigureChannelMapAlg (pure virtual)
std::shared_ptr< const seg::AuxDetChannelMapAlg > AuxDetChannelMapAlgPtr_t
void ConfigureAuxDetChannelMapAlg(fhicl::ParameterSet const &sortingParameters, geo::AuxDetGeometryCore *geom)
Configure and initialize the channel map.
AuxDetChannelMapAlgPtr_t GetAuxDetChannelMapAlg() const
virtual AuxDetChannelMapAlgPtr_t doGetAuxDetChannelMapAlg() const =0
Returns the ChannelMapAlg.
General GArSoft Utilities.
Interface to a service with detector-specific geometry knowledge.
virtual ~AuxDetExptGeoHelperInterface()=default
Virtual destructor; does nothing.
#define DECLARE_ART_SERVICE_INTERFACE(svc, scope)
LArSoft geometry interface.
Definition: ChannelGeo.h:16
Description of geometry of one set of auxiliary detectors.