CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FUShmRawCell.h
Go to the documentation of this file.
1 #ifndef FUSHMRAWCELL_H
2 #define FUSHMRAWCELL_H 1
3 
4 #include <assert.h>
5 
6 namespace evf {
7  namespace evt {
8  enum Type_t { NOP, STOPPER, EOL, DATA};
9  }
11  {
12  public:
13  //
14  // construction/destruction
15  //
16  FUShmRawCell(unsigned int payloadSize);
17  ~FUShmRawCell();
18 
19 
20  //
21  // member functions
22  //
23  void initialize(unsigned int index);
24 
25  unsigned int index() const { return index_; }
26  unsigned int fuResourceId() const { return fuResourceId_; }
27  unsigned int buResourceId() const { return buResourceId_; }
28  unsigned int evtNumber() const { return evtNumber_; }
29 
30  unsigned int payloadSize() const { return payloadSize_; }
31  unsigned char* payloadAddr() const;
32 
33  unsigned int nFed() const { return nFed_; }
34  unsigned int fedSize(unsigned int i) const;
35  unsigned char* fedAddr(unsigned int i) const;
36 
37  unsigned int nSuperFrag() const { return nSuperFrag_; }
38  unsigned int superFragSize(unsigned int i) const;
39  unsigned char* superFragAddr(unsigned int i) const;
40 
41  unsigned int eventSize() const;
42 
43  void setFuResourceId(unsigned int id) { fuResourceId_=id; }
44  void setBuResourceId(unsigned int id) { buResourceId_=id; }
45  void setEvtNumber(unsigned int evt) { evtNumber_ =evt; }
46 
47  void clear();
48  void dump() const;
49 
50  unsigned int readFed(unsigned int i,unsigned char*buffer) const;
51  unsigned char* writeData(unsigned char*data,unsigned int dataSize);
52 
53  bool markFed(unsigned int i,unsigned int size,unsigned char*addr);
54  bool markSuperFrag(unsigned int i,unsigned int size,unsigned char*addr);
55 
56  void setLumiSection(unsigned int);
58  {assert(eventType_ == evt::NOP);
60  }
62  {assert(eventType_ == evt::NOP);
64  }
66  {assert(eventType_ == evt::NOP);
68  }
69  unsigned int getEventType() const {return eventType_;}
70  unsigned int getLumiSection() const {return lumiSection_;}
71  //
72  // static member functions
73  //
74  static unsigned int size(unsigned int payloadSize);
75 
76 
77  private:
78  //
79  // member data
80  //
81  unsigned int index_;
82  unsigned int fuResourceId_;
83  unsigned int buResourceId_;
84  unsigned int evtNumber_;
85  unsigned int payloadSize_;
86  unsigned int nFed_;
87  unsigned int nSuperFrag_;
88  unsigned int lumiSection_;
89  unsigned int eventType_;
90  unsigned int fedSizeOffset_;
91  unsigned int fedOffset_;
92  unsigned int superFragSizeOffset_;
93  unsigned int superFragOffset_;
94  unsigned int payloadOffset_;
95  unsigned int payloadPosition_;
96 
97  };
98 
99 
100 } // namespace evf
101 
102 
103 #endif
int i
Definition: DBlmapReader.cc:9
unsigned int payloadPosition_
Definition: FUShmRawCell.h:95
unsigned int superFragOffset_
Definition: FUShmRawCell.h:93
unsigned char * writeData(unsigned char *data, unsigned int dataSize)
bool markFed(unsigned int i, unsigned int size, unsigned char *addr)
unsigned int evtNumber_
Definition: FUShmRawCell.h:84
unsigned int eventType_
Definition: FUShmRawCell.h:89
unsigned int nSuperFrag_
Definition: FUShmRawCell.h:87
unsigned int evtNumber() const
Definition: FUShmRawCell.h:28
void dump() const
void setEventTypeEol()
Definition: FUShmRawCell.h:61
static unsigned int size(unsigned int payloadSize)
unsigned int getLumiSection() const
Definition: FUShmRawCell.h:70
void initialize(unsigned int index)
Definition: FUShmRawCell.cc:73
unsigned char * payloadAddr() const
void setEventTypeData()
Definition: FUShmRawCell.h:57
unsigned char * superFragAddr(unsigned int i) const
unsigned int getEventType() const
Definition: FUShmRawCell.h:69
unsigned int payloadOffset_
Definition: FUShmRawCell.h:94
bool markSuperFrag(unsigned int i, unsigned int size, unsigned char *addr)
void setEvtNumber(unsigned int evt)
Definition: FUShmRawCell.h:45
unsigned char * fedAddr(unsigned int i) const
Definition: FUShmRawCell.cc:94
void setBuResourceId(unsigned int id)
Definition: FUShmRawCell.h:44
unsigned int fedOffset_
Definition: FUShmRawCell.h:91
unsigned int payloadSize() const
Definition: FUShmRawCell.h:30
unsigned int readFed(unsigned int i, unsigned char *buffer) const
unsigned int fuResourceId_
Definition: FUShmRawCell.h:82
unsigned int lumiSection_
Definition: FUShmRawCell.h:88
unsigned int index_
Definition: FUShmRawCell.h:81
unsigned int payloadSize_
Definition: FUShmRawCell.h:85
unsigned int eventSize() const
unsigned int superFragSize(unsigned int i) const
unsigned int superFragSizeOffset_
Definition: FUShmRawCell.h:92
void setFuResourceId(unsigned int id)
Definition: FUShmRawCell.h:43
unsigned int fedSizeOffset_
Definition: FUShmRawCell.h:90
unsigned int buResourceId_
Definition: FUShmRawCell.h:83
unsigned int index() const
Definition: FUShmRawCell.h:25
void setLumiSection(unsigned int)
unsigned int nFed() const
Definition: FUShmRawCell.h:33
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
unsigned int nSuperFrag() const
Definition: FUShmRawCell.h:37
unsigned int fuResourceId() const
Definition: FUShmRawCell.h:26
unsigned int fedSize(unsigned int i) const
Definition: FUShmRawCell.cc:82
FUShmRawCell(unsigned int payloadSize)
Definition: FUShmRawCell.cc:29
unsigned int buResourceId() const
Definition: FUShmRawCell.h:27
void setEventTypeStopper()
Definition: FUShmRawCell.h:65
unsigned int nFed_
Definition: FUShmRawCell.h:86