Public Types | Public Member Functions | Private Attributes | List of all members
ChannelGeo Class Reference

#include <ChannelGeo.h>

Public Types

using Index = unsigned int
 
using Point = TVector3
 
using EndPoints = std::pair< Point, Point >
 
using EndPointsVector = std::vector< EndPoints >
 

Public Member Functions

 ChannelGeo (Index icha, const geo::GeometryCore *pgeo)
 
 ChannelGeo (Index icha)
 
Index channel () const
 
bool isValid () const
 
Index nWires () const
 
const EndPointsVectorwires () const
 
const Pointtop () const
 
const Pointbottom () const
 

Private Attributes

Index m_icha
 
bool m_valid
 
EndPointsVector m_ends
 
Point m_top
 
Point m_bot
 

Detailed Description

Definition at line 20 of file ChannelGeo.h.

Member Typedef Documentation

using ChannelGeo::EndPoints = std::pair<Point, Point>

Definition at line 26 of file ChannelGeo.h.

Definition at line 27 of file ChannelGeo.h.

using ChannelGeo::Index = unsigned int

Definition at line 24 of file ChannelGeo.h.

using ChannelGeo::Point = TVector3

Definition at line 25 of file ChannelGeo.h.

Constructor & Destructor Documentation

ChannelGeo::ChannelGeo ( Index  icha,
const geo::GeometryCore pgeo 
)

Definition at line 15 of file ChannelGeo.cxx.

16 : m_icha(icha), m_valid(false) {
17  if ( pgeo == nullptr ) return;
18  if ( icha >= pgeo->Nchannels() ) return;
19  m_valid = true;
20  for ( geo::WireID wid : pgeo->ChannelToWire(icha) ) {
21  EndPoints ends = pgeo->WireEndPoints<TVector3>(wid);
22  if ( ends.first.y() > ends.second.y() ) {
23  Point firstPoint = ends.first;
24  ends.first = ends.second;
25  ends.second = firstPoint;
26  }
27  if ( m_ends.size() == 0 ) {
28  m_bot = ends.first;
29  m_top = ends.second;
30  } else {
31  if ( ends.first.y() < m_bot.y() ) m_bot = ends.first;
32  if ( ends.second.y() > m_top.y() ) m_top = ends.second;
33  }
34  m_ends.push_back(ends);
35  }
36 }
Index m_icha
Definition: ChannelGeo.h:53
std::vector< geo::WireID > ChannelToWire(raw::ChannelID_t const channel) const
Returns a list of wires connected to the specified TPC channel.
unsigned int Nchannels() const
Returns the number of TPC readout channels in the detector.
std::pair< Point, Point > EndPoints
Definition: ChannelGeo.h:26
EndPointsVector m_ends
Definition: ChannelGeo.h:55
Point m_bot
Definition: ChannelGeo.h:57
Point m_top
Definition: ChannelGeo.h:56
void WireEndPoints(geo::WireID const &wireid, double *xyzStart, double *xyzEnd) const
Fills two arrays with the coordinates of the wire end points.
bool m_valid
Definition: ChannelGeo.h:54
if(!yymsg) yymsg
ChannelGeo::ChannelGeo ( Index  icha)

Definition at line 10 of file ChannelGeo.cxx.

ChannelGeo(Index icha, const geo::GeometryCore *pgeo)
Definition: ChannelGeo.cxx:15

Member Function Documentation

const Point& ChannelGeo::bottom ( ) const
inline

Definition at line 49 of file ChannelGeo.h.

49 { return m_bot; }
Point m_bot
Definition: ChannelGeo.h:57
Index ChannelGeo::channel ( ) const
inline

Definition at line 36 of file ChannelGeo.h.

36 { return m_icha; }
Index m_icha
Definition: ChannelGeo.h:53
bool ChannelGeo::isValid ( ) const
inline

Definition at line 39 of file ChannelGeo.h.

39 { return m_valid; }
bool m_valid
Definition: ChannelGeo.h:54
Index ChannelGeo::nWires ( ) const
inline

Definition at line 42 of file ChannelGeo.h.

42 { return m_ends.size(); }
EndPointsVector m_ends
Definition: ChannelGeo.h:55
const Point& ChannelGeo::top ( ) const
inline

Definition at line 48 of file ChannelGeo.h.

48 { return m_top; }
Point m_top
Definition: ChannelGeo.h:56
const EndPointsVector& ChannelGeo::wires ( ) const
inline

Definition at line 45 of file ChannelGeo.h.

45 { return m_ends; }
EndPointsVector m_ends
Definition: ChannelGeo.h:55

Member Data Documentation

Point ChannelGeo::m_bot
private

Definition at line 57 of file ChannelGeo.h.

EndPointsVector ChannelGeo::m_ends
private

Definition at line 55 of file ChannelGeo.h.

Index ChannelGeo::m_icha
private

Definition at line 53 of file ChannelGeo.h.

Point ChannelGeo::m_top
private

Definition at line 56 of file ChannelGeo.h.

bool ChannelGeo::m_valid
private

Definition at line 54 of file ChannelGeo.h.


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