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 
21 
22 #ifndef GEO_ExptGeoHelperInterface_h
23 #define GEO_ExptGeoHelperInterface_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 
39  namespace geo
40  {
41 
42  class GeometryCore;
43  namespace seg {
44  class ChannelMapAlg;
45  class SegmentationAlg;
46  }
47 
48  /**
49  * @brief Interface to a service with detector-specific geometry knowledge
50  *
51  * This is an interface to a service that virtualizes detector or
52  * experiment-specific knowledge that is required by the Geometry service.
53  * Experiments implement the private virtual functions within a concrete
54  * service provider class to perform the specified actions as appropriate for
55  * the particular experiment.
56  * It is expected that such requests will occur infrequently within a job.
57  * Calculations that occur frequently should be handled via interfaces that
58  * are passed back to the Geometry service.
59  *
60  * @note The public interface for this service cannot be overriden.
61  * The experiment-specific sub-classes should implement only the private
62  * methods without promoting their visibility.
63  */
65  {
66  public:
67  using ChannelMapAlgPtr_t = std::shared_ptr<const seg::ChannelMapAlg>;
68  using SegmentationAlgPtr_t = std::shared_ptr<const seg::SegmentationAlg>;
69 
70  /// Virtual destructor; does nothing
71  virtual ~ExptGeoHelperInterface() = default;
72 
73  /**
74  * @brief Configure and initialize the channel map
75  * @param sortingParameters parameters for the channel map algorithm
76  * @param geom pointer to a geometry description object
77  * @return a (shared) pointer to the channel mapping algorithm
78  *
79  * This method creates a new ChannelMapAlg according to the geometry and
80  * specified configuration, then it configures the geometry itself
81  * according to the channel map (usually, it resorts the data).
82  */
83  void ConfigureChannelMapAlg
84  (fhicl::ParameterSet const & sortingParameters, geo::GeometryCore* geom);
85 
86  /// Returns null pointer if the initialization failed
87  /// NOTE: the sub-class owns the ChannelMapAlg object
88  ///
89  ChannelMapAlgPtr_t GetChannelMapAlg() const;
90 
91  void ConfigureECALSegmentationAlg
92  (fhicl::ParameterSet const & segParameters, geo::GeometryCore* geom);
93 
94  SegmentationAlgPtr_t GetECALSegmentationAlg() const;
95 
96  void ConfigureMinervaSegmentationAlg
97  (fhicl::ParameterSet const & segParameters, geo::GeometryCore* geom);
98 
99  SegmentationAlgPtr_t GetMinervaSegmentationAlg() const;
100 
101  void ConfigureMuIDSegmentationAlg
102  (fhicl::ParameterSet const & segParameters, geo::GeometryCore* geom);
103 
104  SegmentationAlgPtr_t GetMuIDSegmentationAlg() const;
105 
106  private:
107 
108  /// Implementation of ConfigureChannelMapAlg (pure virtual)
109  virtual void doConfigureChannelMapAlg(fhicl::ParameterSet const & sortingParameters,
110  gar::geo::GeometryCore* geom) = 0;
111 
112  /// Returns the ChannelMapAlg
113  virtual ChannelMapAlgPtr_t doGetChannelMapAlg() const = 0;
114 
115  /// Implementation of ConfigureECALSegmentationAlg (pure virtual)
116  virtual void doConfigureECALSegmentationAlg(fhicl::ParameterSet const & segParameters,
117  gar::geo::GeometryCore* geom) = 0;
118 
119  /// Returns the ECAL SegmentationAlg
120  virtual SegmentationAlgPtr_t doGetECALSegmentationAlg() const = 0;
121 
122  /// Implementation of ConfigureECALSegmentationAlg (pure virtual)
123  virtual void doConfigureMinervaSegmentationAlg(fhicl::ParameterSet const & segParameters,
124  gar::geo::GeometryCore* geom) = 0;
125 
126  /// Returns the Tracker Sc SegmentationAlg
127  virtual SegmentationAlgPtr_t doGetMinervaSegmentationAlg() const = 0;
128 
129  /// Implementation of ConfigureECALSegmentationAlg (pure virtual)
130  virtual void doConfigureMuIDSegmentationAlg(fhicl::ParameterSet const & segParameters,
131  gar::geo::GeometryCore* geom) = 0;
132 
133  /// Returns the MuID SegmentationAlg
134  virtual SegmentationAlgPtr_t doGetMuIDSegmentationAlg() const = 0;
135 
136  }; // end ExptGeoHelperInterface class declaration
137 
138 
139 
140  //-------------------------------------------------------------------------------------------
143  {
144  doConfigureChannelMapAlg(sortingParameters, geom);
145  }
146 
147  //-------------------------------------------------------------------------------------------
149  {
150  return doGetChannelMapAlg();
151  }
152 
153  //-------------------------------------------------------------------------------------------
156  {
157  doConfigureECALSegmentationAlg(segParameters, geom);
158  }
159 
160  //-------------------------------------------------------------------------------------------
162  {
163  return doGetECALSegmentationAlg();
164  }
165 
166  //-------------------------------------------------------------------------------------------
169  {
170  doConfigureMinervaSegmentationAlg(segParameters, geom);
171  }
172 
173  //-------------------------------------------------------------------------------------------
175  {
176  return doGetMinervaSegmentationAlg();
177  }
178 
179  //-------------------------------------------------------------------------------------------
182  {
183  doConfigureMuIDSegmentationAlg(segParameters, geom);
184  }
185 
186  //-------------------------------------------------------------------------------------------
188  {
189  return doGetMuIDSegmentationAlg();
190  }
191  }
192 } // gar
193 
195 
196 #endif // GEO_ExptGeoHelperInterface_h
void ConfigureChannelMapAlg(fhicl::ParameterSet const &sortingParameters, geo::GeometryCore *geom)
Configure and initialize the channel map.
std::shared_ptr< const seg::ChannelMapAlg > ChannelMapAlgPtr_t
std::shared_ptr< const seg::SegmentationAlg > SegmentationAlgPtr_t
Description of geometry of one entire detector.
Definition: GeometryCore.h:436
SegmentationAlgPtr_t GetECALSegmentationAlg() const
Interface to a service with detector-specific geometry knowledge.
void ConfigureECALSegmentationAlg(fhicl::ParameterSet const &segParameters, geo::GeometryCore *geom)
ChannelMapAlgPtr_t GetChannelMapAlg() const
SegmentationAlgPtr_t GetMuIDSegmentationAlg() const
General GArSoft Utilities.
void ConfigureMuIDSegmentationAlg(fhicl::ParameterSet const &segParameters, geo::GeometryCore *geom)
#define DECLARE_ART_SERVICE_INTERFACE(svc, scope)
LArSoft geometry interface.
Definition: ChannelGeo.h:16
void ConfigureMinervaSegmentationAlg(fhicl::ParameterSet const &segParameters, geo::GeometryCore *geom)
SegmentationAlgPtr_t GetMinervaSegmentationAlg() const