CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DTOfflineSummaryClients.cc
Go to the documentation of this file.
1 /*
2  * See header file for a description of this class.
3  *
4  * $Date: 2009/10/19 14:08:05 $
5  * $Revision: 1.7 $
6  * \author M. Pelliccioni - INFN Torino
7  */
8 
9 
11 
12 // Framework
17 
21 
22 #include <string>
23 #include <cmath>
24 
25 using namespace edm;
26 using namespace std;
27 
28 
30 
31  LogVerbatim("DTDQM|DTMonitorClient|DTOfflineSummaryClients") << "[DTOfflineSummaryClients]: Constructor";
32 
33 
35 
36 }
37 
39  LogVerbatim ("DTDQM|DTMonitorClient|DTOfflineSummaryClients") << "DTOfflineSummaryClients: analyzed " << nevents << " events";
40 
41 }
42 
43 void DTOfflineSummaryClients::beginRun(Run const& run, EventSetup const& eSetup) {
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 }
72 
73 
75 
76  LogVerbatim ("DTDQM|DTMonitorClient|DTOfflineSummaryClients") <<"[DTOfflineSummaryClients]: endJob";
77 
78 }
79 
80 
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 }
91 
92 
94 
95  LogVerbatim("DTDQM|DTMonitorClient|DTOfflineSummaryClients")
96  << "[DTOfflineSummaryClients]: End of LS transition" << endl;
97 
98 }
99 
100 
101 void DTOfflineSummaryClients::endRun(Run const& run, EventSetup const& context) {
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  // protection
114  bool efficiencyFound = true;
115 
116  // Fill the map using, at the moment, only the information from DT chamber efficiency
117  // problems at a granularity smaller than the chamber are ignored
118  for(int wheel=-2; wheel<=2; wheel++) { // loop over wheels
119  // retrieve the chamber efficiency summary
120  stringstream str;
121  str << "DT/05-ChamberEff/EfficiencyMap_All_W" << wheel;
122  MonitorElement * segmentWheelSummary = dbe->get(str.str());
123  if(segmentWheelSummary != 0) {
124 
125  float nFailingChambers = 0.;
126 
127  for(int sector=1; sector<=12; sector++) { // loop over sectors
128 
129  double meaneff = 0.;
130  double errorsum = 0.;
131 
132  for(int station = 1; station != 5; ++station) { // loop over stations
133 
134  const double tmpefficiency = segmentWheelSummary->getBinContent(sector, station);
135  const double tmpvariance = pow(segmentWheelSummary->getBinError(sector, station),2);
136 
137  if(tmpefficiency == 0 || tmpvariance == 0){
138  nFailingChambers++;
139  continue;
140  }
141 
142  meaneff += tmpefficiency/tmpvariance;
143  errorsum += 1./tmpvariance;
144 
145  if(tmpefficiency < 0.2) nFailingChambers++;
146 
147  LogTrace("DTDQM|DTMonitorClient|DTOfflineSummaryClients")
148  << "Wheel: " << wheel << " Stat: " << station << " Sect: " << sector << " status: " << meaneff/errorsum << endl;
149  }
150 
151  const double eff_result = meaneff/errorsum;
152 
153  if(eff_result > 0.7) summaryReportMap->Fill(sector,wheel,1.);
154  else if(eff_result < 0.7 && eff_result > 0.5) summaryReportMap->Fill(sector,wheel,0.6);
155  else if(eff_result < 0.5 && eff_result > 0.3) summaryReportMap->Fill(sector,wheel,0.4);
156  else if(eff_result < 0.3 && eff_result > 0.) summaryReportMap->Fill(sector,wheel,0.15);
157 
158  }
159  theSummaryContents[wheel+2]->Fill((48.-nFailingChambers)/48.);
160  summaryReport->Fill(summaryReport->getFloatValue() + theSummaryContents[wheel+2]->getFloatValue()/5.);
161  } else {
162  efficiencyFound = false;
163  LogWarning("DTDQM|DTMonitorClient|DTOfflineSummaryClients")
164  << " [DTOfflineSummaryClients] Segment Summary not found with name: " << str.str() << endl;
165  }
166  }
167 
168 }
169 
170 
void beginRun(edm::Run const &run, edm::EventSetup const &eSetup)
BeginRun.
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:456
void Fill(long long x)
void endRun(edm::Run const &run, edm::EventSetup const &eSetup)
DQM Client Diagnostic.
double getFloatValue(void) const
int nevents
void endLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &c)
EndLumi.
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1270
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
#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)
DTOfflineSummaryClients(const edm::ParameterSet &ps)
Constructor.
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:647
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void Reset(void)
reset ME (ie. contents, errors, etc)
virtual ~DTOfflineSummaryClients()
Destructor.
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:237
Definition: Run.h:31
void analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze.