| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

DybDaq::FeeTraits Class Reference

#include <FeeTraits.h>

Inheritance diagram for DybDaq::FeeTraits:

[legend]
Collaboration diagram for DybDaq::FeeTraits:
[legend]
List of all members.

Public Types

typedef std::vector< BitsDefinitionDefinitions

Public Member Functions

virtual ~FeeTraits ()
 Destroy this instance of the class.
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 unsigned int triggerTypeEnd () const =0
 Returns the maximum trigger type.
virtual const char * triggerTypeAsString (unsigned int triggerType) const
 Returns the string for the specified trigger type.
virtual unsigned int headSize () const =0
 Returns the size of a FeeHead in this format.
virtual unsigned int hitSize () const =0
 Returns the size of a fee hit in this format.
virtual unsigned int footSize () const =0
 Returns the size of a FeeFoot in this format.
virtual void initializeHead (char *buffer) const =0
 Initializes the FeeHead memory with the appropriate markers.
virtual void initializeHit (char *buffer) const =0
 Initializes the FeeHit memory with the appropriate markers.
virtual void initializeFoot (char *buffer) const =0
 Initializes the FeeFoot memory with the appropriate markers.
virtual unsigned int majorVersion () const =0
virtual unsigned int minorVersion () const =0
virtual const std::string versionString () const =0
virtual unsigned int marker (unsigned int marker) const
virtual const char * boolAsString (bool value) const
const DaqTraits::DefinitionsbitsDefinitions (unsigned int component) const

Static Public Member Functions

static const FeeTraitsdefaultTraits ()
 Returns a default FeeTraits to bootstrap the system.
static const FeeTraitsreadTraits (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

 FeeTraits ()
 Creates an instance of this class.
virtual const char ** triggerTypeStrings () const =0
 Returns the array of trigger type strings.
unsigned int index (unsigned int field) const
virtual unsigned int markersEnd () const =0
virtual const unsigned int * markers () const =0
virtual unsigned int fieldsEnd () const =0
virtual const unsigned int * indices () const =0
virtual const unsigned int * shifts () const =0
virtual const unsigned int * masks () const =0
virtual const std::string * descriptions () const
virtual DaqTraits::Definitionsdefinitions (unsigned int component) const
virtual void setDefinitions (DaqTraits::Definitions *definitions, unsigned int component)
virtual const unsigned int * componentFields (unsigned int component) const
virtual const unsigned int componentFieldsEnd (unsigned int component) const

Static Protected Member Functions

static unsigned int readUnsignedInt (const char *&buffer, const DaqTraits &traits, unsigned int field)

Private Member Functions

 FeeTraits (FeeTraits &rhs)
 Suppress default.
FeeTraitsoperator= (FeeTraits &rhs)
 Suppress default.

Friends

friend class DaqBuffer

Detailed Description

Definition at line 17 of file FeeTraits.h.


Constructor & Destructor Documentation

FeeTraits::~FeeTraits (  )  [virtual]

Destroy this instance of the class.

Definition at line 58 of file FeeTraits.cc.

00058                       {
00059 }

FeeTraits::FeeTraits (  )  [protected]

Creates an instance of this class.

Definition at line 55 of file FeeTraits.cc.

00055                      {
00056 }

DybDaq::FeeTraits::FeeTraits ( FeeTraits rhs  )  [private]

Suppress default.


Member Function Documentation

const FeeTraits & FeeTraits::defaultTraits (  )  [static]

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]

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]

Returns the index value for an illegal header.

Implements DybDaq::DaqTraits.

Definition at line 87 of file FeeTraits.cc.

00087                                             {
00088     return 0xffffffffU;
00089 }

unsigned int FeeTraits::illegalField (  )  const [virtual]

Returns the index value for an illegal field.

Implements DybDaq::DaqTraits.

Definition at line 91 of file FeeTraits.cc.

00091                                            {
00092     return 0xffffffffU;
00093 }

virtual unsigned int DybDaq::FeeTraits::triggerTypeEnd (  )  const [pure virtual]

Returns the maximum trigger type.

Implemented in DybDaq::FeeTraits_v0_0, DybDaq::FeeTraits_v0_1, and DybDaq::FeeTraits_v0_2.

const char * FeeTraits::triggerTypeAsString ( unsigned int  triggerType  )  const [virtual]

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 }

virtual unsigned int DybDaq::FeeTraits::headSize (  )  const [pure virtual]

Returns the size of a FeeHead in this format.

Implemented in DybDaq::FeeTraits_v0_0, DybDaq::FeeTraits_v0_1, and DybDaq::FeeTraits_v0_2.

virtual unsigned int DybDaq::FeeTraits::hitSize (  )  const [pure virtual]

Returns the size of a fee hit in this format.

Implemented in DybDaq::FeeTraits_v0_0, DybDaq::FeeTraits_v0_1, and DybDaq::FeeTraits_v0_2.

virtual unsigned int DybDaq::FeeTraits::footSize (  )  const [pure virtual]

Returns the size of a FeeFoot in this format.

Implemented in DybDaq::FeeTraits_v0_0, DybDaq::FeeTraits_v0_1, and DybDaq::FeeTraits_v0_2.

virtual void DybDaq::FeeTraits::initializeHead ( char *  buffer  )  const [pure virtual]

Initializes the FeeHead memory with the appropriate markers.

