CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
DaqData< Format > Class Template Reference

#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_
 

Detailed Description

template<class Format>
class DaqData< Format >

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.

Date:
2005/07/06 16:37:54
Revision:
1.1
Author
G. Bruno - CERN, EP Division

Definition at line 56 of file DaqData.h.

Constructor & Destructor Documentation

template<class Format >
DaqData< Format >::DaqData ( std::vector< unsigned int > &  v)
inline

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_.

60  : size_(0), buffer_(0), nobjects_(0) {
61 
62  try {
63 
64  if (v.size() == 0) throw string("DaqData: empty input data vector provided: ");
65 
66  int Nfields = Format::getNumberOfFields();
67  if (v.size()%Nfields != 0) throw string("DaqData: ERROR. You must provide a number of input values compatibles with the requested format: ");
68 
69 
70  int ObjSize = Format::getFieldLastBit(Nfields-1)+1;
71  nobjects_ = v.size()/Nfields;
72  // cout<<"Going to create "<<nobjects_<< " objects of type "<<typeid(Format).name()<<endl;
73 
74 
75  size_ = (int) ceil(((double)(ObjSize*nobjects_))/8);
76  buffer_= new char[size_];
77  // cout<<"The buffer will be "<<size_ <<" bytes long"<<endl;
78 
79  std::vector<unsigned int>::iterator vit = v.begin();
80  char * p = buffer_;
81  int bitsalreadyfilled = 0;
82 
83  int Totbytes=1;
84 
85  for(int i=0; i<nobjects_; i++) {
86 
87  //additional bytes necessary to accomodate the current object
88  int Nbytes = (int) ceil((double)(Format::getFieldLastBit(Nfields-1)+1-8+bitsalreadyfilled)/8);
89 
90  if ((Totbytes+=Nbytes) > size_) throw string("Exceeded allocated buffer size");
91 
92  compressObject(p, vit, bitsalreadyfilled);
93 
94  // cout<<"Successfully compressed object "<< i <<endl;
95 
96  data_.insert(std::pair< int, std::vector<unsigned int> >(i,std::vector<unsigned int>(vit-Nfields,vit) ));
97 
98  //the second term is necessary in the case the last byte has been fully used
99  p+=(Nbytes+(8-bitsalreadyfilled)/8) ;
100  Totbytes+=(8-bitsalreadyfilled)/8 ;
101  }
102  if(bitsalreadyfilled==0) Totbytes--;
103 
104  /*
105  cout << "Compression successful. "<< Totbytes<<" bytes compressed in total"<< endl;
106  cout<< "Buffer pointer: "<<hex<< buffer_<< dec << "Size of buffer= "<< size_<<endl;
107  for(int i=0; i<nobjects_; i++) {
108  cout << "Object # "<< i << " fields: " <<endl;
109  for(int j=0; j<Format::getNumberOfFields(); j++) cout << getValue(j,i) <<endl;
110  }
111  */
112 
113  }
114 
115  catch (std::string s){
116 
117  cout<<"DaqData - Exception caught: " << s <<endl;
118  cout<<"Object compression failed! No data has been constructed for format: "<< string(typeid(Format).name())<<endl;
119 
120  }
121 
122  }
int i
Definition: DBlmapReader.cc:9
int nobjects_
Definition: DaqData.h:481
int size_
Definition: DaqData.h:479
std::map< int, std::vector< unsigned int > > data_
Definition: DaqData.h:477
tuple cout
Definition: gather_cfg.py:41
unsigned char * buffer_
Definition: DaqData.h:480
string s
Definition: asciidump.py:422
mathSSE::Vec4< T > v
void compressObject(const unsigned char *ptr, std::vector< unsigned int >::iterator &vit, int &bitsalreadyfilled)
Definition: DaqData.h:375
template<class Format >
DaqData< Format >::DaqData ( const unsigned char *  ptr,
int  sizeinbytes 
)
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().

126  : size_(0), buffer_(0), nobjects_(0) {
127 
128 
129  try {
130 
131  if (sizeinbytes==0) throw std::string("Buffer size is zero");
132 
133  int Nfields = Format::getNumberOfFields();
134  int ObjSize = Format::getFieldLastBit(Nfields-1)+1;
135  nobjects_ = (sizeinbytes*8)/ObjSize;
136 
137  // cout<<"Going to create "<<nobjects_<< " objects of type "<<typeid(Format).name()<<endl;
138  // cout<<"The buffer will be "<<size_ <<" bytes long"<<endl;
139 
140  if ((sizeinbytes*8)%ObjSize != 0) {
141  cout<<"DaqData: there will be " << (sizeinbytes*8)%ObjSize <<" meaningless bits at the end of the buffer"<<endl;
142  }
143 
144  // buffer_ = new char[sizeinbytes];
145  // memmove(buffer_,ptr,sizeinbytes);
146 
147  // char * p = buffer_;
148 
149  const unsigned char * p = ptr;
150  int bitsalreadyfilled = 0;
151 
152  int Totbytes=1;
153 
154  for(int i=0; i<nobjects_; i++) {
155 
156  std::vector<unsigned int> objdata;
157  objdata.reserve(Nfields);
158 
159  //additional bytes necessary to accomodate the current object
160  int Nbytes = (int) ceil((double)(Format::getFieldLastBit(Nfields-1)+1-8+bitsalreadyfilled)/8);
161 
162 
163  if ((Totbytes+=Nbytes) > sizeinbytes) throw std::string("Exceeded allocated buffer size");
164 
165 
166  uncompressObject(p, objdata, bitsalreadyfilled);
167 
168  // cout<<"Successfully uncompressed object "<< i <<endl;
169  data_.insert(std::pair< int, std::vector<unsigned int> >(i,objdata) );
170 
171  //the second term is necessary in the case the last byte has been fully used
172  p+= (Nbytes + (8-bitsalreadyfilled)/8);
173  Totbytes+= (8-bitsalreadyfilled)/8;
174 
175  }
176 
177  if(bitsalreadyfilled==0) Totbytes--;
178 
179  /*
180  cout << "Uncompression succeeded. "<< Totbytes<<" bytes uncompressed in total"<< endl;
181  cout<< "Buffer pointer: "<<hex<< buffer_<< dec<< "Size of buffer= "<< size_<<endl;
182 
183  for(int i=0; i<nobjects_; i++) {
184  cout << "Object # "<< i << " fields: " <<endl;
185  for(int j=0; j<Format::getNumberOfFields(); j++) cout << getValue(j,i) <<endl;
186  }
187  */
188 
189  }
190  catch (std::string s){
191 
192  std::cout<<"DaqData - Exception caught: " << s <<std::endl;
193  std::cout<<"Object uncompression failed! No data has been constructed for format: "<<std::string(typeid(Format).name())<<endl;
194 
195  }
196 
197  }
int i
Definition: DBlmapReader.cc:9
int nobjects_
Definition: DaqData.h:481
int size_
Definition: DaqData.h:479
void uncompressObject(const unsigned char *ptr, std::vector< unsigned int > &objdata, int &bitsalreadyfilled)
Definition: DaqData.h:253
std::map< int, std::vector< unsigned int > > data_
Definition: DaqData.h:477
tuple cout
Definition: gather_cfg.py:41
unsigned char * buffer_
Definition: DaqData.h:480
string s
Definition: asciidump.py:422
template<class Format >
DaqData< Format >::DaqData ( const DaqData< Format > &  a)
inline

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_.

200  {
201 
202  size_ = a.Size();
203  buffer_ = new char[size_];
204  memmove(buffer_,a.Buffer(),size_);
205  nobjects_ = a.Nobjects();
206 
207  for(int i=0; i<nobjects_; i++) {
208  std::vector<unsigned int> vec;
209  for(int j=0; j<Format::getNumberOfFields(); j++) vec.push_back(a.getValue(j,i));
210  data_.insert(std::pair< int, std::vector<unsigned int> >(i, vec));
211  }
212 
213  }
int Nobjects() const
Definition: DaqData.h:228
int i
Definition: DBlmapReader.cc:9
int Size() const
Definition: DaqData.h:226
int nobjects_
Definition: DaqData.h:481
int size_
Definition: DaqData.h:479
int j
Definition: DBlmapReader.cc:9
char * Buffer() const
Definition: DaqData.h:224
std::map< int, std::vector< unsigned int > > data_
Definition: DaqData.h:477
unsigned char * buffer_
Definition: DaqData.h:480
unsigned int getValue(int indfield, int indobj=0) const
Definition: DaqData.h:236
template<class Format >
DaqData< Format >::~DaqData ( )
inline

Definition at line 216 of file DaqData.h.

References DaqData< Format >::buffer_.

216  {
217 
218  // cout<<"Deleting DaqData of type "<<typeid(Format).name()<<endl;
219  if (buffer_!=0) delete [] buffer_;
220 
221  };
unsigned char * buffer_
Definition: DaqData.h:480

Member Function Documentation

template<class Format >
char* DaqData< Format >::Buffer ( ) const
inline

Definition at line 224 of file DaqData.h.

References DaqData< Format >::buffer_.

Referenced by DaqData< Format >::DaqData().

224 {return buffer_;}
unsigned char * buffer_
Definition: DaqData.h:480
template<class Format >
void DaqData< Format >::compressObject ( const unsigned char *  ptr,
std::vector< unsigned int >::iterator &  vit,
int &  bitsalreadyfilled 
)
inlineprivate

Definition at line 375 of file DaqData.h.

References funct::pow().

Referenced by DaqData< Format >::DaqData().

