CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DQMStore.h
Go to the documentation of this file.
1 #ifndef DQMSERVICES_CORE_DQM_STORE_H
2 # define DQMSERVICES_CORE_DQM_STORE_H
3 
4 # if __GNUC__ && ! defined DQM_DEPRECATED
5 # define DQM_DEPRECATED __attribute__((deprecated))
6 # endif
7 
9 # include "classlib/utils/Regexp.h"
10 # include <vector>
11 # include <string>
12 # include <list>
13 # include <map>
14 # include <set>
15 # include <cassert>
16 # include <mutex>
17 # include <thread>
18 # include <execinfo.h>
19 # include <stdio.h>
20 # include <stdlib.h>
21 # include <cxxabi.h>
22 # include <iosfwd>
23 
24 namespace edm { class DQMHttpSource; class ParameterSet; class ActivityRegistry;}
25 namespace lat { class Regexp; }
26 namespace dqmstorepb {class ROOTFilePB; class ROOTFilePB_Histo;}
27 
28 class MonitorElement;
29 class QCriterion;
30 class TFile;
31 class TBufferFile;
32 class TObject;
33 class TH1;
34 class TObjString;
35 class TH1F;
36 class TH1S;
37 class TH1D;
38 class TH2F;
39 class TH2S;
40 class TH2D;
41 class TH3F;
42 class TProfile;
43 class TProfile2D;
44 class TNamed;
45 
46 
51 class fastmatch
52 {
53  private:
55 
56  public:
57  fastmatch (std::string const& _fastString);
58  ~fastmatch();
59 
60  bool match (std::string const& s) const;
61 
62  private:
63  // checks if two strings are equal, starting at the back of the strings
65  std::string const& input) const;
66  // checks if two strings are equal, starting at the front of the strings
67  bool compare_strings (std::string const& pattern,
68  std::string const& input) const;
69 
70  lat::Regexp * regexp_;
73 };
74 
75 class DQMStore
76 {
77  public:
79  {
83  };
85  {
88  };
89 
90  class IBooker
91  {
92  public:
93  friend class DQMStore;
94 
95  // for the supported syntaxes, see the declarations of DQMStore::bookString
96  template <typename... Args>
98  return owner_->bookString(std::forward<Args>(args)...);
99  }
100 
101  // for the supported syntaxes, see the declarations of DQMStore::bookInt
102  template <typename... Args>
104  return owner_->bookInt(std::forward<Args>(args)...);
105  }
106 
107  // for the supported syntaxes, see the declarations of DQMStore::bookFloat
108  template <typename... Args>
110  return owner_->bookFloat(std::forward<Args>(args)...);
111  }
112 
113  // for the supported syntaxes, see the declarations of DQMStore::book1D
114  template <typename... Args>
116  return owner_->book1D(std::forward<Args>(args)...);
117  }
118 
119  // for the supported syntaxes, see the declarations of DQMStore::book1S
120  template <typename... Args>
122  return owner_->book1S(std::forward<Args>(args)...);
123  }
124 
125  // for the supported syntaxes, see the declarations of DQMStore::book1DD
126  template <typename... Args>
128  return owner_->book1DD(std::forward<Args>(args)...);
129  }
130 
131  // for the supported syntaxes, see the declarations of DQMStore::book2D
132  template <typename... Args>
134  return owner_->book2D(std::forward<Args>(args)...);
135  }
136 
137  // for the supported syntaxes, see the declarations of DQMStore::book2S
138  template <typename... Args>
140  return owner_->book2S(std::forward<Args>(args)...);
141  }
142 
143  // for the supported syntaxes, see the declarations of DQMStore::book2DD
144  template <typename... Args>
146  return owner_->book2DD(std::forward<Args>(args)...);
147  }
148 
149  // for the supported syntaxes, see the declarations of DQMStore::book3D
150  template <typename... Args>
152  return owner_->book3D(std::forward<Args>(args)...);
153  }
154 
155  // for the supported syntaxes, see the declarations of DQMStore::bookProfile
156  template <typename... Args>
158  return owner_->bookProfile(std::forward<Args>(args)...);
159  }
160 
161  // for the supported syntaxes, see the declarations of DQMStore::bookProfile2D
162  template <typename... Args>
164  return owner_->bookProfile2D(std::forward<Args>(args)...);
165  }
166 
167  void cd(void);
168  void cd(const std::string &dir);
169  void setCurrentFolder(const std::string &fullpath);
170  void goUp(void);
171  const std::string & pwd(void);
172  void tag(MonitorElement *, unsigned int);
173  void tagContents(const std::string &, unsigned int);
174 
175  private:
176  explicit IBooker(DQMStore * store):owner_(0) {
177  assert(store);
178  owner_ = store;
179  }
180 
181  IBooker();
182  IBooker(const IBooker&);
183 
184  // Embedded classes do not natively own a pointer to the embedding
185  // class. We therefore need to store a pointer to the main
186  // DQMStore instance (owner_).
188  }; // IBooker
189 
190  class IGetter
191  {
192  public:
193  friend class DQMStore;
194 
195  // for the supported syntaxes, see the declarations of DQMStore::getContents
196  template <typename... Args>
197  std::vector<MonitorElement *> getContents(Args && ... args) {
198  return owner_->getContents(std::forward<Args>(args)...);
199  }
200  // for the supported syntaxes, see the declarations of DQMStore::removeElements
201  template <typename... Args>
202  void removeElement(Args && ... args) {
203  return owner_->removeElement(std::forward<Args>(args)...);
204  }
205 
206  std::vector<MonitorElement*> getAllContents(const std::string &path,
207  uint32_t runNumber = 0,
208  uint32_t lumi = 0);
209  MonitorElement * get(const std::string &path);
210  std::vector<std::string> getSubdirs(void);
211  std::vector<std::string> getMEs(void);
213  bool dirExists(const std::string &path);
214  void cd(void);
215  void cd(const std::string &dir);
216  void setCurrentFolder(const std::string &fullpath);
217 
218  private:
219  explicit IGetter(DQMStore * store):owner_(0) {
220  assert(store);
221  owner_ = store;
222  }
223 
224  IGetter();
225  IGetter(const IGetter&);
226 
227  // Embedded classes do not natively own a pointer to the embedding
228  // class. We therefore need to store a pointer to the main
229  // DQMStore instance (owner_).
231  }; //IGetter
232 
233  // Template function to be used inside each DQM Modules' lambda
234  // functions to book MonitorElements into the DQMStore. The function
235  // calls whatever user-supplied code via the function f. The latter
236  // is passed the instance of the IBooker class (owned by the *only*
237  // DQMStore instance), that is capable of booking MonitorElements
238  // into the DQMStore via a public API. The central mutex is acquired
239  // *before* invoking fand automatically released upon returns.
240  template <typename iFunc>
241  void bookTransaction(iFunc f,
242  uint32_t run,
243  uint32_t streamId,
244  uint32_t moduleId) {
245  std::lock_guard<std::mutex> guard(book_mutex_);
246  /* If enableMultiThread is not enabled we do not set run_,
247  streamId_ and moduleId_ to 0, since we rely on their default
248  initialization in DQMStore constructor. */
249  if (enableMultiThread_) {
250  run_ = run;
251  streamId_ = streamId;
252  moduleId_ = moduleId;
253  }
254  f(*ibooker_);
255 
256  /* Initialize to 0 the run_, streamId_ and moduleId_ variables
257  in case we run in mixed conditions with DQMEDAnalyzers and
258  legacy modules */
259  if (enableMultiThread_) {
260  run_ = 0;
261  streamId_ = 0;
262  moduleId_ = 0;
263  }
264  }
265  // Signature needed in the harvesting where the booking is done
266  // in the endJob. No handles to the run there. Two arguments ensure
267  // the capability of booking and getting. The method relies on the
268  // initialization of run, stream and module ID to 0. The mutex
269  // is not needed.
270  template <typename iFunc>
271  void meBookerGetter(iFunc f) {
272  f(*ibooker_, *igetter_);
273  }
274  // Signature needed in the harvesting where it might be needed to get
275  // the LS based histograms. Handle to the Lumi and to the iSetup are available.
276  // No need to book anything there. The method relies on the
277  // initialization of run, stream and module ID to 0. The mutex
278  // is not needed.
279  template <typename iFunc>
280  void meGetter(iFunc f) {
281  f(*igetter_);
282  }
283 
284  //-------------------------------------------------------------------------
285  // ---------------------- Constructors ------------------------------------
287  DQMStore(const edm::ParameterSet &pset);
288  ~DQMStore(void);
289 
290  //-------------------------------------------------------------------------
291  void setVerbose(unsigned level);
292 
293  // ---------------------- public navigation -------------------------------
294  const std::string & pwd(void) const;
295  void cd(void);
296  void cd(const std::string &subdir);
297  void setCurrentFolder(const std::string &fullpath);
298  void goUp(void);
299 
300  bool dirExists(const std::string &path) const;
301 
302  //-------------------------------------------------------------------------
303  // ---------------------- public ME booking -------------------------------
304 
305  MonitorElement * bookInt (const char *name);
307 
308  MonitorElement * bookFloat (const char *name);
310 
311  MonitorElement * bookString (const char *name,
312  const char *value);
314  const std::string &value);
315 
316  MonitorElement * book1D (const char *name,
317  const char *title,
318  int nchX, double lowX, double highX);
320  const std::string &title,
321  int nchX, double lowX, double highX);
322  MonitorElement * book1D (const char *name,
323  const char *title,
324  int nchX, const float *xbinsize);
326  const std::string &title,
327  int nchX, const float *xbinsize);
328  MonitorElement * book1D (const char *name, TH1F *h);
329  MonitorElement * book1D (const std::string &name, TH1F *h);
330 
331  MonitorElement * book1S (const char *name,
332  const char *title,
333  int nchX, double lowX, double highX);
335  const std::string &title,
336  int nchX, double lowX, double highX);
337  MonitorElement * book1S (const char *name,
338  const char *title,
339  int nchX, const float *xbinsize);
341  const std::string &title,
342  int nchX, const float *xbinsize);
343  MonitorElement * book1S (const char *name, TH1S *h);
344  MonitorElement * book1S (const std::string &name, TH1S *h);
345 
346  MonitorElement * book1DD (const char *name,
347  const char *title,
348  int nchX, double lowX, double highX);
350  const std::string &title,
351  int nchX, double lowX, double highX);
352  MonitorElement * book1DD (const char *name,
353  const char *title,
354  int nchX, const float *xbinsize);
356  const std::string &title,
357  int nchX, const float *xbinsize);
358  MonitorElement * book1DD (const char *name, TH1D *h);
359  MonitorElement * book1DD (const std::string &name, TH1D *h);
360 
361  MonitorElement * book2D (const char *name,
362  const char *title,
363  int nchX, double lowX, double highX,
364  int nchY, double lowY, double highY);
366  const std::string &title,
367  int nchX, double lowX, double highX,
368  int nchY, double lowY, double highY);
369  MonitorElement * book2D (const char *name,
370  const char *title,
371  int nchX, const float *xbinsize,
372  int nchY, const float *ybinsize);
374  const std::string &title,
375  int nchX, const float *xbinsize,
376  int nchY, const float *ybinsize);
377  MonitorElement * book2D (const char *name, TH2F *h);
378  MonitorElement * book2D (const std::string &name, TH2F *h);
379 
380  MonitorElement * book2S (const char *name,
381  const char *title,
382  int nchX, double lowX, double highX,
383  int nchY, double lowY, double highY);
385  const std::string &title,
386  int nchX, double lowX, double highX,
387  int nchY, double lowY, double highY);
388  MonitorElement * book2S (const char *name,
389  const char *title,
390  int nchX, const float *xbinsize,
391  int nchY, const float *ybinsize);
393  const std::string &title,
394  int nchX, const float *xbinsize,
395  int nchY, const float *ybinsize);
396  MonitorElement * book2S (const char *name, TH2S *h);
397  MonitorElement * book2S (const std::string &name, TH2S *h);
398 
399  MonitorElement * book2DD (const char *name,
400  const char *title,
401  int nchX, double lowX, double highX,
402  int nchY, double lowY, double highY);
404  const std::string &title,
405  int nchX, double lowX, double highX,
406  int nchY, double lowY, double highY);
407  MonitorElement * book2DD (const char *name,
408  const char *title,
409  int nchX, const float *xbinsize,
410  int nchY, const float *ybinsize);
412  const std::string &title,
413  int nchX, const float *xbinsize,
414  int nchY, const float *ybinsize);
415  MonitorElement * book2DD (const char *name, TH2D *h);
416  MonitorElement * book2DD (const std::string &name, TH2D *h);
417 
418  MonitorElement * book3D (const char *name,
419  const char *title,
420  int nchX, double lowX, double highX,
421  int nchY, double lowY, double highY,
422  int nchZ, double lowZ, double highZ);
424  const std::string &title,
425  int nchX, double lowX, double highX,
426  int nchY, double lowY, double highY,
427  int nchZ, double lowZ, double highZ);
428  MonitorElement * book3D (const char *name, TH3F *h);
429  MonitorElement * book3D (const std::string &name, TH3F *h);
430 
431  MonitorElement * bookProfile (const char *name,
432  const char *title,
433  int nchX, double lowX, double highX,
434  int nchY, double lowY, double highY,
435  const char *option = "s");
437  const std::string &title,
438  int nchX, double lowX, double highX,
439  int nchY, double lowY, double highY,
440  const char *option = "s");
441  MonitorElement * bookProfile (const char *name,
442  const char *title,
443  int nchX, double lowX, double highX,
444  double lowY, double highY,
445  const char *option = "s");
447  const std::string &title,
448  int nchX, double lowX, double highX,
449  double lowY, double highY,
450  const char *option = "s");
451  MonitorElement * bookProfile (const char *name,
452  const char *title,
453  int nchX, const double *xbinsize,
454  int nchY, double lowY, double highY,
455  const char *option = "s");
457  const std::string &title,
458  int nchX, const double *xbinsize,
459  int nchY, double lowY, double highY,
460  const char *option = "s");
461  MonitorElement * bookProfile (const char *name,
462  const char *title,
463  int nchX, const double *xbinsize,
464  double lowY, double highY,
465  const char *option = "s");
467  const std::string &title,
468  int nchX, const double *xbinsize,
469  double lowY, double highY,
470  const char *option = "s");
471  MonitorElement * bookProfile (const char *name, TProfile *h);
472  MonitorElement * bookProfile (const std::string &name, TProfile *h);
473 
474  MonitorElement * bookProfile2D(const char *name,
475  const char *title,
476  int nchX, double lowX, double highX,
477  int nchY, double lowY, double highY,
478  int nchZ, double lowZ, double highZ,
479  const char *option = "s");
481  const std::string &title,
482  int nchX, double lowX, double highX,
483  int nchY, double lowY, double highY,
484  int nchZ, double lowZ, double highZ,
485  const char *option = "s");
486  MonitorElement * bookProfile2D(const char *name,
487  const char *title,
488  int nchX, double lowX, double highX,
489  int nchY, double lowY, double highY,
490  double lowZ, double highZ,
491  const char *option = "s");
493  const std::string &title,
494  int nchX, double lowX, double highX,
495  int nchY, double lowY, double highY,
496  double lowZ, double highZ,
497  const char *option = "s");
498  MonitorElement * bookProfile2D(const char *name, TProfile2D *h);
499  MonitorElement * bookProfile2D(const std::string &name, TProfile2D *h);
500 
501  //-------------------------------------------------------------------------
502  // ---------------------- public tagging ----------------------------------
503  void tag(MonitorElement *me, unsigned int myTag);
504  void tag(const std::string &path, unsigned int myTag);
505  void tagContents(const std::string &path, unsigned int myTag);
506  void tagAllContents(const std::string &path, unsigned int myTag);
507 
508  //-------------------------------------------------------------------------
509  // ---------------------- public ME getters -------------------------------
510  std::vector<std::string> getSubdirs(void) const;
511  std::vector<std::string> getMEs(void) const;
512  bool containsAnyMonitorable(const std::string &path) const;
513 
514  MonitorElement * get(const std::string &path) const;
515  std::vector<MonitorElement *> get(unsigned int tag) const;
516  std::vector<MonitorElement *> getContents(const std::string &path) const;
517  std::vector<MonitorElement *> getContents(const std::string &path, unsigned int tag) const;
518  void getContents(std::vector<std::string> &into, bool showContents = true) const;
519 
520  // ---------------------- softReset methods -------------------------------
521  void softReset(MonitorElement *me);
523 
524  // ---------------------- Public deleting ---------------------------------
525  void rmdir(const std::string &fullpath);
526  void removeContents(void);
527  void removeContents(const std::string &dir);
528  void removeElement(const std::string &name);
529  void removeElement(const std::string &dir, const std::string &name, bool warning = true);
530 
531  //-------------------------------------------------------------------------
532  // ---------------------- public I/O --------------------------------------
533  void savePB(const std::string &filename,
534  const std::string &path = "",
535  const uint32_t run = 0,
536  const uint32_t lumi = 0,
537  const bool resetMEsAfterWriting = false);
538  void save(const std::string &filename,
539  const std::string &path = "",
540  const std::string &pattern = "",
541  const std::string &rewrite = "",
542  const uint32_t run = 0,
543  const uint32_t lumi = 0,
546  const std::string &fileupdate = "RECREATE",
547  const bool resetMEsAfterWriting = false);
548  bool open(const std::string &filename,
549  bool overwrite = false,
550  const std::string &path ="",
551  const std::string &prepend = "",
552  OpenRunDirs stripdirs = KeepRunDirs,
553  bool fileMustExist = true);
554  bool load(const std::string &filename,
555  OpenRunDirs stripdirs = StripRunDirs,
556  bool fileMustExist = true);
557  bool mtEnabled() { return enableMultiThread_; };
558 
559  //-------------------------------------------------------------------------
560  // ---------------------- Public print methods -----------------------------
561  void showDirStructure(void) const;
562 
563  // ---------------------- Public check options -----------------------------
564  bool isCollate(void) const;
565 
566  //-------------------------------------------------------------------------
567  // ---------------------- Quality Test methods -----------------------------
568  QCriterion * getQCriterion(const std::string &qtname) const;
569  QCriterion * createQTest(const std::string &algoname, const std::string &qtname);
570  void useQTest(const std::string &dir, const std::string &qtname);
571  int useQTestByMatch(const std::string &pattern, const std::string &qtname);
572  void runQTests(void);
573  int getStatus(const std::string &path = "") const;
574  void scaleElements(void);
575 
576  private:
577  // ---------------- Navigation -----------------------
578  bool cdInto(const std::string &path) const;
579 
580  // ------------------- Reference ME -------------------------------
581  bool isCollateME(MonitorElement *me) const;
582 
583  // ------------------- Private "getters" ------------------------------
584  bool readFilePB(const std::string &filename,
585  bool overwrite = false,
586  const std::string &path ="",
587  const std::string &prepend = "",
588  OpenRunDirs stripdirs = StripRunDirs,
589  bool fileMustExist = true);
590  bool readFile(const std::string &filename,
591  bool overwrite = false,
592  const std::string &path ="",
593  const std::string &prepend = "",
594  OpenRunDirs stripdirs = StripRunDirs,
595  bool fileMustExist = true);
596  void makeDirectory(const std::string &path);
597  unsigned int readDirectory(TFile *file,
598  bool overwrite,
599  const std::string &path,
600  const std::string &prepend,
601  const std::string &curdir,
602  OpenRunDirs stripdirs);
603 
605  const std::string &name,
606  const uint32_t run = 0,
607  const uint32_t lumi = 0,
608  const uint32_t streamId = 0,
609  const uint32_t moduleId = 0) const;
610 
613  std::string & objname,
614  TObject ** obj);
615 
616  public:
617  void getAllTags(std::vector<std::string> &into) const;
618  std::vector<MonitorElement*> getAllContents(const std::string &path,
619  uint32_t runNumber = 0,
620  uint32_t lumi = 0) const;
621  std::vector<MonitorElement*> getMatchingContents(const std::string &pattern, lat::Regexp::Syntax syntaxType = lat::Regexp::Wildcard) const;
622 
623  // Multithread SummaryCache manipulations
624  void mergeAndResetMEsRunSummaryCache(uint32_t run,
625  uint32_t streamId,
626  uint32_t moduleId);
628  uint32_t lumi,
629  uint32_t streamId,
630  uint32_t moduleId);
631 
632  void deleteUnusedLumiHistograms(uint32_t run, uint32_t lumi);
633  private:
634 
635  // ---------------- Miscellaneous -----------------------------
636  void initializeFrom(const edm::ParameterSet&);
637  void reset(void);
638  void forceReset(void);
639 
640  bool extract(TObject *obj, const std::string &dir, bool overwrite, bool collateHistograms);
641  TObject * extractNextObject(TBufferFile&) const;
642 
643  // ---------------------- Booking ------------------------------------
646  const std::string &name,
647  const char *context);
648  template <class HISTO, class COLLATE>
650  const char *context, int kind,
651  HISTO *h, COLLATE collate);
652 
656  MonitorElement * book1D(const std::string &dir, const std::string &name, TH1F *h);
657  MonitorElement * book1S(const std::string &dir, const std::string &name, TH1S *h);
658  MonitorElement * book1DD(const std::string &dir, const std::string &name, TH1D *h);
659  MonitorElement * book2D(const std::string &dir, const std::string &name, TH2F *h);
660  MonitorElement * book2S(const std::string &dir, const std::string &name, TH2S *h);
661  MonitorElement * book2DD(const std::string &dir, const std::string &name, TH2D *h);
662  MonitorElement * book3D(const std::string &dir, const std::string &name, TH3F *h);
663  MonitorElement * bookProfile(const std::string &dir, const std::string &name, TProfile *h);
664  MonitorElement * bookProfile2D(const std::string &folder, const std::string &name, TProfile2D *h);
665 
666  static bool checkBinningMatches(MonitorElement *me, TH1 *h, unsigned verbose);
667 
668  static void collate1D(MonitorElement *me, TH1F *h, unsigned verbose);
669  static void collate1S(MonitorElement *me, TH1S *h, unsigned verbose);
670  static void collate1DD(MonitorElement *me, TH1D *h, unsigned verbose);
671  static void collate2D(MonitorElement *me, TH2F *h, unsigned verbose);
672  static void collate2S(MonitorElement *me, TH2S *h, unsigned verbose);
673  static void collate2DD(MonitorElement *me, TH2D *h, unsigned verbose);
674  static void collate3D(MonitorElement *me, TH3F *h, unsigned verbose);
675  static void collateProfile(MonitorElement *me, TProfile *h, unsigned verbose);
676  static void collateProfile2D(MonitorElement *me, TProfile2D *h, unsigned verbose);
677 
678  // --- Operations on MEs that are normally reset at end of monitoring cycle ---
679  void setAccumulate(MonitorElement *me, bool flag);
680 
681  void print_trace(const std::string &dir, const std::string &name);
682 
683  // ----------------------- Unavailable ---------------------------------------
684  DQMStore(const DQMStore&);
685  const DQMStore& operator=(const DQMStore&);
686 
687  //-------------------------------------------------------------------------------
688  //-------------------------------------------------------------------------------
689  typedef std::pair<fastmatch *, QCriterion *> QTestSpec;
690  typedef std::list<QTestSpec> QTestSpecs;
691  typedef std::set<MonitorElement> MEMap;
692  typedef std::map<std::string, QCriterion *> QCMap;
693  typedef std::map<std::string, QCriterion *(*)(const std::string &)> QAMap;
694 
695  unsigned verbose_;
696  unsigned verboseQT_;
697  bool reset_;
698  double scaleFlag_;
704  uint32_t run_;
705  uint32_t streamId_;
706  uint32_t moduleId_;
707  std::ofstream * stream_;
708 
711  std::set<std::string> dirs_;
712 
716 
720 
721  friend class edm::DQMHttpSource;
722  friend class DQMService;
723  friend class DQMNet;
724  friend class DQMArchiver;
725  friend class DQMStoreExample; // for get{All,Matching}Contents -- sole user of this method!
726  friend class DQMRootOutputModule;
727  friend class DQMRootSource;
728  friend class DQMFileSaver;
729  friend class MEtoEDMConverter;
730 };
731 
732 #endif // DQMSERVICES_CORE_DQM_STORE_H
QCriterion * getQCriterion(const std::string &qtname) const
Definition: DQMStore.cc:3233
IGetter * igetter_
Definition: DQMStore.h:719
bool compare_strings_reverse(std::string const &pattern, std::string const &input) const
Definition: DQMStore.cc:205
std::pair< fastmatch *, QCriterion * > QTestSpec
Definition: DQMStore.h:689
std::vector< MonitorElement * > getContents(Args &&...args)
Definition: DQMStore.h:197
MonitorElement * book1S(Args &&...args)
Definition: DQMStore.h:121
DQMStore(const edm::ParameterSet &pset, edm::ActivityRegistry &)
Definition: DQMStore.cc:483
MonitorElement * book2S(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2S histogram.
Definition: DQMStore.cc:1144
std::map< std::string, QCriterion * > QCMap
Definition: DQMStore.h:692
bool containsAnyMonitorable(const std::string &path) const
Definition: DQMStore.cc:1738
bool isCollateME(MonitorElement *me) const
Definition: DQMStore.cc:3426
bool cdInto(const std::string &path) const
Definition: DQMStore.cc:2430
void cd(void)
Definition: DQMStore.cc:322
int getStatus(const std::string &path="") const
Definition: DQMStore.cc:3339
std::vector< std::string > getSubdirs(void) const
Definition: DQMStore.cc:1699
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:994
void rmdir(const std::string &fullpath)
Definition: DQMStore.cc:3166
static void collate3D(MonitorElement *me, TH3F *h, unsigned verbose)
Definition: DQMStore.cc:1603
bool match(std::string const &s) const
Definition: DQMStore.cc:247
bool readFile(const std::string &filename, bool overwrite=false, const std::string &path="", const std::string &prepend="", OpenRunDirs stripdirs=StripRunDirs, bool fileMustExist=true)
Definition: DQMStore.cc:3001
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:157
static boost::mutex mutex
Definition: LHEProxy.cc:11
MonitorElement * findObject(const std::string &dir, const std::string &name, const uint32_t run=0, const uint32_t lumi=0, const uint32_t streamId=0, const uint32_t moduleId=0) const
Definition: DQMStore.cc:1878
static void collateProfile(MonitorElement *me, TProfile *h, unsigned verbose)
Definition: DQMStore.cc:1610
MonitorElement * book3D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ)
Book 3D histogram.
Definition: DQMStore.cc:1256
MatchingHeuristicEnum
Definition: DQMStore.h:54
Definition: DQMNet.h:22
void cd(void)
Definition: DQMStore.cc:266
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:684
MonitorElement * book2DD(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D double histogram.
Definition: DQMStore.cc:1166
uint32_t streamId_
Definition: DQMStore.h:705
tuple lumi
Definition: fjr2json.py:35
const std::string & pwd(void)
Definition: DQMStore.cc:282
assert(m_qm.get())
static void collate2DD(MonitorElement *me, TH2D *h, unsigned verbose)
Definition: DQMStore.cc:1596
MonitorElement * bookInt(Args &&...args)
Definition: DQMStore.h:103
std::vector< MonitorElement * > getMatchingContents(const std::string &pattern, lat::Regexp::Syntax syntaxType=lat::Regexp::Wildcard) const
Definition: DQMStore.cc:2010
MonitorElement * bookString(Args &&...args)
Definition: DQMStore.h:97
MatchingHeuristicEnum matching_
Definition: DQMStore.h:72
list pattern
Definition: chain.py:104
bool reset_
Definition: DQMStore.h:697
MonitorElement * book1DD(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1S histogram.
Definition: DQMStore.cc:1026
friend class DQMArchiver
Definition: DQMStore.h:724
void initializeFrom(const edm::ParameterSet &)
Definition: DQMStore.cc:555
OpenRunDirs
Definition: DQMStore.h:84
uint32_t moduleId_
Definition: DQMStore.h:706
QCMap qtests_
Definition: DQMStore.h:713
MonitorElement * book(const std::string &dir, const std::string &name, const char *context)
Definition: DQMStore.cc:849
std::mutex book_mutex_
Definition: DQMStore.h:717
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:931
static std::string const input
Definition: EdmProvDump.cc:43
SaveReferenceTag
Definition: DQMStore.h:78
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1634
~DQMStore(void)
Definition: DQMStore.cc:541
void disableSoftReset(MonitorElement *me)
Definition: DQMStore.cc:3378
void forceReset(void)
Definition: DQMStore.cc:2070
std::vector< MonitorElement * > getAllContents(const std::string &path, uint32_t runNumber=0, uint32_t lumi=0) const
Definition: DQMStore.cc:1961
fastmatch(std::string const &_fastString)
Definition: DQMStore.cc:129
unsigned verboseQT_
Definition: DQMStore.h:696
QTestSpecs qtestspecs_
Definition: DQMStore.h:715
void removeContents(void)
erase all monitoring elements in current directory (not including subfolders);
Definition: DQMStore.cc:3200
double scaleFlag_
Definition: DQMStore.h:698
void deleteUnusedLumiHistograms(uint32_t run, uint32_t lumi)
Definition: DQMStore.cc:2094
void get_info(const dqmstorepb::ROOTFilePB_Histo &, std::string &dirname, std::string &objname, TObject **obj)
Definition: DQMStore.cc:3064
MonitorElement * bookString(const char *name, const char *value)
Book string.
Definition: DQMStore.cc:960
MonitorElement * bookProfile2D(Args &&...args)
Definition: DQMStore.h:163
std::set< MonitorElement > MEMap
Definition: DQMStore.h:691
bool isCollate(void) const
Definition: DQMStore.cc:3417
void removeElement(const std::string &name)
Definition: DQMStore.cc:3208
static void collateProfile2D(MonitorElement *me, TProfile2D *h, unsigned verbose)
Definition: DQMStore.cc:1620
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
void tag(MonitorElement *, unsigned int)
Definition: DQMStore.cc:286
MonitorElement * book2S(Args &&...args)
Definition: DQMStore.h:139
double f[11][100]
uint32_t run_
Definition: DQMStore.h:704
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
Definition: DQMStore.cc:1308
void setVerbose(unsigned level)
Definition: DQMStore.cc:671
void softReset(MonitorElement *me)
Definition: DQMStore.cc:3370
std::string pwd_
Definition: DQMStore.h:709
void runQTests(void)
Definition: DQMStore.cc:3318
TObject * extractNextObject(TBufferFile &) const
Definition: DQMStore.cc:3056
lat::Regexp * regexp_
Definition: DQMStore.h:70
IBooker * ibooker_
Definition: DQMStore.h:718
QAMap qalgos_
Definition: DQMStore.h:714
std::vector< MonitorElement * > getContents(const std::string &path) const
Definition: DQMStore.cc:1777
std::string readSelectedDirectory_
Definition: DQMStore.h:703
std::vector< std::string > getMEs(void)
Definition: DQMStore.cc:310
void mergeAndResetMEsRunSummaryCache(uint32_t run, uint32_t streamId, uint32_t moduleId)
Definition: DQMStore.cc:343
std::string fastString_
Definition: DQMStore.h:71
void meGetter(iFunc f)
Definition: DQMStore.h:280
bool dirExists(const std::string &path) const
true if directory exists
Definition: DQMStore.cc:772
void savePB(const std::string &filename, const std::string &path="", const uint32_t run=0, const uint32_t lumi=0, const bool resetMEsAfterWriting=false)
Definition: DQMStore.cc:2472
void getAllTags(std::vector< std::string > &into) const
Definition: DQMStore.cc:1908
const DQMStore & operator=(const DQMStore &)
bool dirExists(const std::string &path)
Definition: DQMStore.cc:318
bool load(const std::string &filename, OpenRunDirs stripdirs=StripRunDirs, bool fileMustExist=true)
Definition: DQMStore.cc:2974
void scaleElements(void)
Definition: DQMStore.cc:3434
~fastmatch()
Definition: DQMStore.cc:199
static void collate1DD(MonitorElement *me, TH1D *h, unsigned verbose)
Definition: DQMStore.cc:1575
void tagAllContents(const std::string &path, unsigned int myTag)
Definition: DQMStore.cc:1677
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * initialise(MonitorElement *me, const std::string &path)
void goUp(void)
Definition: DQMStore.cc:278
bool containsAnyMonitorable(const std::string &path)
Definition: DQMStore.cc:314
void tagContents(const std::string &, unsigned int)
Definition: DQMStore.cc:290
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
unsigned verbose_
Definition: DQMStore.h:695
std::list< QTestSpec > QTestSpecs
Definition: DQMStore.h:690
MEMap data_
Definition: DQMStore.h:710
void print_trace(const std::string &dir, const std::string &name)
Definition: DQMStore.cc:615
int useQTestByMatch(const std::string &pattern, const std::string &qtname)
attach quality test &lt;qc&gt; to monitor elements matching &lt;pattern&gt;.
Definition: DQMStore.cc:3283
std::vector< MonitorElement * > getAllContents(const std::string &path, uint32_t runNumber=0, uint32_t lumi=0)
Definition: DQMStore.cc:296
static void collate1D(MonitorElement *me, TH1F *h, unsigned verbose)
Definition: DQMStore.cc:1561
void bookTransaction(iFunc f, uint32_t run, uint32_t streamId, uint32_t moduleId)
Definition: DQMStore.h:241
std::vector< std::string > getMEs(void) const
get list of (non-dir) MEs of current directory
Definition: DQMStore.cc:1722
friend class DQMStoreExample
Definition: DQMStore.h:725
std::vector< std::string > getSubdirs(void)
Definition: DQMStore.cc:306
DQMStore * owner_
Definition: DQMStore.h:187
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:330
unsigned int readDirectory(TFile *file, bool overwrite, const std::string &path, const std::string &prepend, const std::string &curdir, OpenRunDirs stripdirs)
Definition: DQMStore.cc:2804
IBooker(DQMStore *store)
Definition: DQMStore.h:176
bool forceResetOnBeginLumi_
Definition: DQMStore.h:702
bool extract(TObject *obj, const std::string &dir, bool overwrite, bool collateHistograms)
Definition: DQMStore.cc:2134
void tagContents(const std::string &path, unsigned int myTag)
tag all children of folder (does NOT include subfolders)
Definition: DQMStore.cc:1665
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, const uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE", const bool resetMEsAfterWriting=false)
Definition: DQMStore.cc:2602
std::map< std::string, QCriterion *(*)(const std::string &)> QAMap
Definition: DQMStore.h:693
bool readFilePB(const std::string &filename, bool overwrite=false, const std::string &path="", const std::string &prepend="", OpenRunDirs stripdirs=StripRunDirs, bool fileMustExist=true)
Definition: DQMStore.cc:3085
void useQTest(const std::string &dir, const std::string &qtname)
Definition: DQMStore.cc:3265
tuple filename
Definition: lut2db_cfg.py:20
MonitorElement * book2DD(Args &&...args)
Definition: DQMStore.h:145
void goUp(void)
equivalent to &quot;cd ..&quot;
Definition: DQMStore.cc:718
bool open(const std::string &filename, bool overwrite=false, const std::string &path="", const std::string &prepend="", OpenRunDirs stripdirs=KeepRunDirs, bool fileMustExist=true)
Definition: DQMStore.cc:2959
static const int STATUS_OK
void setAccumulate(MonitorElement *me, bool flag)
Definition: DQMStore.cc:3387
static void collate1S(MonitorElement *me, TH1S *h, unsigned verbose)
Definition: DQMStore.cc:1568
tuple level
Definition: testEve_cfg.py:34
void meBookerGetter(iFunc f)
Definition: DQMStore.h:271
std::ofstream * stream_
Definition: DQMStore.h:707
QCriterion * createQTest(const std::string &algoname, const std::string &qtname)
Definition: DQMStore.cc:3244
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:109
static bool checkBinningMatches(MonitorElement *me, TH1 *h, unsigned verbose)
Definition: DQMStore.cc:1534
dbl *** dir
Definition: mlp_gen.cc:35
void showDirStructure(void) const
Definition: DQMStore.cc:3397
void reset(void)
Definition: DQMStore.cc:2046
static void collate2D(MonitorElement *me, TH2F *h, unsigned verbose)
Definition: DQMStore.cc:1582
MonitorElement * bookInt(const char *name)
Book int.
Definition: DQMStore.cc:901
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1122
tuple collateHistograms
MonitorElement * book3D(Args &&...args)
Definition: DQMStore.h:151
void mergeAndResetMEsLuminositySummaryCache(uint32_t run, uint32_t lumi, uint32_t streamId, uint32_t moduleId)
Definition: DQMStore.cc:414
DQMStore * owner_
Definition: DQMStore.h:230
friend class edm::DQMHttpSource
Definition: DQMStore.h:721
std::set< std::string > dirs_
Definition: DQMStore.h:711
bool collateHistograms_
Definition: DQMStore.h:699
void removeElement(Args &&...args)
Definition: DQMStore.h:202
MonitorElement * book1DD(Args &&...args)
Definition: DQMStore.h:127
bool LSbasedMode_
Definition: DQMStore.h:701
MonitorElement * book1S(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1S histogram.
Definition: DQMStore.cc:1010
void makeDirectory(const std::string &path)
Definition: DQMStore.cc:731
bool compare_strings(std::string const &pattern, std::string const &input) const
Definition: DQMStore.cc:226
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:707
static void collate2S(MonitorElement *me, TH2S *h, unsigned verbose)
Definition: DQMStore.cc:1589
const std::string & pwd(void) const
Definition: DQMStore.cc:679
bool mtEnabled()
Definition: DQMStore.h:557
bool enableMultiThread_
Definition: DQMStore.h:700
MonitorElement * bookProfile2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ, const char *option="s")
Definition: DQMStore.cc:1452
IGetter(DQMStore *store)
Definition: DQMStore.h:219