CMS 3D CMS Logo

DQMStore.h
Go to the documentation of this file.
1 #ifndef DQMServices_Core_DQMStore_h
2 #define DQMServices_Core_DQMStore_h
3 
6 
8 
9 #include <type_traits>
10 #include <functional>
11 #include <mutex>
12 
13 // TODO: Remove at some point:
14 #define TRACE(msg) \
15  std::cout << "TRACE: " << __FILE__ << ":" << __LINE__ << "(" << __FUNCTION__ << ") " << msg << std::endl;
16 #define TRACE_ TRACE("");
17 
18 namespace dqm {
19  namespace implementation {
21  class DQMStore;
22 
23  // The common implementation to change folders
24  class NavigatorBase {
25  public:
26  virtual void cd();
27  // cd is identical to setCurrentFolder!
29  virtual void cd(std::string const& dir);
30  // This is the only method that is allowed to change cwd_ value
31  virtual void setCurrentFolder(std::string const& fullpath);
32  virtual void goUp();
33  // returns the current directory without (!) trailing slash or empty string.
34  virtual std::string pwd();
35 
36  virtual ~NavigatorBase() {}
37 
38  protected:
41  };
42 
44  public:
45  // DQMStore configures the IBooker in bookTransaction.
46  friend class DQMStore;
47 
48  // functor to be passed as a default argument that does not do anything.
49  struct NOOP {
50  void operator()(TH1*) const {};
51  void operator()() const {};
52  };
53 
54  //
55  // Booking Methods, templated to allow passing in lambdas.
56  // The variations taking ROOT object pointers do NOT take ownership of
57  // the object; it will be clone'd.
58  //
59 
60  // The function argument as an optional template parameter adds a lot of
61  // ambiguity to the overload resolution, since it accepts *anything* by
62  // default (and it does not help that we rely on implicit conversions for
63  // almost all of the arguments in many cases, converting string literal
64  // to TString and ints to floats, and 0 also prefers to convert to float*
65  // and so on ...).
66  // So, we use SFINAE to restrict the template parameter type, but that is
67  // also not that easy: there is no way to check for sth. callable in
68  // type_traits (`is_function` is not the right thing!), so instead we
69  // check for not-numeric things, which works most of the time (though e.g.
70  // enum constants somehow still pass as not arithmetic and need an
71  // explicit cast to resolve the ambiguity).
73  MonitorElement* bookInt(TString const& name, FUNC onbooking = NOOP()) {
75  onbooking();
76  return nullptr;
77  });
78  }
80  MonitorElement* bookFloat(TString const& name, FUNC onbooking = NOOP()) {
82  onbooking();
83  return nullptr;
84  });
85  }
87  MonitorElement* bookString(TString const& name, TString const& value, FUNC onbooking = NOOP()) {
88  std::string initial_value(value);
90  onbooking();
91  return nullptr;
92  });
93  me->Fill(initial_value);
94  return me;
95  }
96 
98  MonitorElement* book1D(TString const& name,
99  TString const& title,
100  int const nchX,
101  double const lowX,
102  double const highX,
103  FUNC onbooking = NOOP()) {
105  auto th1 = new TH1F(name, title, nchX, lowX, highX);
106  onbooking(th1);
107  return th1;
108  });
109  }
112  TString const& name, TString const& title, int nchX, float const* xbinsize, FUNC onbooking = NOOP()) {
114  auto th1 = new TH1F(name, title, nchX, xbinsize);
115  onbooking(th1);
116  return th1;
117  });
118  }
120  MonitorElement* book1D(TString const& name, TH1F* object, FUNC onbooking = NOOP()) {
121  return bookME(
122  name,
124  [=]() {
125  auto th1 = static_cast<TH1F*>(object->Clone(name));
126  onbooking(th1);
127  return th1;
128  },
129  /* forceReplace */ true);
130  }
131 
134  TString const& name, TString const& title, int nchX, double lowX, double highX, FUNC onbooking = NOOP()) {
136  auto th1 = new TH1S(name, title, nchX, lowX, highX);
137  onbooking(th1);
138  return th1;
139  });
140  }
142  MonitorElement* book1S(TString const& name, TH1S* object, FUNC onbooking = NOOP()) {
143  return bookME(
144  name,
146  [=]() {
147  auto th1 = static_cast<TH1S*>(object->Clone(name));
148  onbooking(th1);
149  return th1;
150  },
151  /* forceReplace */ true);
152  }
153 
156  TString const& name, TString const& title, int nchX, double lowX, double highX, FUNC onbooking = NOOP()) {
158  auto th1 = new TH1D(name, title, nchX, lowX, highX);
159  onbooking(th1);
160  return th1;
161  });
162  }
165  TString const& name, TString const& title, int nchX, float const* xbinsize, FUNC onbooking = NOOP()) {
167  auto th1 = new TH1D(name, title, nchX, xbinsize);
168  onbooking(th1);
169  return th1;
170  });
171  }
173  MonitorElement* book1DD(TString const& name, TH1D* object, FUNC onbooking = NOOP()) {
174  return bookME(
175  name,
177  [=]() {
178  auto th1 = static_cast<TH1D*>(object->Clone(name));
179  onbooking(th1);
180  return th1;
181  },
182  /* forceReplace */ true);
183  }
184 
186  MonitorElement* book1I(TString const& name,
187  TString const& title,
188  int const nchX,
189  double const lowX,
190  double const highX,
191  FUNC onbooking = NOOP()) {
193  auto th1 = new TH1I(name, title, nchX, lowX, highX);
194  onbooking(th1);
195  return th1;
196  });
197  }
200  TString const& name, TString const& title, int nchX, float const* xbinsize, FUNC onbooking = NOOP()) {
202  auto th1 = new TH1I(name, title, nchX, xbinsize);
203  onbooking(th1);
204  return th1;
205  });
206  }
208  MonitorElement* book1I(TString const& name, TH1I* object, FUNC onbooking = NOOP()) {
209  return bookME(
210  name,
212  [=]() {
213  auto th1 = static_cast<TH1I*>(object->Clone(name));
214  onbooking(th1);
215  return th1;
216  },
217  /* forceReplace */ true);
218  }
219 
221  MonitorElement* book2D(TString const& name,
222  TString const& title,
223  int nchX,
224  double lowX,
225  double highX,
226  int nchY,
227  double lowY,
228  double highY,
229  FUNC onbooking = NOOP()) {
231  auto th2 = new TH2F(name, title, nchX, lowX, highX, nchY, lowY, highY);
232  onbooking(th2);
233  return th2;
234  });
235  }
237  MonitorElement* book2D(TString const& name,
238  TString const& title,
239  int nchX,
240  float const* xbinsize,
241  int nchY,
242  float const* ybinsize,
243  FUNC onbooking = NOOP()) {
245  auto th2 = new TH2F(name, title, nchX, xbinsize, nchY, ybinsize);
246  onbooking(th2);
247  return th2;
248  });
249  }
251  MonitorElement* book2D(TString const& name, TH2F* object, FUNC onbooking = NOOP()) {
252  return bookME(
253  name,
255  [=]() {
256  auto th2 = static_cast<TH2F*>(object->Clone(name));
257  onbooking(th2);
258  return th2;
259  },
260  /* forceReplace */ true);
261  }
263  MonitorElement* book2S(TString const& name,
264  TString const& title,
265  int nchX,
266  double lowX,
267  double highX,
268  int nchY,
269  double lowY,
270  double highY,
271  FUNC onbooking = NOOP()) {
273  auto th2 = new TH2S(name, title, nchX, lowX, highX, nchY, lowY, highY);
274  onbooking(th2);
275  return th2;
276  });
277  }
279  MonitorElement* book2S(TString const& name,
280  TString const& title,
281  int nchX,
282  float const* xbinsize,
283  int nchY,
284  float const* ybinsize,
285  FUNC onbooking = NOOP()) {
287  auto th2 = new TH2S(name, title, nchX, xbinsize, nchY, ybinsize);
288  onbooking(th2);
289  return th2;
290  });
291  }
293  MonitorElement* book2S(TString const& name, TH2S* object, FUNC onbooking = NOOP()) {
294  return bookME(
295  name,
297  [=]() {
298  auto th2 = static_cast<TH2S*>(object->Clone(name));
299  onbooking(th2);
300  return th2;
301  },
302  /* forceReplace */ true);
303  }
305  MonitorElement* book2I(TString const& name,
306  TString const& title,
307  int nchX,
308  double lowX,
309  double highX,
310  int nchY,
311  double lowY,
312  double highY,
313  FUNC onbooking = NOOP()) {
315  auto th2 = new TH2I(name, title, nchX, lowX, highX, nchY, lowY, highY);
316  onbooking(th2);
317  return th2;
318  });
319  }
321  MonitorElement* book2I(TString const& name,
322  TString const& title,
323  int nchX,
324  float const* xbinsize,
325  int nchY,
326  float const* ybinsize,
327  FUNC onbooking = NOOP()) {
329  auto th2 = new TH2I(name, title, nchX, xbinsize, nchY, ybinsize);
330  onbooking(th2);
331  return th2;
332  });
333  }
335  MonitorElement* book2I(TString const& name, TH2I* object, FUNC onbooking = NOOP()) {
336  return bookME(
337  name,
339  [=]() {
340  auto th2 = static_cast<TH2I*>(object->Clone(name));
341  onbooking(th2);
342  return th2;
343  },
344  /* forceReplace */ true);
345  }
347  MonitorElement* book2DD(TString const& name,
348  TString const& title,
349  int nchX,
350  double lowX,
351  double highX,
352  int nchY,
353  double lowY,
354  double highY,
355  FUNC onbooking = NOOP()) {
357  auto th2 = new TH2D(name, title, nchX, lowX, highX, nchY, lowY, highY);
358  onbooking(th2);
359  return th2;
360  });
361  }
363  MonitorElement* book2DD(TString const& name, TH2D* object, FUNC onbooking = NOOP()) {
364  return bookME(
365  name,
367  [=]() {
368  auto th2 = static_cast<TH2D*>(object->Clone(name));
369  onbooking(th2);
370  return th2;
371  },
372  /* forceReplace */ true);
373  }
374 
376  MonitorElement* book3D(TString const& name,
377  TString const& title,
378  int nchX,
379  double lowX,
380  double highX,
381  int nchY,
382  double lowY,
383  double highY,
384  int nchZ,
385  double lowZ,
386  double highZ,
387  FUNC onbooking = NOOP()) {
389  auto th3 = new TH3F(name, title, nchX, lowX, highX, nchY, lowY, highY, nchZ, lowZ, highZ);
390  onbooking(th3);
391  return th3;
392  });
393  }
395  MonitorElement* book3D(TString const& name, TH3F* object, FUNC onbooking = NOOP()) {
396  return bookME(
397  name,
399  [=]() {
400  auto th3 = static_cast<TH3F*>(object->Clone(name));
401  onbooking(th3);
402  return th3;
403  },
404  /* forceReplace */ true);
405  }
406 
408  MonitorElement* bookProfile(TString const& name,
409  TString const& title,
410  int nchX,
411  double lowX,
412  double highX,
413  int /* nchY */,
414  double lowY,
415  double highY,
416  char const* option = "s",
417  FUNC onbooking = NOOP()) {
419  auto tprofile = new TProfile(name, title, nchX, lowX, highX, lowY, highY, option);
420  onbooking(tprofile);
421  return tprofile;
422  });
423  }
425  MonitorElement* bookProfile(TString const& name,
426  TString const& title,
427  int nchX,
428  double lowX,
429  double highX,
430  double lowY,
431  double highY,
432  char const* option = "s",
433  FUNC onbooking = NOOP()) {
435  auto tprofile = new TProfile(name, title, nchX, lowX, highX, lowY, highY, option);
436  onbooking(tprofile);
437  return tprofile;
438  });
439  }
441  MonitorElement* bookProfile(TString const& name,
442  TString const& title,
443  int nchX,
444  double const* xbinsize,
445  int /* nchY */,
446  double lowY,
447  double highY,
448  char const* option = "s",
449  FUNC onbooking = NOOP()) {
451  auto tprofile = new TProfile(name, title, nchX, xbinsize, lowY, highY, option);
452  onbooking(tprofile);
453  return tprofile;
454  });
455  }
457  MonitorElement* bookProfile(TString const& name,
458  TString const& title,
459  int nchX,
460  double const* xbinsize,
461  double lowY,
462  double highY,
463  char const* option = "s",
464  FUNC onbooking = NOOP()) {
466  auto tprofile = new TProfile(name, title, nchX, xbinsize, lowY, highY, option);
467  onbooking(tprofile);
468  return tprofile;
469  });
470  }
472  MonitorElement* bookProfile(TString const& name, TProfile* object, FUNC onbooking = NOOP()) {
473  return bookME(
474  name,
476  [=]() {
477  auto tprofile = static_cast<TProfile*>(object->Clone(name));
478  onbooking(tprofile);
479  return tprofile;
480  },
481  /* forceReplace */ true);
482  }
483 
486  TString const& title,
487  int nchX,
488  double lowX,
489  double highX,
490  int nchY,
491  double lowY,
492  double highY,
493  double lowZ,
494  double highZ,
495  char const* option = "s",
496  FUNC onbooking = NOOP()) {
498  auto tprofile = new TProfile2D(name, title, nchX, lowX, highX, nchY, lowY, highY, lowZ, highZ, option);
499  onbooking(tprofile);
500  return tprofile;
501  });
502  }
505  TString const& title,
506  int nchX,
507  double lowX,
508  double highX,
509  int nchY,
510  double lowY,
511  double highY,
512  int /* nchZ */,
513  double lowZ,
514  double highZ,
515  char const* option = "s",
516  FUNC onbooking = NOOP()) {
518  auto tprofile = new TProfile2D(name, title, nchX, lowX, highX, nchY, lowY, highY, lowZ, highZ, option);
519  onbooking(tprofile);
520  return tprofile;
521  });
522  }
524  MonitorElement* bookProfile2D(TString const& name, TProfile2D* object, FUNC onbooking = NOOP()) {
525  return bookME(
526  name,
528  [=]() {
529  auto tprofile = static_cast<TProfile2D*>(object->Clone(name));
530  onbooking(tprofile);
531  return tprofile;
532  },
533  /* forceReplace */ true);
534  }
535 
536  //
537  // all non-template interfaces are virtual.
538  //
539 
541  // RAII-Style guard to set and reset the Scope.
542  template <MonitorElementData::Scope SCOPE>
543  struct UseScope {
546  UseScope(IBooker& booker) : parent(booker) { oldscope = parent.setScope(SCOPE); }
548  };
552 
553  ~IBooker() override;
554 
555  private:
556  IBooker(DQMStore* store);
557  virtual uint64_t setModuleID(uint64_t moduleID);
559  virtual MonitorElement* bookME(TString const& name,
561  std::function<TH1*()> makeobject,
562  bool forceReplace = false);
563 
564  DQMStore* store_ = nullptr;
565  MonitorElementData::Scope scope_ = MonitorElementData::Scope::JOB;
569  };
570 
572  public:
573  // The IGetter interface is not really suitable for concurrent lumis/runs,
574  // so we don't even try much to get it right. Harvesting needs to run
575  // sequentially for now. Therefore, the methods just return the next-best
576  // global MEs that they find, ignoring Scope and run/lumi.
577  // Since these are global MEs, they may be deleted at some point; don't
578  // store the pointers!
579  // They are also shared with other modules. That is save when running
580  // multi-threaded as long as getTH1() etc. are not used, but of course
581  // all dependencies need to be properly declared to get correct results.
582 
583  // TODO: review and possibly rename the all methods below:
584  // get MEs that are direct children of full path `path`
585  virtual std::vector<dqm::harvesting::MonitorElement*> getContents(std::string const& path) const;
586 
587  // get all elements below full path `path`
588  // we have to discuss semantics here -- are run/lumi ever used?
589  virtual std::vector<dqm::harvesting::MonitorElement*> getAllContents(std::string const& path) const;
591  virtual std::vector<dqm::harvesting::MonitorElement*> getAllContents(std::string const& path,
592  uint32_t runNumber,
593  uint32_t lumi) const;
594  // TODO: rename to reflect the fact that it requires full path
595  // return ME identified by full path `path`, or nullptr
596  virtual MonitorElement* get(std::string const& fullpath) const;
597 
598  // This is the most specific way to get a ME, specifying also run and
599  // lumi in the key. Primarily for internal use.
600  virtual MonitorElement* get(MonitorElementData::Key const& key) const;
601 
602  // same as get, throws an exception if histogram not found
603  // Deprecated simply because it is barely used.
605  virtual MonitorElement* getElement(std::string const& path) const;
606 
607  // return sub-directories of current directory
608  // Deprecated because the current implementation is very slow and barely
609  // used, use getAllContents instead.
611  virtual std::vector<std::string> getSubdirs() const;
612  // return element names of direct children of current directory
613  virtual std::vector<std::string> getMEs() const;
614  // returns whether there are objects at full path `path`
615  virtual bool dirExists(std::string const& path) const;
616 
617  ~IGetter() override;
618 
619  protected:
620  IGetter(DQMStore* store);
621 
623  };
624 
625  class DQMStore : public IGetter, public IBooker {
626  public:
627  // IGetter uses the globalMEs_ directly.
628  friend IGetter;
630 
632  DQMStore(DQMStore const&) = delete;
633  DQMStore(DQMStore&&) = delete;
634  DQMStore& operator=(DQMStore const&) = delete;
635  ~DQMStore() override;
636 
637  // ------------------------------------------------------------------------
638  // ---------------------- public I/O --------------------------------------
640  void save(std::string const& filename, std::string const& path = "");
642  bool open(std::string const& filename,
643  bool overwrite = false,
644  std::string const& path = "",
645  std::string const& prepend = "",
646  OpenRunDirs stripdirs = KeepRunDirs,
647  bool fileMustExist = true);
648 
649  // ------------------------------------------------------------------------
650  // ------------ IBooker/IGetter overrides to prevent ambiguity ------------
651  void cd() override { this->IBooker::cd(); }
652  void cd(std::string const& dir) override { this->IBooker::cd(dir); }
653  void goUp() override { this->IBooker::goUp(); }
654  std::string pwd() override { return this->IBooker::pwd(); }
655 
656  void setCurrentFolder(std::string const& fullpath) override {
657  // only here we keep the two in sync -- all the others call this in the end!
658  this->IBooker::setCurrentFolder(fullpath);
659  this->IGetter::setCurrentFolder(fullpath);
660  }
661 
662  public:
663  // internal -- figure out better protection.
664  template <typename iFunc>
665  void bookTransaction(iFunc f, uint64_t moduleId, bool canSaveByLumi) {
666  // taking the lock here only to protect the single, global IBooker (as
667  // base class of DQMStore). We could avoid taking this lock by making a
668  // new IBooker instance for each transaction, and the DQMStore itself
669  // takes the lock before touching any data structures.
670  // There is a race in bookME when we don't take this lock, where two
671  // modules might prepare a global ME for the same name at the same time
672  // and only one of them succeeds in putME: this is is safe, but we need
673  // to remove the assertion over there and subsystem code has to be
674  // aware that the booking callback *can* run multiple times.
675  // Additionally, this lock is what keeps usage of getTH1() safe during
676  // booking... all code needs to be migrated to callbacks before this can
677  // be removed.
678  auto lock = std::scoped_lock(this->booking_mutex_);
679 
680  // This is to make sure everything gets reset in case of an exception.
681  // That is not really required (an exception here will crash the job
682  // anyways, and it is technically not required to reset everything), but
683  // it prevents misleading error messages in other threads.
684  struct ModuleIdScope {
685  IBooker& booker_;
686  uint64_t oldid_;
687  MonitorElementData::Scope oldscope_;
688  edm::LuminosityBlockID oldrunlumi_;
689  ModuleIdScope(IBooker& booker,
690  uint64_t newid,
691  MonitorElementData::Scope newscope,
692  edm::LuminosityBlockID newrunlumi)
693  : booker_(booker) {
694  oldid_ = booker_.setModuleID(newid);
695  oldscope_ = booker_.setScope(newscope);
696  oldrunlumi_ = booker_.setRunLumi(newrunlumi);
697  assert(newid != kInvalidModuleID || !"moduleID must be set for normal booking transaction");
698  assert(oldid_ == kInvalidModuleID || !"Nested booking transaction?");
699  }
700  ~ModuleIdScope() {
701  booker_.setModuleID(oldid_);
702  booker_.setScope(oldscope_);
703  booker_.setRunLumi(oldrunlumi_);
704  }
705  };
706 
707  ModuleIdScope booker(
708  *this,
709  moduleId,
710  // enable per-lumi-by-default here
711  canSaveByLumi && this->doSaveByLumi_ ? MonitorElementData::Scope::LUMI : MonitorElementData::Scope::RUN,
712  // always book prototypes
714 
715  f(booker.booker_);
716  };
717 
718  template <typename iFunc>
719  void meBookerGetter(iFunc f) {
720  auto lock = std::scoped_lock(this->booking_mutex_);
721  // here, we make much less assumptions compared to bookTransaction.
722  // This is essentially legacy semantics except we actually take the lock.
723  f(*this, *this);
724  // TODO: we should maybe make sure that Scope changes are reset here,
725  // but also it makes sense to inherit the Scope from the environement
726  // (e.g. when meBookerGetter is called *inside* a booking transaction).
727  };
728 
729  // For input modules: trigger recycling without local ME/enterLumi/moduleID.
731 
732  // this creates local all needed global MEs for the given run/lumi (and
733  // module), potentially cloning them if there are concurrent runs/lumis.
734  // Symmetrical to cleanupLumi, this is called from a framwork hook, to
735  // make sure it also runs when the module does not call anything.
738 
739  // modules are expected to call these callbacks when they change run/lumi.
740  // The DQMStore then updates the module's MEs local MEs to point to the
741  // new run/lumi.
744 
745  // this is triggered by a framework hook to remove/recycle MEs after a
746  // run/lumi is saved. We do this via the edm::Service interface to make
747  // sure it runs after *all* output modules, even if there are multiple.
749 
750  // Add ME to DQMStore datastructures. The object will be deleted if a
751  // similar object is already present.
752  // For global ME
754  // For local ME
756  // Find a global ME of matching name, in any state.
757  // MELIKE can be a MonitorElementData::Path or MonitorElement*.
758  template <typename MELIKE>
759  MonitorElement* findME(MELIKE const& path);
760  // Log a backtrace on booking.
761  void printTrace(std::string const& message);
762  // print a log message if ME matches trackME_.
763  void debugTrackME(const char* message, MonitorElement* me_local, MonitorElement* me_global) const;
764  // accesor to keep MEsToSave_ private
765  const auto& getMEsToSave() const { return MEsToSave_; }
766  // accesor to keep onlineMode_ private
767  const bool& getMode() const { return onlineMode_; }
768 
769  private:
770  // MEComparison is a name-only comparison on MEs and Paths, allowing
771  // heterogeneous lookup.
772  // The ME objects here are lightweight, all the important stuff is in the
773  // MEData. However we never handle MEData directly, but always keep it
774  // wrapped in MEs (created as needed). MEs can share MEData.
775  // ME objects must never appear more than once in these sets. ME objects
776  // in localMEs_ cannot be deleted, since the module might hold pointers.
777  // MEs in globalMEs_ can be deleted/recycled at the end of their scope,
778  // if there are no local MEs left that share the data.
779  // MEs can be _protoype MEs_ if their scope is not yet known (after
780  // booking, after leaveLumi). A prototype is kept if and only if there is
781  // no other global instance of the same ME. Prototype MEs have
782  // run = lumi = 0 and scope != JOB. If scope == JOB, a prototype is never
783  // required. Prototype MEs are reset *before* inserting, so fill calls
784  // can go into prototype MEs and not be lost.
785  // Key is (run, lumi), potentially one or both 0 for SCOPE::RUN or SCOPE::JOB
786  // NEVER modify the key_ of a ME in these datastructures. Since we use
787  // pointers, this may be possible (not everything is const), but it could
788  // still corrupt the datastructure.
789  std::map<edm::LuminosityBlockID, std::set<MonitorElement*, MonitorElement::MEComparison>> globalMEs_;
790  // Key is (moduleID [, run | , stream]), run is only needed for
791  // edm::global, stream only for edm::stream.
792  // Legacy MEs have moduleID 0.
793  std::map<uint64_t, std::set<MonitorElement*, MonitorElement::MEComparison>> localMEs_;
794  // Whenever modifying these sets, take this mutex. It's recursive, so we
795  // can be liberal -- lock on any access, but also lock on the full booking
796  // transaction.
797  std::recursive_mutex booking_mutex_;
798 
799  // Universal verbose flag.
800  // Only very few usages remain, the main debugging tool is trackME_.
801  int verbose_;
802 
803  // If set to true, error out whenever things happen that are not safe for
804  // legacy modules.
806 
807  // Book MEs by lumi by default whenever possible.
809  // Book MEs by lumi from list in DQMServices/Core/python/DQMStore_cfi.py
810  std::vector<std::string> MEsToSave_; //just if perLS is ON
811 
812  // if non-empty, debugTrackME calls will log some information whenever a
813  // ME path contains this string.
815 
816  // Online mode
818  };
819  } // namespace implementation
820 
821  // Since we still use a single, edm::Serivce instance of a DQMStore, these are all the same.
822  namespace legacy {
824  public:
827  // import constructors.
829  };
830  } // namespace legacy
831  namespace reco {
833  } // namespace reco
834  namespace harvesting {
836  } // namespace harvesting
837 } // namespace dqm
838 
839 #endif
DQMStore(edm::ParameterSet const &pset, edm::ActivityRegistry &)
Definition: DQMStore.cc:778
MonitorElement * book2D(TString const &name, TString const &title, int nchX, float const *xbinsize, int nchY, float const *ybinsize, FUNC onbooking=NOOP())
Definition: DQMStore.h:237
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:80
MonitorElement * book2S(TString const &name, TString const &title, int nchX, float const *xbinsize, int nchY, float const *ybinsize, FUNC onbooking=NOOP())
Definition: DQMStore.h:279
MonitorElement * book2D(TString const &name, TH2F *object, FUNC onbooking=NOOP())
Definition: DQMStore.h:251
MonitorElement * book1D(TString const &name, TString const &title, int nchX, float const *xbinsize, FUNC onbooking=NOOP())
Definition: DQMStore.h:111
MonitorElement * bookProfile2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, double lowZ, double highZ, char const *option="s", FUNC onbooking=NOOP())
Definition: DQMStore.h:485
virtual DQM_DEPRECATED MonitorElement * getElement(std::string const &path) const
Definition: DQMStore.cc:731
MonitorElement * book1I(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:186
MonitorElement * book2S(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:263
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
MonitorElement * book1D(TString const &name, TH1F *object, FUNC onbooking=NOOP())
Definition: DQMStore.h:120
MonitorElement * bookProfile(TString const &name, TProfile *object, FUNC onbooking=NOOP())
Definition: DQMStore.h:472
dqm::legacy::DQMStore DQMStore
Definition: DQMStore.h:835
const auto & getMEsToSave() const
Definition: DQMStore.h:765
virtual std::vector< std::string > getMEs() const
Definition: DQMStore.cc:759
virtual std::string pwd()
Definition: DQMStore.cc:20
virtual edm::LuminosityBlockID setRunLumi(edm::LuminosityBlockID runlumi)
Definition: DQMStore.cc:61
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:656
virtual MonitorElementData::Scope setScope(MonitorElementData::Scope newscope)
Definition: DQMStore.cc:50
virtual bool dirExists(std::string const &path) const
Definition: DQMStore.cc:769
void printTrace(std::string const &message)
Definition: DQMStore.cc:242
void bookTransaction(iFunc f, uint64_t moduleId, bool canSaveByLumi)
Definition: DQMStore.h:665
MonitorElement * book2DD(TString const &name, TH2D *object, FUNC onbooking=NOOP())
Definition: DQMStore.h:363
std::map< uint64_t, std::set< MonitorElement *, MonitorElement::MEComparison > > localMEs_
Definition: DQMStore.h:793
virtual MonitorElement * bookME(TString const &name, MonitorElementData::Kind kind, std::function< TH1 *()> makeobject, bool forceReplace=false)
Definition: DQMStore.cc:67
void cd(std::string const &dir) override
Definition: DQMStore.h:652
std::string pwd() override
Definition: DQMStore.h:654
edm::LuminosityBlockID runlumi_
Definition: DQMStore.h:568
MonitorElementData::Scope scope_
Definition: DQMStore.h:565
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
Definition: DQMStore.h:425
assert(be >=bs)
unsigned int LuminosityBlockNumber_t
DQMStore & operator=(DQMStore const &)=delete
MonitorElement * book1S(TString const &name, TH1S *object, FUNC onbooking=NOOP())
Definition: DQMStore.h:142
MonitorElement * bookString(TString const &name, TString const &value, FUNC onbooking=NOOP())
Definition: DQMStore.h:87
MonitorElement * findOrRecycle(MonitorElementData::Key const &)
Definition: DQMStore.cc:349
void leaveLumi(edm::RunNumber_t run, edm::LuminosityBlockNumber_t lumi, uint64_t moduleID)
Definition: DQMStore.cc:524
MonitorElement * book1DD(TString const &name, TString const &title, int nchX, double lowX, double highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:155
void initLumi(edm::RunNumber_t run, edm::LuminosityBlockNumber_t lumi)
Definition: DQMStore.cc:392
void enterLumi(edm::RunNumber_t run, edm::LuminosityBlockNumber_t lumi, uint64_t moduleID)
Definition: DQMStore.cc:480
std::recursive_mutex booking_mutex_
Definition: DQMStore.h:797
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:408
virtual std::vector< dqm::harvesting::MonitorElement * > getAllContents(std::string const &path) const
Definition: DQMStore.cc:641
MonitorElement * book2I(TString const &name, TString const &title, int nchX, float const *xbinsize, int nchY, float const *ybinsize, FUNC onbooking=NOOP())
Definition: DQMStore.h:321
IGetter(DQMStore *store)
Definition: DQMStore.cc:774
IBooker(DQMStore *store)
Definition: DQMStore.cc:43
void meBookerGetter(iFunc f)
Definition: DQMStore.h:719
MonitorElement * book1S(TString const &name, TString const &title, int nchX, double lowX, double highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:133
key
prepare the HTCondor submission files and eventually submit them
double f[11][100]
Definition: value.py:1
std::map< edm::LuminosityBlockID, std::set< MonitorElement *, MonitorElement::MEComparison > > globalMEs_
Definition: DQMStore.h:789
virtual uint64_t setModuleID(uint64_t moduleID)
Definition: DQMStore.cc:55
MonitorElement * book1I(TString const &name, TString const &title, int nchX, float const *xbinsize, FUNC onbooking=NOOP())
Definition: DQMStore.h:199
MonitorElement * book1I(TString const &name, TH1I *object, FUNC onbooking=NOOP())
Definition: DQMStore.h:208
MonitorElementData::Scope oldscope
Definition: DQMStore.h:545
dqm::legacy::MonitorElement MonitorElement
Definition: DQMStore.h:20
MonitorElement * book1DD(TString const &name, TString const &title, int nchX, float const *xbinsize, FUNC onbooking=NOOP())
Definition: DQMStore.h:164
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double const *xbinsize, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
Definition: DQMStore.h:457
MonitorElement * bookProfile2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int, double lowZ, double highZ, char const *option="s", FUNC onbooking=NOOP())
Definition: DQMStore.h:504
unsigned long long uint64_t
Definition: Time.h:13
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:221
MonitorElement * findME(MELIKE const &path)
Definition: DQMStore.cc:228
MonitorElement * bookInt(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:73
MonitorElement * book2DD(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:347
std::vector< std::string > MEsToSave_
Definition: DQMStore.h:810
void operator()(TH1 *) const
Definition: DQMStore.h:50
MonitorElement * bookProfile2D(TString const &name, TProfile2D *object, FUNC onbooking=NOOP())
Definition: DQMStore.h:524
MonitorElement * putME(MonitorElement *me)
Definition: DQMStore.cc:180
DQM_DEPRECATED void save(std::string const &filename, std::string const &path="")
Definition: DQMStore.cc:824
MonitorElement * book2S(TString const &name, TH2S *object, FUNC onbooking=NOOP())
Definition: DQMStore.h:293
fixed size matrix
const bool & getMode() const
Definition: DQMStore.h:767
uint16_t *__restrict__ uint16_t const *__restrict__ uint32_t const *__restrict__ uint32_t *__restrict__ uint32_t const *__restrict__ moduleId
dqm::reco::DQMStore::IBooker IBooker
MonitorElement * book1DD(TString const &name, TH1D *object, FUNC onbooking=NOOP())
Definition: DQMStore.h:173
void cleanupLumi(edm::RunNumber_t run, edm::LuminosityBlockNumber_t lumi)
Definition: DQMStore.cc:558
unsigned int RunNumber_t
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double const *xbinsize, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
Definition: DQMStore.h:441
void debugTrackME(const char *message, MonitorElement *me_local, MonitorElement *me_global) const
Definition: DQMStore.cc:311
MonitorElement * book2I(TString const &name, TH2I *object, FUNC onbooking=NOOP())
Definition: DQMStore.h:335
Definition: DQMStore.h:18
MonitorElement * book3D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ, FUNC onbooking=NOOP())
Definition: DQMStore.h:376
MonitorElement * book2I(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:305
DQM_DEPRECATED bool open(std::string const &filename, bool overwrite=false, std::string const &path="", std::string const &prepend="", OpenRunDirs stripdirs=KeepRunDirs, bool fileMustExist=true)
Definition: DQMStore.cc:830
#define DQM_DEPRECATED
Definition: DQMStore.cc:2
virtual std::vector< dqm::harvesting::MonitorElement * > getContents(std::string const &path) const
Definition: DQMStore.cc:625
MonitorElement * book3D(TString const &name, TH3F *object, FUNC onbooking=NOOP())
Definition: DQMStore.h:395
static constexpr uint64_t kInvalidModuleID
Definition: DQMStore.h:566
virtual DQM_DEPRECATED std::vector< std::string > getSubdirs() const
Definition: DQMStore.cc:739