#include <EventTraits_v0_6.h>
Inheritance diagram for DybDaq::EventTraits_v0_6:
Public Types | |
typedef std::vector< BitsDefinition > | Definitions |
Public Member Functions | |
EventTraits_v0_6 () | |
Creates an instance of this class. | |
virtual | ~EventTraits_v0_6 () |
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 | headerSize (const unsigned int marker) const |
Returns the length of the requested marker. | |
virtual void | initializeHeader (const unsigned int marker, char *buffer) const |
Initializes the EventHeader 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. | |
const char * | siteAsString (const unsigned int site) const |
Returns the string for the specified site. | |
const char * | detectorAsString (const unsigned int detector) const |
Returns the string for the specified detector. | |
const char * | dataTypeAsString (const unsigned int dataType) const |
Returns the string for the specified dataType. | |
unsigned int | moduleType (const unsigned int module) const |
Returns the module type for the specified module, or 0xffffffU. | |
const char * | moduleTypeAsString (const unsigned int moduleType) const |
Returns the string for the specified module 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 EventTraits. | |
static const EventTraits & | defaultTraits () |
Returns a new default LtbTraits to bootstrap the system. | |
static const EventTraits * | readTraits (const char *&buffer) |
Returns a new LtbTraits if the supplied traits do not match the current one. | |
Static Public Attributes | |
static const unsigned int | kEventHeader = 0 |
The Event Header block. | |
static const unsigned int | kRomHeader = EventTraits::kEventHeader + 1 |
The ROM Header block. | |
static const unsigned int | kMarker = 0 |
The merker for the header. | |
static const unsigned int | kMajorVersion = EventTraits::kMarker + 1 |
The field for the major version number. | |
static const unsigned int | kMinorVersion = EventTraits::kMajorVersion + 1 |
The field for the minor version number. | |
static const unsigned int | kEventHeaderSize = EventTraits::kMinorVersion + 1 |
The field for the event header size. | |
static const unsigned int | kEventTotalSize = EventTraits::kEventHeaderSize + 1 |
The field for the total event size. | |
static const unsigned int | kEventSite = EventTraits::kEventTotalSize + 1 |
The field for the total event size. | |
static const unsigned int | kEventDetector = EventTraits::kEventSite + 1 |
The field for the detector of the event. | |
static const unsigned int | kEventRun = EventTraits::kEventDetector + 1 |
The field for the run number of the event. | |
static const unsigned int | kEventNumber = EventTraits::kEventRun + 1 |
The field for the event number of the event. | |
static const unsigned int | kEventDataType = EventTraits::kEventNumber + 1 |
The field for the data type of the event. | |
static const unsigned int | kCbltWrapping = EventTraits::kEventDataType + 1 |
The field for the wrapped CBLT readout. | |
static const unsigned int | kRawCblt = EventTraits::kCbltWrapping + 1 |
The field for the raw CBLT readout. | |
static const unsigned int | kLtbMismatch = EventTraits::kRawCblt + 1 |
The field for the trigger mismatch. | |
static const unsigned int | kInvalidData = EventTraits::kLtbMismatch + 1 |
The field for the invalid readout. | |
static const unsigned int | kRomHeaderSize = EventTraits::kInvalidData + 1 |
The field for the rom fragment header length. | |
static const unsigned int | kRomTotalSize = EventTraits::kRomHeaderSize + 1 |
The field for the total rom fragment length. | |
static const unsigned int | kRomSite = EventTraits::kRomTotalSize + 1 |
The field for the site of the rom fragment. | |
static const unsigned int | kRomDetector = EventTraits::kRomSite + 1 |
The field for the detector within the site of the rom fragment. | |
static const unsigned int | kRomModuleType = EventTraits::kRomDetector + 1 |
The field for the module type of the rom fragment. | |
static const unsigned int | kRomSlot = EventTraits::kRomModuleType + 1 |
The field for the slot of the rom fragment. | |
static const unsigned int | kFeeModule = 0 |
The ModuleType of the FEE. | |
static const unsigned int | kFadcModule = EventTraits::kFeeModule + 1 |
The ModuleType of the Trigger. | |
static const unsigned int | kLtbModule = EventTraits::kFadcModule + 1 |
The ModuleType of the Local Trigger Board. | |
static const unsigned int | kRpcRomModule = EventTraits::kLtbModule + 1 |
The ModuleType of the ROM Readout module. | |
static const unsigned int | kRpcRtmModule = EventTraits::kRpcRomModule + 1 |
The ModuleType of the ROM Readout module. | |
static const unsigned int | kMtbModule = EventTraits::kRpcRtmModule + 1 |
The ModuleType of the Master Trigger Board. | |
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 | maxSite () const |
Returns the maximum site. | |
virtual const char ** | siteStrings () const |
Returns the array of site strings. | |
virtual unsigned int | maxDetector () const |
Returns the maximum detector. | |
virtual const char ** | detectorStrings () const |
Returns the array of detector strings. | |
virtual unsigned int | maxDataType () const |
Returns the maximum data type. | |
virtual const char ** | dataTypeStrings () const |
Returns the array of data type strings. | |
virtual unsigned int | maxModuleType () const |
Returns the maximum module type. | |
virtual const unsigned int * | moduleTypes () const |
Returns the array of module types. | |
virtual const char ** | moduleTypeStrings () const |
Returns the array of site 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 | |
EventTraits_v0_6 (EventTraits_v0_6 &rhs) | |
Suppress default. | |
EventTraits_v0_6 & | operator= (EventTraits_v0_6 &rhs) |
Suppress default. | |
Friends | |
friend class | DaqBuffer |
Definition at line 17 of file EventTraits_v0_6.h.
EventTraits_v0_6::EventTraits_v0_6 | ( | ) |
EventTraits_v0_6::~EventTraits_v0_6 | ( | ) | [virtual] |
DybDaq::EventTraits_v0_6::EventTraits_v0_6 | ( | EventTraits_v0_6 & | rhs | ) | [private] |
Suppress default.
const char * EventTraits_v0_6::key | ( | ) | [static] |
Returns a key for this verion, unique with EventTraits.
Definition at line 211 of file EventTraits_v0_6.cc.
unsigned int EventTraits_v0_6::majorVersion | ( | ) | const [virtual] |
unsigned int EventTraits_v0_6::minorVersion | ( | ) | const [virtual] |
const string EventTraits_v0_6::versionString | ( | ) | const [virtual] |
Returns the version of the event format as a string.
Implements DybDaq::DaqTraits.
Definition at line 229 of file EventTraits_v0_6.cc.
00229 { 00230 return key(); 00231 }
unsigned int EventTraits_v0_6::headerSize | ( | const unsigned int | marker | ) | const [virtual] |
Returns the length of the requested marker.
Implements DybDaq::EventTraits.
Definition at line 233 of file EventTraits_v0_6.cc.
00233 { 00234 if (marker >= markersEnd()) { 00235 return illegalMarker(); 00236 } 00237 return m_headerLengths[marker]; 00238 }
void EventTraits_v0_6::initializeHeader | ( | const unsigned int | marker, | |
char * | buffer | |||
) | const [virtual] |
Initializes the EventHeader memory with the appropriate markers.
Implements DybDaq::EventTraits.
Definition at line 240 of file EventTraits_v0_6.cc.
00241 { 00242 for (unsigned int count = 0; 00243 count != headerSize(markerToInit); 00244 ++count) { 00245 *((unsigned int*)(buffer + (count * DaqBuffer::kBytesInInt))) = 0x00000000U; // Header four bytes 00246 } 00247 *((unsigned int*)buffer) = marker(markerToInit); 00248 if (markerToInit == kEventHeader) { 00249 *(((unsigned int*)buffer) + index(EventTraits::kEventDetector)) = 0xC0000000U; 00250 } 00251 }
unsigned int EventTraits_v0_6::markersEnd | ( | ) | const [protected, virtual] |
Returns the maximum number of headers in an event.
Implements DybDaq::DaqTraits.
Definition at line 253 of file EventTraits_v0_6.cc.
00253 { 00254 return kRomHeader + 1; 00255 }
const unsigned int * EventTraits_v0_6::markers | ( | ) | const [protected, virtual] |
Returns the markers for the records.
Implements DybDaq::DaqTraits.
Definition at line 257 of file EventTraits_v0_6.cc.
00257 { 00258 return m_markers; 00259 }
unsigned int EventTraits_v0_6::fieldsEnd | ( | ) | const [protected, virtual] |
Returns the maximum field value for a particluar format.
Implements DybDaq::DaqTraits.
Definition at line 261 of file EventTraits_v0_6.cc.
00261 { 00262 return kRomSlot + 1; 00263 }
const unsigned int * EventTraits_v0_6::indices | ( | ) | const [protected, virtual] |
Returns the indices of shifts for fields.
Implements DybDaq::DaqTraits.
Definition at line 265 of file EventTraits_v0_6.cc.
00265 { 00266 return m_indices; 00267 }
const unsigned int * EventTraits_v0_6::shifts | ( | ) | const [protected, virtual] |
Returns the array of shifts for fields.
Implements DybDaq::DaqTraits.
Definition at line 269 of file EventTraits_v0_6.cc.
00269 { 00270 return m_shifts; 00271 }
const unsigned int * EventTraits_v0_6::masks | ( | ) | const [protected, virtual] |
Returns the array of marks for fields.
Implements DybDaq::DaqTraits.
Definition at line 273 of file EventTraits_v0_6.cc.
00273 { 00274 return m_masks; 00275 }
const std::string * EventTraits_v0_6::descriptions | ( | ) | const [protected, virtual] |
Returns the array of descriptions for fields.
Reimplemented from DybDaq::DaqTraits.
Definition at line 277 of file EventTraits_v0_6.cc.
00277 { 00278 return m_description; 00279 }
DaqTraits::Definitions * EventTraits_v0_6::definitions | ( | unsigned int | component | ) | const [protected, virtual] |
Returns the array of bits definitions for a compement.
Reimplemented from DybDaq::DaqTraits.
Definition at line 281 of file EventTraits_v0_6.cc.
00281 { 00282 return m_definitions[component]; 00283 }
void EventTraits_v0_6::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 285 of file EventTraits_v0_6.cc.
00286 { 00287 m_definitions[component] = definitions; 00288 }
const unsigned int * EventTraits_v0_6::componentFields | ( | unsigned int | component | ) | const [protected, virtual] |
Sets the array of fields for a compoment.
Reimplemented from DybDaq::DaqTraits.
Definition at line 290 of file EventTraits_v0_6.cc.
00290 { 00291 return m_componentFields[component]; 00292 }
const unsigned int EventTraits_v0_6::componentFieldsEnd | ( | unsigned int | component | ) | const [protected, virtual] |
Returns the maximum indexthe array of fields for a compoment.
Reimplemented from DybDaq::DaqTraits.
Definition at line 294 of file EventTraits_v0_6.cc.
00294 { 00295 return m_componentFieldsEnd[component]; 00296 }
unsigned int EventTraits_v0_6::maxSite | ( | ) | const [protected, virtual] |
Returns the maximum site.
Implements DybDaq::EventTraits.
Definition at line 298 of file EventTraits_v0_6.cc.
const char ** EventTraits_v0_6::siteStrings | ( | ) | const [protected, virtual] |
Returns the array of site strings.
Implements DybDaq::EventTraits.
Definition at line 302 of file EventTraits_v0_6.cc.
00302 { 00303 return m_sites; 00304 }
unsigned int EventTraits_v0_6::maxDetector | ( | ) | const [protected, virtual] |
Returns the maximum detector.
Implements DybDaq::EventTraits.
Definition at line 306 of file EventTraits_v0_6.cc.
const char ** EventTraits_v0_6::detectorStrings | ( | ) | const [protected, virtual] |
Returns the array of detector strings.
Implements DybDaq::EventTraits.
Definition at line 310 of file EventTraits_v0_6.cc.
00310 { 00311 return m_detectors; 00312 }
unsigned int EventTraits_v0_6::maxDataType | ( | ) | const [protected, virtual] |
Returns the maximum data type.
Implements DybDaq::EventTraits.
Definition at line 314 of file EventTraits_v0_6.cc.
const char ** EventTraits_v0_6::dataTypeStrings | ( | ) | const [protected, virtual] |
Returns the array of data type strings.
Implements DybDaq::EventTraits.
Definition at line 318 of file EventTraits_v0_6.cc.
00318 { 00319 return m_dataTypes; 00320 }
unsigned int EventTraits_v0_6::maxModuleType | ( | ) | const [protected, virtual] |
Returns the maximum module type.
Implements DybDaq::EventTraits.
Definition at line 322 of file EventTraits_v0_6.cc.
00322 { 00323 return kMtbModule; 00324 }
const unsigned int * EventTraits_v0_6::moduleTypes | ( | ) | const [protected, virtual] |
Returns the array of module types.
Implements DybDaq::EventTraits.
Definition at line 326 of file EventTraits_v0_6.cc.
00326 { 00327 return m_moduleTypes; 00328 }
const char ** EventTraits_v0_6::moduleTypeStrings | ( | ) | const [protected, virtual] |
Returns the array of site strings.
Implements DybDaq::EventTraits.
Definition at line 330 of file EventTraits_v0_6.cc.
00330 { 00331 return m_moduleTypeStrings; 00332 }
EventTraits_v0_6& DybDaq::EventTraits_v0_6::operator= | ( | EventTraits_v0_6 & | rhs | ) | [private] |
Suppress default.
const EventTraits & EventTraits::defaultTraits | ( | ) | [static, inherited] |
Returns a new default LtbTraits to bootstrap the system.
Definition at line 60 of file EventTraits.cc.
00060 { 00061 if (0 == m_allTraits.size()) { 00062 m_allTraits.insert(std::pair<const char*, EventTraits*>(EventTraits_v0_6::key(),new EventTraits_v0_6())); 00063 } 00064 return *m_allTraits[EventTraits_v0_6::key()]; 00065 }
const EventTraits * EventTraits::readTraits | ( | const char *& | buffer | ) | [static, inherited] |
Returns a new LtbTraits if the supplied traits do not match the current one.
Definition at line 67 of file EventTraits.cc.
00067 { 00068 return &defaultTraits(); 00069 }
unsigned int EventTraits::illegalMarker | ( | ) | const [virtual, inherited] |
Returns the index value for an illegal header.
Implements DybDaq::DaqTraits.
Definition at line 71 of file EventTraits.cc.
unsigned int EventTraits::illegalField | ( | ) | const [virtual, inherited] |
Returns the index value for an illegal field.
Implements DybDaq::DaqTraits.
Definition at line 75 of file EventTraits.cc.
const char * EventTraits::siteAsString | ( | const unsigned int | site | ) | const [inherited] |
Returns the string for the specified site.
Definition at line 79 of file EventTraits.cc.
00079 { 00080 return siteStrings()[site]; 00081 }
const char * EventTraits::detectorAsString | ( | const unsigned int | detector | ) | const [inherited] |
Returns the string for the specified detector.
Definition at line 83 of file EventTraits.cc.
00083 { 00084 return detectorStrings()[detector]; 00085 }
const char * EventTraits::dataTypeAsString | ( | const unsigned int | dataType | ) | const [inherited] |
Returns the string for the specified dataType.
Definition at line 87 of file EventTraits.cc.
00087 { 00088 return dataTypeStrings()[dataType]; 00089 }
unsigned int EventTraits::moduleType | ( | const unsigned int | module | ) | const [inherited] |
Returns the module type for the specified module, or 0xffffffU.
Definition at line 91 of file EventTraits.cc.
00091 { 00092 if (module > maxModuleType()) { 00093 return 0; 00094 } 00095 return moduleTypes()[module]; 00096 }
const char * EventTraits::moduleTypeAsString | ( | const unsigned int | moduleType | ) | const [inherited] |
Returns the string for the specified module type.
Definition at line 98 of file EventTraits.cc.
00098 { 00099 return moduleTypeStrings()[moduleType]; 00100 }
const unsigned int EventTraits::kEventHeader = 0 [static, inherited] |
const unsigned int EventTraits::kRomHeader = EventTraits::kEventHeader + 1 [static, inherited] |
const unsigned int EventTraits::kMarker = 0 [static, inherited] |
const unsigned int EventTraits::kMajorVersion = EventTraits::kMarker + 1 [static, inherited] |
const unsigned int EventTraits::kMinorVersion = EventTraits::kMajorVersion + 1 [static, inherited] |
const unsigned int EventTraits::kEventHeaderSize = EventTraits::kMinorVersion + 1 [static, inherited] |
const unsigned int EventTraits::kEventTotalSize = EventTraits::kEventHeaderSize + 1 [static, inherited] |
const unsigned int EventTraits::kEventSite = EventTraits::kEventTotalSize + 1 [static, inherited] |
const unsigned int EventTraits::kEventDetector = EventTraits::kEventSite + 1 [static, inherited] |
const unsigned int EventTraits::kEventRun = EventTraits::kEventDetector + 1 [static, inherited] |
const unsigned int EventTraits::kEventNumber = EventTraits::kEventRun + 1 [static, inherited] |
const unsigned int EventTraits::kEventDataType = EventTraits::kEventNumber + 1 [static, inherited] |
const unsigned int EventTraits::kCbltWrapping = EventTraits::kEventDataType + 1 [static, inherited] |
const unsigned int EventTraits::kRawCblt = EventTraits::kCbltWrapping + 1 [static, inherited] |
const unsigned int EventTraits::kLtbMismatch = EventTraits::kRawCblt + 1 [static, inherited] |
const unsigned int EventTraits::kInvalidData = EventTraits::kLtbMismatch + 1 [static, inherited] |
const unsigned int EventTraits::kRomHeaderSize = EventTraits::kInvalidData + 1 [static, inherited] |
const unsigned int EventTraits::kRomTotalSize = EventTraits::kRomHeaderSize + 1 [static, inherited] |
const unsigned int EventTraits::kRomSite = EventTraits::kRomTotalSize + 1 [static, inherited] |
const unsigned int EventTraits::kRomDetector = EventTraits::kRomSite + 1 [static, inherited] |
The field for the detector within the site of the rom fragment.
Definition at line 127 of file EventTraits.h.
const unsigned int EventTraits::kRomModuleType = EventTraits::kRomDetector + 1 [static, inherited] |
const unsigned int EventTraits::kRomSlot = EventTraits::kRomModuleType + 1 [static, inherited] |
const unsigned int EventTraits::kFeeModule = 0 [static, inherited] |
const unsigned int EventTraits::kFadcModule = EventTraits::kFeeModule + 1 [static, inherited] |
const unsigned int EventTraits::kLtbModule = EventTraits::kFadcModule + 1 [static, inherited] |
const unsigned int EventTraits::kRpcRomModule = EventTraits::kLtbModule + 1 [static, inherited] |
const unsigned int EventTraits::kRpcRtmModule = EventTraits::kRpcRomModule + 1 [static, inherited] |
const unsigned int EventTraits::kMtbModule = EventTraits::kRpcRtmModule + 1 [static, inherited] |