IcebergChannelGeo.cxx
Go to the documentation of this file.
1 // IcebergChannelGeo.cxx
2 
3 #include "IcebergChannelGeo.h"
4 
7 #include <string>
8 #include <iostream>
9 
10 using std::string;
11 using std::cout;
12 using std::endl;
13 
14 //**********************************************************************
15 
17 : IcebergChannelGeo(icha, &*art::ServiceHandle<geo::Geometry>()) { }
18 
19 //**********************************************************************
20 
22 : m_icha(icha), m_valid(false) {
23  const string myname = "IcebergChannelGeo::ctor: ";
24  if ( pgeo == nullptr ) return;
25  if ( icha >= pgeo->Nchannels() ) return;
26  m_valid = true;
27  if ( pgeo->DetectorName() != "iceberg" ) {
28  cout << myname << "WARNING: Iceberg mod is applied to non-Iceberg detector channels." << endl;
29  }
30  double ylo = 173.819 - 95.23;
31  for ( geo::WireID wid : pgeo->ChannelToWire(icha) ) {
32  EndPoints ends = pgeo->WireEndPoints<TVector3>(wid);
33  if ( ends.first.y() > ends.second.y() ) {
34  Point firstPoint = ends.first;
35  ends.first = ends.second;
36  ends.second = firstPoint;
37  }
38  Point& plo = ends.first;
39  Point& phi = ends.second;
40  if ( phi.y() < ylo ) continue;
41  if ( plo.y() < ylo ) {
42  // Set lower limit to ylo.
43  double slop = (plo.z() - phi.z())/(plo.y() - phi.y());
44  double zlo = phi.z() + slop*(ylo - phi.y());
45  plo.SetY(ylo);
46  plo.SetZ(zlo);
47  }
48  if ( m_ends.size() == 0 ) {
49  m_bot = ends.first;
50  m_top = ends.second;
51  } else {
52  if ( ends.first.y() < m_bot.y() ) m_bot = ends.first;
53  if ( ends.second.y() > m_top.y() ) m_top = ends.second;
54  }
55  m_ends.push_back(ends);
56  }
57 }
58 
59 //**********************************************************************
std::string string
Definition: nybbler.cc:12
std::vector< geo::WireID > ChannelToWire(raw::ChannelID_t const channel) const
Returns a list of wires connected to the specified TPC channel.
art framework interface to geometry description
unsigned int Nchannels() const
Returns the number of TPC readout channels in the detector.
std::string DetectorName() const
Returns a string with the name of the detector, as configured.
IcebergChannelGeo(Index icha, const geo::GeometryCore *pgeo)
Description of geometry of one entire detector.
EndPointsVector m_ends
void WireEndPoints(geo::WireID const &wireid, double *xyzStart, double *xyzEnd) const
Fills two arrays with the coordinates of the wire end points.
std::pair< Point, Point > EndPoints
if(!yymsg) yymsg
LArSoft geometry interface.
Definition: ChannelGeo.h:16
QTextStream & endl(QTextStream &s)