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  }
164  MonitorElement* book1DD(TString const& name, TH1D* object, FUNC onbooking = NOOP()) {
165  return bookME(
166  name,
168  [=]() {
169  auto th1 = static_cast<TH1D*>(object->Clone(name));
170  onbooking(th1);
171  return th1;
172  },
173  /* forceReplace */ true);
174  }
175 
177  MonitorElement* book1I(TString const& name,
178  TString const& title,
179  int const nchX,
180  double const lowX,
181  double const highX,
182  FUNC onbooking = NOOP()) {
184  auto th1 = new TH1I(name, title, nchX, lowX, highX);
185  onbooking(th1);
186  return th1;
187  });
188  }
191  TString const& name, TString const& title, int nchX, float const* xbinsize, FUNC onbooking = NOOP()) {
193  auto th1 = new TH1I(name, title, nchX, xbinsize);
194  onbooking(th1);
195  return th1;
196  });
197  }
199  MonitorElement* book1I(TString const& name, TH1I* object, FUNC onbooking = NOOP()) {
200  return bookME(
201  name,
203  [=]() {
204  auto th1 = static_cast<TH1I*>(object->Clone(name));
205  onbooking(th1);
206  return th1;
207  },
208  /* forceReplace */ true);
209  }
210 
212  MonitorElement* book2D(TString const& name,
213  TString const& title,
214  int nchX,
215  double lowX,
216  double highX,
217  int nchY,
218  double lowY,
219  double highY,
220  FUNC onbooking = NOOP()) {
222  auto th2 = new TH2F(name, title, nchX, lowX, highX, nchY, lowY, highY);
223  onbooking(th2);
224  return th2;
225  });
226  }
228  MonitorElement* book2D(TString const& name,
229  TString const& title,
230  int nchX,
231  float const* xbinsize,
232  int nchY,
233  float const* ybinsize,
234  FUNC onbooking = NOOP()) {
236  auto th2 = new TH2F(name, title, nchX, xbinsize, nchY, ybinsize);
237  onbooking(th2);
238  return th2;
239  });
240  }
242  MonitorElement* book2D(TString const& name, TH2F* object, FUNC onbooking = NOOP()) {
243  return bookME(
244  name,
246  [=]() {
247  auto th2 = static_cast<TH2F*>(object->Clone(name));
248  onbooking(th2);
249  return th2;
250  },
251  /* forceReplace */ true);
252  }
254  MonitorElement* book2S(TString const& name,
255  TString const& title,
256  int nchX,
257  double lowX,
258  double highX,
259  int nchY,
260  double lowY,
261  double highY,
262  FUNC onbooking = NOOP()) {
264  auto th2 = new TH2S(name, title, nchX, lowX, highX, nchY, lowY, highY);
265  onbooking(th2);
266  return th2;
267  });
268  }
270  MonitorElement* book2S(TString const& name,
271  TString const& title,
272  int nchX,
273  float const* xbinsize,
274  int nchY,
275  float const* ybinsize,
276  FUNC onbooking = NOOP()) {
278  auto th2 = new TH2S(name, title, nchX, xbinsize, nchY, ybinsize);
279  onbooking(th2);
280  return th2;
281  });
282  }
284  MonitorElement* book2S(TString const& name, TH2S* object, FUNC onbooking = NOOP()) {
285  return bookME(
286  name,
288  [=]() {
289  auto th2 = static_cast<TH2S*>(object->Clone(name));
290  onbooking(th2);
291  return th2;
292  },
293  /* forceReplace */ true);
294  }
296  MonitorElement* book2I(TString const& name,
297  TString const& title,
298  int nchX,
299  double lowX,
300  double highX,
301  int nchY,
302  double lowY,
303  double highY,
304  FUNC onbooking = NOOP()) {
306  auto th2 = new TH2I(name, title, nchX, lowX, highX, nchY, lowY, highY);
307  onbooking(th2);
308  return th2;
309  });
310  }
312  MonitorElement* book2I(TString const& name,
313  TString const& title,
314  int nchX,
315  float const* xbinsize,
316  int nchY,
317  float const* ybinsize,
318  FUNC onbooking = NOOP()) {
320  auto th2 = new TH2I(name, title, nchX, xbinsize, nchY, ybinsize);
321  onbooking(th2);
322  return th2;
323  });
324  }
326  MonitorElement* book2I(TString const& name, TH2I* object, FUNC onbooking = NOOP()) {
327  return bookME(
328  name,
330  [=]() {
331  auto th2 = static_cast<TH2I*>(object->Clone(name));
332  onbooking(th2);
333  return th2;
334  },
335  /* forceReplace */ true);
336  }
338  MonitorElement* book2DD(TString const& name,
339  TString const& title,
340  int nchX,
341  double lowX,
342  double highX,
343  int nchY,
344  double lowY,
345  double highY,
346  FUNC onbooking = NOOP()) {
348  auto th2 = new TH2D(name, title, nchX, lowX, highX, nchY, lowY, highY);
349  onbooking(th2);
350  return th2;
351  });
352  }
354  MonitorElement* book2DD(TString const& name, TH2D* object, FUNC onbooking = NOOP()) {
355  return bookME(
356  name,
358  [=]() {
359  auto th2 = static_cast<TH2D*>(object->Clone(name));
360  onbooking(th2);
361  return th2;
362  },
363  /* forceReplace */ true);
364  }
365 
367  MonitorElement* book3D(TString const& name,
368  TString const& title,
369  int nchX,
370  double lowX,
371  double highX,
372  int nchY,
373  double lowY,
374  double highY,
375  int nchZ,
376  double lowZ,
377  double highZ,
378  FUNC onbooking = NOOP()) {
380  auto th3 = new TH3F(name, title, nchX, lowX, highX, nchY, lowY, highY, nchZ, lowZ, highZ);
381  onbooking(th3);
382  return th3;
383  });
384  }
386  MonitorElement* book3D(TString const& name, TH3F* object, FUNC onbooking = NOOP()) {
387  return bookME(
388  name,
390  [=]() {
391  auto th3 = static_cast<TH3F*>(object->Clone(name));
392  onbooking(th3);
393  return th3;
394  },
395  /* forceReplace */ true);
396  }
397 
399  MonitorElement* bookProfile(TString const& name,
400  TString const& title,
401  int nchX,
402  double lowX,
403  double highX,
404  int /* nchY */,
405  double lowY,
406  double highY,
407  char const* option = "s",
408  FUNC onbooking = NOOP()) {
410  auto tprofile = new TProfile(name, title, nchX, lowX, highX, lowY, highY, option);
411  onbooking(tprofile);
412  return tprofile;
413  });
414  }
416  MonitorElement* bookProfile(TString const& name,
417  TString const& title,
418  int nchX,
419  double lowX,
420  double highX,
421  double lowY,
422  double highY,
423  char const* option = "s",
424  FUNC onbooking = NOOP()) {
426  auto tprofile = new TProfile(name, title, nchX, lowX, highX, lowY, highY, option);
427  onbooking(tprofile);
428  return tprofile;
429  });
430  }
432  MonitorElement* bookProfile(TString const& name,
433  TString const& title,
434  int nchX,
435  double const* xbinsize,
436  int /* nchY */,
437  double lowY,
438  double highY,
439  char const* option = "s",
440  FUNC onbooking = NOOP()) {
442  auto tprofile = new TProfile(name, title, nchX, xbinsize, lowY, highY, option);
443  onbooking(tprofile);
444  return tprofile;
445  });
446  }
448  MonitorElement* bookProfile(TString const& name,
449  TString const& title,
450  int nchX,
451  double const* xbinsize,
452  double lowY,
453  double highY,
454  char const* option = "s",
455  FUNC onbooking = NOOP()) {
457  auto tprofile = new TProfile(name, title, nchX, xbinsize, lowY, highY, option);
458  onbooking(tprofile);
459  return tprofile;
460  });
461  }
463  MonitorElement* bookProfile(TString const& name, TProfile* object, FUNC onbooking = NOOP()) {
464  return bookME(
465  name,
467  [=]() {
468  auto tprofile = static_cast<TProfile*>(object->Clone(name));
469  onbooking(tprofile);
470  return tprofile;
471  },
472  /* forceReplace */ true);
473  }
474 
477  TString const& title,
478  int nchX,
479  double lowX,
480  double highX,
481  int nchY,
482  double lowY,
483  double highY,
484  double lowZ,
485  double highZ,
486  char const* option = "s",
487  FUNC onbooking = NOOP()) {
489  auto tprofile = new TProfile2D(name, title, nchX, lowX, highX, nchY, lowY, highY, lowZ, highZ, option);
490  onbooking(tprofile);
491  return tprofile;
492  });
493  }
496  TString const& title,
497  int nchX,
498  double lowX,
499  double highX,
500  int nchY,
501  double lowY,
502  double highY,
503  int /* nchZ */,
504  double lowZ,
505  double highZ,
506  char const* option = "s",
507  FUNC onbooking = NOOP()) {
509  auto tprofile = new TProfile2D(name, title, nchX, lowX, highX, nchY, lowY, highY, lowZ, highZ, option);
510  onbooking(tprofile);
511  return tprofile;
512  });
513  }
515  MonitorElement* bookProfile2D(TString const& name, TProfile2D* object, FUNC onbooking = NOOP()) {
516  return bookME(
517  name,
519  [=]() {
520  auto tprofile = static_cast<TProfile2D*>(object->Clone(name));
521  onbooking(tprofile);
522  return tprofile;
523  },
524  /* forceReplace */ true);
525  }
526 
527  //
528  // all non-template interfaces are virtual.
529  //
530 
532  // RAII-Style guard to set and reset the Scope.
533  template <MonitorElementData::Scope SCOPE>
534  struct UseScope {
537  UseScope(IBooker& booker) : parent(booker) { oldscope = parent.setScope(SCOPE); }
539  };
543 
544  ~IBooker() override;
545 
546  private:
547  IBooker(DQMStore* store);
548  virtual uint64_t setModuleID(uint64_t moduleID);
550  virtual MonitorElement* bookME(TString const& name,
552  std::function<TH1*()> makeobject,
553  bool forceReplace = false);
554 
555  DQMStore* store_ = nullptr;
556  MonitorElementData::Scope scope_ = MonitorElementData::Scope::JOB;
559  };
560 
562  public:
563  // The IGetter interface is not really suitable for concurrent lumis/runs,
564  // so we don't even try much to get it right. Harvesting needs to run
565  // sequentially for now. Therefore, the methods just return the next-best
566  // global MEs that they find, ignoring Scope and run/lumi.
567  // Since these are global MEs, they may be deleted at some point; don't
568  // store the pointers!
569  // They are also shared with other modules. That is save when running
570  // multi-threaded as long as getTH1() etc. are not used, but of course
571  // all dependencies need to be properly declared to get correct results.
572 
573  // TODO: review and possibly rename the all methods below:
574  // get MEs that are direct children of full path `path`
575  virtual std::vector<dqm::harvesting::MonitorElement*> getContents(std::string const& path) const;
576 
577  // get all elements below full path `path`
578  // we have to discuss semantics here -- are run/lumi ever used?
579  virtual std::vector<dqm::harvesting::MonitorElement*> getAllContents(std::string const& path) const;
581  virtual std::vector<dqm::harvesting::MonitorElement*> getAllContents(std::string const& path,
582  uint32_t runNumber,
583  uint32_t lumi) const;
584  // TODO: rename to reflect the fact that it requires full path
585  // return ME identified by full path `path`, or nullptr
586  virtual MonitorElement* get(std::string const& fullpath) const;
587 
588  // This is the most specific way to get a ME, specifying also run and
589  // lumi in the key. Primarily for internal use.
590  virtual MonitorElement* get(MonitorElementData::Key const& key) const;
591 
592  // same as get, throws an exception if histogram not found
593  // Deprecated simply because it is barely used.
595  virtual MonitorElement* getElement(std::string const& path) const;
596 
597  // return sub-directories of current directory
598  // Deprecated because the current implementation is very slow and barely
599  // used, use getAllContents instead.
601  virtual std::vector<std::string> getSubdirs() const;
602  // return element names of direct children of current directory
603  virtual std::vector<std::string> getMEs() const;
604  // returns whether there are objects at full path `path`
605  virtual bool dirExists(std::string const& path) const;
606 
607  ~IGetter() override;
608 
609  protected:
610  IGetter(DQMStore* store);
611 
613  };
614 
615  class DQMStore : public IGetter, public IBooker {
616  public:
617  // IGetter uses the globalMEs_ directly.
618  friend IGetter;
620 
622  DQMStore(DQMStore const&) = delete;
623  DQMStore(DQMStore&&) = delete;
624  DQMStore& operator=(DQMStore const&) = delete;
625  ~DQMStore() override;
626 
627  // ------------------------------------------------------------------------
628  // ---------------------- public I/O --------------------------------------
630  void save(std::string const& filename, std::string const& path = "");
632  bool open(std::string const& filename,
633  bool overwrite = false,
634  std::string const& path = "",
635  std::string const& prepend = "",
636  OpenRunDirs stripdirs = KeepRunDirs,
637  bool fileMustExist = true);
638 
639  // ------------------------------------------------------------------------
640  // ------------ IBooker/IGetter overrides to prevent ambiguity ------------
641  void cd() override { this->IBooker::cd(); }
642  void cd(std::string const& dir) override { this->IBooker::cd(dir); }
643  void goUp() override { this->IBooker::goUp(); }
644  std::string pwd() override { return this->IBooker::pwd(); }
645 
646  void setCurrentFolder(std::string const& fullpath) override {
647  // only here we keep the two in sync -- all the others call this in the end!
648  this->IBooker::setCurrentFolder(fullpath);
649  this->IGetter::setCurrentFolder(fullpath);
650  }
651 
652  public:
653  // internal -- figure out better protection.
654  template <typename iFunc>
655  void bookTransaction(iFunc f, uint64_t moduleId, bool canSaveByLumi) {
656  // taking the lock here only to protect the single, global IBooker (as
657  // base class of DQMStore). We could avoid taking this lock by making a
658  // new IBooker instance for each transaction, and the DQMStore itself
659  // takes the lock before touching any data structures.
660  // There is a race in bookME when we don't take this lock, where two
661  // modules might prepare a global ME for the same name at the same time
662  // and only one of them succeeds in putME: this is is safe, but we need
663  // to remove the assertion over there and subsystem code has to be
664  // aware that the booking callback *can* run multiple times.
665  // Additionally, this lock is what keeps usage of getTH1() safe during
666  // booking... all code needs to be migrated to callbacks before this can
667  // be removed.
668  auto lock = std::scoped_lock(this->booking_mutex_);
669 
670  // This is to make sure everything gets reset in case of an exception.
671  // That is not really required (an exception here will crash the job
672  // anyways, and it is technically not required to reset everything), but
673  // it prevents misleading error messages in other threads.
674  struct ModuleIdScope {
675  IBooker& booker_;
676  uint64_t oldid_;
677  MonitorElementData::Scope oldscope_;
678  edm::LuminosityBlockID oldrunlumi_;
679  ModuleIdScope(IBooker& booker,
680  uint64_t newid,
681  MonitorElementData::Scope newscope,
682  edm::LuminosityBlockID newrunlumi)
683  : booker_(booker) {
684  oldid_ = booker_.setModuleID(newid);
685  oldscope_ = booker_.setScope(newscope);
686  oldrunlumi_ = booker_.setRunLumi(newrunlumi);
687  assert(newid != 0 || !"moduleID must be set for normal booking transaction");
688  assert(oldid_ == 0 || !"Nested booking transaction?");
689  }
690  ~ModuleIdScope() {
691  booker_.setModuleID(oldid_);
692  booker_.setScope(oldscope_);
693  booker_.setRunLumi(oldrunlumi_);
694  }
695  };
696 
697  ModuleIdScope booker(
698  *this,
699  moduleId,
700  // enable per-lumi-by-default here
701  canSaveByLumi && this->doSaveByLumi_ ? MonitorElementData::Scope::LUMI : MonitorElementData::Scope::RUN,
702  // always book prototypes
704 
705  f(booker.booker_);
706  };
707 
708  template <typename iFunc>
709  void meBookerGetter(iFunc f) {
710  auto lock = std::scoped_lock(this->booking_mutex_);
711  // here, we make much less assumptions compared to bookTransaction.
712  // This is essentially legacy semantics except we actually take the lock.
713  f(*this, *this);
714  // TODO: we should maybe make sure that Scope changes are reset here,
715  // but also it makes sense to inherit the Scope from the environement
716  // (e.g. when meBookerGetter is called *inside* a booking transaction).
717  };
718 
719  // For input modules: trigger recycling without local ME/enterLumi/moduleID.
721 
722  // this creates local all needed global MEs for the given run/lumi (and
723  // module), potentially cloning them if there are concurrent runs/lumis.
724  // Symmetrical to cleanupLumi, this is called from a framwork hook, to
725  // make sure it also runs when the module does not call anything.
728 
729  // modules are expected to call these callbacks when they change run/lumi.
730  // The DQMStore then updates the module's MEs local MEs to point to the
731  // new run/lumi.
734 
735  // this is triggered by a framework hook to remove/recycle MEs after a
736  // run/lumi is saved. We do this via the edm::Service interface to make
737  // sure it runs after *all* output modules, even if there are multiple.
739 
740  // Add ME to DQMStore datastructures. The object will be deleted if a
741  // similar object is already present.
742  // For global ME
744  // For local ME
746  // Find a global ME of matching name, in any state.
747  // MELIKE can be a MonitorElementData::Path or MonitorElement*.
748  template <typename MELIKE>
749  MonitorElement* findME(MELIKE const& path);
750  // Log a backtrace on booking.
751  void printTrace(std::string const& message);
752  // print a log message if ME matches trackME_.
753  void debugTrackME(const char* message, MonitorElement* me_local, MonitorElement* me_global) const;
754 
755  private:
756  // MEComparison is a name-only comparison on MEs and Paths, allowing
757  // heterogeneous lookup.
758  // The ME objects here are lightweight, all the important stuff is in the
759  // MEData. However we never handle MEData directly, but always keep it
760  // wrapped in MEs (created as needed). MEs can share MEData.
761  // ME objects must never appear more than once in these sets. ME objects
762  // in localMEs_ cannot be deleted, since the module might hold pointers.
763  // MEs in globalMEs_ can be deleted/recycled at the end of their scope,
764  // if there are no local MEs left that share the data.
765  // MEs can be _protoype MEs_ if their scope is not yet known (after
766  // booking, after leaveLumi). A prototype is kept if and only if there is
767  // no other global instance of the same ME. Prototype MEs have
768  // run = lumi = 0 and scope != JOB. If scope == JOB, a prototype is never
769  // required. Prototype MEs are reset *before* inserting, so fill calls
770  // can go into prototype MEs and not be lost.
771  // Key is (run, lumi), potentially one or both 0 for SCOPE::RUN or SCOPE::JOB
772  // NEVER modify the key_ of a ME in these datastructures. Since we use
773  // pointers, this may be possible (not everything is const), but it could
774  // still corrupt the datastructure.
775  std::map<edm::LuminosityBlockID, std::set<MonitorElement*, MonitorElement::MEComparison>> globalMEs_;
776  // Key is (moduleID [, run | , stream]), run is only needed for
777  // edm::global, stream only for edm::stream.
778  // Legacy MEs have moduleID 0.
779  std::map<uint64_t, std::set<MonitorElement*, MonitorElement::MEComparison>> localMEs_;
780  // Whenever modifying these sets, take this mutex. It's recursive, so we
781  // can be liberal -- lock on any access, but also lock on the full booking
782  // transaction.
783  std::recursive_mutex booking_mutex_;
784 
785  // Universal verbose flag.
786  // Only very few usages remain, the main debugging tool is trackME_.
787  int verbose_;
788 
789  // If set to true, error out whenever things happen that are not safe for
790  // legacy modules.
792 
793  // Book MEs by lumi by default whenever possible.
795  std::vector<std::string> MEsToSave_; //just if perLS is ON
796 
797  // if non-empty, debugTrackME calls will log some information whenever a
798  // ME path contains this string.
800  };
801  } // namespace implementation
802 
803  // Since we still use a single, edm::Serivce instance of a DQMStore, these are all the same.
804  namespace legacy {
806  public:
809  // import constructors.
811  };
812  } // namespace legacy
813  namespace reco {
815  } // namespace reco
816  namespace harvesting {
818  } // namespace harvesting
819 } // namespace dqm
820 
821 #endif
DQMStore(edm::ParameterSet const &pset, edm::ActivityRegistry &)
Definition: DQMStore.cc:756
MonitorElement * book2D(TString const &name, TString const &title, int nchX, float const *xbinsize, int nchY, float const *ybinsize, FUNC onbooking=NOOP())
Definition: DQMStore.h:228
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:270
MonitorElement * book2D(TString const &name, TH2F *object, FUNC onbooking=NOOP())
Definition: DQMStore.h:242
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:476
virtual DQM_DEPRECATED MonitorElement * getElement(std::string const &path) const
Definition: DQMStore.cc:709
MonitorElement * book1I(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:177
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:254
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:463
dqm::legacy::DQMStore DQMStore
Definition: DQMStore.h:817
virtual std::vector< std::string > getMEs() const
Definition: DQMStore.cc:737
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:646
virtual MonitorElementData::Scope setScope(MonitorElementData::Scope newscope)
Definition: DQMStore.cc:50
virtual bool dirExists(std::string const &path) const
Definition: DQMStore.cc:747
void printTrace(std::string const &message)
Definition: DQMStore.cc:227
void bookTransaction(iFunc f, uint64_t moduleId, bool canSaveByLumi)
Definition: DQMStore.h:655
MonitorElement * book2DD(TString const &name, TH2D *object, FUNC onbooking=NOOP())
Definition: DQMStore.h:354
std::map< uint64_t, std::set< MonitorElement *, MonitorElement::MEComparison > > localMEs_
Definition: DQMStore.h:779
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:642
std::string pwd() override
Definition: DQMStore.h:644
edm::LuminosityBlockID runlumi_
Definition: DQMStore.h:558
MonitorElementData::Scope scope_
Definition: DQMStore.h:556
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:416
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:334
void leaveLumi(edm::RunNumber_t run, edm::LuminosityBlockNumber_t lumi, uint64_t moduleID)
Definition: DQMStore.cc:509
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:377
void enterLumi(edm::RunNumber_t run, edm::LuminosityBlockNumber_t lumi, uint64_t moduleID)
Definition: DQMStore.cc:465
std::recursive_mutex booking_mutex_
Definition: DQMStore.h:783
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:399
virtual std::vector< dqm::harvesting::MonitorElement * > getAllContents(std::string const &path) const
Definition: DQMStore.cc:626
MonitorElement * book2I(TString const &name, TString const &title, int nchX, float const *xbinsize, int nchY, float const *ybinsize, FUNC onbooking=NOOP())
Definition: DQMStore.h:312
IGetter(DQMStore *store)
Definition: DQMStore.cc:752
IBooker(DQMStore *store)
Definition: DQMStore.cc:43
void meBookerGetter(iFunc f)
Definition: DQMStore.h:709
MonitorElement * book1S(TString const &name, TString const &title, int nchX, double lowX, double highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:133
double f[11][100]
Definition: value.py:1
std::map< edm::LuminosityBlockID, std::set< MonitorElement *, MonitorElement::MEComparison > > globalMEs_
Definition: DQMStore.h:775
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:190
MonitorElement * book1I(TString const &name, TH1I *object, FUNC onbooking=NOOP())
Definition: DQMStore.h:199
MonitorElementData::Scope oldscope
Definition: DQMStore.h:536
dqm::legacy::MonitorElement MonitorElement
Definition: DQMStore.h:20
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:448
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:495
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:212
MonitorElement * findME(MELIKE const &path)
Definition: DQMStore.cc:213
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:338
std::vector< std::string > MEsToSave_
Definition: DQMStore.h:795
void operator()(TH1 *) const
Definition: DQMStore.h:50
MonitorElement * bookProfile2D(TString const &name, TProfile2D *object, FUNC onbooking=NOOP())
Definition: DQMStore.h:515
MonitorElement * putME(MonitorElement *me)
Definition: DQMStore.cc:165
DQM_DEPRECATED void save(std::string const &filename, std::string const &path="")
Definition: DQMStore.cc:801
MonitorElement * book2S(TString const &name, TH2S *object, FUNC onbooking=NOOP())
Definition: DQMStore.h:284
fixed size matrix
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:164
void cleanupLumi(edm::RunNumber_t run, edm::LuminosityBlockNumber_t lumi)
Definition: DQMStore.cc:543
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:432
void debugTrackME(const char *message, MonitorElement *me_local, MonitorElement *me_global) const
Definition: DQMStore.cc:296
MonitorElement * book2I(TString const &name, TH2I *object, FUNC onbooking=NOOP())
Definition: DQMStore.h:326
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:367
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:296
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:807
#define DQM_DEPRECATED
Definition: DQMStore.cc:2
virtual std::vector< dqm::harvesting::MonitorElement * > getContents(std::string const &path) const
Definition: DQMStore.cc:610
MonitorElement * book3D(TString const &name, TH3F *object, FUNC onbooking=NOOP())
Definition: DQMStore.h:386
virtual DQM_DEPRECATED std::vector< std::string > getSubdirs() const
Definition: DQMStore.cc:717