36 #include <sys/types.h>
58 : evf::ServiceWeb(
"FUShmDQMOutputService")
102 if (lumiSectionInterval_ < 1) {lumiSectionInterval_ = 0;}
106 struct timezone dummyTZ;
107 gettimeofday(&now, &dummyTZ);
109 timeInSecSinceUTC_ =
static_cast<double>(now.tv_sec) + (static_cast<double>(now.tv_usec)/1000000.0);
112 if(got_host != 0) strcpy(
host_name_,
"noHostNameFoundOrTooLong");
118 std::string guidString = guidObj.
toString();
121 uLong crc = crc32(0
L, Z_NULL, 0);
122 Bytef* buf = (Bytef*)guidString.data();
123 crc = crc32(crc, buf, guidString.length());
145 is->fireItemAvailable(
"nbDqmUpdates",&
nbUpdates_);
149 <<
" exception when publishing to InfoSpace ";
161 edm::LogError(
"FUShmDQMOutputService")<<
"exception when trying to get service MicroStateService";
166 unsigned int thisLumiSection = 0;
172 struct timezone dummyTZ;
173 gettimeofday(&now, &dummyTZ);
174 double timeInSec =
static_cast<double>(now.tv_sec) + (static_cast<double>(now.tv_usec)/1000000.0) -
timeInSecSinceUTC_;
188 struct timezone dummyTZ;
189 gettimeofday(&now, &dummyTZ);
191 timeInSecSinceUTC_ =
static_cast<double>(now.tv_sec) + (static_cast<double>(now.tv_usec)/1000000.0);
196 if(thisLumiSection%4!=0)
212 unsigned int lumiSectionTag = thisLumiSection;
221 throw cms::Exception(
"postEventProcessing",
"FUShmDQMOutputService")
222 <<
"Unable to lookup the DQMStore service!\n";
227 std::vector<std::string> topLevelFolderList;
235 std::map< std::string, DQMEvent::TObjectTable > toMap;
236 std::vector<std::string>::const_iterator dirIter;
237 for (dirIter = topLevelFolderList.begin();
238 dirIter != topLevelFolderList.end();
240 std::string
dirName = *dirIter;
252 for (dirIter = topLevelFolderList.begin();
253 dirIter != topLevelFolderList.end();
255 std::string
dirName = *dirIter;
257 if (toTable.size() == 0) {
continue;}
265 unsigned int newSize = srcSize + 50000;
280 std::copy(src,src + srcSize, dqmMsgBuilder.eventAddress());
281 dqmMsgBuilder.setEventLength(srcSize);
287 dqmMsgBuilder.setFUProcessId(getpid());
345 std::string folderPath)
350 std::vector<MonitorElement *> localMEList =
bei->
getContents(folderPath);
354 std::vector<TObject *> updateTOList;
355 for (
int idx = 0; idx < (int) localMEList.size(); idx++) {
361 if (updateTOList.size() > 0) {
362 toTable[folderPath] = updateTOList;
374 std::vector<std::string>::const_iterator dirIter;
375 for (dirIter = subDirList.begin(); dirIter != subDirList.end(); dirIter++) {
376 std::string subDirPath = (*dirIter);
388 unsigned char* buffer = (
unsigned char*) dqmMsgBuilder.
startAddress();
389 unsigned int size = dqmMsgBuilder.
size();
393 unsigned int runid = dqmMsgView.
runNumber();
398 uLong crc = crc32(0
L, Z_NULL, 0);
399 Bytef* buf = (Bytef*)topFolder.data();
400 crc = crc32(crc, buf, topFolder.length());
404 <<
" Error writing to shared memory as shm is not available";
408 if(!ret)
edm::LogError(
"FUShmDQMOutputService") <<
" Error with writing data to ShmBuffer";
420 edm::LogError(
"FUDQMShmOutputService")<<
"Failed to attach to shared memory";
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
FUShmDQMOutputService(const edm::ParameterSet &pset, edm::ActivityRegistry &actReg)
uint32_t adler32_chksum() const
static uint32 fuGuidValue_
std::vector< std::string > getSubdirs(void) const
void watchPostEndJob(PostEndJob::slot_type const &iSlot)
void postEndJobProcessing()
bool writeDqmEventData(unsigned int runNumber, unsigned int evtAtUpdate, unsigned int folderId, unsigned int fuProcessId, unsigned int fuGuid, unsigned char *data, unsigned int dataSize)
static FUShmBuffer * getShmBuffer()
void postEndLumi(edm::LuminosityBlock const &, edm::EventSetup const &)
void writeShmDQMData(DQMEventMsgBuilder const &dqmMsgBuilder)
void cd(void)
go to top directory (ie. root)
~FUShmDQMOutputService(void)
void watchPostSourceConstruction(PostSourceConstruction::slot_type const &iSlot)
void watchPostEndLumi(PostEndLumi::slot_type const &iSlot)
uint32 eventNumberAtUpdate() const
int serializeDQMEvent(DQMEvent::TObjectTable &toTable, bool use_compression, int compression_level)
void setMicroState(std::string const *)
unsigned int currentEventSize() const
std::vector< char > messageBuffer_
LuminosityBlockNumber_t luminosityBlock() const
std::string const toString() const
Automatic conversion from string reprentation.
unsigned int firstLumiSectionSeen_
edm::StreamDQMSerializer serializeWorker_
std::string topFolderName() const
unsigned int lumiSectionOfPreviousUpdate_
Timestamp const & endTime() const
void publish(xdata::InfoSpace *)
unsigned int currentSpaceUsed() const
unsigned char * bufferPointer() const
std::vector< MonitorElement * > getContents(const std::string &path) const
evf::FUShmBuffer * shmBuffer_
bool initializationIsNeeded_
bool dirExists(const std::string &path) const
true if directory exists
std::string getReleaseVersion()
xdata::UnsignedInteger32 nbUpdates_
TObject * getRootObject(void) const
void preBeginRun(const edm::RunID &runID, const edm::Timestamp ×tamp)
double timeInSecSinceUTC_
void postSourceConstructionProcessing(const edm::ModuleDescription &modDesc)
void findMonitorElements(DQMEvent::TObjectTable &toTable, std::string folderPath)
static bool fuIdsInitialized_
uint8 * startAddress() const
void defaultWebPage(xgi::Input *in, xgi::Output *out)
std::map< std::string, std::vector< TObject * > > TObjectTable
tuple size
Write out results.
void setCurrentFolder(const std::string &fullpath)
void watchPreBeginRun(PreBeginRun::slot_type const &iSlot)
double lumiSectionsPerUpdate_