Implemented in DybDaq::FeeTraits_v0_0, DybDaq::FeeTraits_v0_1, and DybDaq::FeeTraits_v0_2.

virtual void DybDaq::FeeTraits::initializeHit ( char *  buffer  )  const [pure virtual]

Initializes the FeeHit memory with the appropriate markers.

Implemented in DybDaq::FeeTraits_v0_0, DybDaq::FeeTraits_v0_1, and DybDaq::FeeTraits_v0_2.

virtual void DybDaq::FeeTraits::initializeFoot ( char *  buffer  )  const [pure virtual]

Initializes the FeeFoot memory with the appropriate markers.

Implemented in DybDaq::FeeTraits_v0_0, DybDaq::FeeTraits_v0_1, and DybDaq::FeeTraits_v0_2.

virtual const char** DybDaq::FeeTraits::triggerTypeStrings (  )  const [protected, pure virtual]

Returns the array of trigger type strings.

Implemented in DybDaq::FeeTraits_v0_0, DybDaq::FeeTraits_v0_1, and DybDaq::FeeTraits_v0_2.

FeeTraits& DybDaq::FeeTraits::operator= ( FeeTraits rhs  )  [private]

Suppress default.


Member Data Documentation

const unsigned int FeeTraits::kHead = 0 [static]

The head component for this format.

Definition at line 24 of file FeeTraits.h.

const unsigned int FeeTraits::kHit = FeeTraits::kHead + 1 [static]

The hit component for this format.

Definition at line 29 of file FeeTraits.h.

const unsigned int FeeTraits::kFoot = FeeTraits::kHit + 1 [static]

The foot component for this format.

Definition at line 34 of file FeeTraits.h.

const unsigned int FeeTraits::kHeadTriggerNumber = 0 [static]

The field for the trigger number in the head.

Definition at line 39 of file FeeTraits.h.

const unsigned int FeeTraits::kTriggerType = FeeTraits::kHeadTriggerNumber + 1 [static]

The field for the trigger type.

Definition at line 44 of file FeeTraits.h.

const unsigned int FeeTraits::kChecked = FeeTraits::kTriggerType + 1 [static]

The field for the checked flag.

Definition at line 49 of file FeeTraits.h.

const unsigned int FeeTraits::kError = FeeTraits::kChecked + 1 [static]

The field for the error flag.

Definition at line 54 of file FeeTraits.h.

const unsigned int FeeTraits::kChargeChannelId = FeeTraits::kError + 1 [static]

The field for the channel id for the charge.

Definition at line 61 of file FeeTraits.h.

const unsigned int FeeTraits::kPeakCycle = FeeTraits::kChargeChannelId + 1 [static]

The field for the peak cycle.

Definition at line 66 of file FeeTraits.h.

const unsigned int FeeTraits::kHighRangeAdc = FeeTraits::kPeakCycle + 1 [static]

The field for the the high ADC range.

Definition at line 71 of file FeeTraits.h.

const unsigned int FeeTraits::kAdc = FeeTraits::kHighRangeAdc + 1 [static]

The field for the measured ADC value.

Definition at line 76 of file FeeTraits.h.

const unsigned int FeeTraits::kTimeChannelId = FeeTraits::kAdc + 1 [static]

The field for the channel id for the charge.

Definition at line 81 of file FeeTraits.h.

const unsigned int FeeTraits::kHitNumber = FeeTraits::kTimeChannelId + 1 [static]

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]

The field for the measured TDC value.

Definition at line 91 of file FeeTraits.h.

const unsigned int FeeTraits::kFootTriggerNumber = FeeTraits::kTdc + 1 [static]

The field for the trigger number in the foot.

Definition at line 98 of file FeeTraits.h.

const unsigned int FeeTraits::kFootDataLength = FeeTraits::kFootTriggerNumber + 1 [static]

The field for the trigger type.

Definition at line 103 of file FeeTraits.h.

const unsigned int FeeTraits::kMajorVersion = FeeTraits::kFootDataLength + 1 [static]

The field for the major version.

Definition at line 110 of file FeeTraits.h.

const unsigned int FeeTraits::kMinorVersion = FeeTraits::kMajorVersion + 1 [static]

The field for the minor version.

Definition at line 115 of file FeeTraits.h.

const unsigned int FeeTraits::kPreAdc = FeeTraits::kMinorVersion + 1 [static]

The field for measured pre-ADC value.

Definition at line 120 of file FeeTraits.h.

const unsigned int FeeTraits::kHeadMarker = FeeTraits::kPreAdc + 1 [static]

The field for the head marker.

Definition at line 127 of file FeeTraits.h.

const unsigned int FeeTraits::kAdcDataMarker = FeeTraits::kHeadMarker + 1 [static]

The field for the ADC data marker.

Definition at line 132 of file FeeTraits.h.

const unsigned int FeeTraits::kTdcDataMarker = FeeTraits::kAdcDataMarker + 1 [static]

The field for the TDC data marker.

Definition at line 137 of file FeeTraits.h.

const unsigned int FeeTraits::kFootMarker = FeeTraits::kTdcDataMarker + 1 [static]

The field for the foot marker.

Definition at line 142 of file FeeTraits.h.


The documentation for this class was generated from the following files:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:08:03 2011 for FeeReadoutFormat by doxygen 1.4.7