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  * \author M. Pelliccioni - INFN Torino
5  */
6 
7 
9 
10 // Framework
15 
19 
20 #include <string>
21 #include <cmath>
22 
23 using namespace edm;
24 using namespace std;
25 
26 
28 
29  LogVerbatim("DTDQM|DTMonitorClient|DTOfflineSummaryClients") << "[DTOfflineSummaryClients]: Constructor";
30 
31 
33 
34 }
35 
37  LogVerbatim ("DTDQM|DTMonitorClient|DTOfflineSummaryClients") << "DTOfflineSummaryClients: analyzed " << nevents << " events";
38 
39 }
40 
41 void DTOfflineSummaryClients::beginRun(Run const& run, EventSetup const& eSetup) {
42 
43  LogVerbatim("DTDQM|DTMonitorClient|DTOfflineSummaryClients") <<"[DTOfflineSummaryClients]: BeginRun";
44 
45  // book the summary histos
46  dbe->setCurrentFolder("DT/EventInfo");
47  summaryReport = dbe->bookFloat("reportSummary");
48  // Initialize to 1 so that no alarms are thrown at the beginning of the run
49  summaryReport->Fill(1.);
50 
51  summaryReportMap = dbe->book2D("reportSummaryMap","DT Report Summary Map",12,1,13,5,-2,3);
52  summaryReportMap->setAxisTitle("sector",1);
53  summaryReportMap->setAxisTitle("wheel",2);
54 
55  dbe->setCurrentFolder("DT/EventInfo/reportSummaryContents");
56 
57  for(int wheel = -2; wheel != 3; ++wheel) {
58  stringstream streams;
59  streams << "DT_Wheel" << wheel;
60  string meName = streams.str();
61  theSummaryContents.push_back(dbe->bookFloat(meName));
62  // Initialize to 1 so that no alarms are thrown at the beginning of the run
63  theSummaryContents[wheel+2]->Fill(1.);
64  }
65 
66 
67 
68 
69 }
70 
71 
73 
74  LogVerbatim ("DTDQM|DTMonitorClient|DTOfflineSummaryClients") <<"[DTOfflineSummaryClients]: endJob";
75 
76 }
77 
78 
80 
81  nevents++;
82  if(nevents%1000 == 0) {
83  LogVerbatim("DTDQM|DTMonitorClient|DTOfflineSummaryClients") << "[DTOfflineSummaryClients] Analyze #Run: " << event.id().run()
84  << " #Event: " << event.id().event()
85  << " LS: " << event.luminosityBlock()
86  << endl;
87  }
88 }
89 
90 
92 
93  LogVerbatim("DTDQM|DTMonitorClient|DTOfflineSummaryClients")
94  << "[DTOfflineSummaryClients]: End of LS transition" << endl;
95 
96 }
97 
98 
99 void DTOfflineSummaryClients::endRun(Run const& run, EventSetup const& context) {
100 
101  LogVerbatim ("DTDQM|DTMonitorClient|DTOfflineSummaryClients") <<"[DTOfflineSummaryClients]: endRun. Performin client operation";
102 
103 
104  // reset the monitor elements
106  summaryReport->Fill(0.);
107  for(int ii = 0; ii != 5; ++ii) {
108  theSummaryContents[ii]->Fill(0.);
109  }
110 
111  // Fill the map using, at the moment, only the information from DT chamber efficiency
112  // problems at a granularity smaller than the chamber are ignored
113  for(int wheel=-2; wheel<=2; wheel++) { // loop over wheels
114  // retrieve the chamber efficiency summary
115  stringstream str;
116  str << "DT/05-ChamberEff/EfficiencyMap_All_W" << wheel;
117  MonitorElement * segmentWheelSummary = dbe->get(str.str());
118  if(segmentWheelSummary != 0) {
119 
120  float nFailingChambers = 0.;
121 
122  for(int sector=1; sector<=12; sector++) { // loop over sectors
123 
124  double meaneff = 0.;
125  double errorsum = 0.;
126 
127  for(int station = 1; station != 5; ++station) { // loop over stations
128 
129  const double tmpefficiency = segmentWheelSummary->getBinContent(sector, station);
130  const double tmpvariance = pow(segmentWheelSummary->getBinError(sector, station),2);
131 
132  if(tmpefficiency == 0 || tmpvariance == 0){
133  nFailingChambers++;
134  continue;
135  }
136 
137  meaneff += tmpefficiency/tmpvariance;
138  errorsum += 1./tmpvariance;
139 
140  if(tmpefficiency < 0.2) nFailingChambers++;
141 
142  LogTrace("DTDQM|DTMonitorClient|DTOfflineSummaryClients")
143  << "Wheel: " << wheel << " Stat: " << station << " Sect: " << sector << " status: " << meaneff/errorsum << endl;
144  }
145 
146  const double eff_result = meaneff/errorsum;
147 
148  if(eff_result > 0.7) summaryReportMap->Fill(sector,wheel,1.);
149  else if(eff_result < 0.7 && eff_result > 0.5) summaryReportMap->Fill(sector,wheel,0.6);
150  else if(eff_result < 0.5 && eff_result > 0.3) summaryReportMap->Fill(sector,wheel,0.4);
151  else if(eff_result < 0.3 && eff_result > 0.) summaryReportMap->Fill(sector,wheel,0.15);
152 
153  }
154  theSummaryContents[wheel+2]->Fill((48.-nFailingChambers)/48.);
155  summaryReport->Fill(summaryReport->getFloatValue() + theSummaryContents[wheel+2]->getFloatValue()/5.);
156  } else {
157  LogWarning("DTDQM|DTMonitorClient|DTOfflineSummaryClients")
158  << " [DTOfflineSummaryClients] Segment Summary not found with name: " << str.str() << endl;
159  }
160  }
161 
162 }
163 
164 
void beginRun(edm::Run const &run, edm::EventSetup const &eSetup)
BeginRun.
int ii
Definition: cuy.py:588
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:809
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:1623
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:1000
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:584
Definition: Run.h:41
void analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze.