CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

XmasToDQMEventInfo Class Reference

#include <XmasToDQMEventInfo.h>

Inheritance diagram for XmasToDQMEventInfo:
edm::EDAnalyzer

List of all members.

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

MonitorElementcmsswVer_
 Current working directory of the job.
timeval currentTime_
DQMStoredbe_
MonitorElementerrSummary_
 CMSSW version run for this job.
MonitorElementerrSummaryEtaPhi_
 Subdetector-specific error summary (float)
MonitorElementerrSummarySegment_ [10]
 Subdetector-specific etaPhi summary (float)
MonitorElementeventId_
 UTC time of the run start.
MonitorElementeventTimeStamp_
int evtRateCount_
float evtRateWindow_
MonitorElementhostName_
 # of event processed so far
timeval lastAvgTime_
timeval lastUpdateTime_
MonitorElementlumisecId_
MonitorElementnUpdates_
edm::ParameterSet parameters_
int pEvent_
MonitorElementprocessEventRate_
 Time elapsed since the last event.
MonitorElementprocessEvents_
 Avg # of events in programmable window (default: 5 min)
MonitorElementprocessId_
 Number of collector updates (TBD)
MonitorElementprocessLatency_
 The UTC time of the last event.
MonitorElementprocessName_
 Hostname of the local machine.
MonitorElementprocessStartTimeStamp_
 The PID associated with this job.
MonitorElementprocessTimeStamp_
 The UTC time of the first event processed.
MonitorElementrunId_
timeval runStartTime_
MonitorElementrunStartTimeStamp_
MonitorElementworkingDir_
 DQM "name" of the job (eg, Hcal or DT)

Detailed Description

Definition at line 35 of file XmasToDQMEventInfo.h.


Constructor & Destructor Documentation

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(&currentTime_,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(&currentTime_));
  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(&currentTime_));
  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;

}

Member Function Documentation

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(&currentTime_,NULL);  
  processTimeStamp_->Fill(getUTCtime(&currentTime_));
  processLatency_->Fill(getUTCtime(&lastUpdateTime_,&currentTime_));

  float time = getUTCtime(&lastAvgTime_,&currentTime_);
  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(&currentTime_) << 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.

                                                           {
  double deltaT=(*a).tv_sec*1000.0+(*a).tv_usec/1000.0;
  if(b!=NULL) deltaT=(*b).tv_sec*1000.0+(*b).tv_usec/1000.0 - deltaT;
  return deltaT/1000.0;
}

Member Data Documentation

Current working directory of the job.

Definition at line 87 of file XmasToDQMEventInfo.h.

Definition at line 58 of file XmasToDQMEventInfo.h.

Definition at line 55 of file XmasToDQMEventInfo.h.

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.

Subdetector-specific etaPhi summary (float)

Definition at line 91 of file XmasToDQMEventInfo.h.

UTC time of the run start.

Definition at line 70 of file XmasToDQMEventInfo.h.

Definition at line 72 of file XmasToDQMEventInfo.h.

Definition at line 61 of file XmasToDQMEventInfo.h.

Definition at line 60 of file XmasToDQMEventInfo.h.

# of event processed so far

Definition at line 84 of file XmasToDQMEventInfo.h.

Definition at line 58 of file XmasToDQMEventInfo.h.

Definition at line 58 of file XmasToDQMEventInfo.h.

Definition at line 71 of file XmasToDQMEventInfo.h.

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.

Definition at line 62 of file XmasToDQMEventInfo.h.

Time elapsed since the last event.

Definition at line 82 of file XmasToDQMEventInfo.h.

Avg # of events in programmable window (default: 5 min)

Definition at line 83 of file XmasToDQMEventInfo.h.

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.

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.

These MEs are filled with the info from the most recent event by the module

Definition at line 68 of file XmasToDQMEventInfo.h.

Definition at line 59 of file XmasToDQMEventInfo.h.

Definition at line 69 of file XmasToDQMEventInfo.h.

DQM "name" of the job (eg, Hcal or DT)

Definition at line 86 of file XmasToDQMEventInfo.h.