#include <LtbFrame.h>
Inheritance diagram for DybDaq::LtbFrame:
Public Types | |
typedef std::pair< const char *, unsigned int > | OutputBuffer |
typedef std::vector< OutputBuffer > | OutputBufferList |
typedef std::vector< ByteInspector * > | Bytes |
typedef std::vector< BitsInspector * > | Bits |
Public Member Functions | |
LtbFrame (const unsigned int readoutType, const unsigned int triggerMask, const LtbTraits::LtbDateTime &dateTime, const unsigned int halfNanoseconds, const int accumulation, const unsigned int hitSum, const bool totalEsum, const bool highEsum, const bool lowEsum, const unsigned int energySum, const unsigned int crossTriggerSource, const bool accumulationStatus, const bool validGps, const bool usingUtc, const bool validClockSystem, const bool feeBufferFull, const bool ltbBufferFull, const unsigned int blockedTriggerCount, const LtbTraits &traits) | |
Create an instance of this class. | |
virtual | ~LtbFrame () |
Destroy this instance of the class. | |
unsigned int | frameNumber () const |
Returns the number of the frame in the LTB package. | |
unsigned int | readoutType () const |
Returns the readout type of this object. | |
unsigned int | triggerMask () const |
Returns the readout type of this object. | |
bool | isTriggerLineSet (const unsigned int line) const |
Returns true if the specified trigger lines bit is set. | |
const LtbTraits::LtbDateTime & | dateTime () const |
Returns the readout type of this object. | |
unsigned int | ticks () const |
Returns the number of ticks, passed the data and time, of this object. | |
unsigned int | halfNanoseconds () const |
Returns the 1/2 nanoseconds within the seconds of this object. | |
int | accumulation () const |
Returns the accumulated deviation of 1/2 nanosecond from the PPS. | |
unsigned int | hitSum () const |
Returns the total hits summation for the object. | |
bool | totalEsum () const |
Returns true if this total energy summation threshold is passed. | |
bool | highEsum () const |
Returns true if this high energy summation threshold is passed. | |
bool | lowEsum () const |
Returns true if this low energy summation threshold is passed. | |
unsigned int | energySum () const |
Returns the total energy summation for the object. | |
unsigned int | crossTriggerSource () const |
Returns the source, if any of any cross trigger received. | |
bool | accumulationStatus () const |
Returns true if the accumulation exceeds the 32-bit integer. | |
bool | validGps () const |
Returns true if the trigger system is using GPS. | |
bool | usingUtc () const |
Returns true if using GPS and using UTC. | |
bool | validClockSystem () const |
Returns true if the clock is external to to the LTB. | |
bool | feeBufferFull () const |
Returns true if the FEE buffer is full between this valid local trigger and the last valid local trigger. | |
bool | ltbBufferFull () const |
Returns true if the LTB buffer is full between this valid local trigger and the last valid local trigger. | |
unsigned int | blockedTriggerCount () const |
Returns the number block trigger in this object. | |
virtual unsigned int | bufferSize () const |
Returns the size, in 4-bytes, of this ojbect's contents in the buffer. | |
virtual unsigned int | gather (OutputBufferList &outputBuffers) const |
Adds to the supplied list the OutputBuffers that contain the DAQ format of this object's content, returning the total number of bytes in the added buffers. | |
virtual unsigned int | inspect (DaqBuffer::Bytes &inspectors) const |
Adds to the supplied list the DaqBuffer::Bytes that contains inspections of this object's objects. | |
void | setTriggerLine (const unsigned int line) |
Sets the specified trigger line. | |
const LtbTraits & | ltbTraits () const |
Returns the LtbTraits instance used to parse this object's buffer. | |
bool | hasDaqTraits () const |
virtual const DaqTraits & | daqTraits () const |
virtual unsigned int | gather (OutputBufferList &outputBuffers) const |
Static Public Attributes | |
static const unsigned int | kBytesInInt |
static const unsigned int | kUndefinedFormatComponent |
Protected Member Functions | |
LtbFrame (const ByteBuffer &byteBuffer, const LtbTraits &traits) | |
Create an instance of this class. | |
const char * | buffer () const |
char * | buffer () |
bool | hasByteBuffer () const |
const ByteBuffer & | byteBuffer () const |
unsigned int | fillInspectors (DaqBuffer::Bytes &inspectors, unsigned int component, unsigned int cursor) const |
virtual bool | readBool (const unsigned int field) const |
virtual int | readInt (const unsigned int field) const |
virtual unsigned char | readUnsignedChar (const unsigned int field) const |
virtual unsigned int | readUnsignedInt (const unsigned int field) const |
virtual void | writeField (const bool value, const unsigned int field) |
virtual void | writeField (const int value, const unsigned int field) |
virtual void | writeField (const unsigned int value, const unsigned int field) |
virtual unsigned int | formatComponent () const |
Private Member Functions | |
LtbFrame () | |
Suppress default. | |
LtbFrame (LtbFrame &rhs) | |
Suppress default. | |
LtbFrame & | operator= (LtbFrame &rhs) |
Suppress default. | |
void | setFrameNumber (const unsigned int frameNumber) |
Sets the number of the frame in the LTB package. | |
void | setReadoutType (const unsigned int readoutType) |
Sets the readout type of this object. | |
void | setTriggerMask (const unsigned int triggerMask) |
Sets the trigger mask of this object. | |
void | setDateTime (const LtbTraits::LtbDateTime &dataTime) |
Returns the readout type of this object. | |
void | setHalfNanoseconds (const unsigned int halfNanoseconds) |
Sets the 1/2 nanoseconds within the seconds of this object. | |
void | setAccumulation (const int accumulation) |
Sets the accumulated deviation of 1/2 nanosecond from the PPS. | |
void | setHitSum (const unsigned int hitSum) |
Sets the total hits summation for the object. | |
void | setTotalEsum (const bool totalEsum) |
Sets whether the total energy summation threshold is passed or not. | |
void | setHighEsum (const bool highEsum) |
Sets whether the high energy summation threshold is passed or not. | |
void | setLowEsum (const bool lowEsum) |
Sets whether the low energy summation threshold is passed or not. | |
void | setEnergySum (const unsigned int energySum) |
Sets the total energy summation for the object. | |
void | setCrossTriggerSource (const unsigned int crossTriggerSource) |
Sets the source, if any of any cross trigger received. | |
void | setAccumulationStatus (const bool accumulationStatus) |
Sets whether the accumulation exceeds the 32-bit integer or not. | |
void | setValidGps (const bool validGps) |
Sets whether the trigger system is using GPS or not. | |
void | setUsingUtc (const bool usingUtc) |
Sets whether if using GPS and using UTC or not. | |
void | setValidClockSystem (const bool validClockSystem) |
Sets whether if the clock is external to to the LTB or not. | |
void | setFeeBufferFull (const bool feeBufferFull) |
Sets whether FEE buffer is full between this valid local trigger and the last valid local trigger or not. | |
void | setLtbBufferFull (const bool ltbBufferFull) |
Sets whether LTB buffer is full between this valid local trigger and the last valid local trigger ot not. | |
void | setBlockedTriggerCount (const unsigned int blockedTriggerCount) |
Sets the number block trigger in this object. | |
Private Attributes | |
LtbTime * | m_time |
The time of this trigger. | |
Friends | |
class | LtbReadout |
Definition at line 23 of file LtbFrame.h.
LtbFrame::LtbFrame | ( | const unsigned int | readoutType, | |
const unsigned int | triggerMask, | |||
const LtbTraits::LtbDateTime & | dateTime, | |||
const unsigned int | halfNanoseconds, | |||
const int | accumulation, | |||
const unsigned int | hitSum, | |||
const bool | totalEsum, | |||
const bool | highEsum, | |||
const bool | lowEsum, | |||
const unsigned int | energySum, | |||
const unsigned int | crossTriggerSource, | |||
const bool | accumulationStatus, | |||
const bool | validGps, | |||
const bool | usingUtc, | |||
const bool | validClockSystem, | |||
const bool | feeBufferFull, | |||
const bool | ltbBufferFull, | |||
const unsigned int | blockedTriggerCount, | |||
const LtbTraits & | traits | |||
) |
Create an instance of this class.
Definition at line 22 of file LtbFrame.cc.
00040 : 00041 LtbBuffer(new char[traits.frameSize() * kBytesInInt], 00042 traits), 00043 m_time(0) { 00044 traits.initializeFrame(buffer()); 00045 setFrameNumber(0); 00046 setReadoutType(readoutType); 00047 setTriggerMask(triggerMask); 00048 m_time = new LtbTime(dateTime, 00049 halfNanoseconds, 00050 accumulation, 00051 traits); 00052 setHitSum(hitSum); 00053 setTotalEsum(totalEsum); 00054 setHighEsum(highEsum); 00055 setLowEsum(lowEsum); 00056 setEnergySum(energySum); 00057 setCrossTriggerSource(crossTriggerSource); 00058 setAccumulationStatus(accumulationStatus); 00059 setValidGps(validGps); 00060 setUsingUtc(usingUtc); 00061 setValidClockSystem(validClockSystem); 00062 setFeeBufferFull(feeBufferFull); 00063 setLtbBufferFull(ltbBufferFull); 00064 setBlockedTriggerCount(blockedTriggerCount); 00065 }
LtbFrame::~LtbFrame | ( | ) | [virtual] |
LtbFrame::LtbFrame | ( | const ByteBuffer & | byteBuffer, | |
const LtbTraits & | traits | |||
) | [protected] |
Create an instance of this class.
Definition at line 68 of file LtbFrame.cc.
00069 : 00070 LtbBuffer(byteBuffer, 00071 traits), 00072 m_time(0) { 00073 const unsigned int position = byteBuffer.position(); 00074 byteBuffer.position(position + (ltbTraits().timeOffset() * kBytesInInt)); 00075 m_time = new LtbTime(byteBuffer, 00076 traits); 00077 byteBuffer.position(position + (ltbTraits().frameSize() * kBytesInInt)); 00078 }
DybDaq::LtbFrame::LtbFrame | ( | ) | [private] |
Suppress default.
DybDaq::LtbFrame::LtbFrame | ( | LtbFrame & | rhs | ) | [private] |
Suppress default.
unsigned int LtbFrame::frameNumber | ( | ) | const |
Returns the number of the frame in the LTB package.
Definition at line 86 of file LtbFrame.cc.
00086 { 00087 return readUnsignedInt(LtbTraits::kFrameNumber); 00088 }
unsigned int LtbFrame::readoutType | ( | ) | const |
Returns the readout type of this object.
Definition at line 90 of file LtbFrame.cc.
00090 { 00091 return readUnsignedInt(LtbTraits::kReadoutType); 00092 }
unsigned int LtbFrame::triggerMask | ( | ) | const |
Returns the readout type of this object.
Definition at line 94 of file LtbFrame.cc.
00094 { 00095 return readUnsignedInt(LtbTraits::kTriggerMask); 00096 }
bool LtbFrame::isTriggerLineSet | ( | const unsigned int | line | ) | const |
Returns true if the specified trigger lines bit is set.
Definition at line 98 of file LtbFrame.cc.
00098 { 00099 return 0 != (triggerMask() & ltbTraits().triggerLineBit(line)); 00100 }
const LtbTraits::LtbDateTime & LtbFrame::dateTime | ( | ) | const |
Returns the readout type of this object.
Definition at line 102 of file LtbFrame.cc.
00102 { 00103 return *m_time; 00104 }
unsigned int LtbFrame::ticks | ( | ) | const |
Returns the number of ticks, passed the data and time, of this object.
Definition at line 106 of file LtbFrame.cc.
unsigned int LtbFrame::halfNanoseconds | ( | ) | const |
Returns the 1/2 nanoseconds within the seconds of this object.
Definition at line 110 of file LtbFrame.cc.
00110 { 00111 return m_time->halfNanoseconds(); 00112 }
int LtbFrame::accumulation | ( | ) | const |
Returns the accumulated deviation of 1/2 nanosecond from the PPS.
Definition at line 114 of file LtbFrame.cc.
00114 { 00115 return m_time->accumulation(); 00116 }
unsigned int LtbFrame::hitSum | ( | ) | const |
Returns the total hits summation for the object.
Definition at line 118 of file LtbFrame.cc.
00118 { 00119 return readUnsignedInt(LtbTraits::kHitSum); 00120 }
bool LtbFrame::totalEsum | ( | ) | const |
Returns true if this total energy summation threshold is passed.
Definition at line 122 of file LtbFrame.cc.
00122 { 00123 return readBool(LtbTraits::kTotalEsum); 00124 }
bool LtbFrame::highEsum | ( | ) | const |
Returns true if this high energy summation threshold is passed.
Definition at line 126 of file LtbFrame.cc.
00126 { 00127 return readBool(LtbTraits::kHighEsum); 00128 }
bool LtbFrame::lowEsum | ( | ) | const |
Returns true if this low energy summation threshold is passed.
Definition at line 130 of file LtbFrame.cc.
00130 { 00131 return readBool(LtbTraits::kLowEsum); 00132 }
unsigned int LtbFrame::energySum | ( | ) | const |
Returns the total energy summation for the object.
Definition at line 134 of file LtbFrame.cc.
00134 { 00135 return readUnsignedInt(LtbTraits::kEnergySum); 00136 }
unsigned int LtbFrame::crossTriggerSource | ( | ) | const |
Returns the source, if any of any cross trigger received.
Definition at line 138 of file LtbFrame.cc.
00138 { 00139 return readUnsignedInt(LtbTraits::kCrossTriggerSource); 00140 }
bool LtbFrame::accumulationStatus | ( | ) | const |
Returns true if the accumulation exceeds the 32-bit integer.
Definition at line 142 of file LtbFrame.cc.
00142 { 00143 return readBool(LtbTraits::kAccumulationStatus); 00144 }
bool LtbFrame::validGps | ( | ) | const |
Returns true if the trigger system is using GPS.
Definition at line 146 of file LtbFrame.cc.
00146 { 00147 return readBool(LtbTraits::kValidGps); 00148 }
bool LtbFrame::usingUtc | ( | ) | const |
Returns true if using GPS and using UTC.
Definition at line 150 of file LtbFrame.cc.
00150 { 00151 return readBool(LtbTraits::kUsingUtc); 00152 }
bool LtbFrame::validClockSystem | ( | ) | const |
Returns true if the clock is external to to the LTB.
Definition at line 154 of file LtbFrame.cc.
00154 { 00155 return readBool(LtbTraits::kValidClockSystem); 00156 }
bool LtbFrame::feeBufferFull | ( | ) | const |
Returns true if the FEE buffer is full between this valid local trigger and the last valid local trigger.
Definition at line 158 of file LtbFrame.cc.
00158 { 00159 return readBool(LtbTraits::kFeeBufferFull); 00160 }
bool LtbFrame::ltbBufferFull | ( | ) | const |
Returns true if the LTB buffer is full between this valid local trigger and the last valid local trigger.
Definition at line 162 of file LtbFrame.cc.
00162 { 00163 return readBool(LtbTraits::kLtbBufferFull); 00164 }
unsigned int LtbFrame::blockedTriggerCount | ( | ) | const |
Returns the number block trigger in this object.
Definition at line 166 of file LtbFrame.cc.
00166 { 00167 return readUnsignedInt(LtbTraits::kBlockedTriggerCount); 00168 }
unsigned int LtbFrame::bufferSize | ( | ) | const [virtual] |
Returns the size, in 4-bytes, of this ojbect's contents in the buffer.
Implements DybDaq::DaqBuffer.
Definition at line 193 of file LtbFrame.cc.
unsigned int LtbFrame::gather | ( | OutputBufferList & | outputBuffers | ) | const [virtual] |
Adds to the supplied list the OutputBuffers that contain the DAQ format of this object's content, returning the total number of bytes in the added buffers.
Definition at line 170 of file LtbFrame.cc.
00170 { 00171 if (!hasByteBuffer()) { 00172 const LtbTraits& traits = ltbTraits(); 00173 memcpy(const_cast<char*>(buffer()) + (traits.timeOffset() * kBytesInInt), 00174 m_time->buffer(), 00175 traits.timeSize() * kBytesInInt); 00176 } 00177 return LtbBuffer::gather(outputBuffers); 00178 }
unsigned int LtbFrame::inspect | ( | DaqBuffer::Bytes & | inspectors | ) | const [virtual] |
Adds to the supplied list the DaqBuffer::Bytes that contains inspections of this object's objects.
Reimplemented from DybDaq::DaqBuffer.
Definition at line 181 of file LtbFrame.cc.
00181 { 00182 unsigned int cursor = fillInspectors(inspectors, 00183 LtbTraits::kFrameFront, 00184 0); 00185 cursor += m_time->inspect(inspectors); 00186 cursor = fillInspectors(inspectors, 00187 LtbTraits::kFrameBack, 00188 cursor + 1); 00189 return cursor + 1; 00190 }
void LtbFrame::setTriggerLine | ( | const unsigned int | line | ) |
Sets the specified trigger line.
Definition at line 212 of file LtbFrame.cc.
00212 { 00213 writeField((triggerMask() | ltbTraits().triggerLineBit(line)), 00214 LtbTraits::kTriggerMask); 00215 }
void LtbFrame::setFrameNumber | ( | const unsigned int | frameNumber | ) | [private] |
Sets the number of the frame in the LTB package.
Definition at line 197 of file LtbFrame.cc.
00197 { 00198 writeField(frameNumber, 00199 LtbTraits::kFrameNumber); 00200 }
void LtbFrame::setReadoutType | ( | const unsigned int | readoutType | ) | [private] |
Sets the readout type of this object.
Definition at line 202 of file LtbFrame.cc.
00202 { 00203 writeField(readoutType, 00204 LtbTraits::kReadoutType); 00205 }
void LtbFrame::setTriggerMask | ( | const unsigned int | triggerMask | ) | [private] |
Sets the trigger mask of this object.
Definition at line 207 of file LtbFrame.cc.
00207 { 00208 writeField(triggerMask, 00209 LtbTraits::kTriggerMask); 00210 }
void LtbFrame::setDateTime | ( | const LtbTraits::LtbDateTime & | dataTime | ) | [private] |
Returns the readout type of this object.
Definition at line 217 of file LtbFrame.cc.
00217 { 00218 m_time->setDateTime(dateTime); 00219 }
void LtbFrame::setHalfNanoseconds | ( | const unsigned int | halfNanoseconds | ) | [private] |
Sets the 1/2 nanoseconds within the seconds of this object.
Definition at line 221 of file LtbFrame.cc.
00221 { 00222 m_time->setHalfNanoseconds(halfNanoseconds); 00223 }
void LtbFrame::setAccumulation | ( | const int | accumulation | ) | [private] |
Sets the accumulated deviation of 1/2 nanosecond from the PPS.
Definition at line 225 of file LtbFrame.cc.
00225 { 00226 m_time->setAccumulation(accumulation); 00227 }
void LtbFrame::setHitSum | ( | const unsigned int | hitSum | ) | [private] |
Sets the total hits summation for the object.
Definition at line 229 of file LtbFrame.cc.
00229 { 00230 writeField(hitSum, 00231 LtbTraits::kHitSum); 00232 }
void LtbFrame::setTotalEsum | ( | const bool | totalEsum | ) | [private] |
Sets whether the total energy summation threshold is passed or not.
Definition at line 234 of file LtbFrame.cc.
00234 { 00235 writeField(totalEsum, 00236 LtbTraits::kTotalEsum); 00237 }
void LtbFrame::setHighEsum | ( | const bool | highEsum | ) | [private] |
Sets whether the high energy summation threshold is passed or not.
Definition at line 239 of file LtbFrame.cc.
00239 { 00240 writeField(highEsum, 00241 LtbTraits::kHighEsum); 00242 }
void LtbFrame::setLowEsum | ( | const bool | lowEsum | ) | [private] |
Sets whether the low energy summation threshold is passed or not.
Definition at line 244 of file LtbFrame.cc.
00244 { 00245 writeField(lowEsum, 00246 LtbTraits::kLowEsum); 00247 }
void LtbFrame::setEnergySum | ( | const unsigned int | energySum | ) | [private] |
Sets the total energy summation for the object.
Definition at line 249 of file LtbFrame.cc.
00249 { 00250 writeField(energySum, 00251 LtbTraits::kEnergySum); 00252 }
void LtbFrame::setCrossTriggerSource | ( | const unsigned int | crossTriggerSource | ) | [private] |
Sets the source, if any of any cross trigger received.
Definition at line 254 of file LtbFrame.cc.
00254 { 00255 writeField(crossTriggerSource, 00256 LtbTraits::kCrossTriggerSource); 00257 }
void LtbFrame::setAccumulationStatus | ( | const bool | accumulationStatus | ) | [private] |
Sets whether the accumulation exceeds the 32-bit integer or not.
Definition at line 259 of file LtbFrame.cc.
00259 { 00260 writeField(accumulationStatus, 00261 LtbTraits::kAccumulationStatus); 00262 }
void LtbFrame::setValidGps | ( | const bool | validGps | ) | [private] |
Sets whether the trigger system is using GPS or not.
Definition at line 264 of file LtbFrame.cc.
00264 { 00265 writeField(validGps, 00266 LtbTraits::kValidGps); 00267 }
void LtbFrame::setUsingUtc | ( | const bool | usingUtc | ) | [private] |
Sets whether if using GPS and using UTC or not.
Definition at line 269 of file LtbFrame.cc.
00269 { 00270 writeField(usingUtc, 00271 LtbTraits::kUsingUtc); 00272 }
void LtbFrame::setValidClockSystem | ( | const bool | validClockSystem | ) | [private] |
Sets whether if the clock is external to to the LTB or not.
Definition at line 274 of file LtbFrame.cc.
00274 { 00275 writeField(validClockSystem, 00276 LtbTraits::kValidClockSystem); 00277 }
void LtbFrame::setFeeBufferFull | ( | const bool | feeBufferFull | ) | [private] |
Sets whether FEE buffer is full between this valid local trigger and the last valid local trigger or not.
Definition at line 279 of file LtbFrame.cc.
00279 { 00280 writeField(feeBufferFull, 00281 LtbTraits::kFeeBufferFull); 00282 }
void LtbFrame::setLtbBufferFull | ( | const bool | ltbBufferFull | ) | [private] |
Sets whether LTB buffer is full between this valid local trigger and the last valid local trigger ot not.
Definition at line 284 of file LtbFrame.cc.
00284 { 00285 writeField(ltbBufferFull, 00286 LtbTraits::kLtbBufferFull); 00287 }
void LtbFrame::setBlockedTriggerCount | ( | const unsigned int | blockedTriggerCount | ) | [private] |
Sets the number block trigger in this object.
Definition at line 289 of file LtbFrame.cc.
00289 { 00290 writeField(blockedTriggerCount, 00291 LtbTraits::kBlockedTriggerCount); 00292 }
const LtbTraits & LtbBuffer::ltbTraits | ( | ) | const [inherited] |
Returns the LtbTraits instance used to parse this object's buffer.
Definition at line 36 of file LtbBuffer.cc.
00036 { 00037 return dynamic_cast<const LtbTraits&>(daqTraits()); 00038 }
friend class LtbReadout [friend] |
Definition at line 27 of file LtbFrame.h.
LtbTime* DybDaq::LtbFrame::m_time [private] |