Auxiliary data structure for module status.
More...
#include <JDetectorCalibration.hh>
Auxiliary data structure for module status.
Definition at line 625 of file JDetectorCalibration.hh.
◆ status_type
◆ JModuleStatus_t() [1/2]
| JDETECTOR::JModuleStatus_t::JModuleStatus_t |
( |
| ) |
|
|
inline |
◆ JModuleStatus_t() [2/2]
| JDETECTOR::JModuleStatus_t::JModuleStatus_t |
( |
const JObjectID & | id, |
|
|
const JStatus & | status ) |
|
inline |
Constructor.
- Parameters
-
| id | module identifier |
| status | module status |
Definition at line 642 of file JDetectorCalibration.hh.
643 :
646 {}
JObjectID()
Default constructor.
JStatus()
Default constructor.
◆ getID() [1/2]
| int JLANG::JObjectID::getID |
( |
| ) |
const |
|
inlineinherited |
Get identifier.
- Returns
- identifier
Definition at line 50 of file JObjectID.hh.
◆ getID() [2/2]
| int & JLANG::JObjectID::getID |
( |
| ) |
|
|
inlineinherited |
Get identifier.
- Returns
- identifier
Definition at line 61 of file JObjectID.hh.
◆ setID()
| void JLANG::JObjectID::setID |
( |
const int | id | ) |
|
|
inlineinherited |
Set identifier.
- Parameters
-
Definition at line 72 of file JObjectID.hh.
◆ less() [1/2]
| bool JLANG::JObjectID::less |
( |
const JObjectID & | object | ) |
const |
|
inlineinherited |
Less than method.
- Parameters
-
- 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.
◆ less() [2/2]
| bool JLANG::JObjectID::less |
( |
const int | id | ) |
const |
|
inlineinherited |
Less than method.
- Parameters
-
- 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
-
- 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 }
◆ getStatus() [1/8]
Get status.
- Returns
- status
Definition at line 60 of file JStatus.hh.
◆ getStatus() [2/8]
Get status.
- Returns
- status
Definition at line 71 of file JStatus.hh.
72 {
73 return *this;
74 }
◆ getStatus() [3/8]
template<class T >
| const T JLANG::JStatus::getStatus |
( |
| ) |
const |
|
inlineinherited |
Get status.
- Returns
- status
Definition at line 83 of file JStatus.hh.
84 {
86 }
const T getStatus() const
Get status.
◆ getStatus() [4/8]
| const JStatus & JLANG::JStatus::getStatus |
( |
| ) |
const |
|
inlineinherited |
Get status.
- Returns
- status
Definition at line 94 of file JStatus.hh.
95 {
96 return static_cast<const JStatus&
>(*this);
97 }
◆ getStatus() [5/8]
Get status.
- Returns
- status
Definition at line 105 of file JStatus.hh.
◆ getStatus() [6/8]
Get status.
- Returns
- status
Definition at line 116 of file JStatus.hh.
117 {
118 return *this;
119 }
◆ getStatus() [7/8]
template<class T >
| T & JLANG::JStatus::getStatus |
( |
| ) |
|
|
inlineinherited |
Get status.
- Returns
- status
Definition at line 128 of file JStatus.hh.
◆ getStatus() [8/8]
| JStatus & JLANG::JStatus::getStatus |
( |
| ) |
|
|
inlineinherited |
Get status.
- Returns
- status
Definition at line 139 of file JStatus.hh.
140 {
141 return static_cast<JStatus&
>(*this);
142 }
◆ setStatus()
| void JLANG::JStatus::setStatus |
( |
const JStatus & | status | ) |
|
|
inlineinherited |
Set status.
- Parameters
-
Definition at line 150 of file JStatus.hh.
◆ equals()
| bool JLANG::JStatus::equals |
( |
const JStatus & | status | ) |
const |
|
inlineinherited |
Equal method.
- Parameters
-
- Returns
- true if this status equal to given status; else false
Definition at line 162 of file JStatus.hh.
◆ getAND()
Get combined status.
- Parameters
-
- Returns
- status
Definition at line 174 of file JStatus.hh.
◆ getOR()
Get combined status.
- Parameters
-
- Returns
- status
Definition at line 186 of file JStatus.hh.
◆ has()
| bool JLANG::JStatus::has |
( |
const int | bit | ) |
const |
|
inlineinherited |
Test PMT status.
- Parameters
-
- Returns
- true if bit is set; else false
Definition at line 198 of file JStatus.hh.
199 {
200 return (this->
status & (1<<bit)) != 0;
201 }
◆ set()
| void JLANG::JStatus::set |
( |
const int | bit | ) |
|
|
inlineinherited |
Set PMT status.
- Parameters
-
Definition at line 209 of file JStatus.hh.
◆ reset()
| void JLANG::JStatus::reset |
( |
const int | bit | ) |
|
|
inlineinherited |
Reset PMT status.
- Parameters
-
Definition at line 220 of file JStatus.hh.
221 {
222 this->
status &= ~(1<<bit);
223 }
◆ to_json
Convert module status to JSon.
- Parameters
-
| js | json |
| object | module status |
Definition at line 655 of file JDetectorCalibration.hh.
656 {
657 js =
json{ {
Id_t,
object.getID() },
659 }
static const std::string Id_t
static const std::string STATUS_t
◆ from_json
Convert JSon to module status.
- Parameters
-
| js | json |
| object | module status |
Definition at line 668 of file JDetectorCalibration.hh.
669 {
671 object.setID(js.at(
DOMId_t).get<
int>());
672 else if (js.contains(
Id_t))
673 object.setID(js.at(
Id_t) .get<
int>());
674 else
675 THROW(JNoValue,
"Missing module identifier.");
676
677 object.setStatus(js.at(
STATUS_t).get<
int>());
678 }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
static const std::string DOMId_t
◆ __id
| int JLANG::JObjectID::__id |
|
protectedinherited |
◆ NUMBER_OF_STATUS_BITS
| const int JLANG::JStatus::NUMBER_OF_STATUS_BITS = sizeof(status_type) * 8 |
|
staticinherited |
number of status bits
Definition at line 34 of file JStatus.hh.
◆ status
The documentation for this struct was generated from the following file: