CMS 3D CMS Logo

DQMFEDIntegrityClient.cc
Go to the documentation of this file.
1 
2 /*
3  * \file DQMFEDIntegrityClient.cc
4  * \author M. Marienfeld
5  * Last Update:
6  *
7  * Description: Summing up FED entries from all subdetectors.
8  *
9 */
10 
11 #include "DQMFEDIntegrityClient.h"
13 
14 // -----------------------------
15 // constructors and destructor
16 // -----------------------------
17 
19  parameters_ = ps;
20  initialize();
21  fillInEventloop = ps.getUntrackedParameter<bool>("fillInEventloop", false);
22  fillOnEndRun = ps.getUntrackedParameter<bool>("fillOnEndRun", false);
23  fillOnEndJob = ps.getUntrackedParameter<bool>("fillOnEndJob", false);
24  fillOnEndLumi = ps.getUntrackedParameter<bool>("fillOnEndLumi", true);
25  moduleName = ps.getUntrackedParameter<std::string>("moduleName", "FED");
26  fedFolderName = ps.getUntrackedParameter<std::string>("fedFolderName", "FEDIntegrity");
27 }
28 
30 
32  // get back-end interface
33  dbe_ = edm::Service<DQMStore>().operator->();
34 }
35 
37  NBINS = 850;
38  XMIN = 0.;
39  XMAX = 850.;
40 
41  dbe_ = edm::Service<DQMStore>().operator->();
42 
43  // ----------------------------------------------------------------------------------
44  std::string currentFolder = moduleName + "/" + fedFolderName;
45  dbe_->setCurrentFolder(currentFolder);
46 
47  FedEntries = dbe_->book1D("FedEntries", "FED Entries", NBINS, XMIN, XMAX);
48  FedFatal = dbe_->book1D("FedFatal", "FED Fatal Errors", NBINS, XMIN, XMAX);
49  FedNonFatal = dbe_->book1D("FedNonFatal", "FED Non Fatal Errors", NBINS, XMIN, XMAX);
50 
51  FedEntries->setAxisTitle("", 1);
52  FedFatal->setAxisTitle("", 1);
53  FedNonFatal->setAxisTitle("", 1);
54 
55  FedEntries->setAxisTitle("", 2);
56  FedFatal->setAxisTitle("", 2);
57  FedNonFatal->setAxisTitle("", 2);
58 
59  FedEntries->setBinLabel(11, "PIXEL", 1);
60  FedEntries->setBinLabel(221, "SIST", 1);
61  FedEntries->setBinLabel(606, "EE", 1);
62  FedEntries->setBinLabel(628, "EB", 1);
63  FedEntries->setBinLabel(651, "EE", 1);
64  FedEntries->setBinLabel(550, "ES", 1);
65  FedEntries->setBinLabel(716, "HCAL", 1);
66  FedEntries->setBinLabel(754, "CSC", 1);
67  FedEntries->setBinLabel(772, "DT", 1);
68  FedEntries->setBinLabel(791, "RPC", 1);
69  FedEntries->setBinLabel(804, "L1T", 1);
70 
71  FedFatal->setBinLabel(11, "PIXEL", 1);
72  FedFatal->setBinLabel(221, "SIST", 1);
73  FedFatal->setBinLabel(606, "EE", 1);
74  FedFatal->setBinLabel(628, "EB", 1);
75  FedFatal->setBinLabel(651, "EE", 1);
76  FedFatal->setBinLabel(550, "ES", 1);
77  FedFatal->setBinLabel(716, "HCAL", 1);
78  FedFatal->setBinLabel(754, "CSC", 1);
79  FedFatal->setBinLabel(772, "DT", 1);
80  FedFatal->setBinLabel(791, "RPC", 1);
81  FedFatal->setBinLabel(804, "L1T", 1);
82 
83  FedNonFatal->setBinLabel(11, "PIXEL", 1);
84  FedNonFatal->setBinLabel(221, "SIST", 1);
85  FedNonFatal->setBinLabel(606, "EE", 1);
86  FedNonFatal->setBinLabel(628, "EB", 1);
87  FedNonFatal->setBinLabel(651, "EE", 1);
88  FedNonFatal->setBinLabel(550, "ES", 1);
89  FedNonFatal->setBinLabel(716, "HCAL", 1);
90  FedNonFatal->setBinLabel(754, "CSC", 1);
91  FedNonFatal->setBinLabel(772, "DT", 1);
92  FedNonFatal->setBinLabel(791, "RPC", 1);
93  FedNonFatal->setBinLabel(804, "L1T", 1);
94 
95  //-----------------------------------------------------------------------------------
96  currentFolder = moduleName + "/EventInfo";
97  dbe_->setCurrentFolder(currentFolder);
98 
99  reportSummary = dbe_->bookFloat("reportSummary");
100 
101  int nSubsystems = 10;
102 
103  if (reportSummary)
104  reportSummary->Fill(1.);
105 
106  currentFolder = moduleName + "/EventInfo/reportSummaryContents";
107  dbe_->setCurrentFolder(currentFolder);
108 
109  reportSummaryContent[0] = dbe_->bookFloat("CSC FEDs");
110  reportSummaryContent[1] = dbe_->bookFloat("DT FEDs");
111  reportSummaryContent[2] = dbe_->bookFloat("EB FEDs");
112  reportSummaryContent[3] = dbe_->bookFloat("EE FEDs");
113  reportSummaryContent[4] = dbe_->bookFloat("ES FEDs");
114  reportSummaryContent[5] = dbe_->bookFloat("Hcal FEDs");
115  reportSummaryContent[6] = dbe_->bookFloat("L1T FEDs");
116  reportSummaryContent[7] = dbe_->bookFloat("Pixel FEDs");
117  reportSummaryContent[8] = dbe_->bookFloat("RPC FEDs");
118  reportSummaryContent[9] = dbe_->bookFloat("SiStrip FEDs");
119 
120  // initialize reportSummaryContents to 1
121  for (int i = 0; i < nSubsystems; ++i) {
122  SummaryContent[i] = 1.;
124  }
125 
126  currentFolder = moduleName + "/EventInfo";
127  dbe_->setCurrentFolder(currentFolder);
128 
129  reportSummaryMap = dbe_->book2D("reportSummaryMap", "FED Report Summary Map", 1, 1, 2, 10, 1, 11);
130 
133 
134  reportSummaryMap->setBinLabel(1, " ", 1);
135  reportSummaryMap->setBinLabel(10, "CSC", 2);
136  reportSummaryMap->setBinLabel(9, "DT", 2);
137  reportSummaryMap->setBinLabel(8, "EB", 2);
138  reportSummaryMap->setBinLabel(7, "EE", 2);
139  reportSummaryMap->setBinLabel(6, "ES", 2);
140  reportSummaryMap->setBinLabel(5, "Hcal", 2);
141  reportSummaryMap->setBinLabel(4, "L1T", 2);
142  reportSummaryMap->setBinLabel(3, "Pixel", 2);
143  reportSummaryMap->setBinLabel(2, "RPC", 2);
144  reportSummaryMap->setBinLabel(1, "SiStrip", 2);
145 }
146 
148 
150  if (fillInEventloop)
151  fillHistograms();
152 }
153 
155  if (fillOnEndLumi)
156  fillHistograms();
157 }
158 
160  // FED Entries
161 
162  std::vector<std::string> entries;
163  entries.push_back("CSC/" + fedFolderName + "/FEDEntries");
164  entries.push_back("DT/" + fedFolderName + "/FEDEntries");
165  entries.push_back("EcalBarrel/" + fedFolderName + "/FEDEntries");
166  entries.push_back("EcalEndcap/" + fedFolderName + "/FEDEntries");
167  entries.push_back("EcalPreshower/" + fedFolderName + "/FEDEntries");
168  entries.push_back("Hcal/" + fedFolderName + "/FEDEntries");
169  entries.push_back("L1T/" + fedFolderName + "/FEDEntries");
170  entries.push_back("Pixel/" + fedFolderName + "/FEDEntries");
171  entries.push_back("RPC/" + fedFolderName + "/FEDEntries");
172  entries.push_back("SiStrip/" + fedFolderName + "/FEDEntries");
173 
174  for (auto ent = entries.begin(); ent != entries.end(); ++ent) {
175  if (!(dbe_->get(*ent))) {
176  // cout << ">> Endluminosity No histogram! <<" << endl;
177  continue;
178  }
179 
180  MonitorElement* me = dbe_->get(*ent);
181 
182  if (TH1F* rootHisto = me->getTH1F()) {
183  int Nbins = me->getNbinsX();
184  float entry = 0.;
185  int xmin = (int)rootHisto->GetXaxis()->GetXmin();
186  if (*ent == "L1T/" + fedFolderName + "/FEDEntries")
187  xmin = xmin + 800;
188 
189  for (int bin = 1; bin <= Nbins; ++bin) {
190  int id = xmin + bin;
191  entry = rootHisto->GetBinContent(bin);
192  if (entry > 0.)
194  }
195  }
196  }
197 
198  // FED Fatal
199 
200  int nSubsystems = 10;
201 
202  std::vector<std::string> fatal;
203  fatal.push_back("CSC/" + fedFolderName + "/FEDFatal");
204  fatal.push_back("DT/" + fedFolderName + "/FEDFatal");
205  fatal.push_back("EcalBarrel/" + fedFolderName + "/FEDFatal");
206  fatal.push_back("EcalEndcap/" + fedFolderName + "/FEDFatal");
207  fatal.push_back("EcalPreshower/" + fedFolderName + "/FEDFatal");
208  fatal.push_back("Hcal/" + fedFolderName + "/FEDFatal");
209  fatal.push_back("L1T/" + fedFolderName + "/FEDFatal");
210  fatal.push_back("Pixel/" + fedFolderName + "/FEDFatal");
211  fatal.push_back("RPC/" + fedFolderName + "/FEDFatal");
212  fatal.push_back("SiStrip/" + fedFolderName + "/FEDFatal");
213 
214  int k = 0, count = 0;
215 
216  float sum = 0.;
217 
218  auto ent = entries.begin();
219  for (auto fat = fatal.begin(); fat != fatal.end(); ++fat) {
220  if (!(dbe_->get(*fat))) {
221  // cout << ">> No histogram! <<" << endl;
223  reportSummaryMap->setBinContent(1, nSubsystems - k, -1);
224  k++;
225  ent++;
226  continue;
227  }
228 
229  MonitorElement* me = dbe_->get(*fat);
230  MonitorElement* meNorm = dbe_->get(*ent);
231  // cout << "Path : " << me->getFullname() << endl;
232 
233  float entry = 0.;
234  float norm = 0.;
235 
236  if (TH1F* rootHisto = me->getTH1F()) {
237  if (TH1F* rootHistoNorm = meNorm->getTH1F()) {
238  int Nbins = me->getNbinsX();
239  int xmin = (int)rootHisto->GetXaxis()->GetXmin();
240  if (*fat == "L1T/" + fedFolderName + "/FEDFatal")
241  xmin = xmin + 800;
242  // int xmax = (int)rootHisto->GetXaxis()->GetXmax();
243  // if (*fat == "L1T/" + fedFolderName + "/FEDFatal")
244  // xmax = xmax + 800;
245  // cout << "FED ID range : " << xmin << " - " << xmax << endl;
246 
247  float binentry = 0.;
248  for (int bin = 1; bin <= Nbins; ++bin) {
249  int id = xmin + bin;
250  binentry = rootHisto->GetBinContent(bin);
251  entry += binentry;
252  norm += rootHistoNorm->GetBinContent(bin);
253  // cout << *fat << "errors = " << entry << "\tnorm = " << norm << endl;
254  // cout << "Bin content : " << entry << endl;
255  FedFatal->setBinContent(id, binentry);
256  }
257  }
258  }
259 
260  if (norm > 0)
261  SummaryContent[k] = 1.0 - entry / norm;
262  // cout << "Summary Content : " << SummaryContent[k] << endl;
264  if ((k == 2 || k == 3) // for EE and EB only show yellow when more than 1% errors.
265  && SummaryContent[k] >= 0.95 && SummaryContent[k] < 0.99)
266  SummaryContent[k] = 0.949;
267  reportSummaryMap->setBinContent(1, nSubsystems - k, SummaryContent[k]);
268  sum = sum + SummaryContent[k];
269 
270  k++;
271  ent++;
272  count++;
273  }
274 
275  if (count > 0)
276  reportSummary->Fill(sum / (float)count);
277 
278  // FED Non Fatal
279 
280  std::vector<std::string> nonfatal;
281  nonfatal.push_back("CSC/" + fedFolderName + "/FEDNonFatal");
282  nonfatal.push_back("DT/" + fedFolderName + "/FEDNonFatal");
283  nonfatal.push_back("EcalBarrel/" + fedFolderName + "/FEDNonFatal");
284  nonfatal.push_back("EcalEndcap/" + fedFolderName + "/FEDNonFatal");
285  nonfatal.push_back("EcalPreshower/" + fedFolderName + "/FEDNonFatal");
286  nonfatal.push_back("Hcal/" + fedFolderName + "/FEDNonFatal");
287  nonfatal.push_back("L1T/" + fedFolderName + "/FEDNonFatal");
288  nonfatal.push_back("Pixel/" + fedFolderName + "/FEDNonFatal");
289  nonfatal.push_back("RPC/" + fedFolderName + "/FEDNonFatal");
290  nonfatal.push_back("SiStrip/" + fedFolderName + "/FEDNonFatal");
291 
292  for (auto non = nonfatal.begin(); non != nonfatal.end(); ++non) {
293  if (!(dbe_->get(*non))) {
294  // cout << ">> No histogram! <<" << endl;
295  continue;
296  }
297 
298  MonitorElement* me = dbe_->get(*non);
299 
300  if (TH1F* rootHisto = me->getTH1F()) {
301  int Nbins = me->getNbinsX();
302  float entry = 0.;
303  int xmin = (int)rootHisto->GetXaxis()->GetXmin();
304  if (*non == "L1T/" + fedFolderName + "/FEDNonFatal")
305  xmin = xmin + 800;
306 
307  for (int bin = 1; bin <= Nbins; ++bin) {
308  int id = xmin + bin;
309  entry = rootHisto->GetBinContent(bin);
310  if (entry > 0.)
312  }
313  }
314  }
315 }
316 
318  if (fillOnEndRun)
319  fillHistograms();
320 }
321 
323  if (fillOnEndJob)
324  fillHistograms();
325 }
DQMFEDIntegrityClient::reportSummaryContent
MonitorElement * reportSummaryContent[10]
Definition: DQMFEDIntegrityClient.h:63
DQMFEDIntegrityClient::endJob
void endJob() override
Definition: DQMFEDIntegrityClient.cc:322
mps_fire.i
i
Definition: mps_fire.py:428
DQMFEDIntegrityClient::beginRun
void beginRun(const edm::Run &r, const edm::EventSetup &c) override
Definition: DQMFEDIntegrityClient.cc:147
dqm::implementation::IBooker::bookFloat
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:80
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
edm::Run
Definition: Run.h:45
mps_splice.entry
entry
Definition: mps_splice.py:68
DQMFEDIntegrityClient.h
DQMFEDIntegrityClient::fillOnEndLumi
bool fillOnEndLumi
Definition: DQMFEDIntegrityClient.h:69
DQMFEDIntegrityClient::XMIN
float XMIN
Definition: DQMFEDIntegrityClient.h:55
dqm::legacy::MonitorElement
Definition: MonitorElement.h:462
DQMFEDIntegrityClient::beginJob
void beginJob() override
Definition: DQMFEDIntegrityClient.cc:36
DQMFEDIntegrityClient::FedNonFatal
MonitorElement * FedNonFatal
Definition: DQMFEDIntegrityClient.h:60
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
dqm::legacy::MonitorElement::getTH1F
virtual TH1F * getTH1F() const
Definition: MonitorElement.h:479
DQMFEDIntegrityClient::fillInEventloop
bool fillInEventloop
Definition: DQMFEDIntegrityClient.h:66
visDQMUpload.context
context
Definition: visDQMUpload.py:37
DQMFEDIntegrityClient::FedFatal
MonitorElement * FedFatal
Definition: DQMFEDIntegrityClient.h:59
Service.h
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
DQMFEDIntegrityClient::DQMFEDIntegrityClient
DQMFEDIntegrityClient(const edm::ParameterSet &)
Definition: DQMFEDIntegrityClient.cc:18
submitPVResolutionJobs.count
count
Definition: submitPVResolutionJobs.py:352
dqm::implementation::DQMStore::setCurrentFolder
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:569
dqmdumpme.k
k
Definition: dqmdumpme.py:60
DQMFEDIntegrityClient::NBINS
int NBINS
Definition: DQMFEDIntegrityClient.h:54
edm::ParameterSet
Definition: ParameterSet.h:47
DQMFEDIntegrityClient::SummaryContent
float SummaryContent[10]
Definition: DQMFEDIntegrityClient.h:56
SiStripMonitorCluster_cfi.Nbins
Nbins
Definition: SiStripMonitorCluster_cfi.py:32
DQMFEDIntegrityClient::fillOnEndRun
bool fillOnEndRun
Definition: DQMFEDIntegrityClient.h:67
edm::Service
Definition: Service.h:30
createfilelist.int
int
Definition: createfilelist.py:10
DQMFEDIntegrityClient::parameters_
edm::ParameterSet parameters_
Definition: DQMFEDIntegrityClient.h:48
dqm::impl::MonitorElement::setBinLabel
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
Definition: MonitorElement.cc:771
DQMFEDIntegrityClient::fedFolderName
std::string fedFolderName
Definition: DQMFEDIntegrityClient.h:71
edm::EventSetup
Definition: EventSetup.h:58
DQMFEDIntegrityClient::FedEntries
MonitorElement * FedEntries
Definition: DQMFEDIntegrityClient.h:58
DQMFEDIntegrityClient::endRun
void endRun(const edm::Run &r, const edm::EventSetup &c) override
Definition: DQMFEDIntegrityClient.cc:317
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DQMFEDIntegrityClient::reportSummary
MonitorElement * reportSummary
Definition: DQMFEDIntegrityClient.h:62
DQMFEDIntegrityClient::fillOnEndJob
bool fillOnEndJob
Definition: DQMFEDIntegrityClient.h:68
alignCSCRings.r
r
Definition: alignCSCRings.py:93
newFWLiteAna.bin
bin
Definition: newFWLiteAna.py:161
dqm::impl::MonitorElement::setBinContent
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
Definition: MonitorElement.cc:691
DQMFEDIntegrityClient::analyze
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Analyze.
Definition: DQMFEDIntegrityClient.cc:149
DQMFEDIntegrityClient::~DQMFEDIntegrityClient
~DQMFEDIntegrityClient() override
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
DQMFEDIntegrityClient::reportSummaryMap
MonitorElement * reportSummaryMap
Definition: DQMFEDIntegrityClient.h:64
DQMFEDIntegrityClient::XMAX
float XMAX
Definition: DQMFEDIntegrityClient.h:55
dqm::implementation::IGetter::get
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:673
DQMFEDIntegrityClient::endLuminosityBlock
void endLuminosityBlock(const edm::LuminosityBlock &l, const edm::EventSetup &c) override
Definition: DQMFEDIntegrityClient.cc:154
DQMFEDIntegrityClient::dbe_
DQMStore * dbe_
Definition: DQMFEDIntegrityClient.h:50
TrackerOfflineValidation_Dqm_cff.xmin
xmin
Definition: TrackerOfflineValidation_Dqm_cff.py:10
hlt_dqm_clientPB-live_cfg.me
me
Definition: hlt_dqm_clientPB-live_cfg.py:61
edm::Event
Definition: Event.h:73
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
DQMFEDIntegrityClient::initialize
void initialize()
Definition: DQMFEDIntegrityClient.cc:31
DQMFEDIntegrityClient::fillHistograms
void fillHistograms()
Definition: DQMFEDIntegrityClient.cc:159
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
DQMFEDIntegrityClient::moduleName
std::string moduleName
Definition: DQMFEDIntegrityClient.h:70
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37