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  * \author G. Mila - INFN Torino
7  */
8 
9 
11 
12 // Framework
16 
20 
21 #include <string>
22 
23 using namespace edm;
24 using namespace std;
25 
26 
28 
29  LogVerbatim("DTDQM|DTMonitorClient|DTSummaryClients") << "[DTSummaryClients]: Constructor";
30 
31 
33 
34 }
35 
37  LogVerbatim ("DTDQM|DTMonitorClient|DTSummaryClients") << "DTSummaryClients: analyzed " << nevents << " events";
38 
39 }
40 
41 void DTSummaryClients::beginRun(Run const& run, EventSetup const& eSetup) {
42 
43  LogVerbatim("DTDQM|DTMonitorClient|DTSummaryClients") <<"[DTSummaryClients]: 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|DTSummaryClients") <<"[DTSummaryClients]: endJob";
75 
76 }
77 
78 
79 void DTSummaryClients::endRun(Run const& run, EventSetup const& eSetup) {
80 
81  LogVerbatim ("DTDQM|DTMonitorClient|DTSummaryClients") <<"[DTSummaryClients]: endRun";
82 
83 }
84 
85 
86 void DTSummaryClients::analyze(const Event& event, const EventSetup& context){
87 
88  nevents++;
89  if(nevents%1000 == 0) {
90  LogVerbatim("DTDQM|DTMonitorClient|DTSummaryClients") << "[DTSummaryClients] Analyze #Run: " << event.id().run()
91  << " #Event: " << event.id().event()
92  << " LS: " << event.luminosityBlock()
93  << endl;
94  }
95 }
96 
97 
98 void DTSummaryClients::endLuminosityBlock(LuminosityBlock const& lumiSeg, EventSetup const& context) {
99 
100  LogVerbatim("DTDQM|DTMonitorClient|DTSummaryClients")
101  << "[DTSummaryClients]: End of LS transition, performing the DQM client operation" << endl;
102 
103  // reset the monitor elements
105  summaryReport->Reset();
106  for(int ii = 0; ii != 5; ++ii) {
107  theSummaryContents[ii]->Reset();
108  }
109 
110  bool noDTData = false;
111 
112  // Check if DT data in each ROS have been read out and set the SummaryContents and the ErrorSummary
113  // accordignly
114  MonitorElement * dataIntegritySummary = dbe->get("DT/00-DataIntegrity/DataIntegritySummary");
115  if(dataIntegritySummary != 0) {
116  int nDisabledFED = 0;
117  for(int wheel = 1; wheel != 6; ++wheel) { // loop over the wheels
118  int nDisablesROS = 0;
119  for(int sect = 1; sect != 13; ++sect) { // loop over sectors
120  if(dataIntegritySummary->getBinContent(sect,wheel) == 1) {
121  nDisablesROS++;
122  }
123  }
124  if(nDisablesROS == 12) {
125  nDisabledFED++;
126  theSummaryContents[wheel-1]->Fill(0);
127  }
128  }
129 
130  if(nDisabledFED == 5) {
131  noDTData = true;
132  summaryReport->Fill(-1);
133  }
134 
135  } else {
136  LogError("DTDQM|DTMonitorClient|DTSummaryClients")
137  << "Data Integrity Summary not found with name: DT/00-DataIntegrity/DataIntegritySummary" <<endl;
138  }
139 
140  double totalStatus = 0;
141  // protection
142  bool occupancyFound = true;
143 
144  // Fill the map using, at the moment, only the information from DT occupancy
145  // problems at a granularity smaller than the chamber are ignored
146  for(int wheel=-2; wheel<=2; wheel++){ // loop over wheels
147  // retrieve the occupancy summary
148  stringstream str;
149  str << "DT/01-Digi/OccupancySummary_W" << wheel;
150  MonitorElement * wheelOccupancySummary = dbe->get(str.str());
151  if(wheelOccupancySummary != 0) {
152  int nFailingChambers = 0;
153  for(int sector=1; sector<=12; sector++){ // loop over sectors
154  for(int station = 1; station != 5; ++station) { // loop over stations
155  double chamberStatus = wheelOccupancySummary->getBinContent(sector, station);
156  LogTrace("DTDQM|DTMonitorClient|DTSummaryClients")
157  << "Wheel: " << wheel << " Stat: " << station << " Sect: " << sector << " status: " << chamberStatus << endl;
158  if(chamberStatus != 4) {
159  summaryReportMap->Fill(sector, wheel, 0.25);
160  } else {
161  nFailingChambers++;
162  }
163  LogTrace("DTDQM|DTMonitorClient|DTSummaryClients") << " sector (" << sector << ") status on the map is: "
164  << summaryReportMap->getBinContent(sector, wheel+3) << endl;
165  }
166 
167  }
168  theSummaryContents[wheel+2]->Fill((48.-nFailingChambers)/48.);
169  totalStatus += (48.-nFailingChambers)/48.;
170  } else {
171  occupancyFound = false;
172  LogError("DTDQM|DTMonitorClient|DTSummaryClients")<< " Wheel Occupancy Summary not found with name: " << str.str() << endl;
173  }
174  }
175 
176 
177  if(occupancyFound && !noDTData)
178  summaryReport->Fill(totalStatus/5.);
179 
180 // cout << "-----------------------------------------------------------------------------" << endl;
181 // cout << " In the endLuminosityBlock: " << endl;
182 // for(int wheel = -2; wheel != 3; ++wheel) {
183 // for(int sector = 1; sector != 13; sector++) {
184 // cout << " wheel: " << wheel << " sector: " << sector << " status on the map is: "
185 // << summaryReportMap->getBinContent(sector, wheel+3) << endl;
186 // }
187 // }
188 // cout << "-----------------------------------------------------------------------------" << endl;
189 
190 
191 }
192 
193 
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.
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.
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
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 ~DTSummaryClients()
Destructor.
Definition: Run.h:41