AnodePlane.h
Go to the documentation of this file.
1 /** An AnodePlane provides wire-related and some volumetric
2  * geometrical information as well serving as the top of
3  * anode/face/plane organizational hierarchy for accessing this info.
4  * See also IAnodeFace and IWirePlane.
5  */
6 
7 #ifndef WIRECELLGEN_ANODEPLANE
8 #define WIRECELLGEN_ANODEPLANE
9 
12 #include "WireCellUtil/Logging.h"
13 #include <unordered_map>
14 
15 namespace WireCell {
16  namespace Gen {
17 
18  class AnodePlane : public IAnodePlane, public IConfigurable {
19  public:
20 
21  AnodePlane();
22  virtual ~AnodePlane() {}
23 
24 
25  // IConfigurable interface
26  virtual void configure(const WireCell::Configuration& config);
28 
29 
30  /// IAnodePlane interface
31  virtual int ident() const { return m_ident; }
32  virtual int nfaces() const { return m_faces.size(); }
33  virtual IAnodeFace::pointer face(int ident) const;
34  virtual IAnodeFace::vector faces() const { return m_faces; }
35  virtual WirePlaneId resolve(int channel) const;
36  virtual std::vector<int> channels() const;
37  virtual IChannel::pointer channel(int chident) const;
38  virtual IWire::vector wires(int channel) const;
39 
40  private:
41 
42  int m_ident;
44 
45  std::unordered_map<int, int> m_c2wpid;
46  std::unordered_map<int, IWire::vector> m_c2wires;
47  std::vector<int> m_channels;
48  std::unordered_map<int, IChannel::pointer> m_ichannels;
50  };
51  }
52 
53 }
54 
55 
56 #endif
std::unordered_map< int, int > m_c2wpid
Definition: AnodePlane.h:45
std::shared_ptr< const IChannel > pointer
Definition: IData.h:19
virtual int ident() const
IAnodePlane interface.
Definition: AnodePlane.h:31
virtual WireCell::Configuration default_configuration() const
Optional, override to return a hard-coded default configuration.
Definition: AnodePlane.cxx:38
std::unordered_map< int, IWire::vector > m_c2wires
Definition: AnodePlane.h:46
virtual WirePlaneId resolve(int channel) const
Resolve a channel ident number to a WirePlaneId.
Definition: AnodePlane.cxx:286
std::vector< pointer > vector
Definition: IData.h:21
virtual IChannel::pointer channel(int chident) const
Return an IChannel with the associated channel ID.
Definition: AnodePlane.cxx:297
std::vector< int > m_channels
Definition: AnodePlane.h:47
std::vector< pointer > vector
Vector of shared pointers.
Definition: IComponent.h:36
static Config * config
Definition: config.cpp:1054
virtual void configure(const WireCell::Configuration &config)
Accept a configuration.
Definition: AnodePlane.cxx:108
std::shared_ptr< Interface > pointer
Definition: Interface.h:16
virtual IAnodeFace::vector faces() const
Return all faces.
Definition: AnodePlane.h:34
std::unordered_map< int, IChannel::pointer > m_ichannels
Definition: AnodePlane.h:48
std::shared_ptr< spdlog::logger > logptr_t
Definition: Logging.h:24
Definition: Main.h:22
virtual int nfaces() const
Return number of faces (eg, MicroBooNE=1, DUNE=2)
Definition: AnodePlane.h:32
virtual IWire::vector wires(int channel) const
Return all wires connected into the given channel ident number.
Definition: AnodePlane.cxx:311
Json::Value Configuration
Definition: Configuration.h:50
virtual std::vector< int > channels() const
Return a collection of all channels.
Definition: AnodePlane.cxx:306
IAnodeFace::vector m_faces
Definition: AnodePlane.h:43
virtual IAnodeFace::pointer face(int ident) const
Return a anode face by its ident number.
Definition: AnodePlane.cxx:275