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 
23 namespace edm { class DQMHttpSource; class ParameterSet; class ActivityRegistry;}
24 namespace lat { class Regexp; }
25 namespace dqmstorepb {class ROOTFilePB; class ROOTFilePB_Histo;}
26 
27 class MonitorElement;
28 class QCriterion;
29 class TFile;
30 class TBufferFile;
31 class TObject;
32 class TH1;
33 class TObjString;
34 class TH1F;
35 class TH1S;
36 class TH1D;
37 class TH2F;
38 class TH2S;
39 class TH2D;
40 class TH3F;
41 class TProfile;
42 class TProfile2D;
43 class TNamed;
44 
49 class fastmatch
50 {
51  private:
53 
54  public:
55  fastmatch (std::string const& _fastString);
56  ~fastmatch();
57 
58  bool match (std::string const& s) const;
59 
60  private:
61  // checks if two strings are equal, starting at the back of the strings
63  std::string const& input) const;
64  // checks if two strings are equal, starting at the front of the strings
65  bool compare_strings (std::string const& pattern,
66  std::string const& input) const;
67 
68  lat::Regexp * regexp_;
71 };
72 
73 class DQMStore
74 {
75  public:
77  {
81  };
83  {
86  };
87 
88  class IBooker
89  {
90  public:
91  friend class DQMStore;
92 
93  // for the supported syntaxes, see the declarations of DQMStore::bookString
94  template <typename... Args>
96  return owner_->bookString(std::forward<Args>(args)...);
97  }
98 
99  // for the supported syntaxes, see the declarations of DQMStore::bookInt
100  template <typename... Args>
102  return owner_->bookInt(std::forward<Args>(args)...);
103  }
104 
105  // for the supported syntaxes, see the declarations of DQMStore::bookFloat
106  template <typename... Args>
108  return owner_->bookFloat(std::forward<Args>(args)...);
109  }
110 
111  // for the supported syntaxes, see the declarations of DQMStore::book1D
112  template <typename... Args>
114  return owner_->book1D(std::forward<Args>(args)...);
115  }
116 
117  // for the supported syntaxes, see the declarations of DQMStore::book1S
118  template <typename... Args>
120  return owner_->book1S(std::forward<Args>(args)...);
121  }
122 
123  // for the supported syntaxes, see the declarations of DQMStore::book1DD
124  template <typename... Args>
126  return owner_->book1DD(std::forward<Args>(args)...);
127  }
128 
129  // for the supported syntaxes, see the declarations of DQMStore::book2D
130  template <typename... Args>
132  return owner_->book2D(std::forward<Args>(args)...);
133  }
134 
135  // for the supported syntaxes, see the declarations of DQMStore::book2S
136  template <typename... Args>
138  return owner_->book2S(std::forward<Args>(args)...);
139  }
140 
141  // for the supported syntaxes, see the declarations of DQMStore::book2DD
142  template <typename... Args>
144  return owner_->book2DD(std::forward<Args>(args)...);
145  }
146 
147  // for the supported syntaxes, see the declarations of DQMStore::book3D
148  template <typename... Args>
150  return owner_->book3D(std::forward<Args>(args)...);
151  }
152 
153  // for the supported syntaxes, see the declarations of DQMStore::bookProfile
154  template <typename... Args>
156  return owner_->bookProfile(std::forward<Args>(args)...);
157  }
158 
159  // for the supported syntaxes, see the declarations of DQMStore::bookProfile2D
160  template <typename... Args>
162  return owner_->bookProfile2D(std::forward<Args>(args)...);
163  }
164 
165  void cd(void);
166  void cd(const std::string &dir);
167  void setCurrentFolder(const std::string &fullpath);
168  void goUp(void);
169  const std::string & pwd(void);
170  void tag(MonitorElement *, unsigned int);
171 
172  private:
173  explicit IBooker(DQMStore * store):owner_(0) {
174  assert(store);
175  owner_ = store;
176  }
177 
178  IBooker();
179  IBooker(const IBooker&);
180 
181  // Embedded classes do not natively own a pointer to the embedding
182  // class. We therefore need to store a pointer to the main
183  // DQMStore instance (owner_).
185  }; // IBooker
186 
187  class IGetter
188  {
189  public:
190  friend class DQMStore;
191 
192  // for the supported syntaxes, see the declarations of DQMStore::getContents
193  template <typename... Args>
194  std::vector<MonitorElement *> getContents(Args && ... args) {
195  return owner_->getContents(std::forward<Args>(args)...);
196  }
197 
198  MonitorElement * get(const std::string &path);
199  std::vector<std::string> getSubdirs(void);
200  std::vector<std::string> getMEs(void);
202  bool dirExists(const std::string &path);
203  void cd(void);
204  void cd(const std::string &dir);
205  void setCurrentFolder(const std::string &fullpath);
206 
207  private:
208  explicit IGetter(DQMStore * store):owner_(0) {
209  assert(store);
210  owner_ = store;
211  }
212 
213  IGetter();
214  IGetter(const IGetter&);
215 
216  // Embedded classes do not natively own a pointer to the embedding
217  // class. We therefore need to store a pointer to the main
218  // DQMStore instance (owner_).
220  }; //IGetter
221 
222  // Template function to be used inside each DQM Modules' lambda
223  // functions to book MonitorElements into the DQMStore. The function
224  // calls whatever user-supplied code via the function f. The latter
225  // is passed the instance of the IBooker class (owned by the *only*
226  // DQMStore instance), that is capable of booking MonitorElements
227  // into the DQMStore via a public API. The central mutex is acquired
228  // *before* invoking fand automatically released upon returns.
229  template <typename iFunc>
230  void bookTransaction(iFunc f,
231  uint32_t run,
232  uint32_t streamId,
233  uint32_t moduleId) {
234  std::lock_guard<std::mutex> guard(book_mutex_);
235  /* If enableMultiThread is not enabled we do not set run_,
236  streamId_ and moduleId_ to 0, since we rely on their default
237  initialization in DQMStore constructor. */
238  if (enableMultiThread_) {
239  run_ = run;
240  streamId_ = streamId;
241  moduleId_ = moduleId;
242  }
243  f(*ibooker_);
244 
245  /* Initialize to 0 the run_, streamId_ and moduleId_ variables
246  in case we run in mixed conditions with DQMEDAnalyzers and
247  legacy modules */
248  if (enableMultiThread_) {
249  run_ = 0;
250  streamId_ = 0;
251  moduleId_ = 0;
252  }
253  }
254  // Signature needed in the harvesting where the booking is done
255  // in the endJob. No handles to the run there. Two arguments ensure
256  // the capability of booking and getting. The method relies on the
257  // initialization of run, stream and module ID to 0. The mutex
258  // is not needed.
259  template <typename iFunc>
260  void meBookerGetter(iFunc f) {
261  f(*ibooker_, *igetter_);
262  }
263  // Signature needed in the harvesting where it might be needed to get
264  // the LS based histograms. Handle to the Lumi and to the iSetup are available.
265  // No need to book anything there. The method relies on the
266  // initialization of run, stream and module ID to 0. The mutex
267  // is not needed.
268  template <typename iFunc>
269  void meGetter(iFunc f) {
270  f(*igetter_);
271  }
272 
273  //-------------------------------------------------------------------------
274  // ---------------------- Constructors ------------------------------------
276  DQMStore(const edm::ParameterSet &pset);
277  ~DQMStore(void);
278 
279  //-------------------------------------------------------------------------
280  void setVerbose(unsigned level);
281 
282  // ---------------------- public navigation -------------------------------
283  const std::string & pwd(void) const;
284  void cd(void);
285  void cd(const std::string &subdir);
286  void setCurrentFolder(const std::string &fullpath);
287  void goUp(void);
288 
289  bool dirExists(const std::string &path) const;
290 
291  //-------------------------------------------------------------------------
292  // ---------------------- public ME booking -------------------------------
293 
294  MonitorElement * bookInt (const char *name);
296 
297  MonitorElement * bookFloat (const char *name);
299 
300  MonitorElement * bookString (const char *name,
301  const char *value);
303  const std::string &value);
304 
305  MonitorElement * book1D (const char *name,
306  const char *title,
307  int nchX, double lowX, double highX);
309  const std::string &title,
310  int nchX, double lowX, double highX);
311  MonitorElement * book1D (const char *name,
312  const char *title,
313  int nchX, float *xbinsize);
315  const std::string &title,
316  int nchX, float *xbinsize);
317  MonitorElement * book1D (const char *name, TH1F *h);
318  MonitorElement * book1D (const std::string &name, TH1F *h);
319 
320  MonitorElement * book1S (const char *name,
321  const char *title,
322  int nchX, double lowX, double highX);
324  const std::string &title,
325  int nchX, double lowX, double highX);
326  MonitorElement * book1S (const char *name,
327  const char *title,
328  int nchX, float *xbinsize);
330  const std::string &title,
331  int nchX, float *xbinsize);
332  MonitorElement * book1S (const char *name, TH1S *h);
333  MonitorElement * book1S (const std::string &name, TH1S *h);
334 
335  MonitorElement * book1DD (const char *name,
336  const char *title,
337  int nchX, double lowX, double highX);
339  const std::string &title,
340  int nchX, double lowX, double highX);
341  MonitorElement * book1DD (const char *name,
342  const char *title,
343  int nchX, float *xbinsize);
345  const std::string &title,
346  int nchX, float *xbinsize);
347  MonitorElement * book1DD (const char *name, TH1D *h);
348  MonitorElement * book1DD (const std::string &name, TH1D *h);
349 
350  MonitorElement * book2D (const char *name,
351  const char *title,
352  int nchX, double lowX, double highX,
353  int nchY, double lowY, double highY);
355  const std::string &title,
356  int nchX, double lowX, double highX,
357  int nchY, double lowY, double highY);
358  MonitorElement * book2D (const char *name,
359  const char *title,
360  int nchX, float *xbinsize,
361  int nchY, float *ybinsize);
363  const std::string &title,
364  int nchX, float *xbinsize,
365  int nchY, float *ybinsize);
366  MonitorElement * book2D (const char *name, TH2F *h);
367  MonitorElement * book2D (const std::string &name, TH2F *h);
368 
369  MonitorElement * book2S (const char *name,
370  const char *title,
371  int nchX, double lowX, double highX,
372  int nchY, double lowY, double highY);
374  const std::string &title,
375  int nchX, double lowX, double highX,
376  int nchY, double lowY, double highY);
377  MonitorElement * book2S (const char *name,
378  const char *title,
379  int nchX, float *xbinsize,
380  int nchY, float *ybinsize);
382  const std::string &title,
383  int nchX, float *xbinsize,
384  int nchY, float *ybinsize);
385  MonitorElement * book2S (const char *name, TH2S *h);
386  MonitorElement * book2S (const std::string &name, TH2S *h);
387 
388  MonitorElement * book2DD (const char *name,
389  const char *title,
390  int nchX, double lowX, double highX,
391  int nchY, double lowY, double highY);
393  const std::string &title,
394  int nchX, double lowX, double highX,
395  int nchY, double lowY, double highY);
396  MonitorElement * book2DD (const char *name,
397  const char *title,
398  int nchX, float *xbinsize,
399  int nchY, float *ybinsize);
401  const std::string &title,
402  int nchX, float *xbinsize,
403  int nchY, float *ybinsize);
404  MonitorElement * book2DD (const char *name, TH2D *h);
405  MonitorElement * book2DD (const std::string &name, TH2D *h);
406 
407  MonitorElement * book3D (const char *name,
408  const char *title,
409  int nchX, double lowX, double highX,
410  int nchY, double lowY, double highY,
411  int nchZ, double lowZ, double highZ);
413  const std::string &title,
414  int nchX, double lowX, double highX,
415  int nchY, double lowY, double highY,
416  int nchZ, double lowZ, double highZ);
417  MonitorElement * book3D (const char *name, TH3F *h);
418  MonitorElement * book3D (const std::string &name, TH3F *h);
419 
420  MonitorElement * bookProfile (const char *name,
421  const char *title,
422  int nchX, double lowX, double highX,
423  int nchY, double lowY, double highY,
424  const char *option = "s");
426  const std::string &title,
427  int nchX, double lowX, double highX,
428  int nchY, double lowY, double highY,
429  const char *option = "s");
430  MonitorElement * bookProfile (const char *name,
431  const char *title,
432  int nchX, double lowX, double highX,
433  double lowY, double highY,
434  const char *option = "s");
436  const std::string &title,
437  int nchX, double lowX, double highX,
438  double lowY, double highY,
439  const char *option = "s");
440  MonitorElement * bookProfile (const char *name,
441  const char *title,
442  int nchX, double *xbinsize,
443  int nchY, double lowY, double highY,
444  const char *option = "s");
446  const std::string &title,
447  int nchX, double *xbinsize,
448  int nchY, double lowY, double highY,
449  const char *option = "s");
450  MonitorElement * bookProfile (const char *name,
451  const char *title,
452  int nchX, double *xbinsize,
453  double lowY, double highY,
454  const char *option = "s");
456  const std::string &title,
457  int nchX, double *xbinsize,
458  double lowY, double highY,
459  const char *option = "s");
460  MonitorElement * bookProfile (const char *name, TProfile *h);
461  MonitorElement * bookProfile (const std::string &name, TProfile *h);
462 
463  MonitorElement * bookProfile2D(const char *name,
464  const char *title,
465  int nchX, double lowX, double highX,
466  int nchY, double lowY, double highY,
467  int nchZ, double lowZ, double highZ,
468  const char *option = "s");
470  const std::string &title,
471  int nchX, double lowX, double highX,
472  int nchY, double lowY, double highY,
473  int nchZ, double lowZ, double highZ,
474  const char *option = "s");
475  MonitorElement * bookProfile2D(const char *name,
476  const char *title,
477  int nchX, double lowX, double highX,
478  int nchY, double lowY, double highY,
479  double lowZ, double highZ,
480  const char *option = "s");
482  const std::string &title,
483  int nchX, double lowX, double highX,
484  int nchY, double lowY, double highY,
485  double lowZ, double highZ,
486  const char *option = "s");
487  MonitorElement * bookProfile2D(const char *name, TProfile2D *h);
488  MonitorElement * bookProfile2D(const std::string &name, TProfile2D *h);
489 
490  //-------------------------------------------------------------------------
491  // ---------------------- public tagging ----------------------------------
492  void tag(MonitorElement *me, unsigned int myTag);
493  void tag(const std::string &path, unsigned int myTag);
494  void tagContents(const std::string &path, unsigned int myTag);
495  void tagAllContents(const std::string &path, unsigned int myTag);
496 
497  //-------------------------------------------------------------------------
498  // ---------------------- public ME getters -------------------------------
499  std::vector<std::string> getSubdirs(void) const;
500  std::vector<std::string> getMEs(void) const;
501  bool containsAnyMonitorable(const std::string &path) const;
502 
503  MonitorElement * get(const std::string &path) const;
504  std::vector<MonitorElement *> get(unsigned int tag) const;
505  std::vector<MonitorElement *> getContents(const std::string &path) const;
506  std::vector<MonitorElement *> getContents(const std::string &path, unsigned int tag) const;
507  void getContents(std::vector<std::string> &into, bool showContents = true) const;
508 
509  // ---------------------- softReset methods -------------------------------
510  void softReset(MonitorElement *me);
512 
513  // ---------------------- Public deleting ---------------------------------
514  void rmdir(const std::string &fullpath);
515  void removeContents(void);
516  void removeContents(const std::string &dir);
517  void removeElement(const std::string &name);
518  void removeElement(const std::string &dir, const std::string &name, bool warning = true);
519 
520  //-------------------------------------------------------------------------
521  // ---------------------- public I/O --------------------------------------
522  void savePB(const std::string &filename,
523  const std::string &path = "",
524  const uint32_t run = 0,
525  const uint32_t lumi = 0,
526  const bool resetMEsAfterWriting = false);
527  void save(const std::string &filename,
528  const std::string &path = "",
529  const std::string &pattern = "",
530  const std::string &rewrite = "",
531  const uint32_t run = 0,
532  const uint32_t lumi = 0,
535  const std::string &fileupdate = "RECREATE",
536  const bool resetMEsAfterWriting = false);
537  bool open(const std::string &filename,
538  bool overwrite = false,
539  const std::string &path ="",
540  const std::string &prepend = "",
541  OpenRunDirs stripdirs = KeepRunDirs,
542  bool fileMustExist = true);
543  bool load(const std::string &filename,
544  OpenRunDirs stripdirs = StripRunDirs,
545  bool fileMustExist = true);
546 
547  //-------------------------------------------------------------------------
548  // ---------------------- Public print methods -----------------------------
549  void showDirStructure(void) const;
550 
551  // ---------------------- Public check options -----------------------------
552  bool isCollate(void) const;
553 
554  //-------------------------------------------------------------------------
555  // ---------------------- Quality Test methods -----------------------------
556  QCriterion * getQCriterion(const std::string &qtname) const;
557  QCriterion * createQTest(const std::string &algoname, const std::string &qtname);
558  void useQTest(const std::string &dir, const std::string &qtname);
559  int useQTestByMatch(const std::string &pattern, const std::string &qtname);
560  void runQTests(void);
561  int getStatus(const std::string &path = "") const;
562  void scaleElements(void);
563 
564  private:
565  // ---------------- Navigation -----------------------
566  bool cdInto(const std::string &path) const;
567 
568  // ------------------- Reference ME -------------------------------
569  bool isCollateME(MonitorElement *me) const;
570 
571  // ------------------- Private "getters" ------------------------------
572  bool readFilePB(const std::string &filename,
573  bool overwrite = false,
574  const std::string &path ="",
575  const std::string &prepend = "",
576  OpenRunDirs stripdirs = StripRunDirs,
577  bool fileMustExist = true);
578  bool readFile(const std::string &filename,
579  bool overwrite = false,
580  const std::string &path ="",
581  const std::string &prepend = "",
582  OpenRunDirs stripdirs = StripRunDirs,
583  bool fileMustExist = true);
584  void makeDirectory(const std::string &path);
585  unsigned int readDirectory(TFile *file,
586  bool overwrite,
587  const std::string &path,
588  const std::string &prepend,
589  const std::string &curdir,
590  OpenRunDirs stripdirs);
591 
593  const std::string &name,
594  const uint32_t run = 0,
595  const uint32_t lumi = 0,
596  const uint32_t streamId = 0,
597  const uint32_t moduleId = 0) const;
598 
600  std::string & dirname,
601  std::string & objname,
602  TObject ** obj);
603 
604  public:
605  void getAllTags(std::vector<std::string> &into) const;
606  std::vector<MonitorElement*> getAllContents(const std::string &path,
607  uint32_t runNumber = 0,
608  uint32_t lumi = 0) const;
609  std::vector<MonitorElement*> getMatchingContents(const std::string &pattern, lat::Regexp::Syntax syntaxType = lat::Regexp::Wildcard) const;
610 
611  // Multithread SummaryCache manipulations
612  void mergeAndResetMEsRunSummaryCache(uint32_t run,
613  uint32_t streamId,
614  uint32_t moduleId);
616  uint32_t lumi,
617  uint32_t streamId,
618  uint32_t moduleId);
619  private:
620 
621  // ---------------- Miscellaneous -----------------------------
622  void initializeFrom(const edm::ParameterSet&);
623  void reset(void);
624  void forceReset(void);
625  void markForDeletion(uint32_t run,
626  uint32_t lumi);
627 
628  bool extract(TObject *obj, const std::string &dir, bool overwrite, bool collateHistograms);
629  TObject * extractNextObject(TBufferFile&) const;
630 
631  // ---------------------- Booking ------------------------------------
634  const std::string &name,
635  const char *context);
636  template <class HISTO, class COLLATE>
638  const char *context, int kind,
639  HISTO *h, COLLATE collate);
640 
644  MonitorElement * book1D(const std::string &dir, const std::string &name, TH1F *h);
645  MonitorElement * book1S(const std::string &dir, const std::string &name, TH1S *h);
646  MonitorElement * book1DD(const std::string &dir, const std::string &name, TH1D *h);
647  MonitorElement * book2D(const std::string &dir, const std::string &name, TH2F *h);
648  MonitorElement * book2S(const std::string &dir, const std::string &name, TH2S *h);
649  MonitorElement * book2DD(const std::string &dir, const std::string &name, TH2D *h);
650  MonitorElement * book3D(const std::string &dir, const std::string &name, TH3F *h);
651  MonitorElement * bookProfile(const std::string &dir, const std::string &name, TProfile *h);
652  MonitorElement * bookProfile2D(const std::string &folder, const std::string &name, TProfile2D *h);
653 
654  static bool checkBinningMatches(MonitorElement *me, TH1 *h);
655 
656  static void collate1D(MonitorElement *me, TH1F *h);
657  static void collate1S(MonitorElement *me, TH1S *h);
658  static void collate1DD(MonitorElement *me, TH1D *h);
659  static void collate2D(MonitorElement *me, TH2F *h);
660  static void collate2S(MonitorElement *me, TH2S *h);
661  static void collate2DD(MonitorElement *me, TH2D *h);
662  static void collate3D(MonitorElement *me, TH3F *h);
663  static void collateProfile(MonitorElement *me, TProfile *h);
664  static void collateProfile2D(MonitorElement *me, TProfile2D *h);
665 
666  // --- Operations on MEs that are normally reset at end of monitoring cycle ---
667  void setAccumulate(MonitorElement *me, bool flag);
668 
669  void print_trace(const std::string &dir, const std::string &name);
670 
671  // ----------------------- Unavailable ---------------------------------------
672  DQMStore(const DQMStore&);
673  const DQMStore& operator=(const DQMStore&);
674 
675  //-------------------------------------------------------------------------------
676  //-------------------------------------------------------------------------------
677  typedef std::pair<fastmatch *, QCriterion *> QTestSpec;
678  typedef std::list<QTestSpec> QTestSpecs;
679  typedef std::set<MonitorElement> MEMap;
680  typedef std::map<std::string, QCriterion *> QCMap;
681  typedef std::map<std::string, QCriterion *(*)(const std::string &)> QAMap;
682 
683  unsigned verbose_;
684  unsigned verboseQT_;
685  bool reset_;
686  double scaleFlag_;
692  uint32_t run_;
693  uint32_t streamId_;
694  uint32_t moduleId_;
695 
698  std::set<std::string> dirs_;
699 
703 
707 
708  friend class edm::DQMHttpSource;
709  friend class DQMService;
710  friend class DQMNet;
711  friend class DQMArchiver;
712  friend class DQMStoreExample; // for get{All,Matching}Contents -- sole user of this method!
713  friend class DQMRootOutputModule;
714  friend class DQMFileSaver;
715  friend class MEtoEDMConverter;
716 };
717 
718 #endif // DQMSERVICES_CORE_DQM_STORE_H
static void collateProfile2D(MonitorElement *me, TProfile2D *h)
Definition: DQMStore.cc:1580
QCriterion * getQCriterion(const std::string &qtname) const
Definition: DQMStore.cc:3168
IGetter * igetter_
Definition: DQMStore.h:706
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:677
std::vector< MonitorElement * > getContents(Args &&...args)
Definition: DQMStore.h:194
MonitorElement * book1S(Args &&...args)
Definition: DQMStore.h:119
DQMStore(const edm::ParameterSet &pset, edm::ActivityRegistry &)
Definition: DQMStore.cc:453
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:1104
std::map< std::string, QCriterion * > QCMap
Definition: DQMStore.h:680
bool containsAnyMonitorable(const std::string &path) const
Definition: DQMStore.cc:1698
bool isCollateME(MonitorElement *me) const
Definition: DQMStore.cc:3361
bool cdInto(const std::string &path) const
Definition: DQMStore.cc:2375
void cd(void)
Definition: DQMStore.cc:311
int getStatus(const std::string &path="") const
Definition: DQMStore.cc:3274
std::vector< std::string > getSubdirs(void) const
Definition: DQMStore.cc:1659
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:954
void rmdir(const std::string &fullpath)
Definition: DQMStore.cc:3101
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:2937
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:155
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:1838
static void collate3D(MonitorElement *me, TH3F *h)
Definition: DQMStore.cc:1563
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:1216
static void collate1D(MonitorElement *me, TH1F *h)
Definition: DQMStore.cc:1521
MatchingHeuristicEnum
Definition: DQMStore.h:52
Definition: DQMNet.h:22
void cd(void)
Definition: DQMStore.cc:266
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:644
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:1126
uint32_t streamId_
Definition: DQMStore.h:693
tuple lumi
Definition: fjr2json.py:35
static void collate1DD(MonitorElement *me, TH1D *h)
Definition: DQMStore.cc:1535
void markForDeletion(uint32_t run, uint32_t lumi)
Definition: DQMStore.cc:2040
const std::string & pwd(void)
Definition: DQMStore.cc:282
MonitorElement * bookInt(Args &&...args)
Definition: DQMStore.h:101
std::vector< MonitorElement * > getMatchingContents(const std::string &pattern, lat::Regexp::Syntax syntaxType=lat::Regexp::Wildcard) const
Definition: DQMStore.cc:1959
MonitorElement * bookString(Args &&...args)
Definition: DQMStore.h:95
MatchingHeuristicEnum matching_
Definition: DQMStore.h:70
bool reset_
Definition: DQMStore.h:685
MonitorElement * book1DD(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1S histogram.
Definition: DQMStore.cc:986
friend class DQMArchiver
Definition: DQMStore.h:711
void initializeFrom(const edm::ParameterSet &)
Definition: DQMStore.cc:520
OpenRunDirs
Definition: DQMStore.h:82
uint32_t moduleId_
Definition: DQMStore.h:694
QCMap qtests_
Definition: DQMStore.h:700
MonitorElement * book(const std::string &dir, const std::string &name, const char *context)
Definition: DQMStore.cc:809
std::mutex book_mutex_
Definition: DQMStore.h:704
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:891
static std::string const input
Definition: EdmProvDump.cc:44
SaveReferenceTag
Definition: DQMStore.h:76
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1594
~DQMStore(void)
Definition: DQMStore.cc:509
void disableSoftReset(MonitorElement *me)
Definition: DQMStore.cc:3313
static void collateProfile(MonitorElement *me, TProfile *h)
Definition: DQMStore.cc:1570
void forceReset(void)
Definition: DQMStore.cc:2019
std::vector< MonitorElement * > getAllContents(const std::string &path, uint32_t runNumber=0, uint32_t lumi=0) const
Definition: DQMStore.cc:1921
fastmatch(std::string const &_fastString)
Definition: DQMStore.cc:129
unsigned verboseQT_
Definition: DQMStore.h:684
QTestSpecs qtestspecs_
Definition: DQMStore.h:702
void removeContents(void)
erase all monitoring elements in current directory (not including subfolders);
Definition: DQMStore.cc:3135
tuple path
else: Piece not in the list, fine.
double scaleFlag_
Definition: DQMStore.h:686
void get_info(const dqmstorepb::ROOTFilePB_Histo &, std::string &dirname, std::string &objname, TObject **obj)
Definition: DQMStore.cc:3000
MonitorElement * bookString(const char *name, const char *value)
Book string.
Definition: DQMStore.cc:920
MonitorElement * bookProfile2D(Args &&...args)
Definition: DQMStore.h:161
std::set< MonitorElement > MEMap
Definition: DQMStore.h:679
static void collate1S(MonitorElement *me, TH1S *h)
Definition: DQMStore.cc:1528
bool isCollate(void) const
Definition: DQMStore.cc:3352
void removeElement(const std::string &name)
Definition: DQMStore.cc:3143
static bool checkBinningMatches(MonitorElement *me, TH1 *h)
Definition: DQMStore.cc:1494
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:113
void tag(MonitorElement *, unsigned int)
Definition: DQMStore.cc:286
MonitorElement * book2S(Args &&...args)
Definition: DQMStore.h:137
double f[11][100]
uint32_t run_
Definition: DQMStore.h:692
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:1268
void setVerbose(unsigned level)
Definition: DQMStore.cc:631
void softReset(MonitorElement *me)
Definition: DQMStore.cc:3305
std::string pwd_
Definition: DQMStore.h:696
void runQTests(void)
Definition: DQMStore.cc:3253
TObject * extractNextObject(TBufferFile &) const
Definition: DQMStore.cc:2992
lat::Regexp * regexp_
Definition: DQMStore.h:68
IBooker * ibooker_
Definition: DQMStore.h:705
QAMap qalgos_
Definition: DQMStore.h:701
std::vector< MonitorElement * > getContents(const std::string &path) const
Definition: DQMStore.cc:1737
std::string readSelectedDirectory_
Definition: DQMStore.h:691
std::vector< std::string > getMEs(void)
Definition: DQMStore.cc:299
void mergeAndResetMEsRunSummaryCache(uint32_t run, uint32_t streamId, uint32_t moduleId)
Definition: DQMStore.cc:332
std::string fastString_
Definition: DQMStore.h:69
void meGetter(iFunc f)
Definition: DQMStore.h:269
bool dirExists(const std::string &path) const
true if directory exists
Definition: DQMStore.cc:732
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:2417
void getAllTags(std::vector< std::string > &into) const
Definition: DQMStore.cc:1868
const DQMStore & operator=(const DQMStore &)
bool dirExists(const std::string &path)
Definition: DQMStore.cc:307
bool load(const std::string &filename, OpenRunDirs stripdirs=StripRunDirs, bool fileMustExist=true)
Definition: DQMStore.cc:2910
void scaleElements(void)
Definition: DQMStore.cc:3369
~fastmatch()
Definition: DQMStore.cc:199
void tagAllContents(const std::string &path, unsigned int myTag)
Definition: DQMStore.cc:1637
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:303
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:131
unsigned verbose_
Definition: DQMStore.h:683
std::list< QTestSpec > QTestSpecs
Definition: DQMStore.h:678
static void collate2S(MonitorElement *me, TH2S *h)
Definition: DQMStore.cc:1549
MEMap data_
Definition: DQMStore.h:697
static void collate2D(MonitorElement *me, TH2F *h)
Definition: DQMStore.cc:1542
void print_trace(const std::string &dir, const std::string &name)
Definition: DQMStore.cc:580
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:3218
void bookTransaction(iFunc f, uint32_t run, uint32_t streamId, uint32_t moduleId)
Definition: DQMStore.h:230
std::vector< std::string > getMEs(void) const
get list of (non-dir) MEs of current directory
Definition: DQMStore.cc:1682
friend class DQMStoreExample
Definition: DQMStore.h:712
std::vector< std::string > getSubdirs(void)
Definition: DQMStore.cc:295
DQMStore * owner_
Definition: DQMStore.h:184
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:319
unsigned int readDirectory(TFile *file, bool overwrite, const std::string &path, const std::string &prepend, const std::string &curdir, OpenRunDirs stripdirs)
Definition: DQMStore.cc:2740
IBooker(DQMStore *store)
Definition: DQMStore.h:173
bool forceResetOnBeginLumi_
Definition: DQMStore.h:690
bool extract(TObject *obj, const std::string &dir, bool overwrite, bool collateHistograms)
Definition: DQMStore.cc:2079
static void collate2DD(MonitorElement *me, TH2D *h)
Definition: DQMStore.cc:1556
void tagContents(const std::string &path, unsigned int myTag)
tag all children of folder (does NOT include subfolders)
Definition: DQMStore.cc:1625
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:2540
std::map< std::string, QCriterion *(*)(const std::string &)> QAMap
Definition: DQMStore.h:681
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:3021
void useQTest(const std::string &dir, const std::string &qtname)
Definition: DQMStore.cc:3200
tuple filename
Definition: lut2db_cfg.py:20
MonitorElement * book2DD(Args &&...args)
Definition: DQMStore.h:143
void goUp(void)
equivalent to &quot;cd ..&quot;
Definition: DQMStore.cc:678
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:2895
static const int STATUS_OK
void setAccumulate(MonitorElement *me, bool flag)
Definition: DQMStore.cc:3322
tuple level
Definition: testEve_cfg.py:34
void meBookerGetter(iFunc f)
Definition: DQMStore.h:260
QCriterion * createQTest(const std::string &algoname, const std::string &qtname)
Definition: DQMStore.cc:3179
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:107
dbl *** dir
Definition: mlp_gen.cc:35
void showDirStructure(void) const
Definition: DQMStore.cc:3332
void reset(void)
Definition: DQMStore.cc:1995
MonitorElement * bookInt(const char *name)
Book int.
Definition: DQMStore.cc:861
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:1082
tuple collateHistograms
MonitorElement * book3D(Args &&...args)
Definition: DQMStore.h:149
void mergeAndResetMEsLuminositySummaryCache(uint32_t run, uint32_t lumi, uint32_t streamId, uint32_t moduleId)
Definition: DQMStore.cc:387
DQMStore * owner_
Definition: DQMStore.h:219
friend class edm::DQMHttpSource
Definition: DQMStore.h:708
std::set< std::string > dirs_
Definition: DQMStore.h:698
bool collateHistograms_
Definition: DQMStore.h:687
MonitorElement * book1DD(Args &&...args)
Definition: DQMStore.h:125
bool LSbasedMode_
Definition: DQMStore.h:689
MonitorElement * book1S(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1S histogram.
Definition: DQMStore.cc:970
void makeDirectory(const std::string &path)
Definition: DQMStore.cc:691
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:667
const std::string & pwd(void) const
Definition: DQMStore.cc:639
bool enableMultiThread_
Definition: DQMStore.h:688
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:1412
IGetter(DQMStore *store)
Definition: DQMStore.h:208