CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes | Friends
evf::FUResource Class Reference

#include <FUResource.h>

Public Member Functions

void allocate (FUShmRawCell *shmCell)
 
void appendBlockToSuperFrag (MemRef_t *bufRef)
 
UInt_t buResourceId () const
 
bool crcBeingChecked ()
 
void doCrcCheck (bool doCrcCheck)
 
UInt_t evtNumber () const
 
bool fatalError () const
 
void fillSuperFragPayload () throw (evf::Exception)
 
 FUResource (UInt_t fuResourceId, log4cplus::Logger, EvffedFillerRB *, xdaq::Application *)
 
UInt_t fuResourceId () const
 
void incNbSent ()
 
bool isAllocated () const
 
bool isComplete () const
 
UInt_t nbBytes (bool reset=true)
 
UInt_t nbCrcErrors (bool reset=true)
 
UInt_t nbErrors (bool reset=true)
 
UInt_t nbSent () const
 
void process (MemRef_t *bufRef)
 
void release (bool detachResource)
 
void releaseSuperFrag ()
 
void removeLastAppendedBlockFromSuperFrag ()
 
void scheduleCRCError ()
 
evf::FUShmRawCellshmCell ()
 
void superFragSize () throw (evf::Exception)
 
virtual ~FUResource ()
 

Static Public Member Functions

static void doFedIdCheck (bool doFedIdCheck)
 
static void useEvmBoard (bool useEvmBoard)
 

Private Attributes

xdaq::Application * app_
 
UInt_t buResourceId_
 
bool doCrcCheck_
 
UInt_t eventPayloadSize_
 
UInt_t eventSize_
 
UInt_t evtNumber_
 
bool fatalError_
 
UInt_t fedSize_ [1024]
 
EvffedFillerRBfrb_
 
UInt_t fuResourceId_
 
UInt_t iBlock_
 
UInt_t iSuperFrag_
 
log4cplus::Logger log_
 
UInt_t nbBytes_
 
UInt_t nbCrcErrors_
 
UInt_t nbErrors_
 
UInt_t nBlock_
 
UInt_t nbSent_
 
bool nextEventWillHaveCRCError_
 
UInt_t nFedMax_
 
UInt_t nSuperFrag_
 
UInt_t nSuperFragMax_
 
evf::FUShmRawCellshmCell_
 
MemRef_tsuperFragHead_
 
UInt_t superFragSize_
 
MemRef_tsuperFragTail_
 

Static Private Attributes

static bool doFedIdCheck_ = true
 
static unsigned int gtpDaqId_ = FEDNumbering::MAXTriggerGTPFEDID
 
static unsigned int gtpeId_ = FEDNumbering::MINTriggerEGTPFEDID
 
static unsigned int gtpEvmId_ = FEDNumbering::MINTriggerGTPFEDID
 
static bool useEvmBoard_ = true
 

Friends

class ResourceChecker
 

Detailed Description

Object representing a managed resource.

Author:
aspataru

Definition at line 43 of file FUResource.h.

Constructor & Destructor Documentation

FUResource::FUResource ( UInt_t  fuResourceId,
log4cplus::Logger  logger,
EvffedFillerRB frb,
xdaq::Application *  app 
)

Definition at line 45 of file FUResource.cc.

46  :
49  frb_(frb), app_(app), nextEventWillHaveCRCError_(false) {
50  //release();
51 }
UInt_t fuResourceId_
Definition: FUResource.h:165
EvffedFillerRB * frb_
Definition: FUResource.h:192
std::ostream & logger()
Definition: fwLog.cc:41
MemRef_t * superFragHead_
Definition: FUResource.h:169
log4cplus::Logger log_
Definition: FUResource.h:156
evf::FUShmRawCell * shmCell_
Definition: FUResource.h:191
UInt_t fuResourceId() const
Definition: FUResource.h:118
MemRef_t * superFragTail_
Definition: FUResource.h:170
UInt_t superFragSize_
Definition: FUResource.h:188
xdaq::Application * app_
Definition: FUResource.h:194
bool nextEventWillHaveCRCError_
Definition: FUResource.h:196
FUResource::~FUResource ( )
virtual

