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
DTSummaryClients Class Reference

#include <DTSummaryClients.h>

Inheritance diagram for DTSummaryClients:
edm::EDAnalyzer

Public Member Functions

 DTSummaryClients (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~DTSummaryClients ()
 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 (edm::Run const &run, edm::EventSetup const &eSetup)
 BeginRun. More...
 
void endJob (void)
 EndJob. More...
 
void endLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &c)
 DQM Client Diagnostic. More...
 
void endRun (edm::Run const &run, edm::EventSetup const &eSetup)
 EndRun. More...
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Private Attributes

DQMStoredbe
 
int nevents
 
MonitorElementsummaryReport
 
MonitorElementsummaryReportMap
 
std::vector< MonitorElement * > theSummaryContents
 

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 DTSummaryClients.h.

Constructor & Destructor Documentation

DTSummaryClients::DTSummaryClients ( const edm::ParameterSet ps)

Constructor.

Definition at line 29 of file DTSummaryClients.cc.

References dbe, and cppFunctionSkipper::operator.

29  : nevents(0) {
30 
31  LogVerbatim("DTDQM|DTMonitorClient|DTSummaryClients") << "[DTSummaryClients]: Constructor";
32 
33 
35 
36 }
DTSummaryClients::~DTSummaryClients ( )
virtual

Destructor.

Definition at line 38 of file DTSummaryClients.cc.

References nevents.

38  {
39  LogVerbatim ("DTDQM|DTMonitorClient|DTSummaryClients") << "DTSummaryClients: analyzed " << nevents << " events";
40 
41 }

Member Function Documentation

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 88 of file DTSummaryClients.cc.

References nevents.

88  {
89 
90  nevents++;
91  if(nevents%1000 == 0) {
92  LogVerbatim("DTDQM|DTMonitorClient|DTSummaryClients") << "[DTSummaryClients] Analyze #Run: " << event.id().run()
93  << " #Event: " << event.id().event()
94  << " LS: " << event.luminosityBlock()
95  << endl;
96  }
97 }
void DTSummaryClients::beginRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
protectedvirtual

BeginRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 43 of file DTSummaryClients.cc.

References DQMStore::book2D(), DQMStore::bookFloat(), dbe, MonitorElement::Fill(), MonitorElement::setAxisTitle(), DQMStore::setCurrentFolder(), hcal_dqm_sourceclient-file_cfg::streams, summaryReport, summaryReportMap, and theSummaryContents.

43  {
44 
45  LogVerbatim("DTDQM|DTMonitorClient|DTSummaryClients") <<"[DTSummaryClients]: BeginRun";
46 
47  // book the summary histos
48  dbe->setCurrentFolder("DT/EventInfo");
49  summaryReport = dbe->bookFloat("reportSummary");
50  // Initialize to 1 so that no alarms are thrown at the beginning of the run
51  summaryReport->Fill(1.);
52 
53  summaryReportMap = dbe->book2D("reportSummaryMap","DT Report Summary Map",12,1,13,5,-2,3);
54  summaryReportMap->setAxisTitle("sector",1);
55  summaryReportMap->setAxisTitle("wheel",2);
56 
57  dbe->setCurrentFolder("DT/EventInfo/reportSummaryContents");
58 
59  for(int wheel = -2; wheel != 3; ++wheel) {
60  stringstream streams;
61  streams << "DT_Wheel" << wheel;
62  string meName = streams.str();
63  theSummaryContents.push_back(dbe->bookFloat(meName));
64  // Initialize to 1 so that no alarms are thrown at the beginning of the run
65  theSummaryContents[wheel+2]->Fill(1.);
66  }
67 
68 
69 
70 
71 }
MonitorElement * summaryReport
MonitorElement * summaryReportMap
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:654
void Fill(long long x)
std::vector< MonitorElement * > theSummaryContents
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:845
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
void DTSummaryClients::endJob ( void  )
protectedvirtual

EndJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 74 of file DTSummaryClients.cc.

74  {
75 
76  LogVerbatim ("DTDQM|DTMonitorClient|DTSummaryClients") <<"[DTSummaryClients]: endJob";
77 
78 }
void DTSummaryClients::endLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  c 
)
protectedvirtual

DQM Client Diagnostic.

Reimplemented from edm::EDAnalyzer.

Definition at line 100 of file DTSummaryClients.cc.

References dbe, MonitorElement::Fill(), DQMStore::get(), MonitorElement::getBinContent(), LogTrace, MonitorElement::Reset(), relativeConstraints::station, summaryReport, summaryReportMap, and theSummaryContents.

