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 
174  private:
175  explicit IBooker(DQMStore * store):owner_(0) {
176  assert(store);
177  owner_ = store;
178  }
179 
180  IBooker();
181  IBooker(const IBooker&);
182 
183  // Embedded classes do not natively own a pointer to the embedding
184  // class. We therefore need to store a pointer to the main
185  // DQMStore instance (owner_).
187  }; // IBooker
188 
189  class IGetter
190  {
191  public:
192  friend class DQMStore;
193 
194  // for the supported syntaxes, see the declarations of DQMStore::getContents
195  template <typename... Args>
196  std::vector<MonitorElement *> getContents(Args && ... args) {
197  return owner_->getContents(std::forward<Args>(args)...);
198  }
199  // for the supported syntaxes, see the declarations of DQMStore::removeElements
200  template <typename... Args>
201  void removeElement(Args && ... args) {
202  return owner_->removeElement(std::forward<Args>(args)...);
203  }
204 
205  std::vector<MonitorElement*> getAllContents(const std::string &path,
206  uint32_t runNumber = 0,
207  uint32_t lumi = 0);
208  MonitorElement * get(const std::string &path);
209  std::vector<std::string> getSubdirs(void);
210  std::vector<std::string> getMEs(void);
212  bool dirExists(const std::string &path);
213  void cd(void);
214  void cd(const std::string &dir);
215  void setCurrentFolder(const std::string &fullpath);
216 
217  private:
218  explicit IGetter(DQMStore * store):owner_(0) {
219  assert(store);
220  owner_ = store;
221  }
222 
223  IGetter();
224  IGetter(const IGetter&);
225 
226  // Embedded classes do not natively own a pointer to the embedding
227  // class. We therefore need to store a pointer to the main
228  // DQMStore instance (owner_).
230  }; //IGetter
231 
232  // Template function to be used inside each DQM Modules' lambda
233  // functions to book MonitorElements into the DQMStore. The function
234  // calls whatever user-supplied code via the function f. The latter
235  // is passed the instance of the IBooker class (owned by the *only*
236  // DQMStore instance), that is capable of booking MonitorElements
237  // into the DQMStore via a public API. The central mutex is acquired
238  // *before* invoking fand automatically released upon returns.
239  template <typename iFunc>
240  void bookTransaction(iFunc f,
241  uint32_t run,
242  uint32_t streamId,
243  uint32_t moduleId) {
244  std::lock_guard<std::mutex> guard(book_mutex_);
245  /* If enableMultiThread is not enabled we do not set run_,
246  streamId_ and moduleId_ to 0, since we rely on their default
247  initialization in DQMStore constructor. */
248  if (enableMultiThread_) {
249  run_ = run;
250  streamId_ = streamId;
251  moduleId_ = moduleId;
252  }
253  f(*ibooker_);
254 
255  /* Initialize to 0 the run_, streamId_ and moduleId_ variables
256  in case we run in mixed conditions with DQMEDAnalyzers and
257  legacy modules */
258  if (enableMultiThread_) {
259  run_ = 0;
260  streamId_ = 0;
261  moduleId_ = 0;
262  }
263  }
264  // Signature needed in the harvesting where the booking is done
265  // in the endJob. No handles to the run there. Two arguments ensure
266  // the capability of booking and getting. The method relies on the
267  // initialization of run, stream and module ID to 0. The mutex
268  // is not needed.
269  template <typename iFunc>
270  void meBookerGetter(iFunc f) {
271  f(*ibooker_, *igetter_);
272  }
273  // Signature needed in the harvesting where it might be needed to get
274  // the LS based histograms. Handle to the Lumi and to the iSetup are available.
275  // No need to book anything there. The method relies on the
276  // initialization of run, stream and module ID to 0. The mutex
277  // is not needed.
278  template <typename iFunc>
279  void meGetter(iFunc f) {
280  f(*igetter_);
281  }
282 
283  //-------------------------------------------------------------------------
284  // ---------------------- Constructors ------------------------------------
286  DQMStore(const edm::ParameterSet &pset);
287  ~DQMStore(void);
288 
289  //-------------------------------------------------------------------------
290  void setVerbose(unsigned level);
291 
292  // ---------------------- public navigation -------------------------------
293  const std::string & pwd(void) const;
294  void cd(void);
295  void cd(const std::string &subdir);
296  void setCurrentFolder(const std::string &fullpath);
297  void goUp(void);
298 
299  bool dirExists(const std::string &path) const;
300 
301  //-------------------------------------------------------------------------
302  // ---------------------- public ME booking -------------------------------
303 
304  MonitorElement * bookInt (const char *name);
306 
307  MonitorElement * bookFloat (const char *name);
309 
310  MonitorElement * bookString (const char *name,
311  const char *value);
313  const std::string &value);
314 
315  MonitorElement * book1D (const char *name,
316  const char *title,
317  int nchX, double lowX, double highX);
319  const std::string &title,
320  int nchX, double lowX, double highX);
321  MonitorElement * book1D (const char *name,
322  const char *title,
323  int nchX, const float *xbinsize);
325  const std::string &title,
326  int nchX, const float *xbinsize);
327  MonitorElement * book1D (const char *name, TH1F *h);
328  MonitorElement * book1D (const std::string &name, TH1F *h);
329 
330  MonitorElement * book1S (const char *name,
331  const char *title,
332  int nchX, double lowX, double highX);
334  const std::string &title,
335  int nchX, double lowX, double highX);
336  MonitorElement * book1S (const char *name,
337  const char *title,
338  int nchX, const float *xbinsize);
340  const std::string &title,
341  int nchX, const float *xbinsize);
342  MonitorElement * book1S (const char *name, TH1S *h);
343  MonitorElement * book1S (const std::string &name, TH1S *h);
344 
345  MonitorElement * book1DD (const char *name,
346  const char *title,
347  int nchX, double lowX, double highX);
349  const std::string &title,
350  int nchX, double lowX, double highX);
351  MonitorElement * book1DD (const char *name,
352  const char *title,
353  int nchX, const float *xbinsize);
355  const std::string &title,
356  int nchX, const float *xbinsize);
357  MonitorElement * book1DD (const char *name, TH1D *h);
358  MonitorElement * book1DD (const std::string &name, TH1D *h);
359 
360  MonitorElement * book2D (const char *name,
361  const char *title,
362  int nchX, double lowX, double highX,
363  int nchY, double lowY, double highY);
365  const std::string &title,
366  int nchX, double lowX, double highX,
367  int nchY, double lowY, double highY);
368  MonitorElement * book2D (const char *name,
369  const char *title,
370  int nchX, const float *xbinsize,
371  int nchY, const float *ybinsize);
373  const std::string &title,
374  int nchX, const float *xbinsize,
375  int nchY, const float *ybinsize);
376  MonitorElement * book2D (const char *name, TH2F *h);
377  MonitorElement * book2D (const std::string &name, TH2F *h);
378 
379  MonitorElement * book2S (const char *name,
380  const char *title,
381  int nchX, double lowX, double highX,
382  int nchY, double lowY, double highY);
384  const std::string &title,
385  int nchX, double lowX, double highX,
386  int nchY, double lowY, double highY);
387  MonitorElement * book2S (const char *name,
388  const char *title,
389  int nchX, const float *xbinsize,
390  int nchY, const float *ybinsize);
392  const std::string &title,
393  int nchX, const float *xbinsize,
394  int nchY, const float *ybinsize);
395  MonitorElement * book2S (const char *name, TH2S *h);
396  MonitorElement * book2S (const std::string &name, TH2S *h);
397 
398  MonitorElement * book2DD (const char *name,
399  const char *title,
400  int nchX, double lowX, double highX,
401  int nchY, double lowY, double highY);
403  const std::string &title,
404  int nchX, double lowX, double highX,
405  int nchY, double lowY, double highY);
406  MonitorElement * book2DD (const char *name,
407  const char *title,
408  int nchX, const float *xbinsize,
409  int nchY, const float *ybinsize);
411  const std::string &title,
412  int nchX, const float *xbinsize,
413  int nchY, const float *ybinsize);
414  MonitorElement * book2DD (const char *name, TH2D *h);
415  MonitorElement * book2DD (const std::string &name, TH2D *h);
416 
417  MonitorElement * book3D (const char *name,
418  const char *title,
419  int nchX, double lowX, double highX,
420  int nchY, double lowY, double highY,
421  int nchZ, double lowZ, double highZ);
423  const std::string &title,
424  int nchX, double lowX, double highX,
425  int nchY, double lowY, double highY,
426  int nchZ, double lowZ, double highZ);
427  MonitorElement * book3D (const char *name, TH3F *h);
428  MonitorElement * book3D (const std::string &name, TH3F *h);
429 
430  MonitorElement * bookProfile (const char *name,
431  const char *title,
432  int nchX, double lowX, double highX,
433  int nchY, double lowY, double highY,
434  const char *option = "s");
436  const std::string &title,
437  int nchX, double lowX, double highX,
438  int nchY, double lowY, double highY,
439  const char *option = "s");
440  MonitorElement * bookProfile (const char *name,
441  const char *title,
442  int nchX, double lowX, double highX,
443  double lowY, double highY,
444  const char *option = "s");
446  const std::string &title,
447  int nchX, double lowX, double highX,
448  double lowY, double highY,
449  const char *option = "s");
450  MonitorElement * bookProfile (const char *name,
451  const char *title,
452  int nchX, const double *xbinsize,
453  int nchY, double lowY, double highY,
454  const char *option = "s");
456  const std::string &title,
457  int nchX, const double *xbinsize,
458  int nchY, double lowY, double highY,
459  const char *option = "s");
460  MonitorElement * bookProfile (const char *name,
461  const char *title,
462  int nchX, const double *xbinsize,
463  double lowY, double highY,
464  const char *option = "s");
466  const std::string &title,
467  int nchX, const double *xbinsize,
468  double lowY, double highY,
469  const char *option = "s");
470  MonitorElement * bookProfile (const char *name, TProfile *h);
471  MonitorElement * bookProfile (const std::string &name, TProfile *h);
472 
473  MonitorElement * bookProfile2D(const char *name,
474  const char *title,
475  int nchX, double lowX, double highX,
476  int nchY, double lowY, double highY,
477  int nchZ, double lowZ, double highZ,
478  const char *option = "s");
480  const std::string &title,
481  int nchX, double lowX, double highX,
482  int nchY, double lowY, double highY,
483  int nchZ, double lowZ, double highZ,
484  const char *option = "s");
485  MonitorElement * bookProfile2D(const char *name,
486  const char *title,
487  int nchX, double lowX, double highX,
488  int nchY, double lowY, double highY,
489  double lowZ, double highZ,
490  const char *option = "s");
492  const std::string &title,
493  int nchX, double lowX, double highX,
494  int nchY, double lowY, double highY,
495  double lowZ, double highZ,
496  const char *option = "s");
497  MonitorElement * bookProfile2D(const char *name, TProfile2D *h);
498  MonitorElement * bookProfile2D(const std::string &name, TProfile2D *h);
499 
500  //-------------------------------------------------------------------------
501  // ---------------------- public tagging ----------------------------------
502  void tag(MonitorElement *me, unsigned int myTag);
503  void tag(const std::string &path, unsigned int myTag);
504  void tagContents(const std::string &path, unsigned int myTag);
505  void tagAllContents(const std::string &path, unsigned int myTag);
506 
507  //-------------------------------------------------------------------------
508  // ---------------------- public ME getters -------------------------------
509  std::vector<std::string> getSubdirs(void) const;
510  std::vector<std::string> getMEs(void) const;
511  bool containsAnyMonitorable(const std::string &path) const;
512 
513  MonitorElement * get(const std::string &path) const;
514  std::vector<MonitorElement *> get(unsigned int tag) const;
515  std::vector<MonitorElement *> getContents(const std::string &path) const;
516  std::vector<MonitorElement *> getContents(const std::string &path, unsigned int tag) const;
517  void getContents(std::vector<std::string> &into, bool showContents = true) const;
518 
519  // ---------------------- softReset methods -------------------------------
520  void softReset(MonitorElement *me);
522 
523  // ---------------------- Public deleting ---------------------------------
524  void rmdir(const std::string &fullpath);
525  void removeContents(void);
526  void removeContents(const std::string &dir);
527  void removeElement(const std::string &name);
528  void removeElement(const std::string &dir, const std::string &name, bool warning = true);
529 
530  //-------------------------------------------------------------------------
531  // ---------------------- public I/O --------------------------------------
532  void savePB(const std::string &filename,
533  const std::string &path = "",
534  const uint32_t run = 0,
535  const uint32_t lumi = 0,
536  const bool resetMEsAfterWriting = false);
537  void save(const std::string &filename,
538  const std::string &path = "",
539  const std::string &pattern = "",
540  const std::string &rewrite = "",
541  const uint32_t run = 0,
542  const uint32_t lumi = 0,
545  const std::string &fileupdate = "RECREATE",
546  const bool resetMEsAfterWriting = false);
547  bool open(const std::string &filename,
548  bool overwrite = false,
549  const std::string &path ="",
550  const std::string &prepend = "",
551  OpenRunDirs stripdirs = KeepRunDirs,
552  bool fileMustExist = true);
553  bool load(const std::string &filename,
554  OpenRunDirs stripdirs = StripRunDirs,
555  bool fileMustExist = true);
556 
557  //-------------------------------------------------------------------------
558  // ---------------------- Public print methods -----------------------------
559  void showDirStructure(void) const;
560 
561  // ---------------------- Public check options -----------------------------
562  bool isCollate(void) const;
563 
564  //-------------------------------------------------------------------------
565  // ---------------------- Quality Test methods -----------------------------
566  QCriterion * getQCriterion(const std::string &qtname) const;
567  QCriterion * createQTest(const std::string &algoname, const std::string &qtname);
568  void useQTest(const std::string &dir, const std::string &qtname);
569  int useQTestByMatch(const std::string &pattern, const std::string &qtname);
570  void runQTests(void);
571  int getStatus(const std::string &path = "") const;
572  void scaleElements(void);
573 
574  private:
575  // ---------------- Navigation -----------------------
576  bool cdInto(const std::string &path) const;
577 
578  // ------------------- Reference ME -------------------------------
579  bool isCollateME(MonitorElement *me) const;
580 
581  // ------------------- Private "getters" ------------------------------
582  bool readFilePB(const std::string &filename,
583  bool overwrite = false,
584  const std::string &path ="",
585  const std::string &prepend = "",
586  OpenRunDirs stripdirs = StripRunDirs,
587  bool fileMustExist = true);
588  bool readFile(const std::string &filename,
589  bool overwrite = false,
590  const std::string &path ="",
591  const std::string &prepend = "",
592  OpenRunDirs stripdirs = StripRunDirs,
593  bool fileMustExist = true);
594  void makeDirectory(const std::string &path);
595  unsigned int readDirectory(TFile *file,
596  bool overwrite,
597  const std::string &path,
598  const std::string &prepend,
599  const std::string &curdir,
600  OpenRunDirs stripdirs);
601 
603  const std::string &name,
604  const uint32_t run = 0,
605  const uint32_t lumi = 0,
606  const uint32_t streamId = 0,
607  const uint32_t moduleId = 0) const;
608 
610  std::string & dirname,
611  std::string & objname,
612  TObject ** obj);
613 
614  public:
615  void getAllTags(std::vector<std::string> &into) const;
616  std::vector<MonitorElement*> getAllContents(const std::string &path,
617  uint32_t runNumber = 0,
618  uint32_t lumi = 0) const;
619  std::vector<MonitorElement*> getMatchingContents(const std::string &pattern, lat::Regexp::Syntax syntaxType = lat::Regexp::Wildcard) const;
620 
621  // Multithread SummaryCache manipulations
622  void mergeAndResetMEsRunSummaryCache(uint32_t run,
623  uint32_t streamId,
624  uint32_t moduleId);
626  uint32_t lumi,
627  uint32_t streamId,
628  uint32_t moduleId);
629  private:
630 
631  // ---------------- Miscellaneous -----------------------------
632  void initializeFrom(const edm::ParameterSet&);
633  void reset(void);
634  void forceReset(void);
635  void markForDeletion(uint32_t run,
636  uint32_t lumi);
637 
638  bool extract(TObject *obj, const std::string &dir, bool overwrite, bool collateHistograms);
639  TObject * extractNextObject(TBufferFile&) const;
640 
641  // ---------------------- Booking ------------------------------------
644  const std::string &name,
645  const char *context);
646  template <class HISTO, class COLLATE>
648  const char *context, int kind,
649  HISTO *h, COLLATE collate);
650 
654  MonitorElement * book1D(const std::string &dir, const std::string &name, TH1F *h);
655  MonitorElement * book1S(const std::string &dir, const std::string &name, TH1S *h);
656  MonitorElement * book1DD(const std::string &dir, const std::string &name, TH1D *h);
657  MonitorElement * book2D(const std::string &dir, const std::string &name, TH2F *h);
658  MonitorElement * book2S(const std::string &dir, const std::string &name, TH2S *h);
659  MonitorElement * book2DD(const std::string &dir, const std::string &name, TH2D *h);
660  MonitorElement * book3D(const std::string &dir, const std::string &name, TH3F *h);
661  MonitorElement * bookProfile(const std::string &dir, const std::string &name, TProfile *h);
662  MonitorElement * bookProfile2D(const std::string &folder, const std::string &name, TProfile2D *h);
663 
664  static bool checkBinningMatches(MonitorElement *me, TH1 *h, unsigned verbose);
665 
666  static void collate1D(MonitorElement *me, TH1F *h, unsigned verbose);
667  static void collate1S(MonitorElement *me, TH1S *h, unsigned verbose);
668  static void collate1DD(MonitorElement *me, TH1D *h, unsigned verbose);
669  static void collate2D(MonitorElement *me, TH2F *h, unsigned verbose);
670  static void collate2S(MonitorElement *me, TH2S *h, unsigned verbose);
671  static void collate2DD(MonitorElement *me, TH2D *h, unsigned verbose);
672  static void collate3D(MonitorElement *me, TH3F *h, unsigned verbose);
673  static void collateProfile(MonitorElement *me, TProfile *h, unsigned verbose);
674  static void collateProfile2D(MonitorElement *me, TProfile2D *h, unsigned verbose);
675 
676  // --- Operations on MEs that are normally reset at end of monitoring cycle ---
677  void setAccumulate(MonitorElement *me, bool flag);
678 
679  void print_trace(const std::string &dir, const std::string &name);
680 
681  // ----------------------- Unavailable ---------------------------------------
682  DQMStore(const DQMStore&);
683  const DQMStore& operator=(const DQMStore&);
684 
685  //-------------------------------------------------------------------------------
686  //-------------------------------------------------------------------------------
687  typedef std::pair<fastmatch *, QCriterion *> QTestSpec;
688  typedef std::list<QTestSpec> QTestSpecs;
689  typedef std::set<MonitorElement> MEMap;
690  typedef std::map<std::string, QCriterion *> QCMap;
691  typedef std::map<std::string, QCriterion *(*)(const std::string &)> QAMap;
692 
693  unsigned verbose_;
694  unsigned verboseQT_;
695  bool reset_;
696  double scaleFlag_;
702  uint32_t run_;
703  uint32_t streamId_;
704  uint32_t moduleId_;
705  std::ofstream * stream_;
706 
709  std::set<std::string> dirs_;
710 
714 
718 
719  friend class edm::DQMHttpSource;
720  friend class DQMService;
721  friend class DQMNet;
722  friend class DQMArchiver;
723  friend class DQMStoreExample; // for get{All,Matching}Contents -- sole user of this method!
724  friend class DQMRootOutputModule;
725  friend class DQMRootSource;
726  friend class DQMFileSaver;
727  friend class MEtoEDMConverter;
728 };
729 
730 #endif // DQMSERVICES_CORE_DQM_STORE_H
QCriterion * getQCriterion(const std::string &qtname) const
Definition: DQMStore.cc:3191
IGetter * igetter_
Definition: DQMStore.h:717
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:687
std::vector< MonitorElement * > getContents(Args &&...args)
Definition: DQMStore.h:196
MonitorElement * book1S(Args &&...args)
Definition: DQMStore.h:121
DQMStore(const edm::ParameterSet &pset, edm::ActivityRegistry &)
Definition: DQMStore.cc:460
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:1121
std::map< std::string, QCriterion * > QCMap
Definition: DQMStore.h:690
bool containsAnyMonitorable(const std::string &path) const
Definition: DQMStore.cc:1715
bool isCollateME(MonitorElement *me) const
Definition: DQMStore.cc:3384
bool cdInto(const std::string &path) const
Definition: DQMStore.cc:2392
void cd(void)
Definition: DQMStore.cc:318
int getStatus(const std::string &path="") const
Definition: DQMStore.cc:3297
std::vector< std::string > getSubdirs(void) const
Definition: DQMStore.cc:1676
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:971
void rmdir(const std::string &fullpath)
Definition: DQMStore.cc:3124
static void collate3D(MonitorElement *me, TH3F *h, unsigned verbose)
Definition: DQMStore.cc:1580
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:2959
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:1855
static void collateProfile(MonitorElement *me, TProfile *h, unsigned verbose)
Definition: DQMStore.cc:1587
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:1233
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:661
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:1143
uint32_t streamId_
Definition: DQMStore.h:703
tuple lumi
Definition: fjr2json.py:35
void markForDeletion(uint32_t run, uint32_t lumi)
Definition: DQMStore.cc:2057
const std::string & pwd(void)
Definition: DQMStore.cc:282
static void collate2DD(MonitorElement *me, TH2D *h, unsigned verbose)
Definition: DQMStore.cc:1573
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:1976
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:695
MonitorElement * book1DD(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1S histogram.
Definition: DQMStore.cc:1003
friend class DQMArchiver
Definition: DQMStore.h:722
void initializeFrom(const edm::ParameterSet &)
Definition: DQMStore.cc:532
OpenRunDirs
Definition: DQMStore.h:84
uint32_t moduleId_
Definition: DQMStore.h:704
QCMap qtests_
Definition: DQMStore.h:711
MonitorElement * book(const std::string &dir, const std::string &name, const char *context)
Definition: DQMStore.cc:826
std::mutex book_mutex_
Definition: DQMStore.h:715
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:908
static std::string const input
Definition: EdmProvDump.cc:44
SaveReferenceTag
Definition: DQMStore.h:78
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1611
~DQMStore(void)
Definition: DQMStore.cc:518
void disableSoftReset(MonitorElement *me)
Definition: DQMStore.cc:3336
void forceReset(void)
Definition: DQMStore.cc:2036
std::vector< MonitorElement * > getAllContents(const std::string &path, uint32_t runNumber=0, uint32_t lumi=0) const
Definition: DQMStore.cc:1938
fastmatch(std::string const &_fastString)
Definition: DQMStore.cc:129
unsigned verboseQT_
Definition: DQMStore.h:694
QTestSpecs qtestspecs_
Definition: DQMStore.h:713
void removeContents(void)
erase all monitoring elements in current directory (not including subfolders);
Definition: DQMStore.cc:3158
tuple path
else: Piece not in the list, fine.
double scaleFlag_
Definition: DQMStore.h:696
void get_info(const dqmstorepb::ROOTFilePB_Histo &, std::string &dirname, std::string &objname, TObject **obj)
Definition: DQMStore.cc:3022
MonitorElement * bookString(const char *name, const char *value)
Book string.
Definition: DQMStore.cc:937
MonitorElement * bookProfile2D(Args &&...args)
Definition: DQMStore.h:163
std::set< MonitorElement > MEMap
Definition: DQMStore.h:689
bool isCollate(void) const
Definition: DQMStore.cc:3375
void removeElement(const std::string &name)
Definition: DQMStore.cc:3166
static void collateProfile2D(MonitorElement *me, TProfile2D *h, unsigned verbose)
Definition: DQMStore.cc:1597
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:702
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:1285
void setVerbose(unsigned level)
Definition: DQMStore.cc:648
void softReset(MonitorElement *me)
Definition: DQMStore.cc:3328
std::string pwd_
Definition: DQMStore.h:707
void runQTests(void)
Definition: DQMStore.cc:3276
TObject * extractNextObject(TBufferFile &) const
Definition: DQMStore.cc:3014
lat::Regexp * regexp_
Definition: DQMStore.h:70
IBooker * ibooker_
Definition: DQMStore.h:716
QAMap qalgos_
Definition: DQMStore.h:712
std::vector< MonitorElement * > getContents(const std::string &path) const
Definition: DQMStore.cc:1754
std::string readSelectedDirectory_
Definition: DQMStore.h:701
std::vector< std::string > getMEs(void)
Definition: DQMStore.cc:306
void mergeAndResetMEsRunSummaryCache(uint32_t run, uint32_t streamId, uint32_t moduleId)
Definition: DQMStore.cc:339
std::string fastString_
Definition: DQMStore.h:71
void meGetter(iFunc f)
Definition: DQMStore.h:279
bool dirExists(const std::string &path) const
true if directory exists
Definition: DQMStore.cc:749
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:2434
void getAllTags(std::vector< std::string > &into) const
Definition: DQMStore.cc:1885
const DQMStore & operator=(const DQMStore &)
bool dirExists(const std::string &path)
Definition: DQMStore.cc:314
bool load(const std::string &filename, OpenRunDirs stripdirs=StripRunDirs, bool fileMustExist=true)
Definition: DQMStore.cc:2932
void scaleElements(void)
Definition: DQMStore.cc:3392
~fastmatch()
Definition: DQMStore.cc:199
static void collate1DD(MonitorElement *me, TH1D *h, unsigned verbose)
Definition: DQMStore.cc:1552
void tagAllContents(const std::string &path, unsigned int myTag)
Definition: DQMStore.cc:1654
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:310
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
unsigned verbose_
Definition: DQMStore.h:693
std::list< QTestSpec > QTestSpecs
Definition: DQMStore.h:688
MEMap data_
Definition: DQMStore.h:708
void print_trace(const std::string &dir, const std::string &name)
Definition: DQMStore.cc:592
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:3241
std::vector< MonitorElement * > getAllContents(const std::string &path, uint32_t runNumber=0, uint32_t lumi=0)
Definition: DQMStore.cc:292
static void collate1D(MonitorElement *me, TH1F *h, unsigned verbose)
Definition: DQMStore.cc:1538
void bookTransaction(iFunc f, uint32_t run, uint32_t streamId, uint32_t moduleId)
Definition: DQMStore.h:240
std::vector< std::string > getMEs(void) const
get list of (non-dir) MEs of current directory
Definition: DQMStore.cc:1699
friend class DQMStoreExample
Definition: DQMStore.h:723
std::vector< std::string > getSubdirs(void)
Definition: DQMStore.cc:302
DQMStore * owner_
Definition: DQMStore.h:186
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:326
unsigned int readDirectory(TFile *file, bool overwrite, const std::string &path, const std::string &prepend, const std::string &curdir, OpenRunDirs stripdirs)
Definition: DQMStore.cc:2762
IBooker(DQMStore *store)
Definition: DQMStore.h:175
bool forceResetOnBeginLumi_
Definition: DQMStore.h:700
bool extract(TObject *obj, const std::string &dir, bool overwrite, bool collateHistograms)
Definition: DQMStore.cc:2096
void tagContents(const std::string &path, unsigned int myTag)
tag all children of folder (does NOT include subfolders)
Definition: DQMStore.cc:1642
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:2562
std::map< std::string, QCriterion *(*)(const std::string &)> QAMap
Definition: DQMStore.h:691
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:3043
void useQTest(const std::string &dir, const std::string &qtname)
Definition: DQMStore.cc:3223
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:695
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:2917
static const int STATUS_OK
void setAccumulate(MonitorElement *me, bool flag)
Definition: DQMStore.cc:3345
static void collate1S(MonitorElement *me, TH1S *h, unsigned verbose)
Definition: DQMStore.cc:1545
tuple level
Definition: testEve_cfg.py:34
void meBookerGetter(iFunc f)
Definition: DQMStore.h:270
std::ofstream * stream_
Definition: DQMStore.h:705
QCriterion * createQTest(const std::string &algoname, const std::string &qtname)
Definition: DQMStore.cc:3202
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:109
static bool checkBinningMatches(MonitorElement *me, TH1 *h, unsigned verbose)
Definition: DQMStore.cc:1511
dbl *** dir
Definition: mlp_gen.cc:35
void showDirStructure(void) const
Definition: DQMStore.cc:3355
void reset(void)
Definition: DQMStore.cc:2012
static void collate2D(MonitorElement *me, TH2F *h, unsigned verbose)
Definition: DQMStore.cc:1559
MonitorElement * bookInt(const char *name)
Book int.
Definition: DQMStore.cc:878
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:1099
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:394
DQMStore * owner_
Definition: DQMStore.h:229
friend class edm::DQMHttpSource
Definition: DQMStore.h:719
std::set< std::string > dirs_
Definition: DQMStore.h:709
bool collateHistograms_
Definition: DQMStore.h:697
void removeElement(Args &&...args)
Definition: DQMStore.h:201
MonitorElement * book1DD(Args &&...args)
Definition: DQMStore.h:127
bool LSbasedMode_
Definition: DQMStore.h:699
MonitorElement * book1S(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1S histogram.
Definition: DQMStore.cc:987
void makeDirectory(const std::string &path)
Definition: DQMStore.cc:708
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:684
static void collate2S(MonitorElement *me, TH2S *h, unsigned verbose)
Definition: DQMStore.cc:1566
const std::string & pwd(void) const
Definition: DQMStore.cc:656
bool enableMultiThread_
Definition: DQMStore.h:698
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:1429
IGetter(DQMStore *store)
Definition: DQMStore.h:218