21 #include "xdaq/Application.h"
22 #include "xdaq/ApplicationContext.h"
23 #include "xdaq/ApplicationGroup.h"
46 , name_(ps.getParameter<std::string>(
"@module_label" ))
52 FDEBUG(9) <<
"FUShmOutputModule: constructor" << endl;
59 std::string guidString = guidObj.
toString();
61 uLong crc = crc32(0
L, Z_NULL, 0);
62 Bytef* buf = (Bytef*)guidString.data();
63 crc = crc32(crc, buf, guidString.length());
70 FDEBUG(9) <<
"FUShmOutputModule: FUShmOutputModule destructor" << endl;
80 if (
name_.size() > std::string(
"hltOutput").size() &&
name_.find(
"hltOutput")!=std::string::npos)
87 for (
size_t i=0;
i<streamDatasetList.size();
i++) {
111 unsigned char* buffer = (
unsigned char*) initMessage.
startAddress();
112 unsigned int size = initMessage.
size();
118 <<
" Error getting shared memory buffer for INIT. "
119 <<
" Make sure you configure the ResourceBroker before the FUEventProcessor! "
120 <<
" No INIT is sent - this is probably fatal!";
123 FDEBUG(10) <<
"writing out INIT message with size = " << size << std::endl;
129 if(!ret)
edm::LogError(
"FUShmOutputModule") <<
" Error writing preamble to ShmBuffer";
136 <<
" Invalid shared memory buffer at first event"
137 <<
" Make sure you configure the ResourceBroker before the FUEventProcessor! "
138 <<
" No event is sent - this is fatal! Should throw here";
142 unsigned char* buffer = (
unsigned char*) eventMessage.
startAddress();
143 unsigned int size = eventMessage.
size();
146 unsigned int runid = eventView.run();
147 unsigned int eventid = eventView.event();
148 unsigned int outModId = eventView.outModId();
149 FDEBUG(10) <<
"FUShmOutputModule: event size = " << size << std::endl;
152 if(!ret)
edm::LogError(
"FUShmOutputModule") <<
" Error with writing data to ShmBuffer";
161 edm::LogError(
"FUShmOutputModule")<<
"Failed to attach to shared memory";
166 FDEBUG(9) <<
"FUShmOutputModule: sending terminate run" << std::endl;
T getParameter(std::string const &) const
unsigned int numDatasets_
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)
std::vector< std::string > selectedDatasetNames_
void hltTriggerBits(uint8 *put_here) const
uint8 * startAddress() const
std::vector< unsigned int > datasetCounts_
void insertStreamAndDatasetInfo(edm::ParameterSet &streams, edm::ParameterSet datasets)
bool removeClientPrcId(pid_t prcId)
void setNExpectedEPs(unsigned int EPs)
bool writeRecoInitMsg(unsigned int outModId, unsigned int fuProcessId, unsigned int fuGuid, unsigned char *data, unsigned int dataSize, unsigned int nExpectedEPs)
void hltTriggerNames(Strings &save_here) const
void doOutputHeader(InitMsgBuilder const &initMessage)
std::vector< Strings > datasetPaths_
std::string const toString() const
Automatic conversion from string reprentation.
U second(std::pair< T, U > const &p)
evf::FUShmBuffer * getShmBuffer()
evf::FUShmBuffer * getBufferRef()
unsigned int nExpectedEPs_
std::vector< std::pair< std::string, edm::EventSelector * > > dpEventSelectors_
static SM_SharedMemoryHandle sm_sharedmemory
uint32 outputModuleId() const
void doOutputEvent(EventMsgBuilder const &eventMessage)
void countEventForDatasets(EventMsgView const &eventMessage)
uint8 * startAddress() const
tuple size
Write out results.
static uint32 fuGuidValue_
void parseDatasets(InitMsgView const &initMessage)
evf::FUShmBuffer * shmBuffer_
static void fillDescription(ParameterSetDescription &)