CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DTSummaryClients.cc
Go to the documentation of this file.
1 
2 
3 /*
4  * See header file for a description of this class.
5  *
6  * $Date: 2008/10/09 09:38:44 $
7  * $Revision: 1.11 $
8  * \author G. Mila - INFN Torino
9  */
10 
11 
13 
14 // Framework
18 
22 
23 #include <string>
24 
25 using namespace edm;
26 using namespace std;
27 
28 
30 
31  LogVerbatim("DTDQM|DTMonitorClient|DTSummaryClients") << "[DTSummaryClients]: Constructor";
32 
33 
35 
36 }
37 
39  LogVerbatim ("DTDQM|DTMonitorClient|DTSummaryClients") << "DTSummaryClients: analyzed " << nevents << " events";
40 
41 }
42 
43 void DTSummaryClients::beginRun(Run const& run, EventSetup const& eSetup) {
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 }
72 
73 
75 
76  LogVerbatim ("DTDQM|DTMonitorClient|DTSummaryClients") <<"[DTSummaryClients]: endJob";
77 
78 }
79 
80 
81 void DTSummaryClients::endRun(Run const& run, EventSetup const& eSetup) {
82 
83  LogVerbatim ("DTDQM|DTMonitorClient|DTSummaryClients") <<"[DTSummaryClients]: endRun";
84 
85 }
86 
87 
88 void DTSummaryClients::analyze(const Event& event, const EventSetup& context){
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 }
98 
99 
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 }
194 
195 
DTSummaryClients(const edm::ParameterSet &ps)
Constructor.
MonitorElement * summaryReport
MonitorElement * summaryReportMap
int ii
Definition: cuy.py:588
void endLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &c)
DQM Client Diagnostic.
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:659
void Fill(long long x)
void analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze.
int nevents
void beginRun(edm::Run const &run, edm::EventSetup const &eSetup)
BeginRun.
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1473
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)
void endRun(edm::Run const &run, edm::EventSetup const &eSetup)
EndRun.
void endJob(void)
EndJob.
double getBinContent(int binx) const
get content of bin (1-D)
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:850
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)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:434
virtual ~DTSummaryClients()
Destructor.
Definition: Run.h:36