Jpp 19.3.0-rc.2
the software that should make you happy
Loading...
Searching...
No Matches
JPMTReadoutAddress.hh
Go to the documentation of this file.
1#ifndef __JDETECTOR__JPMTREADOUTADDRESS__
2#define __JDETECTOR__JPMTREADOUTADDRESS__
3
4#include <istream>
5#include <ostream>
6
9
10
11/**
12 * \author mdejong
13 */
14
15namespace JDETECTOR {}
16namespace JPP { using namespace JDETECTOR; }
17
18namespace JDETECTOR {
19
21 using JIO::JReader;
22 using JIO::JWriter;
23
24
25 /**
26 * Data structure for PMT readout address.
27 */
29 public JComparable<JPMTReadoutAddress>
30 {
31 public:
32 /**
33 * Default constructor.
34 */
36 {
37 this->tdc = -1;
38 }
39
40
41 /**
42 * Constructor.
43 *
44 * \param tdc TDC
45 */
47 {
48 this->tdc = tdc;
49 }
50
51
52 /**
53 * Less than method.
54 *
55 * \param address PMT readout address
56 * \result true if this address before given address; else false
57 */
58 inline bool less(const JPMTReadoutAddress& address) const
59 {
60 return this->tdc < address.tdc;
61 }
62
63
64 /**
65 * Get TDC.
66 *
67 * \return TDC
68 */
69 int getTDC() const
70 {
71 return tdc;
72 }
73
74
75 /**
76 * Read PMT readout address from input.
77 *
78 * \param in input stream
79 * \param object PMT readout address
80 * \return input stream
81 */
82 friend inline std::istream& operator>>(std::istream& in, JPMTReadoutAddress& object)
83 {
84 return in >> object.tdc;
85 }
86
87
88 /**
89 * Write PMT readout address to output.
90 *
91 * \param out output stream
92 * \param object PMT readout address
93 * \return output stream
94 */
95 friend inline std::ostream& operator<<(std::ostream& out, const JPMTReadoutAddress& object)
96 {
97 return out << object.tdc;
98 }
99
100
101 /**
102 * Read PMT readout address from input.
103 *
104 * \param in reader
105 * \param object PMT readout address
106 * \return reader
107 */
108 friend inline JReader& operator>>(JReader& in, JPMTReadoutAddress& object)
109 {
110 return in >> object.tdc;
111 }
112
113
114 /**
115 * Write PMT readout address to output.
116 *
117 * \param out writer
118 * \param object PMT readout address
119 * \return writer
120 */
121 friend inline JWriter& operator<<(JWriter& out, const JPMTReadoutAddress& object)
122 {
123 return out << object.tdc;
124 }
125
126
127 int tdc; //!< TDC channel
128 };
129}
130
131#endif
Data structure for PMT readout address.
friend std::istream & operator>>(std::istream &in, JPMTReadoutAddress &object)
Read PMT readout address from input.
JPMTReadoutAddress()
Default constructor.
friend std::ostream & operator<<(std::ostream &out, const JPMTReadoutAddress &object)
Write PMT readout address to output.
friend JReader & operator>>(JReader &in, JPMTReadoutAddress &object)
Read PMT readout address from input.
friend JWriter & operator<<(JWriter &out, const JPMTReadoutAddress &object)
Write PMT readout address to output.
JPMTReadoutAddress(const int tdc)
Constructor.
bool less(const JPMTReadoutAddress &address) const
Less than method.
Interface for binary input.
Interface for binary output.
file Auxiliary data structures and methods for detector calibration.
Definition JAnchor.hh:12
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Template definition of auxiliary base class for comparison of data structures.