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 Member Functions | Private Attributes
XmasToDQMEventInfo Class Reference

#include <XmasToDQMEventInfo.h>

Inheritance diagram for XmasToDQMEventInfo:
edm::EDAnalyzer

Public Member Functions

 XmasToDQMEventInfo (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~XmasToDQMEventInfo ()
 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 beginRun (const edm::Run &r, const edm::EventSetup &c)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Private Member Functions

double getUTCtime (timeval *a, timeval *b=NULL)
 

Private Attributes

MonitorElementcmsswVer_
 Current working directory of the job. More...
 
timeval currentTime_
 
DQMStoredbe_
 
MonitorElementerrSummary_
 CMSSW version run 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...
 
MonitorElementeventTimeStamp_
 
int evtRateCount_
 
float evtRateWindow_
 
MonitorElementhostName_
 

of event processed so far

More...
 
timeval lastAvgTime_
 
timeval lastUpdateTime_
 
MonitorElementlumisecId_
 
MonitorElementnUpdates_
 These MEs are either static or updated upon each analyze() call. More...
 
edm::ParameterSet parameters_
 
int 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_
 
timeval 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 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, cppFunctionSkipper::operator, and DQMStore::setCurrentFolder().

25  {
26 
27  cout << "Constructor of XmasToDQMEventInfo called...." << endl;
28 
29  parameters_ = ps;
30  pEvent_ = 0;
31  evtRateCount_ = 0;
32  gettimeofday(&currentTime_,NULL);
34 
36 
37  string eventinfofolder = parameters_.getUntrackedParameter<string>("eventInfoFolder", "EventInfo") ;
38  string subsystemname = parameters_.getUntrackedParameter<string>("subSystemFolder", "YourSubsystem") ;
39  string currentfolder = subsystemname + "/" + eventinfofolder ;
40  cout << "currentfolder " << currentfolder << endl;
41 
42  evtRateWindow_ = parameters_.getUntrackedParameter<double>("eventRateWindow", 0.5);
43  if(evtRateWindow_<=0.15) evtRateWindow_=0.15;
44  cout << "Event Rate averaged over " << evtRateWindow_ << " minutes" << endl;
45 
46  dbe_->setCurrentFolder(currentfolder) ;
47 
48  //Event specific contents
49  runId_ = dbe_->bookInt("iRun");
50  lumisecId_ = dbe_->bookInt("iLumiSection");
51  eventId_ = dbe_->bookInt("iEvent");
52  eventTimeStamp_ = dbe_->bookFloat("eventTimeStamp");
53 
54  dbe_->setCurrentFolder(currentfolder) ;
55  //Process specific contents
56  processTimeStamp_ = dbe_->bookFloat("processTimeStamp");
58  processLatency_ = dbe_->bookFloat("processLatency");
60  processEvents_ = dbe_->bookInt("processedEvents");
62  processEventRate_ = dbe_->bookFloat("processEventRate");
63  processEventRate_->Fill(-1);
64  nUpdates_= dbe_->bookInt("processUpdates");
65  nUpdates_->Fill(-1);
66 
67  //Static Contents
68  processId_= dbe_->bookInt("processID");
69  processId_->Fill(gSystem->GetPid());
70  processStartTimeStamp_ = dbe_->bookFloat("processStartTimeStamp");
72  runStartTimeStamp_ = dbe_->bookFloat("runStartTimeStamp");
73  hostName_= dbe_->bookString("hostName",gSystem->HostName());
74  processName_= dbe_->bookString("processName",subsystemname);
75  workingDir_= dbe_->bookString("workingDir",gSystem->pwd());
76  cmsswVer_= dbe_->bookString("CMSSW_Version",edm::getReleaseVersion());
77 // dqmPatch_= dbe_->bookString("DQM_Patch",dbe_->getDQMPatchVersion());
78 
79  // Folder to be populated by sub-systems' code
80  string subfolder = currentfolder + "/reportSummaryContents" ;
81  dbe_->setCurrentFolder(subfolder);
82 
83 }
MonitorElement * eventId_
UTC time of the run start.
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * processTimeStamp_
The UTC time of the first event processed.
MonitorElement * lumisecId_
#define NULL
Definition: scimark2.h:8
MonitorElement * processName_
Hostname of the local machine.
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:654
void Fill(long long x)
MonitorElement * runId_
MonitorElement * runStartTimeStamp_
MonitorElement * bookString(const char *name, const char *value)
Book string.
Definition: DQMStore.cc:683
MonitorElement * processEvents_
Avg # of events in programmable window (default: 5 min)
MonitorElement * cmsswVer_
Current working directory of the job.
std::string getReleaseVersion()
double getUTCtime(timeval *a, timeval *b=NULL)
edm::ParameterSet parameters_
MonitorElement * hostName_
of event processed so far
MonitorElement * processId_
Number of collector updates (TBD)
MonitorElement * eventTimeStamp_
MonitorElement * workingDir_
DQM &quot;name&quot; of the job (eg, Hcal or DT)
tuple cout
Definition: gather_cfg.py:121
MonitorElement * processStartTimeStamp_
The PID associated with this job.
MonitorElement * nUpdates_
These MEs are either static or updated upon each analyze() call.
MonitorElement * bookInt(const char *name)
Book int.
Definition: DQMStore.cc:624
MonitorElement * processEventRate_
Time elapsed since the last event.
MonitorElement * processLatency_
The UTC time of the last event.
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
XmasToDQMEventInfo::~XmasToDQMEventInfo ( )
virtual

Destructor.

Definition at line 85 of file XmasToDQMEventInfo.cc.

References gather_cfg::cout.

85  {
86 
87  cout<<"[XmasToDQMEventInfo]: destructor"<<endl;
88 
89 }
tuple cout
Definition: gather_cfg.py:121

Member Function Documentation

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

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, convertSQLiteXML::runNumber, xmas2dqm::wse::ToDqm::runNumber_, edm::EventBase::time(), cond::rpcobgas::time, and edm::Timestamp::value().

106  {
107 
108  static int icalls = 1;
109  cout << "XmasToDQMEventInfo::analyze call = " << icalls << std::endl;
110 
111  //runId_->Fill(e.id().run());
112  std::string runNumber;
113 
114  //xmas2dqm::wse::ToDqm::instance()->BSem_.take();
115  runNumber = xmas2dqm::wse::ToDqm::instance()->runNumber_.toString();
116  std::cout << "EventInfo runNumber ... = " << runNumber << std::endl;
117  //xmas2dqm::wse::ToDqm::instance()->BSem_.give();
118 
119  std::istringstream istrfloat(runNumber);
120  float runNumber_value;
121  istrfloat >> runNumber_value;
122  runId_->Fill(runNumber_value);
123 
125  eventId_->Fill(e.id().event());
126  eventTimeStamp_->Fill(e.time().value()/(double)0xffffffff);
127 
128  pEvent_++;
129  evtRateCount_++;
131 
133  gettimeofday(&currentTime_,NULL);
136 
138  if(time>=(evtRateWindow_*60.0)){
139  processEventRate_->Fill((float)evtRateCount_/time);
140  evtRateCount_ = 0;
142  }
143 
144  icalls++;
145  return;
146 }
MonitorElement * eventId_
UTC time of the run start.
EventNumber_t event() const
Definition: EventID.h:44
MonitorElement * processTimeStamp_
The UTC time of the first event processed.
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:59
MonitorElement * lumisecId_
#define NULL
Definition: scimark2.h:8
xdata::String runNumber_
Definition: ToDqm.h:61
void Fill(long long x)
MonitorElement * runId_
static ToDqm * instance()
Definition: ToDqm.cc:6
MonitorElement * processEvents_
Avg # of events in programmable window (default: 5 min)
TimeValue_t value() const
Definition: Timestamp.cc:72
double getUTCtime(timeval *a, timeval *b=NULL)
MonitorElement * eventTimeStamp_
edm::EventID id() const
Definition: EventBase.h:56
tuple cout
Definition: gather_cfg.py:121
MonitorElement * processEventRate_
Time elapsed since the last event.
MonitorElement * processLatency_
The UTC time of the last event.
edm::Timestamp time() const
Definition: EventBase.h:57
void XmasToDQMEventInfo::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 91 of file XmasToDQMEventInfo.cc.

References edm::RunBase::beginTime(), cond::rpcobgas::time, and edm::Timestamp::value().

91  {
92 
93  const edm::Timestamp time = r.beginTime();
94 
95  float sec = time.value() >> 32;
96  float usec = 0xFFFFFFFF & time.value() ;
97 
98  // cout << " begin Run " << r.run() << " " << time.value() << endl;
99  // cout << setprecision(16) << getUTCtime(&currentTime_) << endl;
100  // cout << sec+usec/1000000. << endl;
101 
102  runStartTimeStamp_->Fill(sec+usec/1000000.);
103 
104 }
void Fill(long long x)
MonitorElement * runStartTimeStamp_
TimeValue_t value() const
Definition: Timestamp.cc:72
Timestamp const & beginTime() const
Definition: RunBase.h:43
double XmasToDQMEventInfo::getUTCtime ( timeval *  a,
timeval *  b = NULL 
)
private

Definition at line 148 of file XmasToDQMEventInfo.cc.

References NULL.

148  {
149  double deltaT=(*a).tv_sec*1000.0+(*a).tv_usec/1000.0;
150  if(b!=NULL) deltaT=(*b).tv_sec*1000.0+(*b).tv_usec/1000.0 - deltaT;
151  return deltaT/1000.0;
152 }
#define NULL
Definition: scimark2.h:8
double b
Definition: hdecay.h:120

Member Data Documentation

MonitorElement* XmasToDQMEventInfo::cmsswVer_
private

Current working directory of the job.

Definition at line 87 of file XmasToDQMEventInfo.h.

timeval XmasToDQMEventInfo::currentTime_
private

Definition at line 58 of file XmasToDQMEventInfo.h.

DQMStore* XmasToDQMEventInfo::dbe_
private

Definition at line 55 of file XmasToDQMEventInfo.h.

MonitorElement* XmasToDQMEventInfo::errSummary_
private

CMSSW version run for this job.

Definition at line 89 of file XmasToDQMEventInfo.h.

MonitorElement* XmasToDQMEventInfo::errSummaryEtaPhi_
private

Subdetector-specific error summary (float)

Definition at line 90 of file XmasToDQMEventInfo.h.

MonitorElement* XmasToDQMEventInfo::errSummarySegment_[10]
private

Subdetector-specific etaPhi summary (float)

Definition at line 91 of file XmasToDQMEventInfo.h.

MonitorElement* XmasToDQMEventInfo::eventId_
private

UTC time of the run start.

Definition at line 70 of file XmasToDQMEventInfo.h.

MonitorElement* XmasToDQMEventInfo::eventTimeStamp_
private

Definition at line 72 of file XmasToDQMEventInfo.h.

int XmasToDQMEventInfo::evtRateCount_
private

Definition at line 61 of file XmasToDQMEventInfo.h.

float XmasToDQMEventInfo::evtRateWindow_
private

Definition at line 60 of file XmasToDQMEventInfo.h.

MonitorElement* XmasToDQMEventInfo::hostName_
private

of event processed so far

Definition at line 84 of file XmasToDQMEventInfo.h.

timeval XmasToDQMEventInfo::lastAvgTime_
private

Definition at line 58 of file XmasToDQMEventInfo.h.

timeval XmasToDQMEventInfo::lastUpdateTime_
private

Definition at line 58 of file XmasToDQMEventInfo.h.

MonitorElement* XmasToDQMEventInfo::lumisecId_
private

Definition at line 71 of file XmasToDQMEventInfo.h.

MonitorElement* XmasToDQMEventInfo::nUpdates_
private

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

Definition at line 77 of file XmasToDQMEventInfo.h.

edm::ParameterSet XmasToDQMEventInfo::parameters_
private
int XmasToDQMEventInfo::pEvent_
private

Definition at line 62 of file XmasToDQMEventInfo.h.

MonitorElement* XmasToDQMEventInfo::processEventRate_
private

Time elapsed since the last event.

Definition at line 82 of file XmasToDQMEventInfo.h.

MonitorElement* XmasToDQMEventInfo::processEvents_
private

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

Definition at line 83 of file XmasToDQMEventInfo.h.

MonitorElement* XmasToDQMEventInfo::processId_
private

Number of collector updates (TBD)

Definition at line 78 of file XmasToDQMEventInfo.h.

MonitorElement* XmasToDQMEventInfo::processLatency_
private

The UTC time of the last event.

Definition at line 81 of file XmasToDQMEventInfo.h.

MonitorElement* XmasToDQMEventInfo::processName_
private

Hostname of the local machine.

Definition at line 85 of file XmasToDQMEventInfo.h.

MonitorElement* XmasToDQMEventInfo::processStartTimeStamp_
private

The PID associated with this job.

Definition at line 79 of file XmasToDQMEventInfo.h.

MonitorElement* XmasToDQMEventInfo::processTimeStamp_
private

The UTC time of the first event processed.

Definition at line 80 of file XmasToDQMEventInfo.h.

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.

timeval XmasToDQMEventInfo::runStartTime_
private

Definition at line 59 of file XmasToDQMEventInfo.h.

MonitorElement* XmasToDQMEventInfo::runStartTimeStamp_
private

Definition at line 69 of file XmasToDQMEventInfo.h.

MonitorElement* XmasToDQMEventInfo::workingDir_
private

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

Definition at line 86 of file XmasToDQMEventInfo.h.