100  {
101 
102  LogVerbatim("DTDQM|DTMonitorClient|DTSummaryClients")
103  << "[DTSummaryClients]: End of LS transition, performing the DQM client operation" << endl;
104 
105  // reset the monitor elements
107  summaryReport->Reset();
108  for(int ii = 0; ii != 5; ++ii) {
109  theSummaryContents[ii]->Reset();
110  }
111 
112  bool noDTData = false;
113 
114  // Check if DT data in each ROS have been read out and set the SummaryContents and the ErrorSummary
115  // accordignly
116  MonitorElement * dataIntegritySummary = dbe->get("DT/00-DataIntegrity/DataIntegritySummary");
117  if(dataIntegritySummary != 0) {
118  int nDisabledFED = 0;
119  for(int wheel = 1; wheel != 6; ++wheel) { // loop over the wheels
120  int nDisablesROS = 0;
121  for(int sect = 1; sect != 13; ++sect) { // loop over sectors
122  if(dataIntegritySummary->getBinContent(sect,wheel) == 1) {
123  nDisablesROS++;
124  }
125  }
126  if(nDisablesROS == 12) {
127  nDisabledFED++;
128  theSummaryContents[wheel-1]->Fill(0);
129  }
130  }
131 
132  if(nDisabledFED == 5) {
133  noDTData = true;
134  summaryReport->Fill(-1);
135  }
136 
137  } else {
138  LogError("DTDQM|DTMonitorClient|DTSummaryClients")
139  << "Data Integrity Summary not found with name: DT/00-DataIntegrity/DataIntegritySummary" <<endl;
140  }
141 
142  double totalStatus = 0;
143  // protection
144  bool occupancyFound = true;
145 
146  // Fill the map using, at the moment, only the information from DT occupancy
147  // problems at a granularity smaller than the chamber are ignored
148  for(int wheel=-2; wheel<=2; wheel++){ // loop over wheels
149  // retrieve the occupancy summary
150  stringstream str;
151  str << "DT/01-Digi/OccupancySummary_W" << wheel;
152  MonitorElement * wheelOccupancySummary = dbe->get(str.str());
153  if(wheelOccupancySummary != 0) {
154  int nFailingChambers = 0;
155  for(int sector=1; sector<=12; sector++){ // loop over sectors
156  for(int station = 1; station != 5; ++station) { // loop over stations
157  double chamberStatus = wheelOccupancySummary->getBinContent(sector, station);
158  LogTrace("DTDQM|DTMonitorClient|DTSummaryClients")
159  << "Wheel: " << wheel << " Stat: " << station << " Sect: " << sector << " status: " << chamberStatus << endl;
160  if(chamberStatus != 4) {
161  summaryReportMap->Fill(sector, wheel, 0.25);
162  } else {
163  nFailingChambers++;
164  }
165  LogTrace("DTDQM|DTMonitorClient|DTSummaryClients") << " sector (" << sector << ") status on the map is: "
166  << summaryReportMap->getBinContent(sector, wheel+3) << endl;
167  }
168 
169  }
170  theSummaryContents[wheel+2]->Fill((48.-nFailingChambers)/48.);
171  totalStatus += (48.-nFailingChambers)/48.;
172  } else {
173  occupancyFound = false;
174  LogError("DTDQM|DTMonitorClient|DTSummaryClients")<< " Wheel Occupancy Summary not found with name: " << str.str() << endl;
175  }
176  }
177 
178 
179  if(occupancyFound && !noDTData)
180  summaryReport->Fill(totalStatus/5.);
181 
182 // cout << "-----------------------------------------------------------------------------" << endl;
183 // cout << " In the endLuminosityBlock: " << endl;
184 // for(int wheel = -2; wheel != 3; ++wheel) {
185 // for(int sector = 1; sector != 13; sector++) {
186 // cout << " wheel: " << wheel << " sector: " << sector << " status on the map is: "
187 // << summaryReportMap->getBinContent(sector, wheel+3) << endl;
188 // }
189 // }
190 // cout << "-----------------------------------------------------------------------------" << endl;
191 
192 
193 }
MonitorElement * summaryReport
MonitorElement * summaryReportMap
void Fill(long long x)
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1468
#define LogTrace(id)
double getBinContent(int binx) const
get content of bin (1-D)
std::vector< MonitorElement * > theSummaryContents
void Reset(void)
reset ME (ie. contents, errors, etc)
void DTSummaryClients::endRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
protectedvirtual

EndRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 81 of file DTSummaryClients.cc.

81  {
82 
83  LogVerbatim ("DTDQM|DTMonitorClient|DTSummaryClients") <<"[DTSummaryClients]: endRun";
84 
85 }

Member Data Documentation

DQMStore* DTSummaryClients::dbe
private

Definition at line 63 of file DTSummaryClients.h.

Referenced by beginRun(), DTSummaryClients(), and endLuminosityBlock().

int DTSummaryClients::nevents
private

Definition at line 62 of file DTSummaryClients.h.

Referenced by analyze(), and ~DTSummaryClients().

MonitorElement* DTSummaryClients::summaryReport
private

Definition at line 65 of file DTSummaryClients.h.

Referenced by beginRun(), and endLuminosityBlock().

MonitorElement* DTSummaryClients::summaryReportMap
private

Definition at line 66 of file DTSummaryClients.h.

Referenced by beginRun(), and endLuminosityBlock().

std::vector<MonitorElement*> DTSummaryClients::theSummaryContents
private

Definition at line 67 of file DTSummaryClients.h.

Referenced by beginRun(), and endLuminosityBlock().