#include <FeeTraits_v0_1.h>
Inheritance diagram for DybDaq::FeeTraits_v0_1:
Public Types | |
typedef std::vector< BitsDefinition > | Definitions |
Public Member Functions | |
FeeTraits_v0_1 () | |
Creates an instance of this class. | |
virtual | ~FeeTraits_v0_1 () |
Destroy this instance of the class. | |
virtual unsigned int | majorVersion () const |
virtual unsigned int | minorVersion () const |
virtual const std::string | versionString () const |
Returns the version of the event format as a string. | |
virtual unsigned int | headSize () const |
Returns the size of a FeeHead in this format. | |
virtual unsigned int | hitSize () const |
Returns the size of a fee hit in this format. | |
virtual unsigned int | footSize () const |
Returns the size of a FeeFoot in this format. | |
virtual void | initializeHead (char *buffer) const |
Initializes the FeeHead memory with the appropriate markers. | |
virtual void | initializeHit (char *buffer) const |
Initializes the FeeHit memory with the appropriate markers. | |
virtual void | initializeFoot (char *buffer) const |
Initializes the FeeFoot memory with the appropriate markers. | |
virtual unsigned int | illegalMarker () const |
Returns the index value for an illegal header. | |
virtual unsigned int | illegalField () const |
Returns the index value for an illegal field. | |
virtual const char * | triggerTypeAsString (unsigned int triggerType) const |
Returns the string for the specified trigger type. | |
virtual unsigned int | marker (unsigned int marker) const |
virtual const char * | boolAsString (bool value) const |
const DaqTraits::Definitions & | bitsDefinitions (unsigned int component) const |
Static Public Member Functions | |
static const char * | key () |
Returns a key for this verion, unique with FeeTraits. | |
static const FeeTraits & | defaultTraits () |
Returns a default FeeTraits to bootstrap the system. | |
static const FeeTraits * | readTraits (const char *&buffer) |
Returns the FeeTraits to use given the supplied buffer. | |
Static Public Attributes | |
static const unsigned int | kHead = 0 |
The head component for this format. | |
static const unsigned int | kHit = FeeTraits::kHead + 1 |
The hit component for this format. | |
static const unsigned int | kFoot = FeeTraits::kHit + 1 |
The foot component for this format. | |
static const unsigned int | kHeadTriggerNumber = 0 |
The field for the trigger number in the head. | |
static const unsigned int | kTriggerType = FeeTraits::kHeadTriggerNumber + 1 |
The field for the trigger type. | |
static const unsigned int | kChecked = FeeTraits::kTriggerType + 1 |
The field for the checked flag. | |
static const unsigned int | kError = FeeTraits::kChecked + 1 |
The field for the error flag. | |
static const unsigned int | kChargeChannelId = FeeTraits::kError + 1 |
The field for the channel id for the charge. | |
static const unsigned int | kPeakCycle = FeeTraits::kChargeChannelId + 1 |
The field for the peak cycle. | |
static const unsigned int | kHighRangeAdc = FeeTraits::kPeakCycle + 1 |
The field for the the high ADC range. | |
static const unsigned int | kAdc = FeeTraits::kHighRangeAdc + 1 |
The field for the measured ADC value. | |
static const unsigned int | kTimeChannelId = FeeTraits::kAdc + 1 |
The field for the channel id for the charge. | |
static const unsigned int | kHitNumber = FeeTraits::kTimeChannelId + 1 |
The field for the hit number within the trigger (counting backwards). | |
static const unsigned int | kTdc = FeeTraits::kHitNumber + 1 |
The field for the measured TDC value. | |
static const unsigned int | kFootTriggerNumber = FeeTraits::kTdc + 1 |
The field for the trigger number in the foot. | |
static const unsigned int | kFootDataLength = FeeTraits::kFootTriggerNumber + 1 |
The field for the trigger type. | |
static const unsigned int | kMajorVersion = FeeTraits::kFootDataLength + 1 |
The field for the major version. | |
static const unsigned int | kMinorVersion = FeeTraits::kMajorVersion + 1 |
The field for the minor version. | |
static const unsigned int | kPreAdc = FeeTraits::kMinorVersion + 1 |
The field for measured pre-ADC value. | |
static const unsigned int | kHeadMarker = FeeTraits::kPreAdc + 1 |
The field for the head marker. | |
static const unsigned int | kAdcDataMarker = FeeTraits::kHeadMarker + 1 |
The field for the ADC data marker. | |
static const unsigned int | kTdcDataMarker = FeeTraits::kAdcDataMarker + 1 |
The field for the TDC data marker. | |
static const unsigned int | kFootMarker = FeeTraits::kTdcDataMarker + 1 |
The field for the foot marker. | |
Protected Member Functions | |
virtual unsigned int | markersEnd () const |
Returns the maximum number of headers in an event. | |
virtual const unsigned int * | markers () const |
Returns the markers for the records. | |
virtual unsigned int | fieldsEnd () const |
Returns the maximum field value for a particluar format. | |
virtual const unsigned int * | indices () const |
Returns the indices of shifts for fields. | |
virtual const unsigned int * | shifts () const |
Returns the array of shifts for fields. | |
virtual const unsigned int * | masks () const |
Returns the array of marks for fields. | |
virtual const std::string * | descriptions () const |
Returns the array of descriptions for fields. | |
virtual DaqTraits::Definitions * | definitions (unsigned int component) const |
Returns the array of bits definitions for a compement. | |
virtual void | setDefinitions (DaqTraits::Definitions *definitions, unsigned int component) |
Sets the array of bits definitions for a compoment. | |
virtual const unsigned int * | componentFields (unsigned int component) const |
Sets the array of fields for a compoment. | |
virtual const unsigned int | componentFieldsEnd (unsigned int component) const |
Returns the maximum indexthe array of fields for a compoment. | |
virtual unsigned int | triggerTypeEnd () const |
Returns the maximum trigger type. | |
virtual const char ** | triggerTypeStrings () const |
Returns the array of trigger type strings. | |
unsigned int | index (unsigned int field) const |
Static Protected Member Functions | |
static unsigned int | readUnsignedInt (const char *&buffer, const DaqTraits &traits, unsigned int field) |
Private Member Functions | |
FeeTraits_v0_1 (FeeTraits_v0_1 &rhs) | |
Suppress default. | |
FeeTraits_v0_1 & | operator= (FeeTraits_v0_1 &rhs) |
Suppress default. | |
Friends | |
friend class | DaqBuffer |
Definition at line 17 of file FeeTraits_v0_1.h.
FeeTraits_v0_1::FeeTraits_v0_1 | ( | ) |
FeeTraits_v0_1::~FeeTraits_v0_1 | ( | ) | [virtual] |
DybDaq::FeeTraits_v0_1::FeeTraits_v0_1 | ( | FeeTraits_v0_1 & | rhs | ) | [private] |
Suppress default.
const char * FeeTraits_v0_1::key | ( | ) | [static] |
Returns a key for this verion, unique with FeeTraits.
Definition at line 161 of file FeeTraits_v0_1.cc.
unsigned int FeeTraits_v0_1::majorVersion | ( | ) | const [virtual] |
unsigned int FeeTraits_v0_1::minorVersion | ( | ) | const [virtual] |
const string FeeTraits_v0_1::versionString | ( | ) | const [virtual] |
Returns the version of the event format as a string.
Implements DybDaq::DaqTraits.
Definition at line 179 of file FeeTraits_v0_1.cc.
00179 { 00180 return key(); 00181 }
unsigned int FeeTraits_v0_1::headSize | ( | ) | const [virtual] |
Returns the size of a FeeHead in this format.
Implements DybDaq::FeeTraits.
Definition at line 183 of file FeeTraits_v0_1.cc.
unsigned int FeeTraits_v0_1::hitSize | ( | ) | const [virtual] |
Returns the size of a fee hit in this format.
Implements DybDaq::FeeTraits.
Definition at line 187 of file FeeTraits_v0_1.cc.
unsigned int FeeTraits_v0_1::footSize | ( | ) | const [virtual] |
Returns the size of a FeeFoot in this format.
Implements DybDaq::FeeTraits.
Definition at line 191 of file FeeTraits_v0_1.cc.
void FeeTraits_v0_1::initializeHead | ( | char * | buffer | ) | const [virtual] |
Initializes the FeeHead memory with the appropriate markers.
Implements DybDaq::FeeTraits.
Definition at line 195 of file FeeTraits_v0_1.cc.
void FeeTraits_v0_1::initializeHit | ( | char * | buffer | ) | const [virtual] |
Initializes the FeeHit memory with the appropriate markers.
Implements DybDaq::FeeTraits.
Definition at line 199 of file FeeTraits_v0_1.cc.
00199 { 00200 *((unsigned int*)buffer) = 0x60000000U; // ADC four bytes 00201 *((unsigned int*)(buffer + 4)) = 0x80000000U; // TDC four bytes 00202 }
void FeeTraits_v0_1::initializeFoot | ( | char * | buffer | ) | const [virtual] |
Initializes the FeeFoot memory with the appropriate markers.
Implements DybDaq::FeeTraits.
Definition at line 204 of file FeeTraits_v0_1.cc.
unsigned int FeeTraits_v0_1::markersEnd | ( | ) | const [protected, virtual] |
Returns the maximum number of headers in an event.
Implements DybDaq::DaqTraits.
Definition at line 208 of file FeeTraits_v0_1.cc.
const unsigned int * FeeTraits_v0_1::markers | ( | ) | const [protected, virtual] |
Returns the markers for the records.
Implements DybDaq::DaqTraits.
Definition at line 212 of file FeeTraits_v0_1.cc.
unsigned int FeeTraits_v0_1::fieldsEnd | ( | ) | const [protected, virtual] |
Returns the maximum field value for a particluar format.
Implements DybDaq::DaqTraits.
Definition at line 216 of file FeeTraits_v0_1.cc.
00216 { 00217 return kFootMarker + 1; 00218 }
const unsigned int * FeeTraits_v0_1::indices | ( | ) | const [protected, virtual] |
Returns the indices of shifts for fields.
Implements DybDaq::DaqTraits.
Definition at line 220 of file FeeTraits_v0_1.cc.
00220 { 00221 return m_indices; 00222 }
const unsigned int * FeeTraits_v0_1::shifts | ( | ) | const [protected, virtual] |
Returns the array of shifts for fields.
Implements DybDaq::DaqTraits.
Definition at line 224 of file FeeTraits_v0_1.cc.
00224 { 00225 return m_shifts; 00226 }
const unsigned int * FeeTraits_v0_1::masks | ( | ) | const [protected, virtual] |
Returns the array of marks for fields.
Implements DybDaq::DaqTraits.
Definition at line 228 of file FeeTraits_v0_1.cc.
00228 { 00229 return m_masks; 00230 }
const std::string * FeeTraits_v0_1::descriptions | ( | ) | const [protected, virtual] |
Returns the array of descriptions for fields.
Reimplemented from DybDaq::DaqTraits.
Definition at line 232 of file FeeTraits_v0_1.cc.
00232 { 00233 return m_description; 00234 }
DaqTraits::Definitions * FeeTraits_v0_1::definitions | ( | unsigned int | component | ) | const [protected, virtual] |
Returns the array of bits definitions for a compement.
Reimplemented from DybDaq::DaqTraits.
Definition at line 236 of file FeeTraits_v0_1.cc.
00236 { 00237 return m_definitions[component]; 00238 }
void FeeTraits_v0_1::setDefinitions | ( | DaqTraits::Definitions * | definitions, | |
unsigned int | component | |||
) | [protected, virtual] |
Sets the array of bits definitions for a compoment.
Reimplemented from DybDaq::DaqTraits.
Definition at line 240 of file FeeTraits_v0_1.cc.
00241 { 00242 m_definitions[component] = definitions; 00243 }
const unsigned int * FeeTraits_v0_1::componentFields | ( | unsigned int | component | ) | const [protected, virtual] |
Sets the array of fields for a compoment.
Reimplemented from DybDaq::DaqTraits.
Definition at line 245 of file FeeTraits_v0_1.cc.
00245 { 00246 return m_componentFields[component]; 00247 }
const unsigned int FeeTraits_v0_1::componentFieldsEnd | ( | unsigned int | component | ) | const [protected, virtual] |
Returns the maximum indexthe array of fields for a compoment.
Reimplemented from DybDaq::DaqTraits.
Definition at line 249 of file FeeTraits_v0_1.cc.
00249 { 00250 return m_componentFieldsEnd[component]; 00251 }
unsigned int FeeTraits_v0_1::triggerTypeEnd | ( | ) | const [protected, virtual] |
Returns the maximum trigger type.
Implements DybDaq::FeeTraits.
Definition at line 253 of file FeeTraits_v0_1.cc.
const char ** FeeTraits_v0_1::triggerTypeStrings | ( | ) | const [protected, virtual] |
Returns the array of trigger type strings.
Implements DybDaq::FeeTraits.
Definition at line 257 of file FeeTraits_v0_1.cc.
00257 { 00258 return m_triggerTypes; 00259 }
FeeTraits_v0_1& DybDaq::FeeTraits_v0_1::operator= | ( | FeeTraits_v0_1 & | rhs | ) | [private] |
Suppress default.
const FeeTraits & FeeTraits::defaultTraits | ( | ) | [static, inherited] |
Returns a default FeeTraits to bootstrap the system.
Definition at line 61 of file FeeTraits.cc.
00061 { 00062 if (0 == m_allTraits.size()) { 00063 m_allTraits.insert(std::pair<const char*, FeeTraits*>(FeeTraits_v0_0::key(),new FeeTraits_v0_0())); 00064 m_allTraits.insert(std::pair<const char*, FeeTraits*>(FeeTraits_v0_1::key(),new FeeTraits_v0_1())); 00065 m_allTraits.insert(std::pair<const char*, FeeTraits*>(FeeTraits_v0_2::key(),new FeeTraits_v0_2())); 00066 } 00067 return *m_allTraits[FeeTraits_v0_2::key()]; 00068 }
const FeeTraits * FeeTraits::readTraits | ( | const char *& | buffer | ) | [static, inherited] |
Returns the FeeTraits to use given the supplied buffer.
Definition at line 70 of file FeeTraits.cc.
00070 { 00071 unsigned int major = 0; 00072 const unsigned int minor = readUnsignedInt(buffer, 00073 defaultTraits(), 00074 FeeTraits::kMinorVersion); 00075 00076 const FeeTraits* result = 0; 00077 if (0U == major && 0U == minor) { 00078 result = m_allTraits[FeeTraits_v0_0::key()]; 00079 } else if (0U == major && 1U == minor) { 00080 result = m_allTraits[FeeTraits_v0_1::key()]; 00081 } else if (0U == major && 2U == minor) { 00082 result = m_allTraits[FeeTraits_v0_2::key()]; 00083 } 00084 return result; 00085 }
unsigned int FeeTraits::illegalMarker | ( | ) | const [virtual, inherited] |
Returns the index value for an illegal header.
Implements DybDaq::DaqTraits.
Definition at line 87 of file FeeTraits.cc.
unsigned int FeeTraits::illegalField | ( | ) | const [virtual, inherited] |
Returns the index value for an illegal field.
Implements DybDaq::DaqTraits.
Definition at line 91 of file FeeTraits.cc.
const char * FeeTraits::triggerTypeAsString | ( | unsigned int | triggerType | ) | const [virtual, inherited] |
Returns the string for the specified trigger type.
Definition at line 95 of file FeeTraits.cc.
00095 { 00096 if (triggerType >= triggerTypeEnd()) { 00097 return "Unknown"; 00098 } 00099 return triggerTypeStrings()[triggerType]; 00100 }
const unsigned int FeeTraits::kHead = 0 [static, inherited] |
const unsigned int FeeTraits::kHit = FeeTraits::kHead + 1 [static, inherited] |
const unsigned int FeeTraits::kFoot = FeeTraits::kHit + 1 [static, inherited] |
const unsigned int FeeTraits::kHeadTriggerNumber = 0 [static, inherited] |
const unsigned int FeeTraits::kTriggerType = FeeTraits::kHeadTriggerNumber + 1 [static, inherited] |
const unsigned int FeeTraits::kChecked = FeeTraits::kTriggerType + 1 [static, inherited] |
const unsigned int FeeTraits::kError = FeeTraits::kChecked + 1 [static, inherited] |
const unsigned int FeeTraits::kChargeChannelId = FeeTraits::kError + 1 [static, inherited] |
const unsigned int FeeTraits::kPeakCycle = FeeTraits::kChargeChannelId + 1 [static, inherited] |
const unsigned int FeeTraits::kHighRangeAdc = FeeTraits::kPeakCycle + 1 [static, inherited] |
const unsigned int FeeTraits::kAdc = FeeTraits::kHighRangeAdc + 1 [static, inherited] |
const unsigned int FeeTraits::kTimeChannelId = FeeTraits::kAdc + 1 [static, inherited] |
const unsigned int FeeTraits::kHitNumber = FeeTraits::kTimeChannelId + 1 [static, inherited] |
The field for the hit number within the trigger (counting backwards).
Definition at line 86 of file FeeTraits.h.
const unsigned int FeeTraits::kTdc = FeeTraits::kHitNumber + 1 [static, inherited] |
const unsigned int FeeTraits::kFootTriggerNumber = FeeTraits::kTdc + 1 [static, inherited] |
const unsigned int FeeTraits::kFootDataLength = FeeTraits::kFootTriggerNumber + 1 [static, inherited] |
const unsigned int FeeTraits::kMajorVersion = FeeTraits::kFootDataLength + 1 [static, inherited] |
const unsigned int FeeTraits::kMinorVersion = FeeTraits::kMajorVersion + 1 [static, inherited] |
const unsigned int FeeTraits::kPreAdc = FeeTraits::kMinorVersion + 1 [static, inherited] |
const unsigned int FeeTraits::kHeadMarker = FeeTraits::kPreAdc + 1 [static, inherited] |
const unsigned int FeeTraits::kAdcDataMarker = FeeTraits::kHeadMarker + 1 [static, inherited] |
const unsigned int FeeTraits::kTdcDataMarker = FeeTraits::kAdcDataMarker + 1 [static, inherited] |
const unsigned int FeeTraits::kFootMarker = FeeTraits::kTdcDataMarker + 1 [static, inherited] |