Definition at line 54 of file FUResource.cc.

54  {
55 
56 }

Member Function Documentation

void FUResource::allocate ( FUShmRawCell shmCell)

Associate a ShmRawCell to the resource

Definition at line 63 of file FUResource.cc.

References evf::FUShmRawCell::clear(), eventPayloadSize_, fuResourceId_, evf::FUShmRawCell::nFed(), nFedMax_, evf::FUShmRawCell::nSuperFrag(), nSuperFragMax_, evf::FUShmRawCell::payloadSize(), evf::FUShmRawCell::setEventTypeData(), evf::FUShmRawCell::setFuResourceId(), shmCell(), and shmCell_.

Referenced by evf::FUResourceQueue::buildResource(), and evf::FUResourceTable::buildResource().

63  {
64  //release();
65  shmCell_ = shmCell;
66  shmCell_->clear();
68  //UPDATED
71  nFedMax_ = shmCell_->nFed();
73  /*
74  cout << "shmCell = " << shmCell_ << " shm cell furesourceId = "
75  << fuResourceId_ << " payload size = " << shmCell_->payloadSize()
76  << " nFed max = " << shmCell_->nFed() << " nSuperFragMax_ = "
77  << shmCell_->nSuperFrag() << endl;
78  */
79 }
UInt_t fuResourceId_
Definition: FUResource.h:165
evf::FUShmRawCell * shmCell_
Definition: FUResource.h:191
void setEventTypeData()
Definition: FUShmRawCell.h:57
unsigned int payloadSize() const
Definition: FUShmRawCell.h:30
UInt_t eventPayloadSize_
Definition: FUResource.h:172
evf::FUShmRawCell * shmCell()
Definition: FUResource.h:145
void setFuResourceId(unsigned int id)
Definition: FUShmRawCell.h:43
unsigned int nFed() const
Definition: FUShmRawCell.h:33
unsigned int nSuperFrag() const
Definition: FUShmRawCell.h:37
UInt_t nSuperFragMax_
Definition: FUResource.h:174
void FUResource::appendBlockToSuperFrag ( MemRef_t bufRef)

Append I2O block to super fragment

Definition at line 184 of file FUResource.cc.

References superFragHead_, and superFragTail_.

184  {
185  if (0 == superFragHead_) {
186  superFragHead_ = bufRef;
187  superFragTail_ = bufRef;
188  } else {
189  superFragTail_->setNextReference(bufRef);
190  superFragTail_ = bufRef;
191  }
192  return;
193 }
MemRef_t * superFragHead_
Definition: FUResource.h:169
MemRef_t * superFragTail_
Definition: FUResource.h:170
UInt_t evf::FUResource::buResourceId ( ) const
inline

Definition at line 121 of file FUResource.h.

References buResourceId_.

121  {
122  return buResourceId_;
123  }
UInt_t buResourceId_
Definition: FUResource.h:166
bool evf::FUResource::crcBeingChecked ( )
inline

Definition at line 107 of file FUResource.h.

References doCrcCheck_.

107  {
108  return doCrcCheck_;
109  }
void evf::FUResource::doCrcCheck ( bool  doCrcCheck)
inline

Definition at line 104 of file FUResource.h.

References doCrcCheck_.

Referenced by evf::FUResourceQueue::buildResource(), and evf::FUResourceTable::buildResource().

104  {
106  }
void doCrcCheck(bool doCrcCheck)
Definition: FUResource.h:104
static void evf::FUResource::doFedIdCheck ( bool  doFedIdCheck)
inlinestatic

Definition at line 97 of file FUResource.h.

References doFedIdCheck_.

Referenced by evf::FUResourceBroker::actionPerformed(), and evf::rb_statemachine::SharedResources::configureResources().

97  {
99  }
static bool doFedIdCheck_
Definition: FUResource.h:159
static void doFedIdCheck(bool doFedIdCheck)
Definition: FUResource.h:97
UInt_t evf::FUResource::evtNumber ( ) const
inline

Definition at line 124 of file FUResource.h.

References evtNumber_.

124  {
125  return evtNumber_;
126  }
UInt_t evtNumber_
Definition: FUResource.h:167
bool evf::FUResource::fatalError ( ) const
inline

Definition at line 110 of file FUResource.h.

References fatalError_.

Referenced by evf::FUResourceQueue::buildResource(), evf::FUResourceTable::buildResource(), and process().

110  {
111  return fatalError_;
112  }
void FUResource::fillSuperFragPayload ( )
throw (evf::Exception
)

Fills super fragment payload with I2O blocks

Definition at line 248 of file FUResource.cc.

References evtNumber_, fuResourceId_, iSuperFrag_, evf::FUShmRawCell::markSuperFrag(), nbBytes(), nbBytes_, nbErrors_, shmCell_, superFragHead_, superFragSize_, and evf::FUShmRawCell::writeData().

248  {
249  UChar_t *blockAddr = 0;
250  UChar_t *frlHeaderAddr = 0;
251  UChar_t *fedAddr = 0;
252  UInt_t nbBytes = 0;
253  UInt_t nbBytesTot = 0;
254  frlh_t *frlHeader = 0;
255  UChar_t *bufferPos = 0;
256  UChar_t *startPos = 0;
257 
258  MemRef_t* bufRef = superFragHead_;
259  while (bufRef != 0) {
260  blockAddr = (UChar_t*) bufRef->getDataLocation();
261  frlHeaderAddr = blockAddr + sizeof(I2O_EVENT_DATA_BLOCK_MESSAGE_FRAME);
262  fedAddr = frlHeaderAddr + sizeof(frlh_t);
263  frlHeader = (frlh_t*) frlHeaderAddr;
264  nbBytes = frlHeader->segsize & FRL_SEGSIZE_MASK;
265  nbBytesTot += nbBytes;
266 
267  // check if still within limits
268  if (nbBytesTot > superFragSize_) {
269  nbErrors_++;
270  stringstream oss;
271  oss << "Reached end of buffer." << " fuResourceId:"
272  << fuResourceId_ << " evtNumber:" << evtNumber_
273  << " iSuperFrag:" << iSuperFrag_;
274  XCEPT_RAISE(evf::Exception, oss.str());
275  }
276 
277  bufferPos = shmCell_->writeData(fedAddr, nbBytes);
278  if (0 == startPos)
279  startPos = bufferPos;
280 
281  nbBytes_ += nbBytes;
282  bufRef = bufRef->getNextReference();
283  }
284 
285  if (!shmCell_->markSuperFrag(iSuperFrag_, superFragSize_, startPos)) {
286  nbErrors_++;
287  stringstream oss;
288  oss << "Failed to mark super fragment in shared mem buffer."
289  << " fuResourceId:" << fuResourceId_ << " evtNumber:"
290  << evtNumber_ << " iSuperFrag:" << iSuperFrag_;
291  XCEPT_RAISE(evf::Exception, oss.str());
292  }
293 
294  return;
295 }
UInt_t nbErrors_
Definition: FUResource.h:183
UInt_t fuResourceId_
Definition: FUResource.h:165
unsigned char * writeData(unsigned char *data, unsigned int dataSize)
UInt_t nbBytes(bool reset=true)
Definition: FUResource.cc:324
toolbox::mem::Reference MemRef_t
Definition: FUTypes.h:10
MemRef_t * superFragHead_
Definition: FUResource.h:169
evf::FUShmRawCell * shmCell_
Definition: FUResource.h:191
UInt_t evtNumber_
Definition: FUResource.h:167
unsigned char UChar_t
Definition: FUTypes.h:14
bool markSuperFrag(unsigned int i, unsigned int size, unsigned char *addr)
UInt_t iSuperFrag_
Definition: FUResource.h:178
unsigned int UInt_t
Definition: FUTypes.h:12
UInt_t superFragSize_
Definition: FUResource.h:188
UInt_t evf::FUResource::fuResourceId ( ) const
inline

Definition at line 118 of file FUResource.h.

References fuResourceId_.

118  {
119  return fuResourceId_;
120  }
UInt_t fuResourceId_
Definition: FUResource.h:165
void evf::FUResource::incNbSent ( )
inline

