22 #include "xdaq/Application.h"
23 #include "xdaq/ApplicationContext.h"
24 #include "xdaq/ApplicationGroup.h"
47 , name_(ps.getParameter<std::string>(
"@module_label" ))
50 FDEBUG(9) <<
"FUShmOutputModule: constructor" << endl;
57 std::string guidString = guidObj.
toString();
59 uLong crc = crc32(0
L, Z_NULL, 0);
60 Bytef* buf = (Bytef*)guidString.data();
61 crc = crc32(crc, buf, guidString.length());
68 FDEBUG(9) <<
"FUShmOutputModule: FUShmOutputModule destructor" << endl;
78 <<
" Error getting shared memory buffer for INIT. "
79 <<
" Make sure you configure the ResourceBroker before the FUEventProcessor! "
80 <<
" No INIT is sent - this is probably fatal!";
83 unsigned char* buffer = (
unsigned char*) initMessage.
startAddress();
84 unsigned int size = initMessage.
size();
85 FDEBUG(10) <<
"writing out INIT message with size = " << size << std::endl;
92 if(!ret)
edm::LogError(
"FUShmOutputModule") <<
" Error writing preamble to ShmBuffer";
99 <<
" Invalid shared memory buffer at first event"
100 <<
" Make sure you configure the ResourceBroker before the FUEventProcessor! "
101 <<
" No event is sent - this is fatal! Should throw here";
105 unsigned char* buffer = (
unsigned char*) eventMessage.
startAddress();
106 unsigned int size = eventMessage.
size();
108 unsigned int runid = eventView.
run();
109 unsigned int eventid = eventView.event();
110 unsigned int outModId = eventView.outModId();
111 FDEBUG(10) <<
"FUShmOutputModule: event size = " << size << std::endl;
114 if(!ret)
edm::LogError(
"FUShmOutputModule") <<
" Error with writing data to ShmBuffer";
123 edm::LogError(
"FUShmOutputModule")<<
"Failed to attach to shared memory";
128 FDEBUG(9) <<
"FUShmOutputModule: sending terminate run" << std::endl;
static bool fuIdsInitialized_
FUShmOutputModule(edm::ParameterSet const &ps)
bool writeRecoEventData(unsigned int runNumber, unsigned int evtNumber, unsigned int outModId, unsigned int fuProcessId, unsigned int fuGuid, unsigned char *data, unsigned int dataSize)
bool writeRecoInitMsg(unsigned int outModId, unsigned int fuProcessId, unsigned int fuGuid, unsigned char *data, unsigned int dataSize)
uint8 * startAddress() const
void doOutputHeader(InitMsgBuilder const &initMessage)
std::string const toString() const
Automatic conversion from string reprentation.
evf::FUShmBuffer * getShmBuffer()
static SM_SharedMemoryHandle sm_sharedmemory
uint32 outputModuleId() const
void doOutputEvent(EventMsgBuilder const &eventMessage)
uint8 * startAddress() const
tuple size
Write out results.
static uint32 fuGuidValue_
evf::FUShmBuffer * shmBuffer_