MegaAnodePlane.h
Go to the documentation of this file.
1 // larweirecell::FrameSaver needs a general channel-to-wireplane
2 // resolver fixme: this is a temporary solution, only a few functions
3 // are useful, otherwise, please do NOT use the other virtual fuctions
4 // inherited from IAnodePlane
5 
6 #ifndef WIRECELLGEN_MEGAANODEPLANE
7 #define WIRECELLGEN_MEGAANODEPLANE
8 
12 #include <vector>
13 
14 namespace WireCell {
15  namespace Gen {
16 
17  class MegaAnodePlane: public IAnodePlane, public IConfigurable {
18  public:
19  // MegaAnodePlane();
20  virtual ~MegaAnodePlane() {}
21 
22  // IConfigurable interface
23  virtual void configure(const WireCell::Configuration& config);
25 
26  // IAnodePlane interface
27 
28  // Actually implemented
29  virtual WirePlaneId resolve(int channel) const;
30  virtual std::vector<int> channels() const;
31  virtual IChannel::pointer channel(int chident) const;
32  virtual IWire::vector wires(int channel) const;
33 
34  // The number of faces is kind of a ill defined quantity
35  // for the mega anode plane.
36  virtual int nfaces() const {
37  return m_anodes[0]->nfaces();
38  }
39 
40  // Implemented with dummies
41  virtual int ident() const {
42  return -1;
43  }
44  virtual IAnodeFace::pointer face(int ident) const {
45  return nullptr;
46  }
47  virtual IAnodeFace::vector faces() const {
48  return IAnodeFace::vector();
49  }
50 
51  private:
52  std::vector<IAnodePlane::pointer> m_anodes;
53 
54  };
55  }
56 }
57 
58 #endif
std::shared_ptr< const IChannel > pointer
Definition: IData.h:19
virtual std::vector< int > channels() const
Return a collection of all channels.
virtual WirePlaneId resolve(int channel) const
Resolve a channel ident number to a WirePlaneId.
virtual void configure(const WireCell::Configuration &config)
Accept a configuration.
virtual WireCell::Configuration default_configuration() const
Optional, override to return a hard-coded default configuration.
std::vector< pointer > vector
Definition: IData.h:21
virtual IAnodeFace::vector faces() const
Return all faces.
virtual int ident() const
Return the ident number of this plane.
virtual int nfaces() const
Return number of faces (eg, MicroBooNE=1, DUNE=2)
std::vector< pointer > vector
Vector of shared pointers.
Definition: IComponent.h:36
static Config * config
Definition: config.cpp:1054
std::shared_ptr< Interface > pointer
Definition: Interface.h:16
Definition: Main.h:22
virtual IChannel::pointer channel(int chident) const
Return an IChannel with the associated channel ID.
std::vector< IAnodePlane::pointer > m_anodes
Json::Value Configuration
Definition: Configuration.h:50
virtual IAnodeFace::pointer face(int ident) const
Return a anode face by its ident number.
virtual IWire::vector wires(int channel) const
Return all wires connected into the given channel ident number.