All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ICARUSsplitInductionChannelMapSetupTool_tool.cc
Go to the documentation of this file.
1 /**
2  * @file icaruscode/Geometry/ICARUSsplitInductionChannelMapSetupTool_tool.cc
3  * @brief Tool to create ICARUS channel mapper with split induction wires.
4  * @author Gianluca Petrillo (petrillo@slac.stanford.edu)
5  * @date October 7, 2019
6  * @see `larcore/Geometry/ChannelMapSetupTool.h`
7  *
8  * This library is header-only.
9  */
10 
11 // ICARUS libraries
13 
14 // LArSoft libraries
17 
18 // framework libraries
19 #include "art/Utilities/ToolConfigTable.h"
20 #include "art/Utilities/ToolMacros.h"
21 
22 
23 // -----------------------------------------------------------------------------
24 namespace icarus {
25  class ICARUSsplitInductionChannelMapSetupTool;
26 } // namespace icarus
27 
28 
29 /**
30  * @brief Interface for a tool creating the standard ICARUS channel mapper.
31  *
32  * This tool creates a `icarus::ICARUSChannelMapAlg` mapper.
33  *
34  */
37 {
38 
39  /// Type of channel mapping algorithm being created.
41 
42  public:
43 
44  using Parameters = art::ToolConfigTable<Mapper_t::Config>;
45 
46 
47  /// Constructor: passes all parameters to the channel mapping algorithm.
49 
50 
51  protected:
52 
53  std::unique_ptr<Mapper_t> fChannelMap;
54 
55 
56  // --- BEGIN -- Virtual interface implementation ---------------------------
57  /// @name Virtual interface
58  /// @{
59 
60  /// Returns a pointer to the channel mapping.
61  virtual std::unique_ptr<geo::ChannelMapAlg> doChannelMap() override
62  { return std::move(fChannelMap); }
63 
64  /// @}
65  // --- END -- Virtual interface implementation -----------------------------
66 
67 
68  /// Creates and returns the channel mapping algorithm.
69  std::unique_ptr<Mapper_t> makeChannelMap
70  (Mapper_t::Config const& config) const;
71 
72 }; // class icarus::ICARUSsplitInductionChannelMapSetupTool
73 
74 
75 // -----------------------------------------------------------------------------
76 // --- Implementation
77 // -----------------------------------------------------------------------------
79  (Parameters const& config)
80  : fChannelMap(makeChannelMap(config()))
81 {}
82 
83 
84 // -----------------------------------------------------------------------------
86  (Mapper_t::Config const& config) const -> std::unique_ptr<Mapper_t>
87 {
88  return std::make_unique<Mapper_t>(config);
89 } // icarus::ICARUSsplitInductionChannelMapSetupTool::makeChannelMap()
90 
91 
92 
93 // -----------------------------------------------------------------------------
95 
96 
97 // -----------------------------------------------------------------------------
Channel mapping algorithms for ICARUS detector.
std::unique_ptr< Mapper_t > makeChannelMap(Mapper_t::Config const &config) const
Creates and returns the channel mapping algorithm.
Interface for a tool to configure a geometry channel mapper.
Interface for a tool creating a channel mapping object.
Interface for a tool creating the standard ICARUS channel mapper.
virtual std::unique_ptr< geo::ChannelMapAlg > doChannelMap() override
Returns a pointer to the channel mapping.
ICARUSsplitInductionChannelMapSetupTool(Parameters const &config)
Constructor: passes all parameters to the channel mapping algorithm.
Channel mapping for ICARUS detector with split wires.
Interface to algorithm class for a specific detector channel mapping.