#include <DaqData.h>
Public Member Functions | |
char * | Buffer () const |
DaqData (std::vector< unsigned int > &v) | |
DaqData (const unsigned char *ptr, int sizeinbytes) | |
DaqData (const DaqData &a) | |
unsigned int | getValue (int indfield, int indobj=0) const |
int | Nobjects () const |
int | Size () const |
~DaqData () | |
Private Member Functions | |
void | compressObject (const unsigned char *ptr, std::vector< unsigned int >::iterator &vit, int &bitsalreadyfilled) |
void | uncompressObject (const unsigned char *ptr, std::vector< unsigned int > &objdata, int &bitsalreadyfilled) |
Private Attributes | |
unsigned char * | buffer_ |
std::map< int, std::vector < unsigned int > > | data_ |
int | nobjects_ |
int | size_ |
This is the basic class accomplishing raw data formatting/unformatting.
1) Creation of a buffer of bytes representing the raw data
the user must create a DaqData object providing as input the data in the form of a vector of unsigned integers. The input data are all the values necessary to specify one (or more) object of the given format, which is the templated type. In case more than one object of the same given format should be put in the buffer, then the values of the second object must follow in the vector those of the first object and so on. DaqData will then compress these values in a bitstream according to the desired format. The bitstream is always aligned to the byte. The user, after successful compression, can request the pointer to the beginning of the buffer of bytes that represent the raw data (method Buffer() ) and the length of this buffer (method Size() ).
2) Interpretation of a buffer of bytes representing the raw data
the user must create a DaqData object providing as input a pointer to a buffer of bytes and the length in bytes of this buffer. DaqData will then extract the values (unsigned integers) present in the buffer according to a proper format, which is again the templated type. After successful uncompression of the buffer, the user can request the number of objects of the given format that were present in the buffer ( method Nobjects() ) and retrieve the individual values characterizing these objects ( method getValue() ).
WARNING: at the moment the interpretation of a buffer of bytes proceeds through the constructor of DaqData. This operation implies more than one copy of the data, which is not the most efficient way of accomplishing the task. In a future version of DaqData, more efficient methods will be made available.
Definition at line 60 of file DaqData.h.
References DaqData< Format >::buffer_, DaqData< Format >::compressObject(), gather_cfg::cout, DaqData< Format >::data_, i, mergeVDriftHistosByStation::name, DaqData< Format >::nobjects_, L1TEmulatorMonitor_cff::p, asciidump::s, and DaqData< Format >::size_.
|
inline |
Definition at line 125 of file DaqData.h.
References gather_cfg::cout, DaqData< Format >::data_, i, mergeVDriftHistosByStation::name, DaqData< Format >::nobjects_, L1TEmulatorMonitor_cff::p, asciidump::s, and DaqData< Format >::uncompressObject().
Definition at line 200 of file DaqData.h.
References DaqData< Format >::Buffer(), DaqData< Format >::buffer_, DaqData< Format >::data_, DaqData< Format >::getValue(), i, j, DaqData< Format >::Nobjects(), DaqData< Format >::nobjects_, DaqData< Format >::Size(), and DaqData< Format >::size_.
|
inline |
Definition at line 224 of file DaqData.h.
References DaqData< Format >::buffer_.
Referenced by DaqData< Format >::DaqData().
|
inlineprivate |
Definition at line 375 of file DaqData.h.
References funct::pow().
Referenced by DaqData< Format >::DaqData().
|
inline |
Definition at line 236 of file DaqData.h.
References gather_cfg::cout, DaqData< Format >::data_, and DaqData< Format >::nobjects_.
Referenced by DaqData< Format >::DaqData().
|
inline |
Definition at line 228 of file DaqData.h.
References DaqData< Format >::nobjects_.
Referenced by DaqData< Format >::DaqData().
|
inline |
Definition at line 226 of file DaqData.h.
References DaqData< Format >::size_.
Referenced by DaqData< Format >::DaqData().
|
inlineprivate |
Definition at line 253 of file DaqData.h.
References relativeConstraints::value.
Referenced by DaqData< Format >::DaqData().
|
private |
Definition at line 480 of file DaqData.h.
Referenced by DaqData< Format >::Buffer(), DaqData< Format >::DaqData(), and DaqData< Format >::~DaqData().
|
private |
Definition at line 477 of file DaqData.h.
Referenced by DaqData< Format >::DaqData(), and DaqData< Format >::getValue().
|
private |
Definition at line 481 of file DaqData.h.
Referenced by DaqData< Format >::DaqData(), DaqData< Format >::getValue(), and DaqData< Format >::Nobjects().
|
private |
Definition at line 479 of file DaqData.h.
Referenced by DaqData< Format >::DaqData(), and DaqData< Format >::Size().