CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Attributes
DQMEventInfo Class Reference

#include <DQMEventInfo.h>

Inheritance diagram for DQMEventInfo:
one::DQMEDAnalyzer< T > one::dqmimplementation::DQMBaseClass< T... >

Public Member Functions

 DQMEventInfo (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~DQMEventInfo () override
 Destructor. More...
 
- Public Member Functions inherited from one::DQMEDAnalyzer< T >
 DQMEDAnalyzer ()=default
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > &&)=delete
 
 ~DQMEDAnalyzer () override=default
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c) override
 Analyze. More...
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 

Private Attributes

MonitorElementcmsswVer_
 Current working directory of the job. More...
 
double currentTime_
 
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...
 
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_
 
std::string subsystemname_
 
MonitorElementworkingDir_
 DQM "name" of the job (eg, Hcal or DT) More...
 

Detailed Description

Definition at line 32 of file DQMEventInfo.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 27 of file DQMEventInfo.cc.

References currentTime_, eventInfoFolder_, evtRateCount_, evtRateWindow_, printsummarytable::folder, edm::ParameterSet::getUntrackedParameter(), lastAvgTime_, pEvent_, stampToReal(), AlCaHLTBitMon_QueryRunRegistry::string, subsystemname_, and ~DQMEventInfo().

27  {
28 
29  struct timeval now;
30  gettimeofday(&now, nullptr);
31 
32  pEvent_ = 0;
33  evtRateCount_ = 0;
35 
36  // read config parms
37  std::string folder = ps.getUntrackedParameter<std::string>("eventInfoFolder", "EventInfo") ;
38  subsystemname_ = ps.getUntrackedParameter<std::string>("subSystemFolder", "YourSubsystem") ;
39 
40  eventInfoFolder_ = subsystemname_ + "/" + folder ;
41  evtRateWindow_ = ps.getUntrackedParameter<double>("eventRateWindow", 0.5);
42  if(evtRateWindow_<=0.15) evtRateWindow_=0.15;
43 
44 }
double evtRateWindow_
Definition: DQMEventInfo.h:61
double currentTime_
Definition: DQMEventInfo.h:59
T getUntrackedParameter(std::string const &, T const &) const
int64_t pEvent_
Definition: DQMEventInfo.h:63
std::string eventInfoFolder_
Definition: DQMEventInfo.h:53
double lastAvgTime_
Definition: DQMEventInfo.h:59
int64_t evtRateCount_
Definition: DQMEventInfo.h:62
static double stampToReal(edm::Timestamp time)
Definition: DQMEventInfo.cc:20
std::string subsystemname_
Definition: DQMEventInfo.h:54
DQMEventInfo::~DQMEventInfo ( )
overridedefault

Destructor.

Referenced by DQMEventInfo().

Member Function Documentation

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

Analyze.

Definition at line 129 of file DQMEventInfo.cc.

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

129  {
130 
131  //Filling lumi here guarantees that the lumi number corresponds to the event when
132  // using multiple concurrent lumis in a job
134  eventId_->Fill(e.id().event()); // Handing edm::EventNumber_t to Fill method which will handle further casting
136 
137  pEvent_++;
138  evtRateCount_++;
140 
141  struct timeval now;
142  gettimeofday(&now, nullptr);
145 
148 
149  double delta = currentTime_ - lastAvgTime_;
150  if (delta >= (evtRateWindow_*60.0))
151  {
153  evtRateCount_ = 0;
154  lastAvgTime_ = currentTime_;
155  }
156 
157  return;
158 }
dbl * delta
Definition: mlp_gen.cc:36
double evtRateWindow_
Definition: DQMEventInfo.h:61
EventNumber_t event() const
Definition: EventID.h:41
double currentTime_
Definition: DQMEventInfo.h:59
double lastUpdateTime_
Definition: DQMEventInfo.h:59
MonitorElement * eventTimeStamp_
Definition: DQMEventInfo.h:73
int64_t pEvent_
Definition: DQMEventInfo.h:63
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:40
void Fill(long long x)
MonitorElement * eventId_
UTC time of the run start.
Definition: DQMEventInfo.h:71
MonitorElement * lumisecId_
Definition: DQMEventInfo.h:72
double lastAvgTime_
Definition: DQMEventInfo.h:59
MonitorElement * processEvents_
Avg # of events in programmable window (default: 5 min)
Definition: DQMEventInfo.h:84
MonitorElement * processLatency_
The UTC time of the last event.
Definition: DQMEventInfo.h:82
int64_t evtRateCount_
Definition: DQMEventInfo.h:62
MonitorElement * processEventRate_
Time elapsed since the last event.
Definition: DQMEventInfo.h:83
edm::EventID id() const
Definition: EventBase.h:59
MonitorElement * processTimeStamp_
The UTC time of the first event processed.
Definition: DQMEventInfo.h:81
static double stampToReal(edm::Timestamp time)
Definition: DQMEventInfo.cc:20
edm::Timestamp time() const
Definition: EventBase.h:60
void DQMEventInfo::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &   
)
overrideprotected

Definition at line 48 of file DQMEventInfo.cc.

References edm::RunBase::beginTime(), DQMStore::IBooker::bookFloat(), DQMStore::IBooker::bookInt(), DQMStore::IBooker::bookString(), cmsswVer_, currentTime_, csvReporter::delimiter, eventId_, eventInfoFolder_, eventTimeStamp_, MonitorElement::Fill(), edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterSet(), edm::getProcessParameterSetContainingModule(), edm::getReleaseVersion(), edm::ParameterSet::getUntrackedParameter(), hostName_, edm::RunBase::id(), join(), lumisecId_, nUpdates_, pEvent_, processEventRate_, processEvents_, processId_, processLatency_, processName_, processStartTimeStamp_, processTimeStamp_, alignCSCRings::pwd, edm::RunID::run(), runId_, runStartTimeStamp_, alignCSCRings::s, DQMStore::IBooker::setCurrentFolder(), stampToReal(), AlCaHLTBitMon_QueryRunRegistry::string, subsystemname_, and workingDir_.

51 {
53 
54  //Event specific contents
55  runId_ = ibooker.bookInt("iRun");
56  runId_->Fill(iRun.id().run());
57  lumisecId_ = ibooker.bookInt("iLumiSection");
58  lumisecId_->Fill(-1);
59  eventId_ = ibooker.bookInt("iEvent");
60  eventId_->Fill(-1);
61  eventTimeStamp_ = ibooker.bookFloat("eventTimeStamp");
62 
64  //Process specific contents
65  processTimeStamp_ = ibooker.bookFloat("processTimeStamp");
67  processLatency_ = ibooker.bookFloat("processLatency");
69  processEvents_ = ibooker.bookInt("processedEvents");
71  processEventRate_ = ibooker.bookFloat("processEventRate");
73  nUpdates_= ibooker.bookInt("processUpdates");
74  nUpdates_->Fill(-1);
75 
76  //Static Contents
77  processId_= ibooker.bookInt("processID");
78  processId_->Fill(getpid());
79  processStartTimeStamp_ = ibooker.bookFloat("processStartTimeStamp");
81  runStartTimeStamp_ = ibooker.bookFloat("runStartTimeStamp");
82  runStartTimeStamp_->Fill(stampToReal(iRun.beginTime()));
83  char hostname[65];
84  gethostname(hostname,64);
85  hostname[64] = 0;
86  hostName_= ibooker.bookString("hostName",hostname);
87  processName_= ibooker.bookString("processName",subsystemname_);
88  char* pwd = getcwd(nullptr, 0);
89  workingDir_= ibooker.bookString("workingDir",pwd);
90  free(pwd);
91  cmsswVer_= ibooker.bookString("CMSSW_Version",edm::getReleaseVersion());
92 
93  // Folder to be populated by sub-systems' code
94  std::string subfolder = eventInfoFolder_ + "/reportSummaryContents" ;
95  ibooker.setCurrentFolder(subfolder);
96 
97  //Online static histograms
98  const edm::ParameterSet &sourcePSet =
100  .getParameterSet("@main_input");
101 
102  if (sourcePSet.getParameter<std::string>("@module_type") == "DQMStreamerReader" ){
103  std::string evSelection;
104  std::vector<std::string> evSelectionList;
105  std::string delimiter( ", " );
106  evSelectionList = sourcePSet.getUntrackedParameter<std::vector<std::string> >("SelectEvents");
107  // add single quotes inline in the vector of HLT paths:
108  // we do copy assignment, and getUntrackedParameter returns
109  // a by-value copy of the vector of strings
110  std::for_each( evSelectionList.begin(), evSelectionList.end(),
111  []( std::string & s ){ std::string squote( "'" );
112  s = squote + s + squote;
113  }
114  );
115  evSelection = boost::algorithm::join( evSelectionList, delimiter );
116  // if no HLT paths are specified, no selections are performed:
117  // we mark this with an asterisk.
118  if( evSelection.empty() ) {
119  evSelection = std::string( "'*'" );
120  }
122  ibooker.bookString("eventSelection",evSelection);
123  }
124 
125 
126 }
T getParameter(std::string const &) const
double currentTime_
Definition: DQMEventInfo.h:59
MonitorElement * hostName_
of event processed so far
Definition: DQMEventInfo.h:85
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * workingDir_
DQM "name" of the job (eg, Hcal or DT)
Definition: DQMEventInfo.h:87
MonitorElement * eventTimeStamp_
Definition: DQMEventInfo.h:73
MonitorElement * processId_
Number of collector updates (TBD)
Definition: DQMEventInfo.h:79
MonitorElement * processStartTimeStamp_
The PID associated with this job.
Definition: DQMEventInfo.h:80
MonitorElement * bookInt(Args &&...args)
Definition: DQMStore.h:104
MonitorElement * bookString(Args &&...args)
Definition: DQMStore.h:103
int64_t pEvent_
Definition: DQMEventInfo.h:63
ParameterSet const & getProcessParameterSetContainingModule(ModuleDescription const &moduleDescription)
void Fill(long long x)
MonitorElement * cmsswVer_
Current working directory of the job.
Definition: DQMEventInfo.h:88
MonitorElement * eventId_
UTC time of the run start.
Definition: DQMEventInfo.h:71
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
std::string eventInfoFolder_
Definition: DQMEventInfo.h:53
MonitorElement * lumisecId_
Definition: DQMEventInfo.h:72
MonitorElement * runStartTimeStamp_
Definition: DQMEventInfo.h:70
MonitorElement * processEvents_
Avg # of events in programmable window (default: 5 min)
Definition: DQMEventInfo.h:84
MonitorElement * processLatency_
The UTC time of the last event.
Definition: DQMEventInfo.h:82
MonitorElement * processName_
Hostname of the local machine.
Definition: DQMEventInfo.h:86
std::string getReleaseVersion()
MonitorElement * runId_
Definition: DQMEventInfo.h:69
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
ParameterSet const & getParameterSet(std::string const &) const
MonitorElement * nUpdates_
These MEs are either static or updated upon each analyze() call.
Definition: DQMEventInfo.h:78
MonitorElement * processEventRate_
Time elapsed since the last event.
Definition: DQMEventInfo.h:83
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:105
MonitorElement * processTimeStamp_
The UTC time of the first event processed.
Definition: DQMEventInfo.h:81
static double stampToReal(edm::Timestamp time)
Definition: DQMEventInfo.cc:20
std::string subsystemname_
Definition: DQMEventInfo.h:54

Member Data Documentation

MonitorElement* DQMEventInfo::cmsswVer_
private

Current working directory of the job.

Definition at line 88 of file DQMEventInfo.h.

Referenced by bookHistograms().

double DQMEventInfo::currentTime_
private

Definition at line 59 of file DQMEventInfo.h.

Referenced by analyze(), bookHistograms(), and DQMEventInfo().

MonitorElement* DQMEventInfo::dqmPatch_
private

CMSSW version run for this job.

Definition at line 89 of file DQMEventInfo.h.

MonitorElement* DQMEventInfo::errSummary_
private

DQM patch version for this job.

Definition at line 90 of file DQMEventInfo.h.

MonitorElement* DQMEventInfo::errSummaryEtaPhi_
private

Subdetector-specific error summary (float)

Definition at line 91 of file DQMEventInfo.h.

MonitorElement* DQMEventInfo::errSummarySegment_[10]
private

Subdetector-specific etaPhi summary (float)

Definition at line 92 of file DQMEventInfo.h.

MonitorElement* DQMEventInfo::eventId_
private

UTC time of the run start.

Definition at line 71 of file DQMEventInfo.h.

Referenced by analyze(), and bookHistograms().

std::string DQMEventInfo::eventInfoFolder_
private

Definition at line 53 of file DQMEventInfo.h.

Referenced by bookHistograms(), and DQMEventInfo().

MonitorElement* DQMEventInfo::eventTimeStamp_
private

Definition at line 73 of file DQMEventInfo.h.

Referenced by analyze(), and bookHistograms().

int64_t DQMEventInfo::evtRateCount_
private

Definition at line 62 of file DQMEventInfo.h.

Referenced by analyze(), and DQMEventInfo().

double DQMEventInfo::evtRateWindow_
private

Definition at line 61 of file DQMEventInfo.h.

Referenced by analyze(), and DQMEventInfo().

MonitorElement* DQMEventInfo::hostName_
private

of event processed so far

Definition at line 85 of file DQMEventInfo.h.

Referenced by bookHistograms().

double DQMEventInfo::lastAvgTime_
private

Definition at line 59 of file DQMEventInfo.h.

Referenced by analyze(), and DQMEventInfo().

double DQMEventInfo::lastUpdateTime_
private

Definition at line 59 of file DQMEventInfo.h.

Referenced by analyze().

MonitorElement* DQMEventInfo::lumisecId_
private

Definition at line 72 of file DQMEventInfo.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* DQMEventInfo::nUpdates_
private

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

Definition at line 78 of file DQMEventInfo.h.

Referenced by bookHistograms().

int64_t DQMEventInfo::pEvent_
private

Definition at line 63 of file DQMEventInfo.h.

Referenced by analyze(), bookHistograms(), and DQMEventInfo().

MonitorElement* DQMEventInfo::processEventRate_
private

Time elapsed since the last event.

Definition at line 83 of file DQMEventInfo.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* DQMEventInfo::processEvents_
private

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

Definition at line 84 of file DQMEventInfo.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* DQMEventInfo::processId_
private

Number of collector updates (TBD)

Definition at line 79 of file DQMEventInfo.h.

Referenced by bookHistograms().

MonitorElement* DQMEventInfo::processLatency_
private

The UTC time of the last event.

Definition at line 82 of file DQMEventInfo.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* DQMEventInfo::processName_
private

Hostname of the local machine.

Definition at line 86 of file DQMEventInfo.h.

Referenced by bookHistograms().

MonitorElement* DQMEventInfo::processStartTimeStamp_
private

The PID associated with this job.

Definition at line 80 of file DQMEventInfo.h.

Referenced by bookHistograms().

MonitorElement* DQMEventInfo::processTimeStamp_
private

The UTC time of the first event processed.

Definition at line 81 of file DQMEventInfo.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* DQMEventInfo::runId_
private

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

Definition at line 69 of file DQMEventInfo.h.

Referenced by bookHistograms().

double DQMEventInfo::runStartTime_
private

Definition at line 60 of file DQMEventInfo.h.

MonitorElement* DQMEventInfo::runStartTimeStamp_
private

Definition at line 70 of file DQMEventInfo.h.

Referenced by bookHistograms().

std::string DQMEventInfo::subsystemname_
private

Definition at line 54 of file DQMEventInfo.h.

Referenced by bookHistograms(), and DQMEventInfo().

MonitorElement* DQMEventInfo::workingDir_
private

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

Definition at line 87 of file DQMEventInfo.h.

Referenced by bookHistograms().