Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
JDETECTOR::JPMTCalibration_t Struct Reference

Auxiliary data structure for PMT time calibration. More...

#include <JDetectorCalibration.hh>

Inheritance diagram for JDETECTOR::JPMTCalibration_t:
JLANG::JObjectID JDETECTOR::JCalibration JLANG::JComparable< JObjectID > JLANG::JComparable< JObjectID, int >

Public Member Functions

 JPMTCalibration_t ()
 Default constructor.
 
 JPMTCalibration_t (const JObjectID &id, const JCalibration &calibration)
 Constructor.
 
int getID () const
 Get identifier.
 
int & getID ()
 Get identifier.
 
void setID (const int id)
 Set identifier.
 
bool less (const JObjectID &object) const
 Less than method.
 
bool less (const int id) const
 Less than method.
 
bool more (const int id) const
 More than method.
 
const JCalibrationgetCalibration () const
 Get calibration.
 
JCalibrationgetCalibration ()
 Get calibration.
 
void setCalibration (const JCalibration &cal)
 Set calibration.
 
double getT0 () const
 Get time offset.
 
void setT0 (const double t0)
 Set time offset.
 
void addT0 (const double t0)
 Add time offset.
 
void subT0 (const double t0)
 Subtract time offset.
 

Protected Attributes

int __id
 
double t0
 

Friends

void to_json (json &js, const JPMTCalibration_t &object)
 Convert PMT time calibration to JSon.
 
void from_json (const json &js, JPMTCalibration_t &object)
 Convert JSon to PMT time calibration.
 

Detailed Description

Auxiliary data structure for PMT time calibration.

Definition at line 139 of file JDetectorCalibration.hh.

Constructor & Destructor Documentation

◆ JPMTCalibration_t() [1/2]

JDETECTOR::JPMTCalibration_t::JPMTCalibration_t ( )
inline

Default constructor.

Definition at line 146 of file JDetectorCalibration.hh.

147 {}

◆ JPMTCalibration_t() [2/2]

JDETECTOR::JPMTCalibration_t::JPMTCalibration_t ( const JObjectID & id,
const JCalibration & calibration )
inline

Constructor.

Parameters
idPMT identifier
calibrationPMT time calibration

Definition at line 156 of file JDetectorCalibration.hh.

157 :
158 JObjectID (id),
159 JCalibration(calibration)
160 {}
JCalibration()
Default constructor.
JObjectID()
Default constructor.
Definition JObjectID.hh:30

Member Function Documentation

◆ getID() [1/2]

int JLANG::JObjectID::getID ( ) const
inlineinherited

Get identifier.

Returns
identifier

Definition at line 50 of file JObjectID.hh.

51 {
52 return __id;
53 }

◆ getID() [2/2]

int & JLANG::JObjectID::getID ( )
inlineinherited

Get identifier.

Returns
identifier

Definition at line 61 of file JObjectID.hh.

62 {
63 return __id;
64 }

◆ setID()

void JLANG::JObjectID::setID ( const int id)
inlineinherited

Set identifier.

Parameters
ididentifier

Definition at line 72 of file JObjectID.hh.

73 {
74 this->__id = id;
75 }

◆ less() [1/2]

bool JLANG::JObjectID::less ( const JObjectID & object) const
inlineinherited

Less than method.

Parameters
objectobject identifier
Returns
true if this identifier less than given identifier; else false

Definition at line 84 of file JObjectID.hh.

85 {
86 return this->getID() < object.getID();
87 }
int getID() const
Get identifier.
Definition JObjectID.hh:50

◆ less() [2/2]

bool JLANG::JObjectID::less ( const int id) const
inlineinherited

Less than method.

Parameters
ididentifier
Returns
true if this identifier less than given identifier; else false

Definition at line 96 of file JObjectID.hh.

97 {
98 return this->getID() < id;
99 }

◆ more()

bool JLANG::JObjectID::more ( const int id) const
inlineinherited

More than method.

Parameters
ididentifier
Returns
true if this identifier greater than given identifier; else false

Definition at line 108 of file JObjectID.hh.

109 {
110 return this->getID() > id;
111 }

◆ getCalibration() [1/2]

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

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 ( )
inlineinherited

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)
inlineinherited

Set calibration.

Parameters
calcalibration

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

90 {
91 *this = cal;
92 }

◆ getT0()

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

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)
inlineinherited

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)
inlineinherited

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)
inlineinherited

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 Symbol Documentation

◆ to_json

void to_json ( json & js,
const JPMTCalibration_t & object )
friend

Convert PMT time calibration to JSon.

Parameters
jsjson
objectPMT time calibration

Definition at line 169 of file JDetectorCalibration.hh.

170 {
171 js = json{ { Serial_t, object.getID() },
172 { T0_t, object.getT0() } };
173 }
nlohmann::json json
static const std::string T0_t
static const std::string Serial_t

◆ from_json

void from_json ( const json & js,
JPMTCalibration_t & object )
friend

Convert JSon to PMT time calibration.

Parameters
jsjson
objectPMT time calibration

Definition at line 182 of file JDetectorCalibration.hh.

183 {
184 object.setID(js.at(Serial_t).get<int>());
185
186 object.setT0(js.at(T0_t).get<double>());
187 }

Member Data Documentation

◆ __id

int JLANG::JObjectID::__id
protectedinherited

Definition at line 140 of file JObjectID.hh.

◆ t0

double JDETECTOR::JCalibration::t0
protectedinherited

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


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