36 #include <sys/types.h>
58 : evf::ServiceWeb(
"FUShmDQMOutputService")
103 if (lumiSectionInterval_ < 1) {lumiSectionInterval_ = 0;}
107 struct timezone dummyTZ;
108 gettimeofday(&now, &dummyTZ);
110 timeInSecSinceUTC_ =
static_cast<double>(now.tv_sec) + (static_cast<double>(now.tv_usec)/1000000.0);
113 if(got_host != 0) strcpy(
host_name_,
"noHostNameFoundOrTooLong");
119 std::string guidString = guidObj.
toString();
122 uLong crc = crc32(0
L, Z_NULL, 0);
123 Bytef* buf = (Bytef*)guidString.data();
124 crc = crc32(crc, buf, guidString.length());
146 is->fireItemAvailable(
"nbDqmUpdates",&
nbUpdates_);
150 <<
" exception when publishing to InfoSpace ";
165 edm::LogError(
"FUShmDQMOutputService")<<
"exception when trying to get service MicroStateService";
170 unsigned int thisLumiSection = 0;
176 struct timezone dummyTZ;
177 gettimeofday(&now, &dummyTZ);
178 double timeInSec =
static_cast<double>(now.tv_sec) + (static_cast<double>(now.tv_usec)/1000000.0) -
timeInSecSinceUTC_;
192 struct timezone dummyTZ;
193 gettimeofday(&now, &dummyTZ);
195 timeInSecSinceUTC_ =
static_cast<double>(now.tv_sec) + (static_cast<double>(now.tv_usec)/1000000.0);
200 if(thisLumiSection%4!=0)
216 unsigned int lumiSectionTag = thisLumiSection;
225 throw cms::Exception(
"postEventProcessing",
"FUShmDQMOutputService")
226 <<
"Unable to lookup the DQMStore service!\n";
231 std::vector<std::string> topLevelFolderList;
239 std::map< std::string, DQMEvent::TObjectTable > toMap;
240 std::vector<std::string>::const_iterator dirIter;
241 for (dirIter = topLevelFolderList.begin();
242 dirIter != topLevelFolderList.end();
244 std::string
dirName = *dirIter;
256 for (dirIter = topLevelFolderList.begin();
257 dirIter != topLevelFolderList.end();
259 std::string
dirName = *dirIter;
261 if (toTable.size() == 0) {
continue;}
269 unsigned int newSize = srcSize + 50000;
284 std::copy(src,src + srcSize, dqmMsgBuilder.eventAddress());
285 dqmMsgBuilder.setEventLength(srcSize);
291 dqmMsgBuilder.setFUProcessId(getpid());
349 std::string folderPath)
354 std::vector<MonitorElement *> localMEList =
bei->
getContents(folderPath);
358 std::vector<TObject *> updateTOList;
359 for (
int idx = 0; idx < (int) localMEList.size(); idx++) {
365 if (updateTOList.size() > 0) {
366 toTable[folderPath] = updateTOList;
378 std::vector<std::string>::const_iterator dirIter;
379 for (dirIter = subDirList.begin(); dirIter != subDirList.end(); dirIter++) {
380 std::string subDirPath = (*dirIter);
392 unsigned char* buffer = (
unsigned char*) dqmMsgBuilder.
startAddress();
393 unsigned int size = dqmMsgBuilder.
size();
397 unsigned int runid = dqmMsgView.
runNumber();
402 uLong crc = crc32(0
L, Z_NULL, 0);
403 Bytef* buf = (Bytef*)topFolder.data();
404 crc = crc32(crc, buf, topFolder.length());
408 <<
" Error writing to shared memory as shm is not available";
412 if(!ret)
edm::LogError(
"FUShmDQMOutputService") <<
" Error with writing data to ShmBuffer";
426 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_