Increment the number of sent resources

Definition at line 134 of file FUResource.h.

References nbSent_.

134  {
135  nbSent_++;
136  }
bool evf::FUResource::isAllocated ( ) const
inline

Definition at line 113 of file FUResource.h.

References shmCell_.

Referenced by evf::FUResourceQueue::buildResource(), and evf::FUResourceTable::buildResource().

113  {
114  return 0 != shmCell_;
115  }
evf::FUShmRawCell * shmCell_
Definition: FUResource.h:191
bool evf::FUResource::isComplete ( ) const
inline

Checks if all I2O blocks have been received for this resource

Definition at line 221 of file FUResource.h.

References gather_cfg::cout, iBlock_, iSuperFrag_, nBlock_, and nSuperFrag_.

Referenced by evf::FUResourceQueue::buildResource(), evf::FUResourceTable::buildResource(), and process().

221  {
222 
223 #ifdef DEBUG_FURESOURCE_H
224  cout << "------------------------------------------------------"<< endl;
225  cout << "nBlock " << nBlock_
226  << " iBlock " << iBlock_
227  << " nSuperFrag " << nSuperFrag_
228  << " iSuperFrag " << iSuperFrag_
229  << endl;
230 #endif
231  return (nBlock_ && nSuperFrag_ && (iSuperFrag_ == nSuperFrag_) && (iBlock_
232  == nBlock_));
233 }
UInt_t iSuperFrag_
Definition: FUResource.h:178
UInt_t nSuperFrag_
Definition: FUResource.h:179
tuple cout
Definition: gather_cfg.py:121
UInt_t FUResource::nbBytes ( bool  reset = true)

Definition at line 324 of file FUResource.cc.

References nbBytes_, and query::result.

Referenced by fillSuperFragPayload().

324  {
326  if (reset)
327  nbBytes_ = 0;
328  return result;
329 }
tuple result
Definition: query.py:137
unsigned int UInt_t
Definition: FUTypes.h:12
void reset(double vett[256])
Definition: TPedValues.cc:11
UInt_t FUResource::nbCrcErrors ( bool  reset = true)

Definition at line 316 of file FUResource.cc.

References nbCrcErrors_, and query::result.

Referenced by evf::FUResourceQueue::buildResource(), and evf::FUResourceTable::buildResource().

316  {
318  if (reset)
319  nbCrcErrors_ = 0;
320  return result;
321 }
tuple result
Definition: query.py:137
unsigned int UInt_t
Definition: FUTypes.h:12
UInt_t nbCrcErrors_
Definition: FUResource.h:184
void reset(double vett[256])
Definition: TPedValues.cc:11
UInt_t FUResource::nbErrors ( bool  reset = true)

Definition at line 308 of file FUResource.cc.

References nbErrors_, and query::result.

Referenced by evf::FUResourceQueue::buildResource(), and evf::FUResourceTable::buildResource().

308  {
310  if (reset)
311  nbErrors_ = 0;
312  return result;
313 }
UInt_t nbErrors_
Definition: FUResource.h:183
tuple result
Definition: query.py:137
unsigned int UInt_t
Definition: FUTypes.h:12
void reset(double vett[256])
Definition: TPedValues.cc:11
UInt_t evf::FUResource::nbSent ( ) const
inline

Definition at line 127 of file FUResource.h.

References nbSent_.

127  {
128  return nbSent_;
129  }
void FUResource::process ( MemRef_t bufRef)

Process resource

Definition at line 126 of file FUResource.cc.

References gather_cfg::cout, alignCSCRings::e, evtNumber_, edm::hlt::Exception, fatalError(), fatalError_, evf::EvffedFillerRB::fedId(), fedSize_, frb_, fuResourceId_, evf::EvffedFillerRB::getPayload(), isComplete(), iSuperFrag_, log_, evf::FUShmRawCell::markFed(), evf::FUShmRawCell::markSuperFrag(), nbErrors_, GetRecoTauVFromDQM_MC_cff::next, evf::ResourceChecker::processDataBlock(), evf::EvffedFillerRB::putHeader(), evf::EvffedFillerRB::putTrailer(), shmCell_, evf::EvffedFillerRB::size(), superFragSize_, and evf::FUShmRawCell::writeData().

