CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FUResource.h
Go to the documentation of this file.
1 #ifndef FURESOURCE_H
2 #define FURESOURCE_H 1
3 
4 
8 
9 #include "log4cplus/logger.h"
10 #include "toolbox/mem/Reference.h"
11 
12 #include <vector>
13 
14 namespace xdaq {
15  class Application;
16 }
17 
18 
19 namespace evf {
20 
21  class EvffedFillerRB;
22 
23  class FUResource
24  {
25  public:
26  //
27  // construction/destruction
28  //
30  , log4cplus::Logger
31  , EvffedFillerRB *
32  , xdaq::Application *);
33  virtual ~FUResource();
34 
35 
36  //
37  // member functions
38  //
40  void release();
41 
42  void process(MemRef_t* bufRef);
43  void processDataBlock(MemRef_t* bufRef) throw (evf::Exception);
44  void checkDataBlockPayload(MemRef_t* bufRef) throw (evf::Exception);
45  void appendBlockToSuperFrag(MemRef_t* bufRef);
47 
48  void superFragSize() throw (evf::Exception);
49  void fillSuperFragPayload() throw (evf::Exception);
50  void findFEDs() throw (evf::Exception);
51 
52  void releaseSuperFrag();
53 
54  static
56  static
59 
60  bool crcBeingChecked() { return doCrcCheck_; }
61 
62  bool fatalError() const { return fatalError_; }
63  bool isAllocated() const { return 0!=shmCell_; }
64  bool isComplete() const;
65 
66  UInt_t fuResourceId() const { return fuResourceId_; }
67  UInt_t buResourceId() const { return buResourceId_; }
68  UInt_t evtNumber() const { return evtNumber_; }
69 
70  UInt_t nbSent() const { return nbSent_; }
71  void incNbSent() { nbSent_++; }
72 
73  UInt_t nbErrors(bool reset=true);
74  UInt_t nbCrcErrors(bool reset=true);
75  UInt_t nbBytes(bool reset=true);
76 
78 
80 
81  private:
82  //
83  // member data
84  //
85  log4cplus::Logger log_;
86 
87  static
89  static
90  bool useEvmBoard_;
93 
97 
100 
104 
109 
111 
115 
119 
122 
123  xdaq::Application *app_;
124 
126 
127  static unsigned int gtpDaqId_;
128  static unsigned int gtpEvmId_;
129  static unsigned int gtpeId_;
130 
131  };
132 
133  //
134  // typedefs
135  //
136  typedef std::vector<FUResource*> FUResourceVec_t;
137 
138 
139 } // namespace evf
140 
141 
142 //
143 // implementation of inline functions
144 //
145 inline
147 {
149 }
150 
151 
152 #endif
UInt_t nbErrors_
Definition: FUResource.h:112
FUResource(UInt_t fuResourceId, log4cplus::Logger, EvffedFillerRB *, xdaq::Application *)
Definition: FUResource.cc:58
static bool doFedIdCheck_
Definition: FUResource.h:88
void process(MemRef_t *bufRef)
Definition: FUResource.cc:144
UInt_t fuResourceId_
Definition: FUResource.h:94
void releaseSuperFrag()
Definition: FUResource.cc:789
EvffedFillerRB * frb_
Definition: FUResource.h:121
bool fatalError() const
Definition: FUResource.h:62
virtual ~FUResource()
Definition: FUResource.cc:77
void appendBlockToSuperFrag(MemRef_t *bufRef)
Definition: FUResource.cc:481
UInt_t nbErrors(bool reset=true)
Definition: FUResource.cc:800
UInt_t nbBytes(bool reset=true)
Definition: FUResource.cc:818
static bool useEvmBoard_
Definition: FUResource.h:90
toolbox::mem::Reference MemRef_t
Definition: FUTypes.h:10
void fillSuperFragPayload()
Definition: FUResource.cc:555
MemRef_t * superFragHead_
Definition: FUResource.h:98
static void useEvmBoard(bool useEvmBoard)
Definition: FUResource.h:57
bool crcBeingChecked()
Definition: FUResource.h:60
log4cplus::Logger log_
Definition: FUResource.h:85
evf::FUShmRawCell * shmCell_
Definition: FUResource.h:120
UInt_t fuResourceId() const
Definition: FUResource.h:66
static unsigned int gtpDaqId_
Definition: FUResource.h:127
void checkDataBlockPayload(MemRef_t *bufRef)
Definition: FUResource.cc:380
MemRef_t * superFragTail_
Definition: FUResource.h:99
void removeLastAppendedBlockFromSuperFrag()
Definition: FUResource.cc:495
UInt_t evtNumber_
Definition: FUResource.h:96
void superFragSize()
Definition: FUResource.cc:518
std::vector< FUResource * > FUResourceVec_t
Definition: FUResource.h:136
UInt_t fedSize_[1024]
Definition: FUResource.h:116
UInt_t buResourceId() const
Definition: FUResource.h:67
bool isComplete() const
Definition: FUResource.h:146
UInt_t iSuperFrag_
Definition: FUResource.h:107
UInt_t eventPayloadSize_
Definition: FUResource.h:101
unsigned int UInt_t
Definition: FUTypes.h:12
evf::FUShmRawCell * shmCell()
Definition: FUResource.h:77
UInt_t evtNumber() const
Definition: FUResource.h:68
bool isAllocated() const
Definition: FUResource.h:63
UInt_t nbCrcErrors_
Definition: FUResource.h:113
UInt_t nbSent() const
Definition: FUResource.h:70
void processDataBlock(MemRef_t *bufRef)
Definition: FUResource.cc:201
static unsigned int gtpeId_
Definition: FUResource.h:129
UInt_t superFragSize_
Definition: FUResource.h:117
UInt_t buResourceId_
Definition: FUResource.h:95
void doCrcCheck(bool doCrcCheck)
Definition: FUResource.h:58
xdaq::Application * app_
Definition: FUResource.h:123
static unsigned int gtpEvmId_
Definition: FUResource.h:128
UInt_t nSuperFrag_
Definition: FUResource.h:108
UInt_t eventSize_
Definition: FUResource.h:118
static void doFedIdCheck(bool doFedIdCheck)
Definition: FUResource.h:55
UInt_t nbCrcErrors(bool reset=true)
Definition: FUResource.cc:809
UInt_t nSuperFragMax_
Definition: FUResource.h:103
void scheduleCRCError()
Definition: FUResource.h:79
bool nextEventWillHaveCRCError_
Definition: FUResource.h:125
void reset(double vett[256])
Definition: TPedValues.cc:11
void allocate(FUShmRawCell *shmCell)
Definition: FUResource.cc:88
void incNbSent()
Definition: FUResource.h:71