#include <DQMServices/XdaqCollector/interface/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 * | dqmPatch_ |
CMSSW version run for this job. | |
MonitorElement * | errSummary_ |
DQM patch version 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_ |
These MEs are either static or updated upon each analyze() call. | |
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_ |
These MEs are filled with the info from the most recent event by the module. | |
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 24 of file XmasToDQMEventInfo.cc.
References DQMStore::bookFloat(), DQMStore::bookInt(), DQMStore::bookString(), cmsswVer_, GenMuonPlsPt100GeV_cfg::cout, currentTime_, dbe_, dqmPatch_, lat::endl(), eventId_, eventTimeStamp_, evtRateCount_, evtRateWindow_, MonitorElement::Fill(), DQMStore::getDQMPatchVersion(), edm::getReleaseVersion(), edm::ParameterSet::getUntrackedParameter(), getUTCtime(), hostName_, lastAvgTime_, lumisecId_, NULL, nUpdates_, parameters_, pEvent_, processEventRate_, processEvents_, processId_, processLatency_, processName_, processStartTimeStamp_, processTimeStamp_, runId_, runStartTimeStamp_, DQMStore::setCurrentFolder(), and workingDir_.
00024 { 00025 00026 cout << "Constructor of XmasToDQMEventInfo called...." << endl; 00027 00028 parameters_ = ps; 00029 pEvent_ = 0; 00030 evtRateCount_ = 0; 00031 gettimeofday(¤tTime_,NULL); 00032 lastAvgTime_ = currentTime_; 00033 00034 dbe_ = edm::Service<DQMStore>().operator->(); 00035 00036 string eventinfofolder = parameters_.getUntrackedParameter<string>("eventInfoFolder", "EventInfo") ; 00037 string subsystemname = parameters_.getUntrackedParameter<string>("subSystemFolder", "YourSubsystem") ; 00038 string currentfolder = subsystemname + "/" + eventinfofolder ; 00039 cout << "currentfolder " << currentfolder << endl; 00040 00041 evtRateWindow_ = parameters_.getUntrackedParameter<double>("eventRateWindow", 0.5); 00042 if(evtRateWindow_<=0.15) evtRateWindow_=0.15; 00043 cout << "Event Rate averaged over " << evtRateWindow_ << " minutes" << endl; 00044 00045 dbe_->setCurrentFolder(currentfolder) ; 00046 00047 //Event specific contents 00048 runId_ = dbe_->bookInt("iRun"); 00049 lumisecId_ = dbe_->bookInt("iLumiSection"); 00050 eventId_ = dbe_->bookInt("iEvent"); 00051 eventTimeStamp_ = dbe_->bookFloat("eventTimeStamp"); 00052 00053 dbe_->setCurrentFolder(currentfolder) ; 00054 //Process specific contents 00055 processTimeStamp_ = dbe_->bookFloat("processTimeStamp"); 00056 processTimeStamp_->Fill(getUTCtime(¤tTime_)); 00057 processLatency_ = dbe_->bookFloat("processLatency"); 00058 processTimeStamp_->Fill(-1); 00059 processEvents_ = dbe_->bookInt("processedEvents"); 00060 processEvents_->Fill(pEvent_); 00061 processEventRate_ = dbe_->bookFloat("processEventRate"); 00062 processEventRate_->Fill(-1); 00063 nUpdates_= dbe_->bookInt("processUpdates"); 00064 nUpdates_->Fill(-1); 00065 00066 //Static Contents 00067 processId_= dbe_->bookInt("processID"); 00068 processId_->Fill(gSystem->GetPid()); 00069 processStartTimeStamp_ = dbe_->bookFloat("processStartTimeStamp"); 00070 processStartTimeStamp_->Fill(getUTCtime(¤tTime_)); 00071 runStartTimeStamp_ = dbe_->bookFloat("runStartTimeStamp"); 00072 hostName_= dbe_->bookString("hostName",gSystem->HostName()); 00073 processName_= dbe_->bookString("processName",subsystemname); 00074 workingDir_= dbe_->bookString("workingDir",gSystem->pwd()); 00075 cmsswVer_= dbe_->bookString("CMSSW_Version",edm::getReleaseVersion()); 00076 dqmPatch_= dbe_->bookString("DQM_Patch",dbe_->getDQMPatchVersion()); 00077 00078 // Folder to be populated by sub-systems' code 00079 string subfolder = currentfolder + "/reportSummaryContents" ; 00080 dbe_->setCurrentFolder(subfolder); 00081 00082 }
XmasToDQMEventInfo::~XmasToDQMEventInfo | ( | ) | [virtual] |
Destructor.
Definition at line 84 of file XmasToDQMEventInfo.cc.
References GenMuonPlsPt100GeV_cfg::cout, and lat::endl().
void XmasToDQMEventInfo::analyze | ( | const edm::Event & | e, | |
const edm::EventSetup & | c | |||
) | [protected, virtual] |
Analyze.
Implements edm::EDAnalyzer.
Definition at line 105 of file XmasToDQMEventInfo.cc.
References GenMuonPlsPt100GeV_cfg::cout, currentTime_, lat::endl(), edm::EventID::event(), eventId_, eventTimeStamp_, evtRateCount_, evtRateWindow_, MonitorElement::Fill(), getUTCtime(), edm::Event::id(), xmas2dqm::wse::ToDqm::instance(), lastAvgTime_, lastUpdateTime_, edm::Event::luminosityBlock(), lumisecId_, NULL, pEvent_, processEventRate_, processEvents_, processLatency_, processTimeStamp_, runId_, edm::Event::time(), and edm::Timestamp::value().
00105 { 00106 00107 static int icalls = 1; 00108 cout << "XmasToDQMEventInfo::analyze call = " << icalls << std::endl; 00109 00110 //runId_->Fill(e.id().run()); 00111 std::string runNumber; 00112 00113 //xmas2dqm::wse::ToDqm::instance()->BSem_.take(); 00114 runNumber = xmas2dqm::wse::ToDqm::instance()->runNumber_.toString(); 00115 std::cout << "EventInfo runNumber ... = " << runNumber << std::endl; 00116 //xmas2dqm::wse::ToDqm::instance()->BSem_.give(); 00117 00118 std::istringstream istrfloat(runNumber); 00119 float runNumber_value; 00120 istrfloat >> runNumber_value; 00121 runId_->Fill(runNumber_value); 00122 00123 lumisecId_->Fill(e.luminosityBlock()); 00124 eventId_->Fill(e.id().event()); 00125 eventTimeStamp_->Fill(e.time().value()/(double)0xffffffff); 00126 00127 pEvent_++; 00128 evtRateCount_++; 00129 processEvents_->Fill(pEvent_); 00130 00131 lastUpdateTime_=currentTime_; 00132 gettimeofday(¤tTime_,NULL); 00133 processTimeStamp_->Fill(getUTCtime(¤tTime_)); 00134 processLatency_->Fill(getUTCtime(&lastUpdateTime_,¤tTime_)); 00135 00136 float time = getUTCtime(&lastAvgTime_,¤tTime_); 00137 if(time>=(evtRateWindow_*60.0)){ 00138 processEventRate_->Fill((float)evtRateCount_/time); 00139 evtRateCount_ = 0; 00140 lastAvgTime_ = currentTime_; 00141 } 00142 00143 icalls++; 00144 return; 00145 }
void XmasToDQMEventInfo::beginRun | ( | const edm::Run & | r, | |
const edm::EventSetup & | c | |||
) | [protected, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 90 of file XmasToDQMEventInfo.cc.
References edm::Run::beginTime(), MonitorElement::Fill(), runStartTimeStamp_, and edm::Timestamp::value().
00090 { 00091 00092 const edm::Timestamp time = r.beginTime(); 00093 00094 float sec = time.value() >> 32; 00095 float usec = 0xFFFFFFFF & time.value() ; 00096 00097 // cout << " begin Run " << r.run() << " " << time.value() << endl; 00098 // cout << setprecision(16) << getUTCtime(¤tTime_) << endl; 00099 // cout << sec+usec/1000000. << endl; 00100 00101 runStartTimeStamp_->Fill(sec+usec/1000000.); 00102 00103 }
double XmasToDQMEventInfo::getUTCtime | ( | timeval * | a, | |
timeval * | b = NULL | |||
) | [private] |
Definition at line 147 of file XmasToDQMEventInfo.cc.
References NULL.
Referenced by analyze(), and XmasToDQMEventInfo().
00147 { 00148 double deltaT=(*a).tv_sec*1000.0+(*a).tv_usec/1000.0; 00149 if(b!=NULL) deltaT=(*b).tv_sec*1000.0+(*b).tv_usec/1000.0 - deltaT; 00150 return deltaT/1000.0; 00151 }
MonitorElement* XmasToDQMEventInfo::cmsswVer_ [private] |
Current working directory of the job.
Definition at line 87 of file XmasToDQMEventInfo.h.
Referenced by XmasToDQMEventInfo().
timeval XmasToDQMEventInfo::currentTime_ [private] |
Definition at line 58 of file XmasToDQMEventInfo.h.
Referenced by analyze(), and XmasToDQMEventInfo().
DQMStore* XmasToDQMEventInfo::dbe_ [private] |
MonitorElement* XmasToDQMEventInfo::dqmPatch_ [private] |
CMSSW version run for this job.
Definition at line 88 of file XmasToDQMEventInfo.h.
Referenced by XmasToDQMEventInfo().
MonitorElement* XmasToDQMEventInfo::errSummary_ [private] |
MonitorElement* XmasToDQMEventInfo::errSummarySegment_[10] [private] |
MonitorElement* XmasToDQMEventInfo::eventId_ [private] |
UTC time of the run start.
Definition at line 70 of file XmasToDQMEventInfo.h.
Referenced by analyze(), and XmasToDQMEventInfo().
Definition at line 72 of file XmasToDQMEventInfo.h.
Referenced by analyze(), and XmasToDQMEventInfo().
int XmasToDQMEventInfo::evtRateCount_ [private] |
Definition at line 61 of file XmasToDQMEventInfo.h.
Referenced by analyze(), and XmasToDQMEventInfo().
float XmasToDQMEventInfo::evtRateWindow_ [private] |
Definition at line 60 of file XmasToDQMEventInfo.h.
Referenced by analyze(), and XmasToDQMEventInfo().
MonitorElement* XmasToDQMEventInfo::hostName_ [private] |
# of event processed so far
Definition at line 84 of file XmasToDQMEventInfo.h.
Referenced by XmasToDQMEventInfo().
timeval XmasToDQMEventInfo::lastAvgTime_ [private] |
Definition at line 58 of file XmasToDQMEventInfo.h.
Referenced by analyze(), and XmasToDQMEventInfo().
timeval XmasToDQMEventInfo::lastUpdateTime_ [private] |
MonitorElement* XmasToDQMEventInfo::lumisecId_ [private] |
Definition at line 71 of file XmasToDQMEventInfo.h.
Referenced by analyze(), and XmasToDQMEventInfo().
MonitorElement* XmasToDQMEventInfo::nUpdates_ [private] |
These MEs are either static or updated upon each analyze() call.
Definition at line 77 of file XmasToDQMEventInfo.h.
Referenced by XmasToDQMEventInfo().
int XmasToDQMEventInfo::pEvent_ [private] |
Definition at line 62 of file XmasToDQMEventInfo.h.
Referenced by analyze(), and XmasToDQMEventInfo().
Time elapsed since the last event.
Definition at line 82 of file XmasToDQMEventInfo.h.
Referenced by analyze(), and XmasToDQMEventInfo().
MonitorElement* XmasToDQMEventInfo::processEvents_ [private] |
Avg # of events in programmable window (default: 5 min).
Definition at line 83 of file XmasToDQMEventInfo.h.
Referenced by analyze(), and XmasToDQMEventInfo().
MonitorElement* XmasToDQMEventInfo::processId_ [private] |
Number of collector updates (TBD).
Definition at line 78 of file XmasToDQMEventInfo.h.
Referenced by XmasToDQMEventInfo().
The UTC time of the last event.
Definition at line 81 of file XmasToDQMEventInfo.h.
Referenced by analyze(), and XmasToDQMEventInfo().
MonitorElement* XmasToDQMEventInfo::processName_ [private] |
Hostname of the local machine.
Definition at line 85 of file XmasToDQMEventInfo.h.
Referenced by XmasToDQMEventInfo().
The PID associated with this job.
Definition at line 79 of file XmasToDQMEventInfo.h.
Referenced by XmasToDQMEventInfo().
The UTC time of the first event processed.
Definition at line 80 of file XmasToDQMEventInfo.h.
Referenced by analyze(), and XmasToDQMEventInfo().
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.
Referenced by analyze(), and XmasToDQMEventInfo().
timeval XmasToDQMEventInfo::runStartTime_ [private] |
Definition at line 59 of file XmasToDQMEventInfo.h.
Definition at line 69 of file XmasToDQMEventInfo.h.
Referenced by beginRun(), and XmasToDQMEventInfo().
MonitorElement* XmasToDQMEventInfo::workingDir_ [private] |
DQM "name" of the job (eg, Hcal or DT).
Definition at line 86 of file XmasToDQMEventInfo.h.
Referenced by XmasToDQMEventInfo().