#include <FeeHit.h>
Inheritance diagram for DybDaq::FeeHit:
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 | |
virtual | ~FeeHit () |
Destroy this instance of the class. | |
unsigned int | channelId () const |
Returns the channel id for this object. | |
unsigned int | adcChannelId () const |
Returns the ADC channel id for this object. | |
unsigned int | peakCycle () const |
Returns the cycle of the ADC peak. | |
bool | isHighRangeAdc () const |
Returns true if the High ADC was readout. | |
unsigned int | preAdc () const |
Returns the mesured pre-ADC value. | |
unsigned int | adc () const |
Returns the measured ADC value. | |
unsigned int | tdcChannelId () const |
Returns the TDC channel id for this object. | |
unsigned int | hitNumber () const |
Returns the hit number within the trigger (counting backwards). | |
unsigned int | tdc () const |
Returns the measured TDC value. | |
virtual unsigned int | bufferSize () const |
Returns the size, in 4-bytes, of this ojbect's contents in the buffer. | |
const FeeTraits & | feeTraits () const |
Returns the FeeTraits instance used to parse this object's buffer. | |
bool | hasDaqTraits () const |
virtual const DaqTraits & | daqTraits () const |
virtual unsigned int | gather (OutputBufferList &outputBuffers) const |
virtual unsigned int | inspect (DaqBuffer::Bytes &inspectors) const |
Static Public Attributes | |
static const unsigned int | kBytesInInt |
static const unsigned int | kUndefinedFormatComponent |
Protected Member Functions | |
virtual unsigned int | formatComponent () const |
Returns the component with the format of this buffer. | |
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) |
Private Member Functions | |
FeeHit (const unsigned int channel, const unsigned int peakCycle, const bool highRangeAdc, const unsigned int pedestal, const unsigned int charge, const unsigned int hitNumber, const unsigned int time, const FeeTraits &traits) | |
FeeHit (const ByteBuffer &byteBuffer, const FeeTraits &traits) | |
Create an instance of this class. | |
FeeHit () | |
Suppress default. | |
FeeHit (FeeHit &rhs) | |
Suppress default. | |
FeeHit & | operator= (FeeHit &rhs) |
Suppress default. | |
void | setChannelId (const unsigned int channelId) |
Set the channel id. | |
void | setPeakCycle (const unsigned int peakCycle) |
Set the cycle of the ADC peak. | |
void | setHighRangeAdc (const bool highRangeAdc) |
Set whether the High ADC was readout or not. | |
void | setPreAdc (const unsigned int value) |
Set the mesured pre-ADC value. | |
void | setAdc (const unsigned int value) |
Set the measured ADC value. | |
void | setHitNumber (const unsigned int hitNumber) |
Set the hit number within the trigger (counting backwards). | |
void | setTdc (const unsigned int value) |
Set the measured TDC vlaue. | |
Friends | |
class | FeeReadout |
Definition at line 20 of file FeeHit.h.
FeeHit::~FeeHit | ( | ) | [virtual] |
FeeHit::FeeHit | ( | const unsigned int | channel, | |
const unsigned int | peakCycle, | |||
const bool | highRangeAdc, | |||
const unsigned int | pedestal, | |||
const unsigned int | charge, | |||
const unsigned int | hitNumber, | |||
const unsigned int | time, | |||
const FeeTraits & | traits | |||
) | [private] |
Definition at line 16 of file FeeHit.cc.
00023 : 00024 FeeBuffer(new char[traits.hitSize() * kBytesInInt], 00025 traits) { 00026 traits.initializeHit(buffer()); 00027 setChannelId(channelId); 00028 setPeakCycle(peakCycle); 00029 setHighRangeAdc(highRangeAdc); 00030 setPreAdc(preAdc); 00031 setAdc(adc); 00032 setHitNumber(hitNumber); 00033 setTdc(tdc); 00034 }
FeeHit::FeeHit | ( | const ByteBuffer & | byteBuffer, | |
const FeeTraits & | traits | |||
) | [private] |
Create an instance of this class.
Definition at line 36 of file FeeHit.cc.
00037 : 00038 FeeBuffer(byteBuffer, 00039 traits) { 00040 byteBuffer.position(byteBuffer.position() + (feeTraits().hitSize() * kBytesInInt)); 00041 }
DybDaq::FeeHit::FeeHit | ( | ) | [private] |
Suppress default.
DybDaq::FeeHit::FeeHit | ( | FeeHit & | rhs | ) | [private] |
Suppress default.
unsigned int FeeHit::channelId | ( | ) | const |
Returns the channel id for this object.
Definition at line 50 of file FeeHit.cc.
00050 { 00051 return readUnsignedInt(FeeTraits::kChargeChannelId); 00052 }
unsigned int FeeHit::adcChannelId | ( | ) | const |
Returns the ADC channel id for this object.
Definition at line 54 of file FeeHit.cc.
00054 { 00055 return readUnsignedInt(FeeTraits::kChargeChannelId); 00056 }
unsigned int FeeHit::peakCycle | ( | ) | const |
Returns the cycle of the ADC peak.
Definition at line 58 of file FeeHit.cc.
00058 { 00059 return readUnsignedInt(FeeTraits::kPeakCycle); 00060 }
bool FeeHit::isHighRangeAdc | ( | ) | const |
Returns true if the High ADC was readout.
Definition at line 62 of file FeeHit.cc.
00062 { 00063 return readBool(FeeTraits::kHighRangeAdc); 00064 }
unsigned int FeeHit::preAdc | ( | ) | const |
Returns the mesured pre-ADC value.
Definition at line 66 of file FeeHit.cc.
00066 { 00067 return readUnsignedInt(FeeTraits::kPreAdc); 00068 }
unsigned int FeeHit::adc | ( | ) | const |
Returns the measured ADC value.
Definition at line 70 of file FeeHit.cc.
00070 { 00071 return readUnsignedInt(FeeTraits::kAdc); 00072 }
unsigned int FeeHit::tdcChannelId | ( | ) | const |
Returns the TDC channel id for this object.
Definition at line 74 of file FeeHit.cc.
00074 { 00075 return readUnsignedInt(FeeTraits::kTimeChannelId); 00076 }
unsigned int FeeHit::hitNumber | ( | ) | const |
Returns the hit number within the trigger (counting backwards).
Definition at line 78 of file FeeHit.cc.
00078 { 00079 return readUnsignedInt(FeeTraits::kHitNumber); 00080 }
unsigned int FeeHit::tdc | ( | ) | const |
Returns the measured TDC value.
Definition at line 82 of file FeeHit.cc.
00082 { 00083 return readUnsignedInt(FeeTraits::kTdc); 00084 }
unsigned int FeeHit::bufferSize | ( | ) | const [virtual] |
Returns the size, in 4-bytes, of this ojbect's contents in the buffer.
Implements DybDaq::DaqBuffer.
Definition at line 86 of file FeeHit.cc.
00086 { 00087 return feeTraits().hitSize(); 00088 }
unsigned int FeeHit::formatComponent | ( | ) | const [protected, virtual] |
Returns the component with the format of this buffer.
Reimplemented from DybDaq::DaqBuffer.
Definition at line 46 of file FeeHit.cc.
00046 { 00047 return FeeTraits::kHit; 00048 }
void FeeHit::setChannelId | ( | const unsigned int | channelId | ) | [private] |
Set the channel id.
Definition at line 90 of file FeeHit.cc.
00090 { 00091 writeField(channelId, 00092 FeeTraits::kChargeChannelId); 00093 writeField(channelId, 00094 FeeTraits::kTimeChannelId); 00095 }
void FeeHit::setPeakCycle | ( | const unsigned int | peakCycle | ) | [private] |
Set the cycle of the ADC peak.
Definition at line 97 of file FeeHit.cc.
00097 { 00098 writeField(peakCycle, 00099 FeeTraits::kPeakCycle); 00100 }
void FeeHit::setHighRangeAdc | ( | const bool | highRangeAdc | ) | [private] |
Set whether the High ADC was readout or not.
Definition at line 102 of file FeeHit.cc.
00102 { 00103 writeField(highRangeAdc, 00104 FeeTraits::kHighRangeAdc); 00105 }
void FeeHit::setPreAdc | ( | const unsigned int | value | ) | [private] |
Set the mesured pre-ADC value.
Definition at line 107 of file FeeHit.cc.
00107 { 00108 writeField(value, 00109 FeeTraits::kPreAdc); 00110 }
void FeeHit::setAdc | ( | const unsigned int | value | ) | [private] |
Set the measured ADC value.
Definition at line 112 of file FeeHit.cc.
00112 { 00113 writeField(value, 00114 FeeTraits::kAdc); 00115 }
void FeeHit::setHitNumber | ( | const unsigned int | hitNumber | ) | [private] |
Set the hit number within the trigger (counting backwards).
Definition at line 117 of file FeeHit.cc.
00117 { 00118 writeField(hitNumber, 00119 FeeTraits::kHitNumber); 00120 }
void FeeHit::setTdc | ( | const unsigned int | value | ) | [private] |
Set the measured TDC vlaue.
Definition at line 122 of file FeeHit.cc.
00122 { 00123 writeField(value, 00124 FeeTraits::kTdc); 00125 }
const FeeTraits & FeeBuffer::feeTraits | ( | ) | const [inherited] |
Returns the FeeTraits instance used to parse this object's buffer.
Definition at line 34 of file FeeBuffer.cc.
00034 { 00035 return dynamic_cast<const FeeTraits&>(daqTraits()); 00036 }
friend class FeeReadout [friend] |