Referenced by evf::FUResourceQueue::buildResource(), evf::FUResourceTable::buildResource(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::dumpPython(), ConfigBuilder.ConfigBuilder.PrintAllModules::leave(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::open(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::outputEventContent(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::setProcess(), and Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::setProperty().

126  {
127  if (fatalError()) {
128  LOG4CPLUS_ERROR(log_, "THIS SHOULD *NEVER* HAPPEN!."); // DEBUG
129  bufRef->release();
130  return;
131  }
132 #ifdef DEBUG_FU_RES
133  std::cout << "Started process() for bufRef: " << bufRef<< std::endl;
134 #endif
135  MemRef_t* itBufRef = bufRef;
136  while (0 != itBufRef && !fatalError()) {
137  MemRef_t* next = itBufRef->getNextReference();
138  itBufRef->setNextReference(0);
139  try {
140 
141  ResourceChecker resCheck(this);
142  resCheck.processDataBlock(itBufRef);
143 
144  } catch (xcept::Exception& e) {
145  LOG4CPLUS_ERROR(log_,
146  "EVENT LOST:" << xcept::stdformat_exception_history(e));
147  fatalError_ = true;
148  itBufRef->setNextReference(next);
149  }
150 
151  itBufRef = next;
152  }
153  if (isComplete()) {
155  frb_->putTrailer();
156  fedSize_[frb_->fedId()] = frb_->size();
157  UChar_t *startPos = shmCell_->writeData(frb_->getPayload(),
158  frb_->size());
159  superFragSize_ = frb_->size();
160  if (!shmCell_->markSuperFrag(iSuperFrag_, superFragSize_, startPos)) {
161  nbErrors_++;
162  stringstream oss;
163  oss << "Failed to mark super fragment in shared mem buffer."
164  << " fuResourceId:" << fuResourceId_ << " evtNumber:"
165  << evtNumber_ << " iSuperFrag:" << iSuperFrag_;
166  XCEPT_RAISE(evf::Exception, oss.str());
167  }
168 
169  if (!shmCell_->markFed(frb_->fedId(), frb_->size(), startPos)) {
170  nbErrors_++;
171  stringstream oss;
172  oss << "Failed to mark fed in buffer." << " evtNumber:"
173  << evtNumber_ << " fedId:" << frb_->fedId() << " fedSize:"
174  << frb_->size() << " fedAddr:0x" << hex
175  << (unsigned long) frb_->getPayload() << dec;
176  XCEPT_RAISE(evf::Exception, oss.str());
177  }
178 
179  }
180  return;
181 }
UInt_t nbErrors_
Definition: FUResource.h:183
UInt_t fuResourceId_
Definition: FUResource.h:165
EvffedFillerRB * frb_
Definition: FUResource.h:192
unsigned int size() const
bool fatalError() const
Definition: FUResource.h:110
unsigned char * writeData(unsigned char *data, unsigned int dataSize)
toolbox::mem::Reference MemRef_t
Definition: FUTypes.h:10
bool markFed(unsigned int i, unsigned int size, unsigned char *addr)
unsigned int fedId() const
log4cplus::Logger log_
Definition: FUResource.h:156
evf::FUShmRawCell * shmCell_
Definition: FUResource.h:191
UInt_t evtNumber_
Definition: FUResource.h:167
unsigned char UChar_t
Definition: FUTypes.h:14
UInt_t fedSize_[1024]
Definition: FUResource.h:187
bool markSuperFrag(unsigned int i, unsigned int size, unsigned char *addr)
bool isComplete() const
Definition: FUResource.h:221
UInt_t iSuperFrag_
Definition: FUResource.h:178
unsigned char *const getPayload()
UInt_t superFragSize_
Definition: FUResource.h:188
tuple cout
Definition: gather_cfg.py:121
void putHeader(unsigned int l1id, unsigned int bxid)
void FUResource::release ( bool  detachResource)

Release resource

Definition at line 82 of file FUResource.cc.

References buResourceId_, doCrcCheck_, alignCSCRings::e, eventSize_, evtNumber_, edm::hlt::Exception, fatalError_, fedSize_, i, iBlock_, iSuperFrag_, log_, nbCrcErrors_, nbErrors_, nBlock_, nbSent_, nSuperFrag_, shmCell_, superFragHead_, and superFragTail_.

Referenced by evf::FUResourceQueue::buildResource(), evf::FUResourceTable::buildResource(), evf::FUResourceQueue::initialize(), and evf::FUResourceTable::initialize().

82  {
83  doCrcCheck_ = false;
84  fatalError_ = false;
85 
86  buResourceId_ = 0xffffffff;
87  evtNumber_ = 0xffffffff;
88 
89  if (0 != superFragHead_) {
90  try {
91  superFragHead_->release();
92  } catch (xcept::Exception& e) {
93  LOG4CPLUS_ERROR(
94  log_,
95  "Failed to release superFragHead: "
96  << xcept::stdformat_exception_history(e));
97  }
98  }
99 
100  superFragHead_ = 0;
101  superFragTail_ = 0;
102 
103  iBlock_ = 0;
104  nBlock_ = 0xffffffff;
105  iSuperFrag_ = 0;
106  nSuperFrag_ = 0xffffffff;
107 
108  nbSent_ = 0;
109 
110  nbErrors_ = 0;
111  nbCrcErrors_ = 0;
112 
113  for (UInt_t i = 0; i < 1024; i++)
114  fedSize_[i] = 0;
115  eventSize_ = 0;
116 
117  if (0 != shmCell_) {
118  shmCell_ = 0;
119  if (detachResource)
120  shmdt(shmCell_);
121  }
122 
123 }
int i
Definition: DBlmapReader.cc:9
UInt_t nbErrors_
Definition: FUResource.h:183
MemRef_t * superFragHead_
Definition: FUResource.h:169
log4cplus::Logger log_
Definition: FUResource.h:156
evf::FUShmRawCell * shmCell_
Definition: FUResource.h:191
MemRef_t * superFragTail_
Definition: FUResource.h:170
UInt_t evtNumber_
Definition: FUResource.h:167
UInt_t fedSize_[1024]
Definition: FUResource.h:187
UInt_t iSuperFrag_
Definition: FUResource.h:178
unsigned int UInt_t
Definition: FUTypes.h:12
UInt_t nbCrcErrors_
Definition: FUResource.h:184
UInt_t buResourceId_
Definition: FUResource.h:166
UInt_t nSuperFrag_
Definition: FUResource.h:179
UInt_t eventSize_
Definition: FUResource.h:189
void FUResource::releaseSuperFrag ( )

Releases the current super fragment and memory used by it

Definition at line 298 of file FUResource.cc.

References superFragHead_, and superFragTail_.

298  {
299  if (0 == superFragHead_)
300  return;
301  superFragHead_->release(); // throws xcept::Exception
302  superFragHead_ = 0;
303  superFragTail_ = 0;
304  return;
305 }
MemRef_t * superFragHead_
Definition: FUResource.h:169
MemRef_t * superFragTail_
Definition: FUResource.h:170
void FUResource::removeLastAppendedBlockFromSuperFrag ( )

Remove last appended I2O block from super fragment

Definition at line 196 of file FUResource.cc.

References cond::rpcobimon::current, GetRecoTauVFromDQM_MC_cff::next, superFragHead_, and superFragTail_.

196  {
197  if (0 == superFragHead_) {
198  //nothing to do... why did we get here then ???
199  } else if (superFragHead_ == superFragTail_) {
200  superFragHead_ = 0;
201  superFragTail_ = 0;
202  } else {
203  MemRef_t *next = 0;
205  while ((next = current->getNextReference()) != superFragTail_) {
206  current = next;
207  //get to the next-to-last block
208  }
210  current->setNextReference(0);
211  }
212  return;
213 }
toolbox::mem::Reference MemRef_t
Definition: FUTypes.h:10
MemRef_t * superFragHead_
Definition: FUResource.h:169
MemRef_t * superFragTail_
Definition: FUResource.h:170
void evf::FUResource::scheduleCRCError ( )
inline

Definition at line 148 of file FUResource.h.

References nextEventWillHaveCRCError_.

148  {
150  }
bool nextEventWillHaveCRCError_
Definition: FUResource.h:196
evf::FUShmRawCell* evf::FUResource::shmCell ( )
inline

Returns a pointer to the Shm Raw cell associated to this resource

Definition at line 145 of file FUResource.h.

References shmCell_.

Referenced by allocate(), and evf::FUResourceTable::buildResource().

145  {
146  return shmCell_;
147  }
evf::FUShmRawCell * shmCell_
Definition: FUResource.h:191
void FUResource::superFragSize ( )
throw (evf::Exception
)

Returns the size of the current super fragment

Definition at line 216 of file FUResource.cc.

References eventPayloadSize_, eventSize_, evtNumber_, fuResourceId_, iSuperFrag_, nbErrors_, superFragHead_, and superFragSize_.

216  {
217  UChar_t *blockAddr = 0;
218  UChar_t *frlHeaderAddr = 0;
219  frlh_t *frlHeader = 0;
220 
221  superFragSize_ = 0;
222 
223  UInt_t frameSize = sizeof(I2O_EVENT_DATA_BLOCK_MESSAGE_FRAME);
224  MemRef_t* bufRef = superFragHead_;
225 
226  while (0 != bufRef) {
227  blockAddr = (UChar_t*) bufRef->getDataLocation();
228  frlHeaderAddr = blockAddr + frameSize;
229  frlHeader = (frlh_t*) frlHeaderAddr;
230  superFragSize_ += frlHeader->segsize & FRL_SEGSIZE_MASK;
231  bufRef = bufRef->getNextReference();
232  }
233 
235 
237  nbErrors_++;
238  stringstream oss;
239  oss << "Event size exceeds maximum size." << " fuResourceId:"
240  << fuResourceId_ << " evtNumber:" << evtNumber_
241  << " iSuperFrag:" << iSuperFrag_ << " eventSize:" << eventSize_
242  << " eventPayloadSize:" << eventPayloadSize_;
243  XCEPT_RAISE(evf::Exception, oss.str());
244  }
245 }
UInt_t nbErrors_
Definition: FUResource.h:183
UInt_t fuResourceId_
Definition: FUResource.h:165
toolbox::mem::Reference MemRef_t
Definition: FUTypes.h:10
MemRef_t * superFragHead_
Definition: FUResource.h:169
UInt_t evtNumber_
Definition: FUResource.h:167
unsigned char UChar_t
Definition: FUTypes.h:14
UInt_t iSuperFrag_
Definition: FUResource.h:178
UInt_t eventPayloadSize_
Definition: FUResource.h:172
unsigned int UInt_t
Definition: FUTypes.h:12
UInt_t superFragSize_
Definition: FUResource.h:188
UInt_t eventSize_
Definition: FUResource.h:189
static void evf::FUResource::useEvmBoard ( bool  useEvmBoard)
inlinestatic

Definition at line 101 of file FUResource.h.

References useEvmBoard_.

Referenced by evf::FUResourceBroker::actionPerformed(), and evf::rb_statemachine::SharedResources::configureResources().

101  {
103  }
static bool useEvmBoard_
Definition: FUResource.h:161
static void useEvmBoard(bool useEvmBoard)
Definition: FUResource.h:101

Friends And Related Function Documentation

friend class ResourceChecker
friend

Definition at line 202 of file FUResource.h.

Member Data Documentation

xdaq::Application* evf::FUResource::app_
private

Definition at line 194 of file FUResource.h.

Referenced by evf::ResourceChecker::findFEDs().

UInt_t evf::FUResource::buResourceId_
private

Definition at line 166 of file FUResource.h.

Referenced by buResourceId(), and release().

bool evf::FUResource::doCrcCheck_
private

Definition at line 162 of file FUResource.h.

Referenced by crcBeingChecked(), doCrcCheck(), evf::ResourceChecker::findFEDs(), and release().

bool FUResource::doFedIdCheck_ = true
staticprivate

Definition at line 159 of file FUResource.h.

Referenced by doFedIdCheck(), and evf::ResourceChecker::findFEDs().

UInt_t evf::FUResource::eventPayloadSize_
private

Definition at line 172 of file FUResource.h.

Referenced by allocate(), and superFragSize().

UInt_t evf::FUResource::eventSize_
private

Definition at line 189 of file FUResource.h.

Referenced by release(), and superFragSize().

UInt_t evf::FUResource::evtNumber_
private
bool evf::FUResource::fatalError_
private

Definition at line 163 of file FUResource.h.

Referenced by fatalError(), process(), and release().

UInt_t evf::FUResource::fedSize_[1024]
private

Definition at line 187 of file FUResource.h.

Referenced by evf::ResourceChecker::findFEDs(), process(), and release().

EvffedFillerRB* evf::FUResource::frb_
private

Definition at line 192 of file FUResource.h.

Referenced by process().

UInt_t evf::FUResource::fuResourceId_
private

Definition at line 165 of file FUResource.h.

Referenced by allocate(), fillSuperFragPayload(), fuResourceId(), process(), and superFragSize().

unsigned int FUResource::gtpDaqId_ = FEDNumbering::MAXTriggerGTPFEDID
staticprivate

Definition at line 198 of file FUResource.h.

Referenced by evf::ResourceChecker::findFEDs().

unsigned int FUResource::gtpeId_ = FEDNumbering::MINTriggerEGTPFEDID
staticprivate

Definition at line 200 of file FUResource.h.

Referenced by evf::ResourceChecker::findFEDs().

unsigned int FUResource::gtpEvmId_ = FEDNumbering::MINTriggerGTPFEDID
staticprivate

Definition at line 199 of file FUResource.h.

Referenced by evf::ResourceChecker::findFEDs().

UInt_t evf::FUResource::iBlock_
private

Definition at line 176 of file FUResource.h.

Referenced by isComplete(), and release().

UInt_t evf::FUResource::iSuperFrag_
private
log4cplus::Logger evf::FUResource::log_
private

Definition at line 156 of file FUResource.h.

Referenced by evf::ResourceChecker::findFEDs(), process(), and release().

UInt_t evf::FUResource::nbBytes_
private

Definition at line 185 of file FUResource.h.

Referenced by fillSuperFragPayload(), and nbBytes().

UInt_t evf::FUResource::nbCrcErrors_
private

Definition at line 184 of file FUResource.h.

Referenced by evf::ResourceChecker::findFEDs(), nbCrcErrors(), and release().

UInt_t evf::FUResource::nbErrors_
private
UInt_t evf::FUResource::nBlock_
private

Definition at line 177 of file FUResource.h.

Referenced by isComplete(), and release().

UInt_t evf::FUResource::nbSent_
private

Definition at line 181 of file FUResource.h.

Referenced by incNbSent(), nbSent(), and release().

bool evf::FUResource::nextEventWillHaveCRCError_
private

Definition at line 196 of file FUResource.h.

Referenced by evf::ResourceChecker::findFEDs(), and scheduleCRCError().

UInt_t evf::FUResource::nFedMax_
private

Definition at line 173 of file FUResource.h.

Referenced by allocate().

UInt_t evf::FUResource::nSuperFrag_
private

Definition at line 179 of file FUResource.h.

Referenced by isComplete(), and release().

UInt_t evf::FUResource::nSuperFragMax_
private

Definition at line 174 of file FUResource.h.

Referenced by allocate().

evf::FUShmRawCell* evf::FUResource::shmCell_
private
MemRef_t* evf::FUResource::superFragHead_
private
UInt_t evf::FUResource::superFragSize_
private

Definition at line 188 of file FUResource.h.

Referenced by fillSuperFragPayload(), process(), and superFragSize().

MemRef_t* evf::FUResource::superFragTail_
private
bool FUResource::useEvmBoard_ = true
staticprivate

Definition at line 161 of file FUResource.h.

Referenced by evf::ResourceChecker::findFEDs(), and useEvmBoard().