CMS 3D CMS Logo

CommissioningHistograms.cc
Go to the documentation of this file.
9 #include <iomanip>
10 
11 using namespace std;
12 using namespace sistrip;
13 
14 // -----------------------------------------------------------------------------
17  DQMStore* bei,
18  const sistrip::RunType& task)
19  : factory_(nullptr),
20  task_(task),
21  bei_(bei),
22  data_(),
23  histos_(),
24  pset_(pset),
25  mask_(pset.existsAs<bool>("vetoModules") ? pset.getParameter<bool>("vetoModules") : true),
26  fedMaskVector_(pset.existsAs<std::vector<uint32_t> >("fedMaskVector")
27  ? pset.getParameter<std::vector<uint32_t> >("fedMaskVector")
28  : std::vector<uint32_t>()),
29  fecMaskVector_(pset.existsAs<std::vector<uint32_t> >("fecMaskVector")
30  ? pset.getParameter<std::vector<uint32_t> >("fecMaskVector")
31  : std::vector<uint32_t>()),
32  ringVector_(pset.existsAs<std::vector<uint32_t> >("ringVector")
33  ? pset.getParameter<std::vector<uint32_t> >("ringVector")
34  : std::vector<uint32_t>()),
35  ccuVector_(pset.existsAs<std::vector<uint32_t> >("ccuVector")
36  ? pset.getParameter<std::vector<uint32_t> >("ccuVector")
37  : std::vector<uint32_t>()),
38  i2cChanVector_(pset.existsAs<std::vector<uint32_t> >("i2cChanVector")
39  ? pset.getParameter<std::vector<uint32_t> >("i2cChanVector")
40  : std::vector<uint32_t>()),
41  lldChanVector_(pset.existsAs<std::vector<uint32_t> >("lldChanVector")
42  ? pset.getParameter<std::vector<uint32_t> >("lldChanVector")
43  : std::vector<uint32_t>()),
44  dataWithMask_(),
45  dataWithMaskCached_(false) {
46  LogTrace(mlDqmClient_) << "[" << __PRETTY_FUNCTION__ << "]"
47  << " Constructing object...";
48 
49  // DQMStore
50  if (!bei_) {
51  edm::LogError(mlDqmClient_) << "[CommissioningHistograms::" << __func__ << "]"
52  << " NULL pointer to DQMStore!";
53  }
54 
56 }
57 
58 // -----------------------------------------------------------------------------
61  : factory_(nullptr),
63  bei_(nullptr),
64  data_(),
65  histos_(),
66  mask_(true),
67  dataWithMask_(),
68  dataWithMaskCached_(false) {
69  LogTrace(mlDqmClient_) << "[" << __PRETTY_FUNCTION__ << "]"
70  << " Constructing object...";
71 }
72 
73 // -----------------------------------------------------------------------------
76  LogTrace(mlDqmClient_) << "[" << __PRETTY_FUNCTION__ << "]"
77  << " Destructing object...";
79  //@@ do not delete BEI ptrs!
80 }
81 
82 // -----------------------------------------------------------------------------
84 void CommissioningHistograms::Histo::print(std::stringstream& ss) const {
85  ss << " [Histo::" << __func__ << "]" << std::endl
86  << " Histogram title : " << title_ << std::endl
87  << " MonitorElement* : 0x" << std::hex << std::setw(8) << std::setfill('0') << me_ << std::endl
88  << std::dec << " CollateME* : 0x" << std::hex << std::setw(8) << std::setfill('0') << cme_ << std::endl
89  << std::dec;
90 }
91 
92 // -----------------------------------------------------------------------------
93 //
94 uint32_t CommissioningHistograms::runNumber(DQMStore* const bei, const std::vector<std::string>& contents) {
95  // Check if histograms present
96  if (contents.empty()) {
97  edm::LogError(mlDqmClient_) << "[CommissioningHistograms::" << __func__ << "]"
98  << " Found no histograms!";
99  return 0;
100  }
101 
102  // Iterate through added contents
103  std::vector<std::string>::const_iterator istr = contents.begin();
104  while (istr != contents.end()) {
105  // Extract source directory path
106  std::string source_dir = istr->substr(0, istr->find(":"));
107 
108  // Generate corresponding client path (removing trailing "/")
109  SiStripFecKey path(source_dir);
110  std::string client_dir = path.path();
111  std::string slash = client_dir.substr(client_dir.size() - 1, 1);
112  if (slash == sistrip::dir_) {
113  client_dir = client_dir.substr(0, client_dir.size() - 1);
114  }
115  client_dir = std::string(sistrip::collate_) + sistrip::dir_ + client_dir;
116 
117  // Iterate though MonitorElements from source directory
118  std::vector<MonitorElement*> me_list = bei->getContents(source_dir);
119  std::vector<MonitorElement*>::iterator ime = me_list.begin();
120  for (; ime != me_list.end(); ime++) {
121  if (!(*ime)) {
122  edm::LogError(mlDqmClient_) << "[CommissioningHistograms::" << __func__ << "]"
123  << " NULL pointer to MonitorElement!";
124  continue;
125  }
126 
127  // Search for run type in string
128  std::string title = (*ime)->getName();
130 
131  // Extract run number from string
132  if (pos != std::string::npos) {
133  std::string value = title.substr(pos + sizeof(sistrip::runNumber_), std::string::npos);
134  if (!value.empty()) {
135  LogTrace(mlDqmClient_) << "[CommissioningHistograms::" << __func__ << "]"
136  << " Found string \"" << title.substr(pos, std::string::npos) << "\" with value \""
137  << value << "\"";
138  if (!(bei->get(client_dir + "/" + title.substr(pos, std::string::npos)))) {
139  bei->setCurrentFolder(client_dir);
140  bei->bookString(title.substr(pos, std::string::npos), value);
141  LogTrace(mlDqmClient_) << "[CommissioningHistograms::" << __func__ << "]"
142  << " Booked string \"" << title.substr(pos, std::string::npos)
143  << "\" in directory \"" << client_dir << "\"";
144  }
145  uint32_t run;
146  std::stringstream ss;
147  ss << value;
148  ss >> std::dec >> run;
149  return run;
150  }
151  }
152  }
153 
154  istr++;
155  }
156  return 0;
157 }
158 
159 // -----------------------------------------------------------------------------
161 sistrip::RunType CommissioningHistograms::runType(DQMStore* const bei, const std::vector<std::string>& contents) {
162  // Check if histograms present
163  if (contents.empty()) {
164  edm::LogError(mlDqmClient_) << "[CommissioningHistograms::" << __func__ << "]"
165  << " Found no histograms!";
167  }
168 
169  // Iterate through added contents
170  std::vector<std::string>::const_iterator istr = contents.begin();
171  while (istr != contents.end()) {
172  // Extract source directory path
173  std::string source_dir = istr->substr(0, istr->find(":"));
174 
175  // Generate corresponding client path (removing trailing "/")
176  SiStripFecKey path(source_dir);
177  std::string client_dir = path.path();
178  std::string slash = client_dir.substr(client_dir.size() - 1, 1);
179  if (slash == sistrip::dir_) {
180  client_dir = client_dir.substr(0, client_dir.size() - 1);
181  }
182  client_dir = std::string(sistrip::collate_) + sistrip::dir_ + client_dir;
183 
184  // Iterate though MonitorElements from source directory
185  std::vector<MonitorElement*> me_list = bei->getContents(source_dir);
186 
187  if (me_list.empty()) {
188  edm::LogError(mlDqmClient_) << "[CommissioningHistograms::" << __func__ << "]"
189  << " No MonitorElements found in dir " << source_dir;
191  }
192 
193  std::vector<MonitorElement*>::iterator ime = me_list.begin();
194  for (; ime != me_list.end(); ime++) {
195  if (!(*ime)) {
196  edm::LogError(mlDqmClient_) << "[CommissioningHistograms::" << __func__ << "]"
197  << " NULL pointer to MonitorElement!";
198  continue;
199  }
200 
201  // Search for run type in string
202  std::string title = (*ime)->getName();
204 
205  // Extract commissioning task from string
206  if (pos != std::string::npos) {
207  std::string value = title.substr(pos + sizeof(sistrip::taskId_), std::string::npos);
208  if (!value.empty()) {
209  LogTrace(mlDqmClient_) << "[CommissioningHistograms::" << __func__ << "]"
210  << " Found string \"" << title.substr(pos, std::string::npos) << "\" with value \""
211  << value << "\"";
212  if (!(bei->get(client_dir + sistrip::dir_ + title.substr(pos, std::string::npos)))) {
213  bei->setCurrentFolder(client_dir);
214  bei->bookString(title.substr(pos, std::string::npos), value);
215  LogTrace(mlDqmClient_) << "[CommissioningHistograms::" << __func__ << "]"
216  << " Booked string \"" << title.substr(pos, std::string::npos)
217  << "\" in directory \"" << client_dir << "\"";
218  }
220  }
221  }
222  }
223 
224  istr++;
225  }
226 
227  edm::LogError(mlDqmClient_) << "[CommissioningHistograms::" << __func__ << "]"
228  << " Unable to extract RunType!";
230 }
231 
232 // -----------------------------------------------------------------------------
233 //
234 void CommissioningHistograms::copyCustomInformation(DQMStore* const bei, const std::vector<std::string>& contents) {
235  // Check if histograms present
236  if (contents.empty()) {
237  edm::LogWarning(mlDqmClient_) << "[CommissioningHistograms::" << __func__ << "]"
238  << " Found no histograms!";
239  return;
240  }
241 
242  // Iterate through added contents
243  std::vector<std::string>::const_iterator istr = contents.begin();
244  while (istr != contents.end()) {
245  // Extract source directory path
246  std::string source_dir = istr->substr(0, istr->find(":"));
247 
248  // Generate corresponding client path (removing trailing "/")
249  SiStripFecKey path(source_dir);
250  std::string client_dir = path.path();
251  std::string slash = client_dir.substr(client_dir.size() - 1, 1);
252  if (slash == sistrip::dir_) {
253  client_dir = client_dir.substr(0, client_dir.size() - 1);
254  }
255 
256  // Iterate though MonitorElements from source directory
257  std::vector<MonitorElement*> me_list = bei->getContents(source_dir);
258  std::vector<MonitorElement*>::iterator ime = me_list.begin();
259  for (; ime != me_list.end(); ime++) {
260  if (!(*ime)) {
261  edm::LogWarning(mlDqmClient_) << "[CommissioningHistograms::" << __func__ << "]"
262  << " NULL pointer to MonitorElement!";
263  continue;
264  }
265  // Search for calchan, isha or vfs
266  if ((*ime)->kind() == MonitorElement::Kind::INT) {
267  std::string title = (*ime)->getName();
268  std::string::size_type pos = title.find("calchan");
269  if (pos == std::string::npos)
270  pos = title.find("isha");
271  if (pos == std::string::npos)
272  pos = title.find("vfs");
273  if (pos != std::string::npos) {
274  int value = (*ime)->getIntValue();
275  if (value >= 0) {
277  << "[CommissioningHistograms::" << __func__ << "]"
278  << " Found \"" << title.substr(pos, std::string::npos) << "\" with value \"" << value << "\"";
279  if (!(bei->get(client_dir + "/" + title.substr(pos, std::string::npos)))) {
280  bei->setCurrentFolder(client_dir);
281  bei->bookInt(title.substr(pos, std::string::npos))->Fill(value);
283  << "[CommissioningHistograms::" << __func__ << "]"
284  << " Booked \"" << title.substr(pos, std::string::npos) << "\" in directory \"" << client_dir << "\"";
285  }
286  }
287  }
288  }
289  }
290  istr++;
291  }
292 }
293 
294 // -----------------------------------------------------------------------------
295 
297 void CommissioningHistograms::extractHistograms(const std::vector<std::string>& contents) {
298  LogTrace(mlDqmClient_) << "[CommissioningHistograms::" << __func__ << "]"
299  << " Extracting available histograms...";
300 
301  // Check pointer
302  if (!bei_) {
303  edm::LogError(mlDqmClient_) << "[CommissioningHistograms::" << __func__ << "]"
304  << " NULL pointer to DQMStore!";
305  return;
306  }
307 
308  // Check list of histograms
309  if (contents.empty()) {
310  edm::LogError(mlDqmClient_) << "[CommissioningHistograms::" << __func__ << "]"
311  << " Empty contents vector!";
312  return;
313  }
314 
315  // Iterate through list of histograms
316  std::vector<std::string>::const_iterator idir;
317  for (idir = contents.begin(); idir != contents.end(); idir++) {
318  // Ignore "DQM source" directories if looking in client file
319  if (idir->find(sistrip::collate_) == std::string::npos) {
320  continue;
321  }
322 
323  // Extract source directory path
324  std::string source_dir = idir->substr(0, idir->find(":"));
325 
326  // Extract view and create key
327  sistrip::View view = SiStripEnumsAndStrings::view(source_dir);
329  if (view == sistrip::CONTROL_VIEW) {
330  path = SiStripFecKey(source_dir);
331  } else if (view == sistrip::READOUT_VIEW) {
332  path = SiStripFedKey(source_dir);
333  } else if (view == sistrip::DETECTOR_VIEW) {
334  path = SiStripDetKey(source_dir);
335  } else {
336  path = SiStripKey();
337  }
338 
339  // Check path is valid
340  if (path.granularity() == sistrip::UNKNOWN_GRAN || path.granularity() == sistrip::UNDEFINED_GRAN) {
341  continue;
342  }
343 
344  // Generate corresponding client path (removing trailing "/")
346  if (view == sistrip::CONTROL_VIEW) {
347  client_dir = SiStripFecKey(path.key()).path();
348  } else if (view == sistrip::READOUT_VIEW) {
349  client_dir = SiStripFedKey(path.key()).path();
350  } else if (view == sistrip::DETECTOR_VIEW) {
351  client_dir = SiStripDetKey(path.key()).path();
352  } else {
353  client_dir = SiStripKey(path.key()).path();
354  }
355  std::string slash = client_dir.substr(client_dir.size() - 1, 1);
356  if (slash == sistrip::dir_) {
357  client_dir = client_dir.substr(0, client_dir.size() - 1);
358  }
359  client_dir = std::string(sistrip::collate_) + sistrip::dir_ + client_dir;
360 
361  // Retrieve MonitorElements from source directory
362  std::vector<MonitorElement*> me_list = bei_->getContents(source_dir);
363 
364  // Iterate though MonitorElements and create CMEs
365  std::vector<MonitorElement*>::iterator ime = me_list.begin();
366  for (; ime != me_list.end(); ime++) {
367  // Retrieve histogram title
368  SiStripHistoTitle title((*ime)->getName());
369 
370  // Check histogram type
371  //if ( title.histoType() != sistrip::EXPERT_HISTO ) { continue; }
372 
373  // Check granularity
374  uint16_t channel = sistrip::invalid_;
375  if (title.granularity() == sistrip::APV) {
376  channel = SiStripFecKey::lldChan(title.channel());
377  } else if (title.granularity() == sistrip::UNKNOWN_GRAN || title.granularity() == sistrip::UNDEFINED_GRAN) {
378  std::stringstream ss;
379  ss << "[CommissioningHistograms::" << __func__ << "]"
380  << " Unexpected granularity for histogram title: " << std::endl
381  << title << " found in path " << std::endl
382  << path;
383  edm::LogError(mlDqmClient_) << ss.str();
384  } else {
385  channel = title.channel();
386  }
387 
388  // Build key
389  uint32_t key = sistrip::invalid32_;
390 
391  if (view == sistrip::CONTROL_VIEW) {
392  // for all runs except cabling
393  SiStripFecKey temp(path.key());
394  key = SiStripFecKey(temp.fecCrate(), temp.fecSlot(), temp.fecRing(), temp.ccuAddr(), temp.ccuChan(), channel)
395  .key();
396  mapping_[title.keyValue()] = key;
397 
398  } else if (view == sistrip::READOUT_VIEW) {
399  // for cabling run
400  key = SiStripFedKey(path.key()).key();
406  channel)
407  .key(); // just record lld channel
408  mapping_[title.keyValue()] = temp;
409 
410  } else if (view == sistrip::DETECTOR_VIEW) {
411  SiStripDetKey temp(path.key());
412  key = SiStripDetKey(temp.partition()).key();
413  mapping_[title.keyValue()] = key;
414 
415  } else {
416  key = SiStripKey(path.key()).key();
417  }
418 
419  // Find CME in histos map
420  Histo* histo = nullptr;
421  HistosMap::iterator ihistos = histos_.find(key);
422  if (ihistos != histos_.end()) {
423  Histos::iterator ihis = ihistos->second.begin();
424  while (!histo && ihis < ihistos->second.end()) {
425  if ((*ime)->getName() == (*ihis)->title_) {
426  histo = *ihis;
427  }
428  ihis++;
429  }
430  }
431 
432  // Create CollateME if it doesn't exist
433  if (!histo) {
434  histos_[key].push_back(new Histo());
435  histo = histos_[key].back();
436  histo->title_ = (*ime)->getName();
437 
438  // If histogram present in client directory, add to map
439  if (source_dir.find(sistrip::collate_) != std::string::npos) {
440  histo->me_ = bei_->get(client_dir + "/" + (*ime)->getName());
441  if (!histo->me_) {
442  edm::LogError(mlDqmClient_) << "[CommissioningHistograms::" << __func__ << "]"
443  << " NULL pointer to MonitorElement!";
444  }
445  }
446  }
447  }
448  }
449 
450  //printHistosMap();
451 
452  edm::LogVerbatim(mlDqmClient_) << "[CommissioningHistograms::" << __func__ << "]"
453  << " Found histograms for " << histos_.size()
454  << " structures in cached histogram map!";
455 }
456 
457 // -----------------------------------------------------------------------------
460  LogTrace(mlDqmClient_) << "[CommissioningHistograms::" << __func__ << "]"
461  << " (Derived) implementation to come...";
462 }
463 
464 // -----------------------------------------------------------------------------
467  Analyses::iterator ianal = data().begin();
468  Analyses::iterator janal = data().end();
469  for (; ianal != janal; ++ianal) {
470  if (ianal->second) {
471  std::stringstream ss;
472  ianal->second->print(ss);
473  if (ianal->second->isValid()) {
474  LogTrace(mlDqmClient_) << ss.str();
475  } else {
476  edm::LogWarning(mlDqmClient_) << ss.str();
477  }
478  }
479  }
480 }
481 
482 // -----------------------------------------------------------------------------
485  std::stringstream good;
486  std::stringstream bad;
487 
488  Analyses::iterator ianal = data().begin();
489  Analyses::iterator janal = data().end();
490  for (; ianal != janal; ++ianal) {
491  if (ianal->second) {
492  if (ianal->second->isValid()) {
493  ianal->second->summary(good);
494  } else {
495  ianal->second->summary(bad);
496  }
497  }
498  }
499 
500  if (good.str().empty()) {
501  good << "None found!";
502  }
503  LogTrace(mlDqmClient_) << "[CommissioningHistograms::" << __func__ << "]"
504  << " Printing summary of good analyses:"
505  << "\n"
506  << good.str();
507 
508  if (bad.str().empty()) {
509  return;
510  } //@@ bad << "None found!"; }
511  LogTrace(mlDqmClient_) << "[CommissioningHistograms::" << __func__ << "]"
512  << " Printing summary of bad analyses:"
513  << "\n"
514  << bad.str();
515 }
516 
517 // -----------------------------------------------------------------------------
520  LogTrace(mlDqmClient_) << "[CommissioningHistograms::" << __func__ << "]"
521  << " Printing histogram map, which has " << histos_.size() << " entries...";
522  HistosMap::const_iterator ihistos = histos_.begin();
523  for (; ihistos != histos_.end(); ihistos++) {
524  std::stringstream ss;
525  ss << " Found " << ihistos->second.size() << " histogram(s) for key: " << std::endl
526  << SiStripFedKey(ihistos->first) << std::endl;
527  Histos::const_iterator ihisto = ihistos->second.begin();
528  for (; ihisto != ihistos->second.end(); ihisto++) {
529  if (*ihisto) {
530  (*ihisto)->print(ss);
531  } else {
532  ss << " NULL pointer to Histo object!";
533  }
534  }
535  LogTrace(mlDqmClient_) << ss.str();
536  }
537 }
538 
539 // -----------------------------------------------------------------------------
542  LogTrace(mlDqmClient_) << "[CommissioningHistograms::" << __func__ << "]"
543  << " Clearing histogram map...";
544  HistosMap::iterator ihistos = histos_.begin();
545  for (; ihistos != histos_.end(); ihistos++) {
546  Histos::iterator ihisto = ihistos->second.begin();
547  for (; ihisto != ihistos->second.end(); ihisto++) {
548  if (*ihisto) {
549  delete *ihisto;
550  }
551  }
552  ihistos->second.clear();
553  }
554  histos_.clear();
555 }
556 
557 // -----------------------------------------------------------------------------
560  const sistrip::Presentation& pres,
561  const std::string& dir,
562  const sistrip::Granularity& gran) {
563  LogTrace(mlDqmClient_) << "[CommissioningHistograms::" << __func__ << "]";
564 
565  // Check view
567  if (view == sistrip::UNKNOWN_VIEW) {
568  return;
569  }
570 
571  // Analyze histograms
572  if (data().empty()) {
573  histoAnalysis(false);
574  }
575 
576  // Check
577  if (data().empty()) {
578  edm::LogError(mlDqmClient_) << "[CommissioningHistograms::" << __func__ << "]"
579  << " No analyses generated!";
580  return;
581  }
582 
583  // Extract data to be histogrammed
584  uint32_t xbins = factory()->init(mon, pres, view, dir, gran, data());
585 
586  // Only create histograms if entries are found!
587  if (!xbins) {
588  return;
589  }
590 
591  // Create summary histogram (if it doesn't already exist)
592  TH1* summary = nullptr;
593  if (pres != sistrip::HISTO_1D) {
594  summary = histogram(mon, pres, view, dir, xbins);
595  } else {
597  }
598 
599  // Fill histogram with data
600  factory()->fill(*summary);
601 }
602 
603 // -----------------------------------------------------------------------------
606  // TODO: remove no longer supported in DQMStore.
607 }
608 
609 // -----------------------------------------------------------------------------
612  // Construct path and filename
613  std::stringstream ss;
614 
615  if (!path.empty()) {
616  ss << path;
617  if (ss.str().find(".root") == std::string::npos) {
618  ss << ".root";
619  }
620 
621  } else {
622  // Retrieve SCRATCH directory
623  std::string scratch = "SCRATCH";
624  std::string dir = "";
625  if (std::getenv(scratch.c_str()) != nullptr) {
626  dir = std::getenv(scratch.c_str());
627  }
628 
629  // Add directory path
630  if (!dir.empty()) {
631  ss << dir << "/";
632  } else {
633  ss << "/tmp/";
634  }
635 
636  // Add filename with run number and ".root" extension
637  if (partitionName.empty())
638  ss << sistrip::dqmClientFileName_ << "_" << std::setfill('0') << std::setw(8) << run_number << ".root";
639  else
640  ss << sistrip::dqmClientFileName_ << "_" << partitionName << "_" << std::setfill('0') << std::setw(8)
641  << run_number << ".root";
642  }
643 
644  // Save file with appropriate filename
645  LogTrace(mlDqmClient_) << "[CommissioningHistograms::" << __func__ << "]"
646  << " Saving histograms to root file"
647  << " (This may take some time!)";
648  path = ss.str();
650  edm::LogVerbatim(mlDqmClient_) << "[CommissioningHistograms::" << __func__ << "]"
651  << " Saved histograms to root file \"" << ss.str() << "\"!";
652 }
653 
654 // -----------------------------------------------------------------------------
655 //
657  const sistrip::Presentation& pres,
658  const sistrip::View& view,
659  const std::string& directory,
660  const uint32_t& xbins,
661  const float& xlow,
662  const float& xhigh) {
663  // Remember pwd
664  std::string pwd = bei_->pwd();
666 
667  // Construct histogram name
669 
670  MonitorElement* me = bei_->get(bei_->pwd() + "/" + name);
671 
672  // Create summary plot
673  float high = static_cast<float>(xbins);
674  if (pres == sistrip::HISTO_1D) {
675  if (xlow < 1. * sistrip::valid_ && xhigh < 1. * sistrip::valid_) {
676  me = bei_->book1D(name, name, xbins, xlow, xhigh);
677  } else {
678  me = bei_->book1D(name, name, xbins, 0., high);
679  }
680  } else if (pres == sistrip::HISTO_2D_SUM) {
681  me = bei_->book1D(name, name, xbins, 0., high);
682  } else if (pres == sistrip::HISTO_2D_SCATTER) {
684  } else if (pres == sistrip::PROFILE_1D) {
686  } else {
687  me = nullptr;
688  edm::LogWarning(mlDqmClient_) << "[CommissioningHistograms::" << __func__ << "]"
689  << " Unexpected presentation \"" << SiStripEnumsAndStrings::presentation(pres)
690  << "\" Unable to create summary plot!";
691  }
692 
693  // Check pointer
694  if (me) {
695  LogTrace(mlDqmClient_) << "[CommissioningHistograms::" << __func__ << "]"
696  << " Created summary plot with name \"" << me->getName() << "\" in directory \""
697  << bei_->pwd() << "\"!";
698  } else {
699  edm::LogWarning(mlDqmClient_) << "[CommissioningHistograms::" << __func__ << "]"
700  << " NULL pointer to MonitorElement!"
701  << " Unable to create summary plot!";
702  }
703 
704  // Extract root object
706  if (!summary) {
707  edm::LogWarning(mlDqmClient_) << "[CommissioningHistograms::" << __func__ << "]"
708  << " Unable to extract root object!"
709  << " Returning NULL pointer!";
710  }
711 
712  // Return to pwd
714 
715  return summary;
716 }
717 
719  if (!getMaskedData)
720  return data_;
721  else {
723  return dataWithMask_;
724  else {
725  Analyses::iterator ianal = data_.begin();
726  Analyses::iterator janal = data_.end();
727  for (; ianal != janal; ++ianal) {
728  CommissioningAnalysis* anal = ianal->second;
729  SiStripFedKey fedkey = anal->fedKey();
730  SiStripFecKey feckey = anal->fecKey();
731  bool maskThisAnal_ = false;
732  for (std::size_t i = 0; i < fedMaskVector_.size(); i++) {
733  if (fedkey.fedId() == fedMaskVector_[i])
734  maskThisAnal_ = true;
735  }
736  for (std::size_t i = 0; i < fecMaskVector_.size(); i++) {
737  if (fecMaskVector_.size() != ringVector_.size() || fecMaskVector_.size() != ccuVector_.size() ||
738  fecMaskVector_.size() != i2cChanVector_.size() || fecMaskVector_.size() != lldChanVector_.size()) {
739  continue;
740  }
741  if (feckey.fecSlot() == fecMaskVector_[i] && feckey.fecRing() == ringVector_[i] &&
742  feckey.ccuAddr() == ccuVector_[i] && feckey.ccuChan() == i2cChanVector_[i] &&
743  feckey.lldChan() == lldChanVector_[i]) {
744  maskThisAnal_ = true;
745  }
746  }
747  if (mask_ && !maskThisAnal_)
748  dataWithMask_[ianal->first] = ianal->second;
749  else if (!mask_ && maskThisAnal_)
750  dataWithMask_[ianal->first] = ianal->second;
751  }
752  dataWithMaskCached_ = true;
753  return dataWithMask_;
754  }
755  }
756 }
sistrip::Granularity
Granularity
Definition: ConstantsForGranularity.h:60
SiStripEnumsAndStrings::runType
static std::string runType(const sistrip::RunType &)
Definition: SiStripEnumsAndStrings.cc:39
CommissioningHistograms::bei_
DQMStore * bei_
Definition: CommissioningHistograms.h:134
runGCPTkAlMap.title
string title
Definition: runGCPTkAlMap.py:94
electrons_cff.bool
bool
Definition: electrons_cff.py:366
fw3dlego::xbins
const double xbins[]
Definition: fw3dlego_xbins.cc:16
mps_fire.i
i
Definition: mps_fire.py:428
CommissioningHistograms::createSummaryHisto
virtual void createSummaryHisto(const sistrip::Monitorable &, const sistrip::Presentation &, const std::string &top_level_dir, const sistrip::Granularity &)
Definition: CommissioningHistograms.cc:559
dqm::implementation::IGetter::getContents
virtual std::vector< dqm::harvesting::MonitorElement * > getContents(std::string const &path) const
Definition: DQMStore.cc:593
MessageLogger.h
funct::false
false
Definition: Factorize.h:29
alignCSCRings.pwd
pwd
Definition: alignCSCRings.py:57
MonitorElementData::Kind::INT
SummaryPlotFactory< CommissioningAnalysis * >::init
uint32_t init(const sistrip::Monitorable &, const sistrip::Presentation &, const sistrip::View &, const std::string &top_level_dir, const sistrip::Granularity &, const std::map< uint32_t, CommissioningAnalysis * > &data)
Definition: CommissioningSummaryFactory.cc:6
sistrip::invalid32_
static const uint32_t invalid32_
Definition: Constants.h:15
CommissioningAnalysis.h
CommissioningHistograms::Histo
Definition: CommissioningHistograms.h:41
sistrip::View
View
Definition: ConstantsForView.h:26
CommissioningHistograms::bei
DQMStore *const bei() const
Definition: CommissioningHistograms.h:159
SiStripKey::key
const uint32_t & key() const
Definition: SiStripKey.h:120
SiStripFecKey::lldChan
const uint16_t & lldChan() const
Definition: SiStripFecKey.h:203
pos
Definition: PixelAliasList.h:18
sistrip::HISTO_2D_SUM
Definition: ConstantsForPresentation.h:32
sistrip::DETECTOR_VIEW
Definition: ConstantsForView.h:31
sistrip::dir_
static const char dir_[]
Definition: ConstantsForDqm.h:17
CommissioningHistograms::remove
void remove(std::string pattern="")
Definition: CommissioningHistograms.cc:605
CommissioningHistograms::extractHistograms
void extractHistograms(const std::vector< std::string > &)
Definition: CommissioningHistograms.cc:297
timingPdfMaker.histo
histo
Definition: timingPdfMaker.py:279
CommissioningHistograms::ringVector_
std::vector< uint32_t > ringVector_
Definition: CommissioningHistograms.h:147
sistrip::undefinedView_
static const char undefinedView_[]
Definition: ConstantsForView.h:18
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
dqm::legacy::MonitorElement
Definition: MonitorElement.h:462
contentValuesCheck.run_number
run_number
Definition: contentValuesCheck.py:38
sistrip::RunType
RunType
Definition: ConstantsForRunType.h:70
SiStripFedKey
A container class for generic run and event-related info, information required by the commissioning a...
Definition: SiStripFedKey.h:56
sistrip::dqmClientFileName_
static const char dqmClientFileName_[]
Definition: ConstantsForDqm.h:26
sistrip::UNKNOWN_GRAN
Definition: ConstantsForGranularity.h:62
CommissioningHistograms::printHistosMap
void printHistosMap()
Definition: CommissioningHistograms.cc:519
CommissioningHistograms::factory
Factory *const factory()
Definition: CommissioningHistograms.h:160
CommissioningHistograms::data
Analyses & data(bool getMaskedData=false)
Definition: CommissioningHistograms.cc:718
ExtractTObject
Definition: ExtractTObject.h:9
SummaryGenerator::name
static std::string name(const sistrip::RunType &, const sistrip::Monitorable &, const sistrip::Presentation &, const sistrip::View &, const std::string &directory)
Definition: SummaryGenerator.cc:48
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
CommissioningHistograms.h
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
sistrip::FED_ADC_RANGE
static const uint16_t FED_ADC_RANGE
Definition: ConstantsForHardwareSystems.h:17
sistrip::mlDqmClient_
static const char mlDqmClient_[]
Definition: ConstantsForLogger.h:19
CommissioningHistograms::CommissioningHistograms
CommissioningHistograms()
Definition: CommissioningHistograms.cc:60
sistrip::valid_
static const uint16_t valid_
Definition: Constants.h:17
relmon_rootfiles_spy.contents
contents
Definition: relmon_rootfiles_spy.py:129
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
CommissioningHistograms::Histo::cme_
MonitorElement * cme_
Definition: CommissioningHistograms.h:51
sistrip::Monitorable
Monitorable
Definition: ConstantsForMonitorable.h:200
debug
#define debug
Definition: HDRShower.cc:19
trigger::size_type
uint16_t size_type
Definition: TriggerTypeDefs.h:18
dqm::legacy::DQMStore
Definition: DQMStore.h:727
SiStripFecKey::fecRing
const uint16_t & fecRing() const
Definition: SiStripFecKey.h:200
CommissioningHistograms::runNumber
static uint32_t runNumber(DQMStore *const, const std::vector< std::string > &)
Definition: CommissioningHistograms.cc:94
TrackValidation_cff.task
task
Definition: TrackValidation_cff.py:252
dqm::implementation::IBooker::bookProfile
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
Definition: DQMStore.h:322
sistrip::Presentation
Presentation
Definition: ConstantsForPresentation.h:28
dqm::implementation::DQMStore::setCurrentFolder
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:569
SiStripEnumsAndStrings::presentation
static std::string presentation(const sistrip::Presentation &)
Definition: SiStripEnumsAndStrings.cc:1237
CommissioningHistograms::histogram
TH1 * histogram(const sistrip::Monitorable &, const sistrip::Presentation &, const sistrip::View &, const std::string &directory, const uint32_t &xbins, const float &xlow=1. *sistrip::invalid_, const float &xhigh=1. *sistrip::invalid_)
Definition: CommissioningHistograms.cc:656
dqm::implementation::DQMStore::save
DQM_DEPRECATED void save(std::string const &filename, std::string const &path="")
Definition: DQMStore.cc:761
CommissioningHistograms::ccuVector_
std::vector< uint32_t > ccuVector_
Definition: CommissioningHistograms.h:148
SiStripFecKey
Utility class that identifies a position within the strip tracker control structure,...
Definition: SiStripFecKey.h:45
SiStripFecKey.h
LaserDQM_cfi.mon
mon
Definition: LaserDQM_cfi.py:3
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SiStripFecKey::ccuChan
const uint16_t & ccuChan() const
Definition: SiStripFecKey.h:202
dqm::implementation::DQMStore::pwd
std::string pwd() override
Definition: DQMStore.h:567
sistrip::HISTO_1D
Definition: ConstantsForPresentation.h:31
sistrip::taskId_
static const char taskId_[]
Definition: ConstantsForDqm.h:31
CommissioningHistograms::task_
sistrip::RunType task_
Definition: CommissioningHistograms.h:132
funct::true
true
Definition: Factorize.h:173
SiStripConstants.h
SiStripFedKey.h
edm::ParameterSet
Definition: ParameterSet.h:47
CommissioningHistograms::Histo::me_
MonitorElement * me_
Definition: CommissioningHistograms.h:50
dqm::implementation::IBooker::bookString
MonitorElement * bookString(TString const &name, TString const &value, FUNC onbooking=NOOP())
Definition: DQMStore.h:87
CommissioningHistograms::printSummary
virtual void printSummary()
Definition: CommissioningHistograms.cc:484
CommissioningHistograms::Histo::print
void print(std::stringstream &) const
Definition: CommissioningHistograms.cc:84
CommissioningHistograms::fedMaskVector_
std::vector< uint32_t > fedMaskVector_
Definition: CommissioningHistograms.h:145
sistrip::HISTO_2D_SCATTER
Definition: ConstantsForPresentation.h:33
dqm::implementation::IBooker::bookInt
MonitorElement * bookInt(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:73
sistrip::UNKNOWN_RUN_TYPE
Definition: ConstantsForRunType.h:94
sistrip::PROFILE_1D
Definition: ConstantsForPresentation.h:34
sistrip::APV
Definition: ConstantsForGranularity.h:79
edmLumisInFiles.summary
summary
Definition: edmLumisInFiles.py:39
SiStripEnumsAndStrings::view
static std::string view(const sistrip::View &)
Definition: SiStripEnumsAndStrings.cc:5
FrameHeaderEvents_cfi.partitionName
partitionName
Definition: FrameHeaderEvents_cfi.py:5
CommissioningHistograms::mapping_
FedToFecMap mapping_
Definition: CommissioningHistograms.h:140
value
Definition: value.py:1
topSingleLeptonDQM_PU_cfi.pattern
pattern
Definition: topSingleLeptonDQM_PU_cfi.py:39
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
ExtractTObject::extract
static T * extract(MonitorElement *me)
Definition: ExtractTObject.cc:21
CommissioningHistograms::i2cChanVector_
std::vector< uint32_t > i2cChanVector_
Definition: CommissioningHistograms.h:149
sistrip::invalid_
static const uint16_t invalid_
Definition: Constants.h:16
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
sistrip::UNKNOWN_VIEW
Definition: ConstantsForView.h:27
HcalObjRepresent::Fill
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
Definition: HcalObjRepresent.h:1053
CommissioningHistograms::Histo::title_
std::string title_
Definition: CommissioningHistograms.h:49
SiStripDetKey.h
CommissioningAnalysis
Abstract base for derived classes that provide analysis of commissioning histograms.
Definition: CommissioningAnalysis.h:18
CommissioningHistograms::runType
static sistrip::RunType runType(DQMStore *const, const std::vector< std::string > &)
Definition: CommissioningHistograms.cc:161
CommissioningHistograms::mask_
bool mask_
Definition: CommissioningHistograms.h:144
SiStripDetKey
Utility class that identifies a position within the strip tracker geometrical structure,...
Definition: SiStripDetKey.h:28
LaserClient_cfi.high
high
Definition: LaserClient_cfi.py:50
std
Definition: JetResolutionObject.h:76
writedatasetfile.run
run
Definition: writedatasetfile.py:27
SiStripFedKey::print
void print(std::stringstream &ss) const override
Definition: SiStripFedKey.cc:482
pickleFileParser.slash
slash
Definition: pickleFileParser.py:12
sistrip::collate_
static const char collate_[]
Definition: ConstantsForDqm.h:29
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
relativeConstraints.value
value
Definition: relativeConstraints.py:53
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
relativeConstraints.empty
bool empty
Definition: relativeConstraints.py:46
sistrip::UNDEFINED_RUN_TYPE
Definition: ConstantsForRunType.h:95
CommissioningHistograms::save
void save(std::string &filename, uint32_t run_number=0, std::string partitionName="")
Definition: CommissioningHistograms.cc:611
CommissioningHistograms::data_
Analyses data_
Definition: CommissioningHistograms.h:136
SiStripFecKey::ccuAddr
const uint16_t & ccuAddr() const
Definition: SiStripFecKey.h:201
createBeamHaloJobs.directory
string directory
Definition: createBeamHaloJobs.py:211
CommissioningHistograms::histos_
HistosMap histos_
Definition: CommissioningHistograms.h:138
SummaryPlotFactory< CommissioningAnalysis * >::fill
void fill(TH1 &summary_histo)
Definition: CommissioningSummaryFactory.cc:31
CommissioningHistograms::lldChanVector_
std::vector< uint32_t > lldChanVector_
Definition: CommissioningHistograms.h:150
dqm::implementation::IGetter::get
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:651
CommissioningHistograms::histoAnalysis
virtual void histoAnalysis(bool debug)
Definition: CommissioningHistograms.cc:459
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
SiStripHistoTitle
Utility class that holds histogram title.
Definition: SiStripHistoTitle.h:20
CommissioningHistograms::~CommissioningHistograms
virtual ~CommissioningHistograms()
Definition: CommissioningHistograms.cc:75
CommissioningHistograms::dataWithMask_
Analyses dataWithMask_
Definition: CommissioningHistograms.h:152
sistrip::CONTROL_VIEW
Definition: ConstantsForView.h:30
SummaryGenerator.h
castor_dqm_sourceclient_file_cfg.path
path
Definition: castor_dqm_sourceclient_file_cfg.py:37
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
sistrip
sistrip classes
Definition: SiStripQualityHelpers.h:14
conversion_template_cfg.anal
anal
Definition: conversion_template_cfg.py:16
hlt_dqm_clientPB-live_cfg.me
me
Definition: hlt_dqm_clientPB-live_cfg.py:61
SiStripFecKey::fecSlot
const uint16_t & fecSlot() const
Definition: SiStripFecKey.h:199
sistrip::UNDEFINED_GRAN
Definition: ConstantsForGranularity.h:61
crabWrapper.key
key
Definition: crabWrapper.py:19
CommissioningHistograms::fecMaskVector_
std::vector< uint32_t > fecMaskVector_
Definition: CommissioningHistograms.h:146
SiStripKey
Base utility class that identifies a position within a logical structure of the strip tracker.
Definition: SiStripKey.h:23
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
CommissioningHistograms::clearHistosMap
void clearHistosMap()
Definition: CommissioningHistograms.cc:541
sistrip::READOUT_VIEW
Definition: ConstantsForView.h:29
sistrip::runNumber_
static const char runNumber_[]
Definition: ConstantsForDqm.h:33
SiStripFedKey::fedId
const uint16_t & fedId() const
Definition: SiStripFedKey.h:188
CommissioningHistograms::copyCustomInformation
static void copyCustomInformation(DQMStore *const, const std::vector< std::string > &)
Definition: CommissioningHistograms.cc:234
CommissioningHistograms::dataWithMaskCached_
bool dataWithMaskCached_
Definition: CommissioningHistograms.h:153
CommissioningHistograms::Analyses
std::map< uint32_t, CommissioningAnalysis * > Analyses
Definition: CommissioningHistograms.h:56
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
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
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23
CommissioningHistograms::printAnalyses
virtual void printAnalyses()
Definition: CommissioningHistograms.cc:466