CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SimpleMsgBuf.h
Go to the documentation of this file.
1 /*
2  * A message buffer that holds
3  *
4  * Run
5  * Lumisection
6  * Evt number
7  * [FED sizes]
8  * [FED raw data segments]
9  *
10  * author: aspataru@cern.ch
11  */
12 
13 #ifndef EVENTFILTER_UTILITIES_SIMPLE_MSG_BUF_H
14 #define EVENTFILTER_UTILITIES_SIMPLE_MSG_BUF_H
15 
18 
19 namespace evf {
20 
21 #define N_FEDS 1024
22 
23 class SimpleMsgBuf : public MsgBuf{
24 
25 public:
26  SimpleMsgBuf();
27  SimpleMsgBuf(unsigned int size, unsigned int type);
28  SimpleMsgBuf(const SimpleMsgBuf &b);
29  virtual ~SimpleMsgBuf();
30 
31  /*
32  * event buffer fields access
33  */
34  void setRLE(unsigned int run, unsigned int lumi, unsigned int evt);
35  void addFedSize(unsigned int fedSize);
36  void addFedData(const unsigned char* fedRawData, unsigned int segmentSize);
37 
38  void getRun(unsigned int&) const;
39  void getLumi(unsigned int&) const;
40  void getEvt(unsigned int&) const;
41  char* getFedSizeStart();
42  char* getFedDataStart();
43  char* getFedDataEnd();
44 
45  void reset() { setBufferPointers(); }
46 
47 private:
48  void setBufferPointers();
49 
50 private:
51  size_t usedSize_;
52  friend class MasterQueue;
53 
54  /*
55  * pointers to different buffer positions
56  */
57  char* pRun_;
58  char* pLumi_;
59  char* pEvt_;
60  char* pFedSizes_;
61  char* pFedRawData_;
62 
63  // helper pointers
64  char* pVarSize_;
65  char* pVarData_;
66 };
67 
68 }
69 
70 #endif
type
Definition: HCALResponse.h:21
void getLumi(unsigned int &) const
Definition: SimpleMsgBuf.cc:51
tuple lumi
Definition: fjr2json.py:35
void getEvt(unsigned int &) const
Definition: SimpleMsgBuf.cc:55
void setBufferPointers()
Definition: SimpleMsgBuf.cc:71
char * getFedDataEnd()
Definition: SimpleMsgBuf.cc:67
void addFedData(const unsigned char *fedRawData, unsigned int segmentSize)
Definition: SimpleMsgBuf.cc:37
void setRLE(unsigned int run, unsigned int lumi, unsigned int evt)
Definition: SimpleMsgBuf.cc:23
void getRun(unsigned int &) const
Definition: SimpleMsgBuf.cc:47
double b
Definition: hdecay.h:120
void addFedSize(unsigned int fedSize)
Definition: SimpleMsgBuf.cc:32
virtual ~SimpleMsgBuf()
Definition: SimpleMsgBuf.cc:17
char * getFedDataStart()
Definition: SimpleMsgBuf.cc:63
char * getFedSizeStart()
Definition: SimpleMsgBuf.cc:59
tuple size
Write out results.