Public Member Functions | Private Attributes | List of all members
WireCell::Gen::MegaAnodePlane Class Reference

#include <MegaAnodePlane.h>

Inheritance diagram for WireCell::Gen::MegaAnodePlane:
WireCell::IAnodePlane WireCell::IConfigurable WireCell::IComponent< IAnodePlane > WireCell::IComponent< IConfigurable > WireCell::Interface WireCell::Interface

Public Member Functions

virtual ~MegaAnodePlane ()
 
virtual void configure (const WireCell::Configuration &config)
 Accept a configuration. More...
 
virtual WireCell::Configuration default_configuration () const
 Optional, override to return a hard-coded default configuration. More...
 
virtual WirePlaneId resolve (int channel) const
 Resolve a channel ident number to a WirePlaneId. More...
 
virtual std::vector< int > channels () const
 Return a collection of all channels. More...
 
virtual IChannel::pointer channel (int chident) const
 Return an IChannel with the associated channel ID. More...
 
virtual IWire::vector wires (int channel) const
 Return all wires connected into the given channel ident number. More...
 
virtual int nfaces () const
 Return number of faces (eg, MicroBooNE=1, DUNE=2) More...
 
virtual int ident () const
 Return the ident number of this plane. More...
 
virtual IAnodeFace::pointer face (int ident) const
 Return a anode face by its ident number. More...
 
virtual IAnodeFace::vector faces () const
 Return all faces. More...
 
- Public Member Functions inherited from WireCell::IAnodePlane
virtual ~IAnodePlane ()
 
- Public Member Functions inherited from WireCell::IComponent< IAnodePlane >
virtual ~IComponent ()
 
- Public Member Functions inherited from WireCell::Interface
virtual ~Interface ()
 
- Public Member Functions inherited from WireCell::IConfigurable
virtual ~IConfigurable ()
 
- Public Member Functions inherited from WireCell::IComponent< IConfigurable >
virtual ~IComponent ()
 

Private Attributes

std::vector< IAnodePlane::pointerm_anodes
 

Additional Inherited Members

- Public Types inherited from WireCell::IComponent< IAnodePlane >
typedef std::shared_ptr< IAnodePlanepointer
 Access subclass facet by pointer. More...
 
typedef std::vector< pointervector
 Vector of shared pointers. More...
 
- Public Types inherited from WireCell::Interface
typedef std::shared_ptr< Interfacepointer
 
- Public Types inherited from WireCell::IComponent< IConfigurable >
typedef std::shared_ptr< IConfigurablepointer
 Access subclass facet by pointer. More...
 
typedef std::vector< pointervector
 Vector of shared pointers. More...
 

Detailed Description

Definition at line 17 of file MegaAnodePlane.h.

Constructor & Destructor Documentation

virtual WireCell::Gen::MegaAnodePlane::~MegaAnodePlane ( )
inlinevirtual

Definition at line 20 of file MegaAnodePlane.h.

20 {}

Member Function Documentation

IChannel::pointer Gen::MegaAnodePlane::channel ( int  chident) const
virtual

Return an IChannel with the associated channel ID.

Implements WireCell::IAnodePlane.

Definition at line 61 of file MegaAnodePlane.cxx.

62 {
63  for(auto& anode: m_anodes) {
64  auto ch = anode->channel(chident);
65  if (ch == nullptr) { continue; }
66  return ch;
67  }
68  return nullptr;
69 }
std::vector< IAnodePlane::pointer > m_anodes
std::vector< int > Gen::MegaAnodePlane::channels ( ) const
virtual

Return a collection of all channels.

Implements WireCell::IAnodePlane.

Definition at line 51 of file MegaAnodePlane.cxx.

52 {
53  std::vector<int> ret;
54  for(auto& anode: m_anodes) {
55  auto chans = anode->channels();
56  ret.insert(ret.end(), chans.begin(), chans.end());
57  }
58  return ret;
59 }
std::vector< IAnodePlane::pointer > m_anodes
void Gen::MegaAnodePlane::configure ( const WireCell::Configuration config)
virtual

Accept a configuration.

Implements WireCell::IConfigurable.

Definition at line 21 of file MegaAnodePlane.cxx.