375  {
376 
377  int Nfields = Format::getNumberOfFields();
378 
379  int bitstoaccomodate=Format::getFieldLastBit(0)+1; // of current field
380 
381  if (*vit > pow(2.,bitstoaccomodate)-1) throw string("The value is too large to fit in the field ");
382 
383  int ifield = 0;
384 
385  //Lower all bits but those already filled
386  *ptr &= 0xff + 1 - (unsigned int)pow(2.,8-bitsalreadyfilled);
387 
388  while (ifield < Nfields) {
389 
390 
391  if(bitstoaccomodate > 8 - bitsalreadyfilled ) {
392 
393  // cout<<"Field cannot be compressed from what left in current byte"<<endl;
394  // cout <<"bitstoaccomodate= "<<bitstoaccomodate<<" bitsalreadyfilled= "<<bitsalreadyfilled<<" ifield="<< ifield<<" Nfields="<<Nfields<<endl;
395 
396  *ptr += (((*vit) >> (bitstoaccomodate - (8 - bitsalreadyfilled))) & 0xff);
397  // cout<< "value: "<< hex << *vit <<" - " << dec << *vit<< endl;
398  // cout<< "byte: "<< hex << (unsigned int)(*ptr) <<" - "<< dec << (unsigned int)(*ptr) << endl;
399 
400 
401  bitstoaccomodate -= (8-bitsalreadyfilled);
402  bitsalreadyfilled = 0;
403  ptr++;
404  *ptr &= 0xff + 1 - (unsigned int)pow(2.,8-bitsalreadyfilled);
405 
406  // cout <<"bitstoaccomodate= "<<bitstoaccomodate<<" bitsalreadyfilled= "<<bitsalreadyfilled<<" ifield="<< ifield<<" Nfields="<<Nfields<<endl;
407 
408  }
409 
410  else if(bitstoaccomodate < (8 - bitsalreadyfilled) && bitstoaccomodate >0){
411 
412  // cout<<"Field can be compressed in the current byte, which will not be completely filled"<<endl;
413 
414  *ptr += ( (((*vit) << 8-bitstoaccomodate) & 0xff) >> (bitsalreadyfilled) );
415 
416  // cout <<"bitstoaccomodate= "<<bitstoaccomodate<<" bitsalreadyfilled= "<<bitsalreadyfilled<<" ifield="<< ifield<<" Nfields="<<Nfields<<endl;
417  // cout<< "value: "<< hex << *vit <<" - " << dec << *vit<< endl;
418  // cout<< "byte: "<< hex << (unsigned int)(*ptr) <<" - "<< dec << (unsigned int)(*ptr) << endl;
419 
420  vit++;
421  bitsalreadyfilled+=bitstoaccomodate;
422 
423  // cout<<"Field completed"<<endl;
424 
425  if(ifield==Nfields-1) return;
426 
427  // cout<<"Compressing new Field"<<endl;
428 
429  ifield++;
430  bitstoaccomodate=Format::getFieldLastBit(ifield)-Format::getFieldLastBit(ifield-1);
431  if (*vit > pow(2.,bitstoaccomodate)-1) throw string("The value is too large to fit in the field ");
432 
433  // cout <<"bitstoaccomodate= "<<bitstoaccomodate<<" bitsalreadyfilled= "<<bitsalreadyfilled<<" ifield="<< ifield<<" Nfields="<<Nfields<<endl;
434 
435  }
436 
437  else if(bitstoaccomodate == (8 - bitsalreadyfilled) && bitstoaccomodate >0){
438 
439  // cout<<"Field can be compressed in the current byte, which will be completely filled"<<endl;
440 
441 
442  *ptr += ( (((*vit) << 8-bitstoaccomodate) & 0xff) >> (bitsalreadyfilled) );
443 
444  // cout <<"bitstoaccomodate= "<<bitstoaccomodate<<" bitsalreadyfilled= "<<bitsalreadyfilled<<" ifield="<< ifield<<" Nfields="<<Nfields<<endl;
445  // cout<< "value: "<< hex << *vit <<" - " << dec << *vit<< endl;
446  // cout<< "byte: "<< hex << (unsigned int)(*ptr) <<" - "<< dec << (unsigned int)(*ptr) << endl;
447 
448  vit++;
449  bitsalreadyfilled=0;
450 
451  // cout<<"Field completed"<<endl;
452 
453  if(ifield==Nfields-1) return;
454 
455  // cout<<"Compressing new Field"<<endl;
456 
457  ptr++;
458  *ptr &= 0xff + 1 - (unsigned int)pow(2.,8-bitsalreadyfilled);
459 
460  ifield++;
461  bitstoaccomodate=Format::getFieldLastBit(ifield)-Format::getFieldLastBit(ifield-1);
462 
463  if (*vit > pow(2.,bitstoaccomodate)-1) throw string("The value is too large to fit in the field ");
464 
465  // cout <<"bitstoaccomodate= "<<bitstoaccomodate<<" bitsalreadyfilled= "<<bitsalreadyfilled<<" ifield="<< ifield<<" Nfields="<<Nfields<<endl;
466 
467  }
468  else throw string(" unexpected situation during compression");
469 
470  } //end of cycle over fields
471 
472  }
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
template<class Format >
unsigned int DaqData< Format >::getValue ( int  indfield,
int  indobj = 0 
) const
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().

236  {
237 
238  if (indobj<nobjects_ && indfield < Format::getNumberOfFields()) {
239  std::map < int, std::vector<unsigned int> >::const_iterator it = data_.find(indobj);
240  if (it != data_.end()) return ((*it).second)[indfield];
241  else {
242  cout<<"DaqData - Strange: object should exist but was not found "<<endl;
243  return 0;
244  }
245  }
246  else cout<<"DaqData - Non existent field or object"<<endl;
247  return 0;
248 
249  }
int nobjects_
Definition: DaqData.h:481
std::map< int, std::vector< unsigned int > > data_
Definition: DaqData.h:477
tuple cout
Definition: gather_cfg.py:41
template<class Format >
int DaqData< Format >::Nobjects ( ) const
inline

Definition at line 228 of file DaqData.h.

