#include <XmasToDQMEventInfo.h>
Public Member Functions | |
XmasToDQMEventInfo (const edm::ParameterSet &ps) | |
Constructor. | |
virtual | ~XmasToDQMEventInfo () |
Destructor. | |
Protected Member Functions | |
void | analyze (const edm::Event &e, const edm::EventSetup &c) |
Analyze. | |
void | beginRun (const edm::Run &r, const edm::EventSetup &c) |
Private Member Functions | |
double | getUTCtime (timeval *a, timeval *b=NULL) |
Private Attributes | |
MonitorElement * | cmsswVer_ |
Current working directory of the job. | |
timeval | currentTime_ |
DQMStore * | dbe_ |
MonitorElement * | errSummary_ |
CMSSW version run for this job. | |
MonitorElement * | errSummaryEtaPhi_ |
Subdetector-specific error summary (float) | |
MonitorElement * | errSummarySegment_ [10] |
Subdetector-specific etaPhi summary (float) | |
MonitorElement * | eventId_ |
UTC time of the run start. | |
MonitorElement * | eventTimeStamp_ |
int | evtRateCount_ |
float | evtRateWindow_ |
MonitorElement * | hostName_ |
# of event processed so far | |
timeval | lastAvgTime_ |
timeval | lastUpdateTime_ |
MonitorElement * | lumisecId_ |
MonitorElement * | nUpdates_ |
edm::ParameterSet | parameters_ |
int | pEvent_ |
MonitorElement * | processEventRate_ |
Time elapsed since the last event. | |
MonitorElement * | processEvents_ |
Avg # of events in programmable window (default: 5 min) | |
MonitorElement * | processId_ |
Number of collector updates (TBD) | |
MonitorElement * | processLatency_ |
The UTC time of the last event. | |
MonitorElement * | processName_ |
Hostname of the local machine. | |
MonitorElement * | processStartTimeStamp_ |
The PID associated with this job. | |
MonitorElement * | processTimeStamp_ |
The UTC time of the first event processed. | |
MonitorElement * | runId_ |
timeval | runStartTime_ |
MonitorElement * | runStartTimeStamp_ |
MonitorElement * | workingDir_ |
DQM "name" of the job (eg, Hcal or DT) |
Definition at line 35 of file XmasToDQMEventInfo.h.
XmasToDQMEventInfo::XmasToDQMEventInfo | ( | const edm::ParameterSet & | ps | ) |
Constructor.
Definition at line 25 of file XmasToDQMEventInfo.cc.
References DQMStore::bookFloat(), DQMStore::bookInt(), DQMStore::bookString(), gather_cfg::cout, dbe_, MonitorElement::Fill(), edm::getReleaseVersion(), NULL, cmsCodeRules::cppFunctionSkipper::operator, and DQMStore::setCurrentFolder().
{ cout << "Constructor of XmasToDQMEventInfo called...." << endl; parameters_ = ps; pEvent_ = 0; evtRateCount_ = 0; gettimeofday(¤tTime_,NULL); lastAvgTime_ = currentTime_; dbe_ = edm::Service<DQMStore>().operator->(); string eventinfofolder = parameters_.getUntrackedParameter<string>("eventInfoFolder", "EventInfo") ; string subsystemname = parameters_.getUntrackedParameter<string>("subSystemFolder", "YourSubsystem") ; string currentfolder = subsystemname + "/" + eventinfofolder ; cout << "currentfolder " << currentfolder << endl; evtRateWindow_ = parameters_.getUntrackedParameter<double>("eventRateWindow", 0.5); if(evtRateWindow_<=0.15) evtRateWindow_=0.15; cout << "Event Rate averaged over " << evtRateWindow_ << " minutes" << endl; dbe_->setCurrentFolder(currentfolder) ; //Event specific contents runId_ = dbe_->bookInt("iRun"); lumisecId_ = dbe_->bookInt("iLumiSection"); eventId_ = dbe_->bookInt("iEvent"); eventTimeStamp_ = dbe_->bookFloat("eventTimeStamp"); dbe_->setCurrentFolder(currentfolder) ; //Process specific contents processTimeStamp_ = dbe_->bookFloat("processTimeStamp"); processTimeStamp_->Fill(getUTCtime(¤tTime_)); processLatency_ = dbe_->bookFloat("processLatency"); processTimeStamp_->Fill(-1); processEvents_ = dbe_->bookInt("processedEvents"); processEvents_->Fill(pEvent_); processEventRate_ = dbe_->bookFloat("processEventRate"); processEventRate_->Fill(-1); nUpdates_= dbe_->bookInt("processUpdates"); nUpdates_->Fill(-1); //Static Contents processId_= dbe_->bookInt("processID"); processId_->Fill(gSystem->GetPid()); processStartTimeStamp_ = dbe_->bookFloat("processStartTimeStamp"); processStartTimeStamp_->Fill(getUTCtime(¤tTime_)); runStartTimeStamp_ = dbe_->bookFloat("runStartTimeStamp"); hostName_= dbe_->bookString("hostName",gSystem->HostName()); processName_= dbe_->bookString("processName",subsystemname); workingDir_= dbe_->bookString("workingDir",gSystem->pwd()); cmsswVer_= dbe_->bookString("CMSSW_Version",edm::getReleaseVersion()); // dqmPatch_= dbe_->bookString("DQM_Patch",dbe_->getDQMPatchVersion()); // Folder to be populated by sub-systems' code string subfolder = currentfolder + "/reportSummaryContents" ; dbe_->setCurrentFolder(subfolder); }
XmasToDQMEventInfo::~XmasToDQMEventInfo | ( | ) | [virtual] |
Destructor.
Definition at line 85 of file XmasToDQMEventInfo.cc.
References gather_cfg::cout.
{ cout<<"[XmasToDQMEventInfo]: destructor"<<endl; }
void XmasToDQMEventInfo::analyze | ( | const edm::Event & | e, |
const edm::EventSetup & | c | ||
) | [protected, virtual] |
Analyze.
Implements edm::EDAnalyzer.
Definition at line 106 of file XmasToDQMEventInfo.cc.
References gather_cfg::cout, edm::EventID::event(), edm::EventBase::id(), xmas2dqm::wse::ToDqm::instance(), edm::EventBase::luminosityBlock(), NULL, inputsource_file_cfi::runNumber, edm::EventBase::time(), cond::rpcobgas::time, and edm::Timestamp::value().
{ static int icalls = 1; cout << "XmasToDQMEventInfo::analyze call = " << icalls << std::endl; //runId_->Fill(e.id().run()); std::string runNumber; //xmas2dqm::wse::ToDqm::instance()->BSem_.take(); runNumber = xmas2dqm::wse::ToDqm::instance()->runNumber_.toString(); std::cout << "EventInfo runNumber ... = " << runNumber << std::endl; //xmas2dqm::wse::ToDqm::instance()->BSem_.give(); std::istringstream istrfloat(runNumber); float runNumber_value; istrfloat >> runNumber_value; runId_->Fill(runNumber_value); lumisecId_->Fill(e.luminosityBlock()); eventId_->Fill(e.id().event()); eventTimeStamp_->Fill(e.time().value()/(double)0xffffffff); pEvent_++; evtRateCount_++; processEvents_->Fill(pEvent_); lastUpdateTime_=currentTime_; gettimeofday(¤tTime_,NULL); processTimeStamp_->Fill(getUTCtime(¤tTime_)); processLatency_->Fill(getUTCtime(&lastUpdateTime_,¤tTime_)); float time = getUTCtime(&lastAvgTime_,¤tTime_); if(time>=(evtRateWindow_*60.0)){ processEventRate_->Fill((float)evtRateCount_/time); evtRateCount_ = 0; lastAvgTime_ = currentTime_; } icalls++; return; }
void XmasToDQMEventInfo::beginRun | ( | const edm::Run & | r, |
const edm::EventSetup & | c | ||
) | [protected, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 91 of file XmasToDQMEventInfo.cc.
References edm::RunBase::beginTime(), cond::rpcobgas::time, and edm::Timestamp::value().
{ const edm::Timestamp time = r.beginTime(); float sec = time.value() >> 32; float usec = 0xFFFFFFFF & time.value() ; // cout << " begin Run " << r.run() << " " << time.value() << endl; // cout << setprecision(16) << getUTCtime(¤tTime_) << endl; // cout << sec+usec/1000000. << endl; runStartTimeStamp_->Fill(sec+usec/1000000.); }
double XmasToDQMEventInfo::getUTCtime | ( | timeval * | a, |
timeval * | b = NULL |
||
) | [private] |
Definition at line 148 of file XmasToDQMEventInfo.cc.
References NULL.
MonitorElement* XmasToDQMEventInfo::cmsswVer_ [private] |
Current working directory of the job.
Definition at line 87 of file XmasToDQMEventInfo.h.
timeval XmasToDQMEventInfo::currentTime_ [private] |
Definition at line 58 of file XmasToDQMEventInfo.h.
DQMStore* XmasToDQMEventInfo::dbe_ [private] |
Definition at line 55 of file XmasToDQMEventInfo.h.
MonitorElement* XmasToDQMEventInfo::errSummary_ [private] |
CMSSW version run for this job.
Definition at line 89 of file XmasToDQMEventInfo.h.
Subdetector-specific error summary (float)
Definition at line 90 of file XmasToDQMEventInfo.h.
MonitorElement* XmasToDQMEventInfo::errSummarySegment_[10] [private] |
Subdetector-specific etaPhi summary (float)
Definition at line 91 of file XmasToDQMEventInfo.h.
MonitorElement* XmasToDQMEventInfo::eventId_ [private] |
UTC time of the run start.
Definition at line 70 of file XmasToDQMEventInfo.h.
Definition at line 72 of file XmasToDQMEventInfo.h.
int XmasToDQMEventInfo::evtRateCount_ [private] |
Definition at line 61 of file XmasToDQMEventInfo.h.
float XmasToDQMEventInfo::evtRateWindow_ [private] |
Definition at line 60 of file XmasToDQMEventInfo.h.
MonitorElement* XmasToDQMEventInfo::hostName_ [private] |
# of event processed so far
Definition at line 84 of file XmasToDQMEventInfo.h.
timeval XmasToDQMEventInfo::lastAvgTime_ [private] |
Definition at line 58 of file XmasToDQMEventInfo.h.
timeval XmasToDQMEventInfo::lastUpdateTime_ [private] |
Definition at line 58 of file XmasToDQMEventInfo.h.
MonitorElement* XmasToDQMEventInfo::lumisecId_ [private] |
Definition at line 71 of file XmasToDQMEventInfo.h.
MonitorElement* XmasToDQMEventInfo::nUpdates_ [private] |
These MEs are either static or updated upon each analyze() call
Definition at line 77 of file XmasToDQMEventInfo.h.
Definition at line 57 of file XmasToDQMEventInfo.h.
int XmasToDQMEventInfo::pEvent_ [private] |
Definition at line 62 of file XmasToDQMEventInfo.h.
Time elapsed since the last event.
Definition at line 82 of file XmasToDQMEventInfo.h.
MonitorElement* XmasToDQMEventInfo::processEvents_ [private] |
Avg # of events in programmable window (default: 5 min)
Definition at line 83 of file XmasToDQMEventInfo.h.
MonitorElement* XmasToDQMEventInfo::processId_ [private] |
Number of collector updates (TBD)
Definition at line 78 of file XmasToDQMEventInfo.h.
The UTC time of the last event.
Definition at line 81 of file XmasToDQMEventInfo.h.
MonitorElement* XmasToDQMEventInfo::processName_ [private] |
Hostname of the local machine.
Definition at line 85 of file XmasToDQMEventInfo.h.
The PID associated with this job.
Definition at line 79 of file XmasToDQMEventInfo.h.
The UTC time of the first event processed.
Definition at line 80 of file XmasToDQMEventInfo.h.
MonitorElement* XmasToDQMEventInfo::runId_ [private] |
These MEs are filled with the info from the most recent event by the module
Definition at line 68 of file XmasToDQMEventInfo.h.
timeval XmasToDQMEventInfo::runStartTime_ [private] |
Definition at line 59 of file XmasToDQMEventInfo.h.
Definition at line 69 of file XmasToDQMEventInfo.h.
MonitorElement* XmasToDQMEventInfo::workingDir_ [private] |
DQM "name" of the job (eg, Hcal or DT)
Definition at line 86 of file XmasToDQMEventInfo.h.