22 {
23  m_anodes.clear();
24  auto anodes_tn = cfg["anodes_tn"];
25  for (auto anode_tn: anodes_tn) {
26  auto anode = Factory::find_tn<IAnodePlane>(anode_tn.asString());
27  m_anodes.push_back(anode);
28  // std::cout << "MegaAnodePlane: adding anode " << anode_tn << std::endl;
29  // for(int channel: anode->channels()){
30  // cout << channel << " ";
31  // }
32  }
33 }
cfg
Definition: dbjson.py:29
std::vector< IAnodePlane::pointer > m_anodes
WireCell::Configuration Gen::MegaAnodePlane::default_configuration ( ) const
virtual

Optional, override to return a hard-coded default configuration.

These must be provided

Reimplemented from WireCell::IConfigurable.

Definition at line 12 of file MegaAnodePlane.cxx.

13 {
15  /// These must be provided
16  cfg["anodes_tn"] = Json::arrayValue;
17 
18  return cfg;
19 }
cfg
Definition: dbjson.py:29
Json::Value Configuration
Definition: Configuration.h:50
virtual IAnodeFace::pointer WireCell::Gen::MegaAnodePlane::face ( int  ident) const
inlinevirtual

Return a anode face by its ident number.

Implements WireCell::IAnodePlane.

Definition at line 44 of file MegaAnodePlane.h.

44  {
45  return nullptr;
46  }
virtual IAnodeFace::vector WireCell::Gen::MegaAnodePlane::faces ( ) const
inlinevirtual

Return all faces.

Implements WireCell::IAnodePlane.

Definition at line 47 of file MegaAnodePlane.h.

47  {
48  return IAnodeFace::vector();
49  }
std::vector< pointer > vector
Vector of shared pointers.
Definition: IComponent.h:36
virtual int WireCell::Gen::MegaAnodePlane::ident ( ) const
inlinevirtual

Return the ident number of this plane.

Implements WireCell::IAnodePlane.

Definition at line 41 of file MegaAnodePlane.h.

41  {
42  return -1;
43  }
virtual int WireCell::Gen::MegaAnodePlane::nfaces ( ) const
inlinevirtual

Return number of faces (eg, MicroBooNE=1, DUNE=2)

Implements WireCell::IAnodePlane.

Definition at line 36 of file MegaAnodePlane.h.

36  {
37  return m_anodes[0]->nfaces();
38  }
std::vector< IAnodePlane::pointer > m_anodes
WirePlaneId Gen::MegaAnodePlane::resolve ( int  channel) const
virtual

Resolve a channel ident number to a WirePlaneId.

Implements WireCell::IAnodePlane.

Definition at line 35 of file MegaAnodePlane.cxx.

36 {
37  // cout << "MegaAnodePlane: resolve channel " << channel << endl;
38  const WirePlaneId bogus(0xFFFFFFFF); // -1 is unknown
39 
40  for(auto& anode: m_anodes){
41  WirePlaneId planeId = anode->resolve(channel);
42  if(planeId.index() > -1){
43  // std::cout << "MegaAnodePlane: plane index " << planeId.index() << "for channel " << channel << std::endl;
44  return planeId;
45  }
46  }
47  // cout << "MegaAnodePlane: unknown plane for channel " << channel << endl;
48  return bogus;
49 }
virtual IChannel::pointer channel(int chident) const
Return an IChannel with the associated channel ID.
std::vector< IAnodePlane::pointer > m_anodes
IWire::vector Gen::MegaAnodePlane::wires ( int  chident) const
virtual

Return all wires connected into the given channel ident number.

Implements WireCell::IAnodePlane.

Definition at line 71 of file MegaAnodePlane.cxx.

72 {
73  for(auto& anode: m_anodes) {
74  auto ws = anode->wires(channel);
75  if (ws.empty()) { continue; }
76  return ws;
77  }
78  return IWire::vector();
79 }
std::vector< pointer > vector
Definition: IData.h:21
virtual IChannel::pointer channel(int chident) const
Return an IChannel with the associated channel ID.
std::vector< IAnodePlane::pointer > m_anodes

Member Data Documentation

std::vector<IAnodePlane::pointer> WireCell::Gen::MegaAnodePlane::m_anodes
private

Definition at line 52 of file MegaAnodePlane.h.


The documentation for this class was generated from the following files: