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:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 DQMEventInfo (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~DQMEventInfo ()
 Destructor. More...
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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 bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
- Protected Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr
< dqmDetails::NoCache
globalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr
< dqmDetails::NoCache
globalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

Definition at line 32 of file DQMEventInfo.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 25 of file DQMEventInfo.cc.

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

25  {
26 
27  struct timeval now;
28  gettimeofday(&now, 0);
29 
30  parameters_ = ps;
31  pEvent_ = 0;
32  evtRateCount_ = 0;
34 
35  // read config parms
36  std::string folder = parameters_.getUntrackedParameter<std::string>("eventInfoFolder", "EventInfo") ;
37  subsystemname_ = parameters_.getUntrackedParameter<std::string>("subSystemFolder", "YourSubsystem") ;
38 
39  eventInfoFolder_ = subsystemname_ + "/" + folder ;
40  evtRateWindow_ = parameters_.getUntrackedParameter<double>("eventRateWindow", 0.5);
41  if(evtRateWindow_<=0.15) evtRateWindow_=0.15;
42 
43 }
double evtRateWindow_
Definition: DQMEventInfo.h:64
double currentTime_
Definition: DQMEventInfo.h:62
T getUntrackedParameter(std::string const &, T const &) const
edm::ParameterSet parameters_
Definition: DQMEventInfo.h:55
int64_t pEvent_
Definition: DQMEventInfo.h:66
std::string eventInfoFolder_
Definition: DQMEventInfo.h:56
double lastAvgTime_
Definition: DQMEventInfo.h:62
int64_t evtRateCount_
Definition: DQMEventInfo.h:65
static double stampToReal(edm::Timestamp time)
Definition: DQMEventInfo.cc:18
std::string subsystemname_
Definition: DQMEventInfo.h:57
DQMEventInfo::~DQMEventInfo ( )
virtual

Destructor.

Definition at line 45 of file DQMEventInfo.cc.

45  {
46 }

Member Function Documentation

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

Analyze.

Implements edm::stream::EDAnalyzerBase.

Definition at line 120 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().

120  {
121 
122  eventId_->Fill(e.id().event()); // Handing edm::EventNumber_t to Fill method which will handle further casting
124 
125  pEvent_++;
126  evtRateCount_++;
128 
129  struct timeval now;
130  gettimeofday(&now, 0);
133 
136 
137  double delta = currentTime_ - lastAvgTime_;
138  if (delta >= (evtRateWindow_*60.0))
139  {
141  evtRateCount_ = 0;
142  lastAvgTime_ = currentTime_;
143  }
144 
145  return;
146 }
dbl * delta
Definition: mlp_gen.cc:36
double evtRateWindow_
Definition: DQMEventInfo.h:64
EventNumber_t event() const
Definition: EventID.h:41
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:18
edm::Timestamp time() const
Definition: EventBase.h:57
void DQMEventInfo::beginLuminosityBlock ( const edm::LuminosityBlock l,
const edm::EventSetup c 
)
protectedvirtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 115 of file DQMEventInfo.cc.

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

116 {
118 }
LuminosityBlockID id() const
void Fill(long long x)
MonitorElement * lumisecId_
Definition: DQMEventInfo.h:75
LuminosityBlockNumber_t luminosityBlock() const
void DQMEventInfo::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &   
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 48 of file DQMEventInfo.cc.

References edm::RunBase::beginTime(), DQMStore::IBooker::bookFloat(), DQMStore::IBooker::bookInt(), DQMStore::IBooker::bookString(), cmsswVer_, currentTime_, eventId_, eventInfoFolder_, eventTimeStamp_, MonitorElement::Fill(), edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterSet(), edm::getProcessParameterSet(), edm::getReleaseVersion(), edm::ParameterSet::getUntrackedParameterSet(), hostName_, edm::RunBase::id(), lumisecId_, nUpdates_, pEvent_, processEventRate_, processEvents_, processId_, processLatency_, processName_, processStartTimeStamp_, processTimeStamp_, alignCSCRings::pwd, edm::RunID::run(), runId_, runStartTimeStamp_, 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[33];
84  gethostname(hostname,32);
85  hostName_= ibooker.bookString("hostName",hostname);
86  processName_= ibooker.bookString("processName",subsystemname_);
87  char pwd[1024];
88  getcwd(pwd,1023);
89  workingDir_= ibooker.bookString("workingDir",pwd);
90  cmsswVer_= ibooker.bookString("CMSSW_Version",edm::getReleaseVersion());
91 
92  // Folder to be populated by sub-systems' code
93  std::string subfolder = eventInfoFolder_ + "/reportSummaryContents" ;
94  ibooker.setCurrentFolder(subfolder);
95 
96  //Online static histograms
97  const edm::ParameterSet &sourcePSet = edm::getProcessParameterSet().getParameterSet("@main_input");
98  if (sourcePSet.getParameter<std::string>("@module_type") == "EventStreamHttpReader" ){
99  std::string evSelection;
100  std::vector<std::string> evSelectionList;
101  const edm::ParameterSet &evSelectionPSet = sourcePSet.getUntrackedParameterSet("SelectEvents");
102  evSelectionList = evSelectionPSet.getParameter<std::vector<std::string> >("SelectEvents");
103  for ( std::vector<std::string>::iterator it = evSelectionList.begin(); it < evSelectionList.end(); it++ )
104  evSelection += "'"+ *it + "', ";
105 
106  evSelection.resize(evSelection.length()-2);
108  ibooker.bookString("eventSelection",evSelection);
109  }
110 
111 
112 }
T getParameter(std::string const &) const
double currentTime_
Definition: DQMEventInfo.h:62
MonitorElement * hostName_
of event processed so far
Definition: DQMEventInfo.h:88
MonitorElement * workingDir_
DQM &quot;name&quot; of the job (eg, Hcal or DT)
Definition: DQMEventInfo.h:90
MonitorElement * eventTimeStamp_
Definition: DQMEventInfo.h:76
MonitorElement * processId_
Number of collector updates (TBD)
Definition: DQMEventInfo.h:82
MonitorElement * processStartTimeStamp_
The PID associated with this job.
Definition: DQMEventInfo.h:83
MonitorElement * bookInt(Args &&...args)
Definition: DQMStore.h:103
MonitorElement * bookString(Args &&...args)
Definition: DQMStore.h:97
int64_t pEvent_
Definition: DQMEventInfo.h:66
ParameterSet getUntrackedParameterSet(std::string const &name, ParameterSet const &defaultValue) const
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:56
MonitorElement * lumisecId_
Definition: DQMEventInfo.h:75
MonitorElement * runStartTimeStamp_
Definition: DQMEventInfo.h:73
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()
MonitorElement * runId_
Definition: DQMEventInfo.h:72
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
ParameterSet const & getProcessParameterSet()
Definition: Registry.cc:85
ParameterSet const & getParameterSet(std::string const &) const
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 * bookFloat(Args &&...args)
Definition: DQMStore.h:109
MonitorElement * processTimeStamp_
The UTC time of the first event processed.
Definition: DQMEventInfo.h:84
static double stampToReal(edm::Timestamp time)
Definition: DQMEventInfo.cc:18
std::string subsystemname_
Definition: DQMEventInfo.h:57

