Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

TDataItem Class Template Reference

#include <TDataItem.h>

Collaboration diagram for TDataItem:

[legend]
List of all members.

Detailed Description

template<typename T>
class TDataItem< T >

Basic data-item class.

A basic templated data item. A TDataItem is a just a wrapper for a class that contains two members i.e. a class with just two Short_ts, or a class with just a Double_t and short, say (c.f. STL pair<>). This could represent an ADC or TDC data-item, but also could be a calibrated data-item in which case we could have an energy value and channel. Putting these two basic items in a class gives more functionality and greater safety by utilising the const keyword. This is probably the most important class written for the Dragon DAQ as everything else hinges upon it.

Note:
This class is typedef'd. One member is always a short (fChannel); the other may be any type (fValue).
Author:
JEP.
Version:
1.2.
Date:
May 2004.

Definition at line 38 of file TDataItem.h.

Public Member Functions

 TDataItem ()
 TDataItem (UShort_t, T)
virtual ~TDataItem ()
void SetItem (UShort_t, T)
void SetChannel (UShort_t)
void SetValue (T)
UShort_t GetChannel () const
GetValue () const
void Print (const Char_t *="") const

Private Attributes

UShort_t fChannel
fValue


Constructor & Destructor Documentation

TDataItem  )  [inline]
 

Default constructor, with fChannel and fValue both initialised to 0.

Definition at line 68 of file TDataItem.h.

TDataItem UShort_t  chan,
val
[inline]
 

Overloaded constructor, with fChannel and fValue initialised to chan and val respectively.

Definition at line 77 of file TDataItem.h.

~TDataItem  )  [inline, virtual]
 

Default deconstructor.

Definition at line 86 of file TDataItem.h.


Member Function Documentation

void SetItem UShort_t  chan,
val
[inline]
 

Set both the channel (fChannel) and value (fValue) of the item to chan and val respectively.

Definition at line 93 of file TDataItem.h.

References fChannel, and fValue.

void SetChannel UShort_t  chan  )  [inline]
 

Set the channel of the hardware data item. This number is always positive (hence the unsigned part) and usually less than 65000 (hence the short part; unless we're dealing with a monster module that is).

Definition at line 103 of file TDataItem.h.

References fChannel.

void SetValue val  )  [inline]
 

Set the value of the hardware data item. This should span the expected range of the ADCs and TDCs, but is templated so that we can write things such as "energy" (which is a Double_t) to disk too.

Definition at line 114 of file TDataItem.h.

References fValue.

UShort_t GetChannel  )  const [inline]
 

Get the channel of the data item (fChannel).

Returns:
The channel.

Definition at line 125 of file TDataItem.h.

T GetValue  )  const [inline]
 

Get the value of the data item (fValue).

Returns:
The value.

Definition at line 134 of file TDataItem.h.

void Print const Char_t *  what = ""  )  const [inline]
 

Print the data held in this class.

Parameters:
[in] what A string to indicate what the data-item is from.

Definition at line 143 of file TDataItem.h.

References fChannel, and fValue.


Member Data Documentation

UShort_t fChannel [private]
 

This is the hardware channel; assumed to be a short.

Definition at line 53 of file TDataItem.h.

T fValue [private]
 

This is the hardware value; typedef'd to type T.

Definition at line 56 of file TDataItem.h.


The documentation for this class was generated from the following file:
Generated on Mon Jan 8 11:54:33 2007 for DragonRoot by  doxygen 1.3.9.1