Router for fast addressing of summary data in KM3NETDAQ::JDAQSummaryslice data structure as a function of the optical module identifier and PMT address.
More...
#include <JSummaryRouter.hh>
Router for fast addressing of summary data in KM3NETDAQ::JDAQSummaryslice data structure as a function of the optical module identifier and PMT address.
The member method update() should be used to update the internal router for a given event. The member method getRate(const JDAQPMTIdentifier&) const can subsequently be used to obtain the measured singles rate for a given PMT.
Definition at line 36 of file JSupport/JSummaryRouter.hh.
◆ JSummaryRouter()
| JSUPPORT::JSummaryRouter::JSummaryRouter |
( |
| ) |
|
|
inline |
◆ update()
Update router.
- Parameters
-
| ps | pointer to new summary slice |
Definition at line 53 of file JSupport/JSummaryRouter.hh.
54 {
55 if (ps != NULL) {
56
57
58
59 for (JDAQSummaryslice::const_iterator i = this->begin(); i != this->end(); ++i) {
60 router.put(i->getModuleID(),
router.getDefaultAddress());
61 }
62
64
65
66
67 for (JDAQSummaryslice::const_iterator i = this->begin(); i != this->end(); ++i) {
69 }
70 }
71 }
◆ getAddress()
Get address of module.
- Parameters
-
- Returns
- address
Definition at line 80 of file JSupport/JSummaryRouter.hh.
81 {
83 }
int getModuleID() const
Get module identifier.
◆ hasSummaryFrame()
◆ getSummaryFrame() [1/2]
Get summary frame.
- Parameters
-
- Returns
- summary frame
Definition at line 104 of file JSupport/JSummaryRouter.hh.
105 {
108 else
110 }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Exception for accessing a value in a collection that is outside of its range.
const int getAddress(const JDAQModuleIdentifier &module) const
Get address of module.
◆ getSummaryFrame() [2/2]
Get summary frame.
- Parameters
-
| module | module |
| rate_Hz | default rate [Hz] |
- Returns
- summary frame
Definition at line 120 of file JSupport/JSummaryRouter.hh.
121 {
123
125
126 } else {
127
130
133 }
134
136 }
137 }
static const JDAQFrameStatus & getInstance()
Get reference to unique instance of this class object.
void setDAQFrameStatus(const JDAQFrameStatus &status)
Set DAQ frame status.
void setModuleIdentifier(const JDAQModuleIdentifier &module)
Set Module identifier.
void setRate(const int tdc, const double rate_Hz)
Set count rate.
static const int NUMBER_OF_PMTS
Total number of PMTs in module.
◆ getRate() [1/2]
Get rate.
- Parameters
-
- Returns
- rate [Hz]
Definition at line 146 of file JSupport/JSummaryRouter.hh.
147 {
150 else
152 }
bool hasSummaryFrame(const JDAQModuleIdentifier &module) const
Has summary frame.
const JDAQSummaryFrame & getSummaryFrame(const JDAQModuleIdentifier &module) const
Get summary frame.
double getRate(const int tdc, const double factor=1.0) const
Get count rate.
◆ getRate() [2/2]
| double JSUPPORT::JSummaryRouter::getRate |
( |
const JDAQPMTIdentifier & | id, |
|
|
const double | rate_Hz ) const |
|
inline |
Get rate.
- Parameters
-
| id | PMT identifier |
| rate_Hz | default rate [Hz] |
- Returns
- rate [Hz]
Definition at line 162 of file JSupport/JSummaryRouter.hh.
163 {
164 double R = 0.0;
165
168 }
169
170 if (R < rate_Hz) {
171 R = rate_Hz;
172 }
173
174 return R;
175 }
◆ print()
| std::ostream & KM3NETDAQ::JDAQSummaryslice::print |
( |
std::ostream & | out, |
|
|
const bool | lpr = false ) const |
|
inlineinherited |
Print DAQ summary.
- Parameters
-
| out | output stream |
| lpr | long print |
- Returns
- output stream
Definition at line 88 of file JDAQSummaryslice.hh.
89 {
91
92 out << this->ClassName() << endl;
93 out << dynamic_cast<const JDAQPreamble&> (*this) << endl;
94 out << dynamic_cast<const JDAQChronometer&>(*this) << endl;
95
96 for (JDAQSummaryslice::const_iterator module = this->begin(); module != this->end(); ++module) {
97
98 out << ' ' << setw(10) << module->getModuleID();
99 out << ' ' << setw(8) << setfill('0') << hex << module->getStatus() << dec << setfill(' ');
100 out << '|' << setw(8) << setfill('0') << hex << module->getFIFOStatus() << dec << setfill(' ');
101 out << ' ' << setw(2) << module->getUDPNumberOfReceivedPackets();
102 out << ' ' << setw(2) << module->getUDPMaximalSequenceNumber();
103
104 if (lpr) {
106 out << ' ' << fixed << showpoint << setw(4) << setprecision(1) << module->getRate(pmt) * 1.0e-3;
107 }
108 }
109
110 out << endl;
111 }
112
113 return out;
114 }
◆ actionAtFileOpen()
| static void KM3NETDAQ::JDAQSummaryslice::actionAtFileOpen |
( |
int | version | ) |
|
|
inlinestaticinherited |
Action method at file open.
- Parameters
-
Definition at line 122 of file JDAQSummaryslice.hh.
123 {
125 }
static int ROOT_IO_VERSION
Streamer version of JDAQSummaryslice as obtained from ROOT file.
◆ ClassDef() [1/5]
◆ ClassDef() [2/5]
◆ ClassDef() [3/5]
◆ ClassDef() [4/5]
| KM3NETDAQ::JDAQHeader::ClassDef |
( |
JDAQHeader | , |
|
|
2 | ) |
|
inherited |
◆ ClassDef() [5/5]
◆ getDAQPreamble()
template<class T >
| static JDAQPreamble KM3NETDAQ::JDAQPreamble::getDAQPreamble |
( |
const T & | object | ) |
|
|
inlinestaticinherited |
Get DAQ preamble.
This method should be used for binary I/O to get the actual data for the given object.
To this end, the following method should be overloaded for the corresponding data type.
size_t getSizeof(const T&);
- Parameters
-
- Returns
- preamble
Definition at line 76 of file JDAQPreamble.hh.
77 {
79
82
83 return preamble;
84 }
friend size_t getSizeof()
Definition of method to get size of data type.
int getDataType()
Template definition for method returning data type.
◆ getLength()
| int KM3NETDAQ::JDAQAbstractPreamble::getLength |
( |
| ) |
const |
|
inlineinherited |
◆ getDataType()
| int KM3NETDAQ::JDAQAbstractPreamble::getDataType |
( |
| ) |
const |
|
inlineinherited |
◆ ClassDefNV()
◆ getDAQSummarysliceHeader()
◆ getDAQHeader()
| const JDAQHeader & KM3NETDAQ::JDAQHeader::getDAQHeader |
( |
| ) |
const |
|
inlineinherited |
Get DAQ header.
- Returns
- DAQ header
Definition at line 49 of file JDAQHeader.hh.
◆ setDAQHeader()
| void KM3NETDAQ::JDAQHeader::setDAQHeader |
( |
const JDAQHeader & | header | ) |
|
|
inlineinherited |
◆ getDAQChronometer()
| const JDAQChronometer & KM3NETDAQ::JDAQChronometer::getDAQChronometer |
( |
| ) |
const |
|
inlineinherited |
◆ setDAQChronometer()
| void KM3NETDAQ::JDAQChronometer::setDAQChronometer |
( |
const JDAQChronometer & | chronometer | ) |
|
|
inlineinherited |
Set DAQ chronometer.
- Parameters
-
| chronometer | DAQ chronometer |
Definition at line 99 of file JDAQChronometer.hh.
◆ getDetectorID()
| int KM3NETDAQ::JDAQChronometer::getDetectorID |
( |
| ) |
const |
|
inlineinherited |
◆ getRunNumber()
| int KM3NETDAQ::JDAQChronometer::getRunNumber |
( |
| ) |
const |
|
inlineinherited |
◆ getFrameIndex()
| int KM3NETDAQ::JDAQChronometer::getFrameIndex |
( |
| ) |
const |
|
inlineinherited |
◆ getTimesliceStart()
Get start of timeslice.
- Returns
- timeslice start
Definition at line 144 of file JDAQChronometer.hh.
145 {
147 }
JDAQUTCExtended timeslice_start
◆ setRunNumber()
| void KM3NETDAQ::JDAQChronometer::setRunNumber |
( |
const int | run | ) |
|
|
inlineinherited |
◆ setFrameIndex()
| void KM3NETDAQ::JDAQChronometer::setFrameIndex |
( |
const int | frame_index | ) |
|
|
inlineinherited |
◆ setTimesliceStart()
| void KM3NETDAQ::JDAQChronometer::setTimesliceStart |
( |
const JDAQUTCExtended & | timeslice_start | ) |
|
|
inlineinherited |
Set timeslice start time.
- Parameters
-
| timeslice_start | timeslice start time |
Definition at line 177 of file JDAQChronometer.hh.
◆ router
◆ frame
◆ length
| int KM3NETDAQ::JDAQAbstractPreamble::length |
|
protectedinherited |
◆ type
| int KM3NETDAQ::JDAQAbstractPreamble::type |
|
protectedinherited |
◆ detector_id
| int KM3NETDAQ::JDAQChronometer::detector_id |
|
protectedinherited |
◆ run
| int KM3NETDAQ::JDAQChronometer::run |
|
protectedinherited |
◆ frame_index
| int KM3NETDAQ::JDAQChronometer::frame_index |
|
protectedinherited |
◆ timeslice_start
The documentation for this class was generated from the following file: