CMS 3D CMS Logo

DCCDataBlockPrototype.h
Go to the documentation of this file.
1 #ifndef DCCDATABLOCKPROTOTYPE_HH
2 #define DCCDATABLOCKPROTOTYPE_HH
3 
4 /*
5  * \class DCCDataBlockPrototype
6  * Prototype for ECAL data block unpacking
7  * \file DCCDataBlockPrototype.h
8  *
9  * \author N. Almeida
10  *
11 */
12 
13 
14 #include <iostream>
15 #include <string>
16 #include <vector>
17 #include <map>
18 #include <utility>
19 #include <cstdio>
20 
22 #include "DCCRawDataDefinitions.h"
23 #include <cstdint>
24 
26 class DCCDataUnpacker;
27 class DCCEventBlock;
28 
30 
31  public :
36 
37  virtual ~DCCDataBlockPrototype() {};
38 
39  virtual int unpack(const uint64_t ** data, unsigned int * dwToEnd){ return BLOCK_UNPACKED;}
40 
41  virtual void updateCollectors(){};
42 
43  virtual void display(std::ostream & o){}
44 
45  void enableSyncChecks(){sync_=true;}
46 
50  virtual void updateEventPointers(){
51 
52  //cout<<"\n block Length "<<blockLength_;
53  //cout<<"\n dwToEne... "<<*dwToEnd_;
54 
55  *datap_ += blockLength_;
56 
57  // preventing pointers from navigating wildly outside of fedBlock
58  if((*dwToEnd_)>=blockLength_)
60  else
61  *dwToEnd_ = 0;
62 
63  }
64 
65  virtual unsigned int getLength(){ return blockLength_; }
66 
67 
68  protected :
70  bool error_;
73 
74 
75  const uint64_t ** datap_;
76  const uint64_t * data_;
77  unsigned int * dwToEnd_;
78 
79 
80  unsigned int blockLength_;
82  bool sync_;
83 
84 };
85 
86 #endif
virtual void display(std::ostream &o)
virtual unsigned int getLength()
unsigned long long uint64_t
Definition: Time.h:15
DCCDataUnpacker * unpacker_
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
virtual int unpack(const uint64_t **data, unsigned int *dwToEnd)
virtual void updateEventPointers()
EcalElectronicsMapper * mapper_
DCCDataBlockPrototype(DCCDataUnpacker *unpacker, EcalElectronicsMapper *mapper, DCCEventBlock *event, bool unpack=true)
Definition: event.py:1