ChannelMapSetupTool.h
Go to the documentation of this file.
1 /**
2  * @file larcore/Geometry/ChannelMapSetupTool.h
3  * @brief Interface for a tool to configure a geometry channel mapper.
4  * @author Gianluca Petrillo (petrillo@slac.stanford.edu)
5  * @date October 7, 2019
6  *
7  * This library is header-only.
8  */
9 
10 #ifndef LARCORE_GEOMETRY_CHANNELMAPSETUPTOOL_H
11 #define LARCORE_GEOMETRY_CHANNELMAPSETUPTOOL_H
12 
13 // LArSoft libraries
15 
16 
17 namespace geo {
18 
19  /**
20  * @brief Interface for a tool creating a channel mapping object.
21  *
22  * This class creates a `geo::ChannelMapAlg` instance.
23  *
24  */
26  public:
27 
28  virtual ~ChannelMapSetupTool() noexcept = default;
29 
30 
31  /**
32  * @brief Returns a new instance of the channel mapping.
33  *
34  * If the call fails, a null pointer is returned. This may happen on calls
35  * following the first one, if the implementation does not support multiple
36  * calls.
37  * For all other errors, the implementations are expected to throw
38  * the proper exception.
39  */
40  std::unique_ptr<geo::ChannelMapAlg> setupChannelMap()
41  { return doChannelMap(); }
42 
43 
44  protected:
45 
46  // --- BEGIN -- Virtual interface ------------------------------------------
47  /// @name Virtual interface
48  /// @{
49 
50  /// Returns a pointer to the channel mapping.
51  virtual std::unique_ptr<geo::ChannelMapAlg> doChannelMap() = 0;
52 
53  /// @}
54  // --- END -- Virtual interface --------------------------------------------
55 
56 
57  }; // class ChannelMapSetupTool
58 
59 
60 } // namespace geo
61 
62 
63 #endif // LARCORE_GEOMETRY_CHANNELMAPSETUPTOOL_H
Interface for a tool creating a channel mapping object.
std::unique_ptr< geo::ChannelMapAlg > setupChannelMap()
Returns a new instance of the channel mapping.
virtual ~ChannelMapSetupTool() noexcept=default
virtual std::unique_ptr< geo::ChannelMapAlg > doChannelMap()=0
Returns a pointer to the channel mapping.
Interface to algorithm class for a specific detector channel mapping.
LArSoft geometry interface.
Definition: ChannelGeo.h:16