CMS 3D CMS Logo

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

#include <DTOfflineSummaryClients.h>

Inheritance diagram for DTOfflineSummaryClients:
edm::EDAnalyzer

Public 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...
 
 DTOfflineSummaryClients (const edm::ParameterSet &ps)
 Constructor. More...
 
void endJob (void)
 EndJob. More...
 
void endLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &c)
 EndLumi. More...
 
void endRun (edm::Run const &run, edm::EventSetup const &eSetup)
 DQM Client Diagnostic. More...
 
virtual ~DTOfflineSummaryClients ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

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 &)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Definition at line 23 of file DTOfflineSummaryClients.h.

Constructor & Destructor Documentation

DTOfflineSummaryClients::DTOfflineSummaryClients ( const edm::ParameterSet ps)

Constructor.

Definition at line 29 of file DTOfflineSummaryClients.cc.

References dbe, and cppFunctionSkipper::operator.

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

Destructor.

Definition at line 38 of file DTOfflineSummaryClients.cc.

References nevents.

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

Member Function Documentation

void DTOfflineSummaryClients::analyze ( const edm::Event e,
const edm::EventSetup c 
)
virtual

Analyze.

Implements edm::EDAnalyzer.

Definition at line 81 of file DTOfflineSummaryClients.cc.

References nevents.

81  {
82 
83  nevents++;
84  if(nevents%1000 == 0) {
85  LogVerbatim("DTDQM|DTMonitorClient|DTOfflineSummaryClients") << "[DTOfflineSummaryClients] Analyze #Run: " << event.id().run()
86  << " #Event: " << event.id().event()
87  << " LS: " << event.luminosityBlock()
88  << endl;
89  }
90 }
void DTOfflineSummaryClients::beginRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
virtual

BeginRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 43 of file DTOfflineSummaryClients.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|DTOfflineSummaryClients") <<"[DTOfflineSummaryClients]: 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 * 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 DTOfflineSummaryClients::endJob ( void  )
virtual

EndJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 74 of file DTOfflineSummaryClients.cc.

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

EndLumi.

Reimplemented from edm::EDAnalyzer.

Definition at line 93 of file DTOfflineSummaryClients.cc.

93  {
94 
95  LogVerbatim("DTDQM|DTMonitorClient|DTOfflineSummaryClients")
96  << "[DTOfflineSummaryClients]: End of LS transition" << endl;
97 
98 }
void DTOfflineSummaryClients::endRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
virtual

DQM Client Diagnostic.

Reimplemented from edm::EDAnalyzer.

Definition at line 101 of file DTOfflineSummaryClients.cc.

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

101  {
102 
103  LogVerbatim ("DTDQM|DTMonitorClient|DTOfflineSummaryClients") <<"[DTOfflineSummaryClients]: endRun. Performin client operation";
104 
105 
106  // reset the monitor elements
108  summaryReport->Fill(0.);
109  for(int ii = 0; ii != 5; ++ii) {
110  theSummaryContents[ii]->Fill(0.);
111  }
112 
113  // Fill the map using, at the moment, only the information from DT chamber efficiency
114  // problems at a granularity smaller than the chamber are ignored
115  for(int wheel=-2; wheel<=2; wheel++) { // loop over wheels
116  // retrieve the chamber efficiency summary
117  stringstream str;
118  str << "DT/05-ChamberEff/EfficiencyMap_All_W" << wheel;
119  MonitorElement * segmentWheelSummary = dbe->get(str.str());
120  if(segmentWheelSummary != 0) {
121 
122  float nFailingChambers = 0.;
123 
124  for(int sector=1; sector<=12; sector++) { // loop over sectors
125 
126  double meaneff = 0.;
127  double errorsum = 0.;
128 
129  for(int station = 1; station != 5; ++station) { // loop over stations
130 
131  const double tmpefficiency = segmentWheelSummary->getBinContent(sector, station);
132  const double tmpvariance = pow(segmentWheelSummary->getBinError(sector, station),2);
133 
134  if(tmpefficiency == 0 || tmpvariance == 0){
135  nFailingChambers++;
136  continue;
137  }
138 
139  meaneff += tmpefficiency/tmpvariance;
140  errorsum += 1./tmpvariance;
141 
142  if(tmpefficiency < 0.2) nFailingChambers++;
143 
144  LogTrace("DTDQM|DTMonitorClient|DTOfflineSummaryClients")
145  << "Wheel: " << wheel << " Stat: " << station << " Sect: " << sector << " status: " << meaneff/errorsum << endl;
146  }
147 
148  const double eff_result = meaneff/errorsum;
149 
150  if(eff_result > 0.7) summaryReportMap->Fill(sector,wheel,1.);
151  else if(eff_result < 0.7 && eff_result > 0.5) summaryReportMap->Fill(sector,wheel,0.6);
152  else if(eff_result < 0.5 && eff_result > 0.3) summaryReportMap->Fill(sector,wheel,0.4);
153  else if(eff_result < 0.3 && eff_result > 0.) summaryReportMap->Fill(sector,wheel,0.15);
154 
155  }
156  theSummaryContents[wheel+2]->Fill((48.-nFailingChambers)/48.);
157  summaryReport->Fill(summaryReport->getFloatValue() + theSummaryContents[wheel+2]->getFloatValue()/5.);
158  } else {
159  LogWarning("DTDQM|DTMonitorClient|DTOfflineSummaryClients")
160  << " [DTOfflineSummaryClients] Segment Summary not found with name: " << str.str() << endl;
161  }
162  }
163 
164 }
void Fill(long long x)
double getFloatValue(void) const
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 getBinError(int binx) const
get uncertainty on content of bin (1-D) - See TH1::GetBinError for details
std::vector< MonitorElement * > theSummaryContents
double getBinContent(int binx) const
get content of bin (1-D)
void Reset(void)
reset ME (ie. contents, errors, etc)
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40

Member Data Documentation

DQMStore* DTOfflineSummaryClients::dbe
private

Definition at line 54 of file DTOfflineSummaryClients.h.

Referenced by beginRun(), DTOfflineSummaryClients(), and endRun().

int DTOfflineSummaryClients::nevents
private

Definition at line 53 of file DTOfflineSummaryClients.h.

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

MonitorElement* DTOfflineSummaryClients::summaryReport
private

Definition at line 56 of file DTOfflineSummaryClients.h.

Referenced by beginRun(), and endRun().

MonitorElement* DTOfflineSummaryClients::summaryReportMap
private

Definition at line 57 of file DTOfflineSummaryClients.h.

Referenced by beginRun(), and endRun().

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

Definition at line 58 of file DTOfflineSummaryClients.h.

Referenced by beginRun(), and endRun().