References DaqData< Format >::nobjects_.

Referenced by DaqData< Format >::DaqData().

228  {
229  return nobjects_;
230  /* cout<<"Nobjects()"<<endl;
231  int Nfields = Format::getNumberOfFields();
232  return size_/(Format::getFieldLastBit(Nfields-1)+1);
233  */
234  }
int nobjects_
Definition: DaqData.h:481
template<class Format >
int DaqData< Format >::Size ( ) const
inline

Definition at line 226 of file DaqData.h.

References DaqData< Format >::size_.

Referenced by DaqData< Format >::DaqData().

226 {return size_;}
int size_
Definition: DaqData.h:479
template<class Format >
void DaqData< Format >::uncompressObject ( const unsigned char *  ptr,
std::vector< unsigned int > &  objdata,
int &  bitsalreadyfilled 
)
inlineprivate

Definition at line 253 of file DaqData.h.

References relativeConstraints::value.

Referenced by DaqData< Format >::DaqData().

255  {
256 
257  int Nfields = Format::getNumberOfFields();
258 
259  int bitstoaccomodate=Format::getFieldLastBit(0)+1; // of current field
260 
261  int ifield = 0;
262  unsigned int value = 0;
263 
264  while (ifield < Nfields) {
265 
266  if(bitstoaccomodate > 8 - bitsalreadyfilled ) {
267 
268  // cout<<"can't complete value from current byte"<<endl;
269  // cout <<"bitstoaccomodate= "<<bitstoaccomodate<<" bitsalreadyfilled= "<<bitsalreadyfilled<<" ifield="<< ifield<<" Nfields="<<Nfields<<endl;
270 
271  //1)The syntax below could be faster.
272  // To be checked as soon as time available(check started with prog test4.C) .
273  //2)check if all cast to unsigned int are really necessary(done, they are not).
274  //3)Instead of using pow(2,1;2;3;4;5..), a faster enum could be used
275  //Lower all bits but those not yet read
276  //value += ( (*ptr & ((unsigned int)pow(2.,8-bitsalreadyfilled)-1)) << bitstoaccomodate + bitsalreadyfilled - 8 ) ;
277  // if(bitstoaccomodate > 8) value += ( ((((unsigned int)(*ptr)) << bitsalreadyfilled) & 0xff) << (bitstoaccomodate - 8) );
278  // else value += ( ((((unsigned int)(*ptr)) << bitsalreadyfilled) & 0xff) >> (8 - bitstoaccomodate) );
279 
280 
281  if(bitstoaccomodate > 8) value += ( ( (*ptr << bitsalreadyfilled) & 0xff ) << (bitstoaccomodate - 8) );
282  else value += ( ( (*ptr << bitsalreadyfilled) & 0xff) >> (8 - bitstoaccomodate) );
283 
284 
285  // cout<< "value: "<< hex << value << " - " << dec << value<< endl;
286  // cout<< "byte: "<< hex << (unsigned int)(*ptr) << " - " << dec << (unsigned int)(*ptr) << endl;
287 
288 
289  ptr++;
290  bitstoaccomodate -= (8-bitsalreadyfilled);
291  bitsalreadyfilled = 0;
292 
293  // cout <<"bitstoaccomodate= "<<bitstoaccomodate<<" bitsalreadyfilled= "<<bitsalreadyfilled<<" ifield="<< ifield<<" Nfields="<<Nfields<<endl;
294 
295  }
296 
297  else if(bitstoaccomodate < (8 - bitsalreadyfilled) && bitstoaccomodate >0){
298  // cout<<"value can be completed from current byte, which still contain info"<<endl;
299 
300  // cout <<"bitstoaccomodate= "<<bitstoaccomodate<<" bitsalreadyfilled= "<<bitsalreadyfilled<<" ifield="<< ifield<<" Nfields="<<Nfields<<endl;
301 
302  //1)The syntax below could be faster.
303  // To be checked as soon as time available.
304  //2)check if all cast to unsigned int are really necessary.
305  //3)Instead of using pow(2,1;2;3;4;5..), a faster enum could be used
306  //Lower all bits but those not yet read
307  //value += (*ptr & ((unsigned int)pow(2.,8-bitsalreadyfilled)-1)) >> (8 - bitstoaccomodate - bitsalreadyfilled);
308 
309  value += ( ( (*ptr << bitsalreadyfilled) & 0xff ) >> (8 - bitstoaccomodate) ) ;
310 
311  // cout<< "value: "<< hex << value << " - " << dec << value<< endl;
312  // cout<< "byte: "<< hex << (unsigned int)(*ptr) << " - " << dec << (unsigned int)(*ptr) << endl;
313 
314 
315  objdata.push_back(value);
316  value = 0;
317  bitsalreadyfilled+=bitstoaccomodate;
318 
319  // cout<<"Field completed"<<endl;
320 
321  if(ifield==Nfields-1) return;
322 
323  // cout<<"Uncompressing new Field"<<endl;
324 
325  ifield++;
326  bitstoaccomodate=Format::getFieldLastBit(ifield)-Format::getFieldLastBit(ifield-1);
327 
328  // cout <<"bitstoaccomodate= "<<bitstoaccomodate<<" bitsalreadyfilled= "<<bitsalreadyfilled<<" ifield="<< ifield<<" Nfields="<<Nfields<<endl;
329 
330  }
331 
332  else if(bitstoaccomodate == (8 - bitsalreadyfilled) && bitstoaccomodate >0){
333  // cout<<"value can be completed from what left in current byte"<<endl;
334  // cout <<"bitstoaccomodate= "<<bitstoaccomodate<<" bitsalreadyfilled= "<<bitsalreadyfilled<<" ifield="<< ifield<<" Nfields="<<Nfields<<endl;
335 
336  //1)The syntax below could be faster.
337  // To be checked as soon as time available.
338  //2)check if all cast to unsigned int are really necessary.
339  //3)Instead of using pow(2,1;2;3;4;5..), a faster enum could be used
340  //Lower all bits but those not yet read
341  // value += *ptr & ((unsigned int)pow(2.,8-bitsalreadyfilled)-1);
342 
343  value += ( ( (*ptr << bitsalreadyfilled) & 0xff ) >> (8 - bitstoaccomodate) ) ;
344 
345  // cout<< "value: "<< hex << value << " - " << dec << value<< endl;
346  // cout<< "byte: "<< hex << (unsigned int)(*ptr) << " - " << dec << (unsigned int)(*ptr) << endl;
347 
348 
349  objdata.push_back(value);
350  value = 0;
351  bitsalreadyfilled=0;
352 
353  // cout<<"Field completed"<<endl;
354 
355  if(ifield==Nfields-1) return;
356 
357  // cout<<"Uncompressing new Field"<<endl;
358 
359  ptr++;
360  ifield++;
361  bitstoaccomodate=Format::getFieldLastBit(ifield)-Format::getFieldLastBit(ifield-1);
362 
363  // cout <<"bitstoaccomodate= "<<bitstoaccomodate<<" bitsalreadyfilled= "<<bitsalreadyfilled<<" ifield="<< ifield<<" Nfields="<<Nfields<<endl;
364 
365  }
366  else throw std::string(" unexpected situation during uncompression");
367 
368  } //end of cycle over fields
369 
370  }

Member Data Documentation

template<class Format >
unsigned char* DaqData< Format >::buffer_
private
template<class Format >
std::map< int, std::vector<unsigned int> > DaqData< Format >::data_
private

Definition at line 477 of file DaqData.h.

Referenced by DaqData< Format >::DaqData(), and DaqData< Format >::getValue().

template<class Format >
int DaqData< Format >::nobjects_
private
template<class Format >
int DaqData< Format >::size_
private

Definition at line 479 of file DaqData.h.

Referenced by DaqData< Format >::DaqData(), and DaqData< Format >::Size().