Jpp  master_rocky
the software that should make you happy
Public Member Functions | Protected Attributes | Friends | List of all members
JDETECTOR::JCalibration Class Reference

Data structure for time calibration. More...

#include <JCalibration.hh>

Inheritance diagram for JDETECTOR::JCalibration:
JDETECTOR::JModule JDETECTOR::JModuleCalibration_t JDETECTOR::JPMT JDETECTOR::JPMTCalibration_t JTRIGGER::JFrame< JElement_t, JAllocator_t > JCALIBRATE::JModel JMONITOR::JClusterBuilder

Public Member Functions

 JCalibration ()
 Default constructor. More...
 
 JCalibration (const double __t0)
 Constructor. More...
 
const JCalibrationgetCalibration () const
 Get calibration. More...
 
JCalibrationgetCalibration ()
 Get calibration. More...
 
void setCalibration (const JCalibration &cal)
 Set calibration. More...
 
double getT0 () const
 Get time offset. More...
 
void setT0 (const double t0)
 Set time offset. More...
 
void addT0 (const double t0)
 Add time offset. More...
 
void subT0 (const double t0)
 Subtract time offset. More...
 

Protected Attributes

double t0
 

Friends

std::istream & operator>> (std::istream &in, JCalibration &cal)
 Read calibration from input. More...
 
std::ostream & operator<< (std::ostream &out, const JCalibration &cal)
 Write calibration to output. More...
 
JReaderoperator>> (JReader &in, JCalibration &cal)
 Read calibration from input. More...
 
JWriteroperator<< (JWriter &out, const JCalibration &cal)
 Write calibration to output. More...
 

Detailed Description

Data structure for time calibration.

Definition at line 41 of file JDetector/JCalibration.hh.

Constructor & Destructor Documentation

◆ JCalibration() [1/2]

JDETECTOR::JCalibration::JCalibration ( )
inline

Default constructor.

Definition at line 47 of file JDetector/JCalibration.hh.

47  :
48  t0(0.0)
49  {}

◆ JCalibration() [2/2]

JDETECTOR::JCalibration::JCalibration ( const double  __t0)
inline

Constructor.

Parameters
__t0time offset [ns]

Definition at line 57 of file JDetector/JCalibration.hh.

57  :
58  t0(__t0)
59  {}

Member Function Documentation

◆ getCalibration() [1/2]

const JCalibration& JDETECTOR::JCalibration::getCalibration ( ) const
inline

Get calibration.

Returns
calibration

Definition at line 67 of file JDetector/JCalibration.hh.

68  {
69  return *this;
70  }

◆ getCalibration() [2/2]

JCalibration& JDETECTOR::JCalibration::getCalibration ( )
inline

Get calibration.

Returns
calibration

Definition at line 78 of file JDetector/JCalibration.hh.

79  {
80  return *this;
81  }

◆ setCalibration()

void JDETECTOR::JCalibration::setCalibration ( const JCalibration cal)
inline

Set calibration.

Parameters
calcalibration

Definition at line 89 of file JDetector/JCalibration.hh.

90  {
91  *this = cal;
92  }

◆ getT0()

double JDETECTOR::JCalibration::getT0 ( ) const
inline

Get time offset.

Returns
time offset [ns]

Definition at line 100 of file JDetector/JCalibration.hh.

101  {
102  return t0;
103  }

◆ setT0()

void JDETECTOR::JCalibration::setT0 ( const double  t0)
inline

Set time offset.

Parameters
t0time offset [ns]

Definition at line 111 of file JDetector/JCalibration.hh.

112  {
113  this->t0 = t0;
114  }

◆ addT0()

void JDETECTOR::JCalibration::addT0 ( const double  t0)
inline

Add time offset.

Parameters
t0time offset [ns]

Definition at line 122 of file JDetector/JCalibration.hh.

123  {
124  this->t0 += t0;
125  }

◆ subT0()

void JDETECTOR::JCalibration::subT0 ( const double  t0)
inline

Subtract time offset.

Parameters
t0time offset [ns]

Definition at line 133 of file JDetector/JCalibration.hh.

134  {
135  this->t0 -= t0;
136  }

Friends And Related Function Documentation

◆ operator>> [1/2]

std::istream& operator>> ( std::istream &  in,
JCalibration cal 
)
friend

Read calibration from input.

Parameters
ininput stream
calcalibration
Returns
input stream

Definition at line 146 of file JDetector/JCalibration.hh.

147  {
148  in >> cal.t0;
149 
150  return in;
151  }

◆ operator<< [1/2]

std::ostream& operator<< ( std::ostream &  out,
const JCalibration cal 
)
friend

Write calibration to output.

Parameters
outoutput stream
calcalibration
Returns
output stream

Definition at line 161 of file JDetector/JCalibration.hh.

162  {
163  const JFormat format(out, getFormat<JCalibration>(JFormat_t(9, 3, std::ios::fixed | std::ios::showpos)));
164 
165  out << format << cal.t0;
166 
167  return out;
168  }
Data structure for format specifications.
Definition: JManip.hh:524
Auxiliary class to temporarily define format specifications.
Definition: JManip.hh:636

◆ operator>> [2/2]

JReader& operator>> ( JReader in,
JCalibration cal 
)
friend

Read calibration from input.

Parameters
inreader
calcalibration
Returns
reader

Definition at line 178 of file JDetector/JCalibration.hh.

179  {
180  in >> cal.t0;
181 
182  return in;
183  }

◆ operator<< [2/2]

JWriter& operator<< ( JWriter out,
const JCalibration cal 
)
friend

Write calibration to output.

Parameters
outwriter
calcalibration
Returns
writer

Definition at line 193 of file JDetector/JCalibration.hh.

194  {
195  out << cal.t0;
196 
197  return out;
198  }

Member Data Documentation

◆ t0

double JDETECTOR::JCalibration::t0
protected

Definition at line 202 of file JDetector/JCalibration.hh.


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