CMS 3D CMS Logo

DTSummaryClients.cc
Go to the documentation of this file.
1 /*
2  * See header file for a description of this class.
3  *
4  * \author G. Mila - INFN Torino
5  *
6  * threadsafe version (//-) oct/nov 2014 - WATWanAbdullah -ncpp-um-my
7  *
8  */
9 
11 
12 // Framework
16 
19 
20 #include <string>
21 
22 using namespace edm;
23 using namespace std;
24 
26  LogVerbatim("DTDQM|DTMonitorClient|DTSummaryClients") << "[DTSummaryClients]: Constructor";
27 
28  bookingdone = false;
29 }
30 
32  LogVerbatim("DTDQM|DTMonitorClient|DTSummaryClients") << "DTSummaryClients: analyzed " << nevents << " events";
33 }
34 
36  LogVerbatim("DTDQM|DTMonitorClient|DTSummaryClients") << "[DTSummaryClients]: endJob";
37 }
38 
40  DQMStore::IGetter& igetter,
41  edm::LuminosityBlock const& lumiSeg,
42  edm::EventSetup const& context) {
43  if (!bookingdone) {
44  // book the summary histos
45 
46  ibooker.setCurrentFolder("DT/EventInfo");
47 
48  summaryReport = ibooker.bookFloat("reportSummary");
49  // Initialize to 1 so that no alarms are thrown at the beginning of the run
50  summaryReport->Fill(1.);
51 
52  summaryReportMap = ibooker.book2D("reportSummaryMap", "DT Report Summary Map", 12, 1, 13, 5, -2, 3);
53  summaryReportMap->setAxisTitle("sector", 1);
54  summaryReportMap->setAxisTitle("wheel", 2);
55 
56  ibooker.setCurrentFolder("DT/EventInfo/reportSummaryContents");
57 
58  for (int wheel = -2; wheel != 3; ++wheel) {
59  stringstream streams;
60  streams << "DT_Wheel" << wheel;
61  string meName = streams.str();
62 
63  theSummaryContents.push_back(ibooker.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  bookingdone = true;
69 
70  LogVerbatim("DTDQM|DTMonitorClient|DTSummaryClients")
71  << "[DTSummaryClients]: End of LS transition, performing the DQM client operation" << endl;
72 
73  // reset the monitor elements
76  for (int ii = 0; ii != 5; ++ii) {
77  theSummaryContents[ii]->Reset();
78  }
79 
80  bool noDTData = false;
81 
82  // Check if DT data in each ROS have been read out and set the SummaryContents and the ErrorSummary
83  // accordignly
84  MonitorElement* dataIntegritySummary = igetter.get("DT/00-DataIntegrity/DataIntegritySummary");
85  if (dataIntegritySummary != nullptr) {
86  int nDisabledFED = 0;
87  for (int wheel = 1; wheel != 6; ++wheel) { // loop over the wheels
88  int nDisablesROS = 0;
89  for (int sect = 1; sect != 13; ++sect) { // loop over sectors
90  if (dataIntegritySummary->getBinContent(sect, wheel) == 0) {
91  nDisablesROS++;
92  }
93  }
94  if (nDisablesROS == 12) {
95  nDisabledFED++;
96  theSummaryContents[wheel - 1]->Fill(0);
97  }
98  }
99 
100  if (nDisabledFED == 5) {
101  noDTData = true;
102  summaryReport->Fill(-1);
103  }
104 
105  } else {
106  LogVerbatim("DTDQM|DTMonitorClient|DTSummaryClients")
107  << "Data Integrity Summary not found with name: DT/00-DataIntegrity/DataIntegritySummary" << endl;
108  }
109 
110  double totalStatus = 0;
111  // protection
112  bool occupancyFound = true;
113 
114  // Fill the map using, at the moment, only the information from DT occupancy
115  // problems at a granularity smaller than the chamber are ignored
116  for (int wheel = -2; wheel <= 2; wheel++) { // loop over wheels
117  // retrieve the occupancy summary
118  stringstream str;
119  str << "DT/01-Digi/OccupancySummary_W" << wheel;
120  MonitorElement* wheelOccupancySummary = igetter.get(str.str());
121  if (wheelOccupancySummary != nullptr) {
122  int nFailingChambers = 0;
123  for (int sector = 1; sector <= 12; sector++) { // loop over sectors
124  for (int station = 1; station != 5; ++station) { // loop over stations
125  double chamberStatus = wheelOccupancySummary->getBinContent(sector, station);
126  LogTrace("DTDQM|DTMonitorClient|DTSummaryClients")
127  << "Wheel: " << wheel << " Stat: " << station << " Sect: " << sector << " status: " << chamberStatus
128  << endl;
129  if (chamberStatus != 4) {
130  summaryReportMap->Fill(sector, wheel, 0.25);
131  } else {
132  nFailingChambers++;
133  }
134  LogTrace("DTDQM|DTMonitorClient|DTSummaryClients")
135  << " sector (" << sector
136  << ") status on the map is: " << summaryReportMap->getBinContent(sector, wheel + 3) << endl;
137  }
138  }
139  theSummaryContents[wheel + 2]->Fill((48. - nFailingChambers) / 48.);
140  totalStatus += (48. - nFailingChambers) / 48.;
141  } else {
142  occupancyFound = false;
143  LogVerbatim("DTDQM|DTMonitorClient|DTSummaryClients")
144  << " Wheel Occupancy Summary not found with name: " << str.str() << endl;
145  }
146  }
147 
148  if (occupancyFound && !noDTData)
149  summaryReport->Fill(totalStatus / 5.);
150 }
cmsHarvester.nevents
nevents
Definition: cmsHarvester.py:3177
MessageLogger.h
DTSummaryClients::summaryReportMap
MonitorElement * summaryReportMap
Definition: DTSummaryClients.h:53
dqm::implementation::IBooker::bookFloat
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:80
DTSummaryClients::nevents
int nevents
Definition: DTSummaryClients.h:50
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
DTSummaryClients::dqmEndJob
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
Definition: DTSummaryClients.cc:35
relativeConstraints.station
station
Definition: relativeConstraints.py:67
edm
HLT enums.
Definition: AlignableModifier.h:19
DTSummaryClients::~DTSummaryClients
~DTSummaryClients() override
Destructor.
Definition: DTSummaryClients.cc:31
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
DQMStore.h
dqm::legacy::MonitorElement
Definition: MonitorElement.h:462
DTSummaryClients::theSummaryContents
std::vector< MonitorElement * > theSummaryContents
Definition: DTSummaryClients.h:54
DTSummaryClients::summaryReport
MonitorElement * summaryReport
Definition: DTSummaryClients.h:52
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
dqm::impl::MonitorElement::Reset
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
Definition: MonitorElement.cc:354
str
#define str(s)
Definition: TestProcessor.cc:52
HLT_Fake1_cff.streams
streams
Definition: HLT_Fake1_cff.py:13
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
makeMuonMisalignmentScenario.wheel
wheel
Definition: makeMuonMisalignmentScenario.py:319
edm::EventSetup
Definition: EventSetup.h:58
DTSummaryClients::DTSummaryClients
DTSummaryClients(const edm::ParameterSet &ps)
Constructor.
Definition: DTSummaryClients.cc:25
DTSummaryClients.h
DTSummaryClients::bookingdone
bool bookingdone
Definition: DTSummaryClients.h:56
std
Definition: JetResolutionObject.h:76
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
dqm::implementation::IGetter
Definition: DQMStore.h:484
dqm::implementation::IBooker::book2D
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:177
dqm::implementation::IGetter::get
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:651
EventSetup.h
dqm::implementation::IBooker
Definition: DQMStore.h:43
DTSummaryClients::dqmEndLuminosityBlock
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: DTSummaryClients.cc:39
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
ParameterSet.h
dqm::impl::MonitorElement::setAxisTitle
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
Definition: MonitorElement.cc:800
dqm::impl::MonitorElement::getBinContent
virtual double getBinContent(int binx) const
get content of bin (1-D)
Definition: MonitorElement.cc:592
cuy.ii
ii
Definition: cuy.py:590