13 #include "xdaq/Application.h"
15 #include "toolbox/mem/HeapAllocator.h"
16 #include "toolbox/mem/MemoryPoolFactory.h"
17 #include "toolbox/net/URN.h"
18 #include "toolbox/fsm/exception/Exception.h"
20 #include "xdata/InfoSpace.h"
21 #include "xdata/UnsignedInteger32.h"
22 #include "xdata/Double.h"
23 #include "xdata/Boolean.h"
24 #include "xdata/String.h"
26 #include "interface/evb/i2oEVBMsgs.h"
27 #include "interface/shared/i2oXFunctionCodes.h"
29 #include "interface/shared/frl_header.h"
30 #include "interface/shared/fed_header.h"
31 #include "interface/shared/fed_trailer.h"
33 #include "i2o/Method.h"
34 #include "i2o/utils/AddressMap.h"
36 #include "CLHEP/Random/RandGauss.h"
42 #include <semaphore.h>
49 class BU :
public xdaq::Application,
50 public xdata::ActionListener
62 BU(xdaq::ApplicationStub *
s);
72 bool enabling(toolbox::task::WorkLoop* wl);
73 bool stopping(toolbox::task::WorkLoop* wl);
74 bool halting(toolbox::task::WorkLoop* wl);
95 bool building(toolbox::task::WorkLoop* wl);
99 bool sending(toolbox::task::WorkLoop* wl);
121 double deltaT(
const struct timeval *
start,
const struct timeval *
end);
125 unsigned int fuResourceId);
xdata::UnsignedInteger32 nbEventsInBU_
struct fedt_struct fedt_t
bool configuring(toolbox::task::WorkLoop *wl)
void webPageRequest(xgi::Input *in, xgi::Output *out)
xdata::Boolean overwriteEvtId_
toolbox::task::ActionSignature * asMonitoring_
xdata::Double memUsedInMB_
std::queue< unsigned int > builtIds_
bool sending(toolbox::task::WorkLoop *wl)
xdata::UnsignedInteger32 msgBufferSize_
xdaq::ApplicationContext * buAppContext_
toolbox::mem::Reference * createMsgChain(evf::BUEvent *evt, unsigned int fuResourceId)
xdata::Boolean useFixedFedSize_
double deltaT(const struct timeval *start, const struct timeval *end)
xdata::UnsignedInteger32 fedSizeWidth_
static const int frlHeaderSize_
std::queue< unsigned int > rqstIds_
bool monitoring(toolbox::task::WorkLoop *wl)
xdata::UnsignedInteger32 instance_
xdata::Boolean overwriteLsId_
xdata::Double throughput_
xdata::UnsignedInteger32 fakeLsUpdateSecs_
void startMonitoringWorkLoop()
static const int fedTrailerSize_
void customWebPage(xgi::Input *in, xgi::Output *out)
bool stopping(toolbox::task::WorkLoop *wl)
void actionPerformed(xdata::Event &e)
xdata::Double deltaSumOfSquares_
void startBuildingWorkLoop()
xoap::MessageReference fsmCallback(xoap::MessageReference msg)
toolbox::task::ActionSignature * asBuilding_
toolbox::task::WorkLoop * wlSending_
xdata::UnsignedInteger32 nbEventsSent_
void I2O_BU_ALLOCATE_Callback(toolbox::mem::Reference *bufRef)
xdata::UnsignedInteger32 nbEventsRequested_
BU(xdaq::ApplicationStub *s)
toolbox::task::WorkLoop * wlBuilding_
xdaq::ApplicationDescriptor * buAppDesc_
xdata::UnsignedInteger32 monSleepSec_
void dumpFrame(unsigned char *data, unsigned int len)
toolbox::task::ActionSignature * asSending_
xdata::UnsignedInteger32 deltaN_
std::vector< unsigned int > validFedIds_
toolbox::task::WorkLoop * wlMonitoring_
unsigned long long uint64_t
xdata::UnsignedInteger32 fedSizeMax_
bool generateEvent(evf::BUEvent *evt)
bool halting(toolbox::task::WorkLoop *wl)
toolbox::mem::Pool * i2oPool_
xdata::UnsignedInteger32 deltaSumOfSizes_
bool building(toolbox::task::WorkLoop *wl)
std::vector< evf::BUEvent * > events_
xdata::UnsignedInteger32 runNumber_
xdata::UnsignedInteger32 eventBufferSize_
xdata::UnsignedInteger32 fedSizeMean_
void I2O_BU_DISCARD_Callback(toolbox::mem::Reference *bufRef)
std::queue< unsigned int > freeIds_
char data[epos_bytes_allocation]
xdaq::ApplicationDescriptor * fuAppDesc_
std::set< unsigned int > sentIds_
void startSendingWorkLoop()
unsigned int monLastSumOfSizes_
uint64_t monLastSumOfSquares_
xdata::UnsignedInteger32 nbEventsDiscarded_
static const int fedHeaderSize_
xdata::UnsignedInteger32 queueSize_
bool enabling(toolbox::task::WorkLoop *wl)
xdata::UnsignedInteger32 nbEventsBuilt_
struct timeval monStartTime_
xdata::UnsignedInteger32 firstEvent_