ChannelGeo.cxx
Go to the documentation of this file.
1 // ChannelGeo.cxx
2 
3 #include "ChannelGeo.h"
4 
7 
8 //**********************************************************************
9 
11 : ChannelGeo(icha, &*art::ServiceHandle<geo::Geometry>()) { }
12 
13 //**********************************************************************
14 
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 }
37 
38 //**********************************************************************
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.
ChannelGeo(Index icha, const geo::GeometryCore *pgeo)
Definition: ChannelGeo.cxx:15
art framework interface to geometry description
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
Description of geometry of one entire detector.
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
LArSoft geometry interface.
Definition: ChannelGeo.h:16
unsigned int Index
Definition: ChannelGeo.h:24