Member Data Documentation

MonitorElement* DQMEventInfo::cmsswVer_
private

Current working directory of the job.

Definition at line 91 of file DQMEventInfo.h.

Referenced by bookHistograms().

double DQMEventInfo::currentTime_
private

Definition at line 62 of file DQMEventInfo.h.

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

DQMStore* DQMEventInfo::dbe_
private

Definition at line 53 of file DQMEventInfo.h.

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 bookHistograms().

std::string DQMEventInfo::eventInfoFolder_
private

Definition at line 56 of file DQMEventInfo.h.

Referenced by bookHistograms(), and DQMEventInfo().

MonitorElement* DQMEventInfo::eventTimeStamp_
private

Definition at line 76 of file DQMEventInfo.h.

Referenced by analyze(), and bookHistograms().

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 bookHistograms().

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 bookHistograms().

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 bookHistograms().

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

Definition at line 66 of file DQMEventInfo.h.

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

MonitorElement* DQMEventInfo::processEventRate_
private

Time elapsed since the last event.

Definition at line 86 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 87 of file DQMEventInfo.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* DQMEventInfo::processId_
private

Number of collector updates (TBD)

Definition at line 82 of file DQMEventInfo.h.

Referenced by bookHistograms().

MonitorElement* DQMEventInfo::processLatency_
private

The UTC time of the last event.

Definition at line 85 of file DQMEventInfo.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* DQMEventInfo::processName_
private

Hostname of the local machine.

Definition at line 89 of file DQMEventInfo.h.

Referenced by bookHistograms().

MonitorElement* DQMEventInfo::processStartTimeStamp_
private

The PID associated with this job.

Definition at line 83 of file DQMEventInfo.h.

Referenced by bookHistograms().

MonitorElement* DQMEventInfo::processTimeStamp_
private

The UTC time of the first event processed.

Definition at line 84 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 72 of file DQMEventInfo.h.

Referenced by bookHistograms().

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 bookHistograms().

std::string DQMEventInfo::subsystemname_
private

Definition at line 57 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 90 of file DQMEventInfo.h.

Referenced by bookHistograms().