OfflineChan.cxx
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \file OfflineChan.cxx
3 /// \brief Simple object representing a (plane, cell) pair
4 /// \version $Id: OfflineChan.cxx,v 1.2 2012-09-20 21:42:43 greenc Exp $
5 /// \author bckhouse@caltech.edu
6 ////////////////////////////////////////////////////////////////////////
7 
9 
10 namespace geo
11 {
12  //....................................................................
14  {
15  return OfflineChan(chan/1000, chan%1000);
16  }
17 
18  //....................................................................
20  {
21  // Cell can never be more than 383.
22  // And this format is fairly human-readable
23  return 1000*fPlane+fCell;
24  }
25 
26  //....................................................................
27  bool OfflineChan::operator<(const OfflineChan& rhs) const
28  {
29  if(fPlane < rhs.fPlane) return true;
30  if(fPlane > rhs.fPlane) return false;
31  return fCell < rhs.fCell;
32  }
33 
34  //....................................................................
35  std::ostream& operator<<(std::ostream& os, const OfflineChan& chan)
36  {
37  os << "Plane " << chan.Plane() << " Cell " << chan.Cell();
38  return os;
39  }
40 
41 } // namespace
42 
43 ////////////////////////////////////////////////////////////////////////
int ToDBValidityChan() const
Definition: OfflineChan.cxx:19
std::ostream & operator<<(std::ostream &os, const OfflineChan &chan)
Definition: OfflineChan.cxx:35
unsigned short Plane() const
Definition: OfflineChan.h:31
unsigned short Cell() const
Definition: OfflineChan.h:32
unsigned short fCell
Definition: OfflineChan.h:41
A (plane, cell) pair.
Definition: OfflineChan.h:17
bool operator<(const OfflineChan &rhs) const
Definition: OfflineChan.cxx:27
unsigned short fPlane
Definition: OfflineChan.h:41
Helper for AttenCurve.
Definition: Path.h:10
Simple object representing a (plane, cell) pair.
static OfflineChan FromDBValidityChan(int chan)
Definition: OfflineChan.cxx:13