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: 2011/11/24 09:17:30 $
5  * $Revision: 1.9 $
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  // 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 }
165 
166 
void beginRun(edm::Run const &run, edm::EventSetup const &eSetup)
BeginRun.
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:654
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:1468
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:845
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:429
Definition: Run.h:33
void analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze.