CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Private Attributes
DQMEventInfo Class Reference

#include <DQMEventInfo.h>

Inheritance diagram for DQMEventInfo:
edm::EDAnalyzer

Public Member Functions

 DQMEventInfo (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~DQMEventInfo ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 Analyze. More...
 
void beginLuminosityBlock (const edm::LuminosityBlock &l, const edm::EventSetup &c)
 
void beginRun (const edm::Run &r, const edm::EventSetup &c)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Private Attributes

MonitorElementcmsswVer_
 Current working directory of the job. More...
 
double currentTime_
 
DQMStoredbe_
 
MonitorElementdqmPatch_
 CMSSW version run for this job. More...
 
MonitorElementerrSummary_
 DQM patch version for this job. More...
 
MonitorElementerrSummaryEtaPhi_
 Subdetector-specific error summary (float) More...
 
MonitorElementerrSummarySegment_ [10]
 Subdetector-specific etaPhi summary (float) More...
 
MonitorElementeventId_
 UTC time of the run start. More...
 
std::string eventInfoFolder_
 
MonitorElementeventTimeStamp_
 
int64_t evtRateCount_
 
double evtRateWindow_
 
MonitorElementhostName_
 

of event processed so far

More...
 
double lastAvgTime_
 
double lastUpdateTime_
 
MonitorElementlumisecId_
 
MonitorElementnUpdates_
 These MEs are either static or updated upon each analyze() call. More...
 
edm::ParameterSet parameters_
 
int64_t pEvent_
 
MonitorElementprocessEventRate_
 Time elapsed since the last event. More...
 
MonitorElementprocessEvents_
 Avg # of events in programmable window (default: 5 min) More...
 
MonitorElementprocessId_
 Number of collector updates (TBD) More...
 
MonitorElementprocessLatency_
 The UTC time of the last event. More...
 
MonitorElementprocessName_
 Hostname of the local machine. More...
 
MonitorElementprocessStartTimeStamp_
 The PID associated with this job. More...
 
MonitorElementprocessTimeStamp_
 The UTC time of the first event processed. More...
 
MonitorElementrunId_
 
double runStartTime_
 
MonitorElementrunStartTimeStamp_
 
MonitorElementworkingDir_
 DQM "name" of the job (eg, Hcal or DT) More...
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Detailed Description

Definition at line 33 of file DQMEventInfo.h.

Constructor & Destructor Documentation

DQMEventInfo::DQMEventInfo ( const edm::ParameterSet ps)

Constructor.

Definition at line 28 of file DQMEventInfo.cc.

References DQMStore::bookFloat(), DQMStore::bookInt(), DQMStore::bookString(), cmsswVer_, currentTime_, dbe_, eventId_, eventInfoFolder_, eventTimeStamp_, evtRateCount_, evtRateWindow_, MonitorElement::Fill(), edm::getReleaseVersion(), edm::ParameterSet::getUntrackedParameter(), hostName_, lastAvgTime_, lumisecId_, nUpdates_, cppFunctionSkipper::operator, parameters_, pEvent_, processEventRate_, processEvents_, processId_, processLatency_, processName_, processStartTimeStamp_, processTimeStamp_, runId_, runStartTimeStamp_, DQMStore::setCurrentFolder(), stampToReal(), and workingDir_.

28  {
29 
30  struct timeval now;
31  gettimeofday(&now, 0);
32 
33  parameters_ = ps;
34  pEvent_ = 0;
35  evtRateCount_ = 0;
37 
38  // read config parms
39  std::string folder = parameters_.getUntrackedParameter<std::string>("eventInfoFolder", "EventInfo") ;
40  std::string subsystemname = parameters_.getUntrackedParameter<std::string>("subSystemFolder", "YourSubsystem") ;
41 
42  eventInfoFolder_ = subsystemname + "/" + folder ;
43  evtRateWindow_ = parameters_.getUntrackedParameter<double>("eventRateWindow", 0.5);
44  if(evtRateWindow_<=0.15) evtRateWindow_=0.15;
45 
46  //
48 
50 
51  //Event specific contents
52  runId_ = dbe_->bookInt("iRun");
53  runId_->Fill(-1);
54  lumisecId_ = dbe_->bookInt("iLumiSection");
55  lumisecId_->Fill(-1);
56  eventId_ = dbe_->bookInt("iEvent");
57  eventId_->Fill(-1);
58  eventTimeStamp_ = dbe_->bookFloat("eventTimeStamp");
59 
61  //Process specific contents
62  processTimeStamp_ = dbe_->bookFloat("processTimeStamp");
64  processLatency_ = dbe_->bookFloat("processLatency");
66  processEvents_ = dbe_->bookInt("processedEvents");
68  processEventRate_ = dbe_->bookFloat("processEventRate");
69  processEventRate_->Fill(-1);
70  nUpdates_= dbe_->bookInt("processUpdates");
71  nUpdates_->Fill(-1);
72 
73  //Static Contents
74  processId_= dbe_->bookInt("processID");
75  processId_->Fill(gSystem->GetPid());
76  processStartTimeStamp_ = dbe_->bookFloat("processStartTimeStamp");
78  runStartTimeStamp_ = dbe_->bookFloat("runStartTimeStamp");
79  hostName_= dbe_->bookString("hostName",gSystem->HostName());
80  processName_= dbe_->bookString("processName",subsystemname);
81  workingDir_= dbe_->bookString("workingDir",gSystem->pwd());
82  cmsswVer_= dbe_->bookString("CMSSW_Version",edm::getReleaseVersion());
83 
84  // Folder to be populated by sub-systems' code
85  std::string subfolder = eventInfoFolder_ + "/reportSummaryContents" ;
86  dbe_->setCurrentFolder(subfolder);
87 
88 }
double evtRateWindow_
Definition: DQMEventInfo.h:64
double currentTime_
Definition: DQMEventInfo.h:62
MonitorElement * hostName_
of event processed so far
Definition: DQMEventInfo.h:88
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * workingDir_
DQM &quot;name&quot; of the job (eg, Hcal or DT)
Definition: DQMEventInfo.h:90
MonitorElement * eventTimeStamp_
Definition: DQMEventInfo.h:76
DQMStore * dbe_
Definition: DQMEventInfo.h:54
edm::ParameterSet parameters_
Definition: DQMEventInfo.h:56
MonitorElement * processId_
Number of collector updates (TBD)
Definition: DQMEventInfo.h:82
MonitorElement * processStartTimeStamp_
The PID associated with this job.
Definition: DQMEventInfo.h:83
int64_t pEvent_
Definition: DQMEventInfo.h:66
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:654
void Fill(long long x)
MonitorElement * cmsswVer_
Current working directory of the job.
Definition: DQMEventInfo.h:91
MonitorElement * eventId_
UTC time of the run start.
Definition: DQMEventInfo.h:74
std::string eventInfoFolder_
Definition: DQMEventInfo.h:57
MonitorElement * bookString(const char *name, const char *value)
Book string.
Definition: DQMStore.cc:683
MonitorElement * lumisecId_
Definition: DQMEventInfo.h:75
MonitorElement * runStartTimeStamp_
Definition: DQMEventInfo.h:73
double lastAvgTime_
Definition: DQMEventInfo.h:62
MonitorElement * processEvents_
Avg # of events in programmable window (default: 5 min)
Definition: DQMEventInfo.h:87
MonitorElement * processLatency_
The UTC time of the last event.
Definition: DQMEventInfo.h:85
MonitorElement * processName_
Hostname of the local machine.
Definition: DQMEventInfo.h:89
std::string getReleaseVersion()
int64_t evtRateCount_
Definition: DQMEventInfo.h:65
MonitorElement * runId_
Definition: DQMEventInfo.h:72
MonitorElement * nUpdates_
These MEs are either static or updated upon each analyze() call.
Definition: DQMEventInfo.h:81
MonitorElement * processEventRate_
Time elapsed since the last event.
Definition: DQMEventInfo.h:86
MonitorElement * bookInt(const char *name)
Book int.
Definition: DQMStore.cc:624
MonitorElement * processTimeStamp_
The UTC time of the first event processed.
Definition: DQMEventInfo.h:84
static double stampToReal(edm::Timestamp time)
Definition: DQMEventInfo.cc:21
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
DQMEventInfo::~DQMEventInfo ( )
virtual

Destructor.

Definition at line 90 of file DQMEventInfo.cc.

90  {
91 }

Member Function Documentation

void DQMEventInfo::analyze ( const edm::Event e,
const edm::EventSetup c 
)
protectedvirtual

Analyze.

Implements edm::EDAnalyzer.

Definition at line 122 of file DQMEventInfo.cc.

References currentTime_, delta, edm::EventID::event(), eventId_, eventTimeStamp_, evtRateCount_, evtRateWindow_, MonitorElement::Fill(), edm::EventBase::id(), lastAvgTime_, lastUpdateTime_, pEvent_, processEventRate_, processEvents_, processLatency_, processTimeStamp_, stampToReal(), and edm::EventBase::time().

122  {
123 
124  eventId_->Fill(int64_t(e.id().event()));
126 
127  pEvent_++;
128  evtRateCount_++;
130 
131  struct timeval now;
132  gettimeofday(&now, 0);
135 
138 
139  double delta = currentTime_ - lastAvgTime_;
140  if (delta >= (evtRateWindow_*60.0))
141  {
143  evtRateCount_ = 0;
144  lastAvgTime_ = currentTime_;
145  }
146 
147  return;
148 }
dbl * delta
Definition: mlp_gen.cc:36
double evtRateWindow_
Definition: DQMEventInfo.h:64
EventNumber_t event() const
Definition: EventID.h:44
double currentTime_
Definition: DQMEventInfo.h:62
double lastUpdateTime_
Definition: DQMEventInfo.h:62
MonitorElement * eventTimeStamp_
Definition: DQMEventInfo.h:76
int64_t pEvent_
Definition: DQMEventInfo.h:66
void Fill(long long x)
MonitorElement * eventId_
UTC time of the run start.
Definition: DQMEventInfo.h:74
double lastAvgTime_
Definition: DQMEventInfo.h:62
MonitorElement * processEvents_
Avg # of events in programmable window (default: 5 min)
Definition: DQMEventInfo.h:87
MonitorElement * processLatency_
The UTC time of the last event.
Definition: DQMEventInfo.h:85
int64_t evtRateCount_
Definition: DQMEventInfo.h:65
MonitorElement * processEventRate_
Time elapsed since the last event.
Definition: DQMEventInfo.h:86
edm::EventID id() const
Definition: EventBase.h:56
MonitorElement * processTimeStamp_
The UTC time of the first event processed.
Definition: DQMEventInfo.h:84
static double stampToReal(edm::Timestamp time)
Definition: DQMEventInfo.cc:21
edm::Timestamp time() const
Definition: EventBase.h:57
void DQMEventInfo::beginLuminosityBlock ( const edm::LuminosityBlock l,
const edm::EventSetup c 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 116 of file DQMEventInfo.cc.

References MonitorElement::Fill(), edm::LuminosityBlockBase::id(), edm::LuminosityBlockID::luminosityBlock(), and lumisecId_.

116  {
117 
119 
120 }
LuminosityBlockID id() const
void Fill(long long x)
MonitorElement * lumisecId_
Definition: DQMEventInfo.h:75
LuminosityBlockNumber_t luminosityBlock() const
void DQMEventInfo::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 93 of file DQMEventInfo.cc.

References edm::RunBase::beginTime(), DQMStore::bookString(), dbe_, eventInfoFolder_, MonitorElement::Fill(), edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterSet(), edm::getProcessParameterSet(), edm::ParameterSet::getUntrackedParameterSet(), edm::RunBase::id(), edm::RunID::run(), runId_, runStartTimeStamp_, DQMStore::setCurrentFolder(), and stampToReal().

94 {
95 
96  runId_->Fill(r.id().run());
98 
99  //Online static histograms
100  const edm::ParameterSet &sourcePSet = edm::getProcessParameterSet().getParameterSet("@main_input");
101  if (sourcePSet.getParameter<std::string>("@module_type") == "EventStreamHttpReader" ){
102  std::string evSelection;
103  std::vector<std::string> evSelectionList;
104  const edm::ParameterSet &evSelectionPSet = sourcePSet.getUntrackedParameterSet("SelectEvents");
105  evSelectionList = evSelectionPSet.getParameter<std::vector<std::string> >("SelectEvents");
106  for ( std::vector<std::string>::iterator it = evSelectionList.begin(); it < evSelectionList.end(); it++ )
107  evSelection += "'"+ *it + "', ";
108 
109  evSelection.resize(evSelection.length()-2);
111  dbe_->bookString("eventSelection",evSelection);
112  }
113 
114 }
T getParameter(std::string const &) const
RunID const & id() const
Definition: RunBase.h:41
RunNumber_t run() const
Definition: RunID.h:44
DQMStore * dbe_
Definition: DQMEventInfo.h:54
void Fill(long long x)
std::string eventInfoFolder_
Definition: DQMEventInfo.h:57
MonitorElement * bookString(const char *name, const char *value)
Book string.
Definition: DQMStore.cc:683
ParameterSet const & getUntrackedParameterSet(std::string const &name, ParameterSet const &defaultValue) const
MonitorElement * runStartTimeStamp_
Definition: DQMEventInfo.h:73
MonitorElement * runId_
Definition: DQMEventInfo.h:72
ParameterSet const & getProcessParameterSet()
Definition: Registry.cc:34
ParameterSet const & getParameterSet(std::string const &) const
Timestamp const & beginTime() const
Definition: RunBase.h:43
static double stampToReal(edm::Timestamp time)
Definition: DQMEventInfo.cc:21
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429

Member Data Documentation

MonitorElement* DQMEventInfo::cmsswVer_
private

Current working directory of the job.

Definition at line 91 of file DQMEventInfo.h.

Referenced by DQMEventInfo().

double DQMEventInfo::currentTime_
private

Definition at line 62 of file DQMEventInfo.h.

Referenced by analyze(), and DQMEventInfo().

DQMStore* DQMEventInfo::dbe_
private

Definition at line 54 of file DQMEventInfo.h.

Referenced by beginRun(), and DQMEventInfo().

MonitorElement* DQMEventInfo::dqmPatch_
private

CMSSW version run for this job.

Definition at line 92 of file DQMEventInfo.h.

MonitorElement* DQMEventInfo::errSummary_
private

DQM patch version for this job.

Definition at line 93 of file DQMEventInfo.h.

MonitorElement* DQMEventInfo::errSummaryEtaPhi_
private

Subdetector-specific error summary (float)

Definition at line 94 of file DQMEventInfo.h.

MonitorElement* DQMEventInfo::errSummarySegment_[10]
private

Subdetector-specific etaPhi summary (float)

Definition at line 95 of file DQMEventInfo.h.

MonitorElement* DQMEventInfo::eventId_
private

UTC time of the run start.

Definition at line 74 of file DQMEventInfo.h.

Referenced by analyze(), and DQMEventInfo().

std::string DQMEventInfo::eventInfoFolder_
private

Definition at line 57 of file DQMEventInfo.h.

Referenced by beginRun(), and DQMEventInfo().

MonitorElement* DQMEventInfo::eventTimeStamp_
private

Definition at line 76 of file DQMEventInfo.h.

Referenced by analyze(), and DQMEventInfo().

int64_t DQMEventInfo::evtRateCount_
private

Definition at line 65 of file DQMEventInfo.h.

Referenced by analyze(), and DQMEventInfo().

double DQMEventInfo::evtRateWindow_
private

Definition at line 64 of file DQMEventInfo.h.

Referenced by analyze(), and DQMEventInfo().

MonitorElement* DQMEventInfo::hostName_
private

of event processed so far

Definition at line 88 of file DQMEventInfo.h.

Referenced by DQMEventInfo().

double DQMEventInfo::lastAvgTime_
private

Definition at line 62 of file DQMEventInfo.h.

Referenced by analyze(), and DQMEventInfo().

double DQMEventInfo::lastUpdateTime_
private

Definition at line 62 of file DQMEventInfo.h.

Referenced by analyze().

MonitorElement* DQMEventInfo::lumisecId_
private

Definition at line 75 of file DQMEventInfo.h.

Referenced by beginLuminosityBlock(), and DQMEventInfo().

MonitorElement* DQMEventInfo::nUpdates_
private

These MEs are either static or updated upon each analyze() call.

Definition at line 81 of file DQMEventInfo.h.

Referenced by DQMEventInfo().

edm::ParameterSet DQMEventInfo::parameters_
private
int64_t DQMEventInfo::pEvent_
private

Definition at line 66 of file DQMEventInfo.h.

Referenced by analyze(), and DQMEventInfo().

MonitorElement* DQMEventInfo::processEventRate_
private

Time elapsed since the last event.

Definition at line 86 of file DQMEventInfo.h.

Referenced by analyze(), and DQMEventInfo().

MonitorElement* DQMEventInfo::processEvents_
private

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

Definition at line 87 of file DQMEventInfo.h.

Referenced by analyze(), and DQMEventInfo().

MonitorElement* DQMEventInfo::processId_
private

Number of collector updates (TBD)

Definition at line 82 of file DQMEventInfo.h.

Referenced by DQMEventInfo().

MonitorElement* DQMEventInfo::processLatency_
private

The UTC time of the last event.

Definition at line 85 of file DQMEventInfo.h.

Referenced by analyze(), and DQMEventInfo().

MonitorElement* DQMEventInfo::processName_
private

Hostname of the local machine.

Definition at line 89 of file DQMEventInfo.h.

Referenced by DQMEventInfo().

MonitorElement* DQMEventInfo::processStartTimeStamp_
private

The PID associated with this job.

Definition at line 83 of file DQMEventInfo.h.

Referenced by DQMEventInfo().

MonitorElement* DQMEventInfo::processTimeStamp_
private

The UTC time of the first event processed.

Definition at line 84 of file DQMEventInfo.h.

Referenced by analyze(), and DQMEventInfo().

MonitorElement* DQMEventInfo::runId_
private

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

Definition at line 72 of file DQMEventInfo.h.

Referenced by beginRun(), and DQMEventInfo().

double DQMEventInfo::runStartTime_
private

Definition at line 63 of file DQMEventInfo.h.

MonitorElement* DQMEventInfo::runStartTimeStamp_
private

Definition at line 73 of file DQMEventInfo.h.

Referenced by beginRun(), and DQMEventInfo().

MonitorElement* DQMEventInfo::workingDir_
private

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

Definition at line 90 of file DQMEventInfo.h.

Referenced by DQMEventInfo().