CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Friends
DQMStore Class Reference

#include <DQMStore.h>

Classes

class  ConcurrentBooker
 
class  IBooker
 
class  IGetter
 

Public Types

enum  OpenRunDirs { KeepRunDirs, StripRunDirs }
 
enum  SaveReferenceTag { SaveWithoutReference, SaveWithReference, SaveWithReferenceForQTest }
 

Public Member Functions

MonitorElementbook1D (const char *name, const char *title, int nchX, double lowX, double highX)
 Book 1D histogram. More...
 
MonitorElementbook1D (const std::string &name, const std::string &title, int nchX, double lowX, double highX)
 Book 1D histogram. More...
 
MonitorElementbook1D (const char *name, const char *title, int nchX, const float *xbinsize)
 Book 1D variable bin histogram. More...
 
MonitorElementbook1D (const std::string &name, const std::string &title, int nchX, const float *xbinsize)
 Book 1D variable bin histogram. More...
 
MonitorElementbook1D (const char *name, TH1F *h)
 Book 1D histogram by cloning an existing histogram. More...
 
MonitorElementbook1D (const std::string &name, TH1F *h)
 Book 1D histogram by cloning an existing histogram. More...
 
MonitorElementbook1DD (const char *name, const char *title, int nchX, double lowX, double highX)
 Book 1S histogram. More...
 
MonitorElementbook1DD (const std::string &name, const std::string &title, int nchX, double lowX, double highX)
 Book 1S histogram. More...
 
MonitorElementbook1DD (const char *name, const char *title, int nchX, const float *xbinsize)
 
MonitorElementbook1DD (const std::string &name, const std::string &title, int nchX, const float *xbinsize)
 
MonitorElementbook1DD (const char *name, TH1D *h)
 Book 1D double histogram by cloning an existing histogram. More...
 
MonitorElementbook1DD (const std::string &name, TH1D *h)
 Book 1D double histogram by cloning an existing histogram. More...
 
MonitorElementbook1S (const char *name, const char *title, int nchX, double lowX, double highX)
 Book 1S histogram. More...
 
MonitorElementbook1S (const std::string &name, const std::string &title, int nchX, double lowX, double highX)
 Book 1S histogram. More...
 
MonitorElementbook1S (const char *name, const char *title, int nchX, const float *xbinsize)
 
MonitorElementbook1S (const std::string &name, const std::string &title, int nchX, const float *xbinsize)
 
MonitorElementbook1S (const char *name, TH1S *h)
 Book 1S histogram by cloning an existing histogram. More...
 
MonitorElementbook1S (const std::string &name, TH1S *h)
 Book 1S histogram by cloning an existing histogram. More...
 
MonitorElementbook2D (const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
 Book 2D histogram. More...
 
MonitorElementbook2D (const std::string &name, const std::string &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
 Book 2D histogram. More...
 
MonitorElementbook2D (const char *name, const char *title, int nchX, const float *xbinsize, int nchY, const float *ybinsize)
 Book 2D variable bin histogram. More...
 
MonitorElementbook2D (const std::string &name, const std::string &title, int nchX, const float *xbinsize, int nchY, const float *ybinsize)
 Book 2D variable bin histogram. More...
 
MonitorElementbook2D (const char *name, TH2F *h)
 Book 2D histogram by cloning an existing histogram. More...
 
MonitorElementbook2D (const std::string &name, TH2F *h)
 Book 2D histogram by cloning an existing histogram. More...
 
MonitorElementbook2DD (const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
 Book 2D double histogram. More...
 
MonitorElementbook2DD (const std::string &name, const std::string &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
 Book 2S histogram. More...
 
MonitorElementbook2DD (const char *name, const char *title, int nchX, const float *xbinsize, int nchY, const float *ybinsize)
 
MonitorElementbook2DD (const std::string &name, const std::string &title, int nchX, const float *xbinsize, int nchY, const float *ybinsize)
 
MonitorElementbook2DD (const char *name, TH2D *h)
 Book 2DS histogram by cloning an existing histogram. More...
 
MonitorElementbook2DD (const std::string &name, TH2D *h)
 Book 2DS histogram by cloning an existing histogram. More...
 
MonitorElementbook2S (const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
 Book 2S histogram. More...
 
MonitorElementbook2S (const std::string &name, const std::string &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
 Book 2S histogram. More...
 
MonitorElementbook2S (const char *name, const char *title, int nchX, const float *xbinsize, int nchY, const float *ybinsize)
 Book 2S variable bin histogram. More...
 
MonitorElementbook2S (const std::string &name, const std::string &title, int nchX, const float *xbinsize, int nchY, const float *ybinsize)
 Book 2S variable bin histogram. More...
 
MonitorElementbook2S (const char *name, TH2S *h)
 Book 2DS histogram by cloning an existing histogram. More...
 
MonitorElementbook2S (const std::string &name, TH2S *h)
 Book 2DS histogram by cloning an existing histogram. More...
 
MonitorElementbook3D (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. More...
 
MonitorElementbook3D (const std::string &name, const std::string &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ)
 Book 3D histogram. More...
 
MonitorElementbook3D (const char *name, TH3F *h)
 Book 3D histogram by cloning an existing histogram. More...
 
MonitorElementbook3D (const std::string &name, TH3F *h)
 Book 3D histogram by cloning an existing histogram. More...
 
template<typename iFunc >
void bookConcurrentTransaction (iFunc f, uint32_t run)
 
MonitorElementbookFloat (const char *name)
 Book float. More...
 
MonitorElementbookFloat (const std::string &name)
 Book float. More...
 
MonitorElementbookInt (const char *name)
 Book int. More...
 
MonitorElementbookInt (const std::string &name)
 Book int. More...
 
MonitorElementbookProfile (const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
 
MonitorElementbookProfile (const std::string &name, const std::string &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
 
MonitorElementbookProfile (const char *name, const char *title, int nchX, double lowX, double highX, double lowY, double highY, const char *option="s")
 
MonitorElementbookProfile (const std::string &name, const std::string &title, int nchX, double lowX, double highX, double lowY, double highY, const char *option="s")
 
MonitorElementbookProfile (const char *name, const char *title, int nchX, const double *xbinsize, int nchY, double lowY, double highY, const char *option="s")
 
MonitorElementbookProfile (const std::string &name, const std::string &title, int nchX, const double *xbinsize, int nchY, double lowY, double highY, const char *option="s")
 
MonitorElementbookProfile (const char *name, const char *title, int nchX, const double *xbinsize, double lowY, double highY, const char *option="s")
 
MonitorElementbookProfile (const std::string &name, const std::string &title, int nchX, const double *xbinsize, double lowY, double highY, const char *option="s")
 
MonitorElementbookProfile (const char *name, TProfile *h)
 Book TProfile by cloning an existing profile. More...
 
MonitorElementbookProfile (const std::string &name, TProfile *h)
 Book TProfile by cloning an existing profile. More...
 
MonitorElementbookProfile2D (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")
 
MonitorElementbookProfile2D (const std::string &name, const std::string &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ, const char *option="s")
 
MonitorElementbookProfile2D (const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, double lowZ, double highZ, const char *option="s")
 
MonitorElementbookProfile2D (const std::string &name, const std::string &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, double lowZ, double highZ, const char *option="s")
 
MonitorElementbookProfile2D (const char *name, TProfile2D *h)
 Book TProfile2D by cloning an existing profile. More...
 
MonitorElementbookProfile2D (const std::string &name, TProfile2D *h)
 Book TProfile2D by cloning an existing profile. More...
 
MonitorElementbookString (const char *name, const char *value)
 Book string. More...
 
MonitorElementbookString (const std::string &name, const std::string &value)
 Book string. More...
 
template<typename iFunc >
void bookTransaction (iFunc f, uint32_t run, uint32_t moduleId)
 
void cd ()
 go to top directory (ie. root) More...
 
void cd (const std::string &subdir)
 cd to subdirectory (if there) More...
 
void cloneLumiHistograms (uint32_t run, uint32_t lumi, uint32_t moduleId)
 
void cloneRunHistograms (uint32_t run, uint32_t moduleId)
 
bool containsAnyMonitorable (const std::string &path) const
 
QCriterioncreateQTest (const std::string &algoname, const std::string &qtname)
 
void deleteUnusedLumiHistograms (uint32_t run, uint32_t lumi)
 
bool dirExists (const std::string &path) const
 true if directory exists More...
 
void disableSoftReset (MonitorElement *me)
 
 DQMStore (const edm::ParameterSet &pset, edm::ActivityRegistry &)
 
 DQMStore (const edm::ParameterSet &pset)
 
MonitorElementget (const std::string &path) const
 get ME from full pathname (e.g. "my/long/dir/my_histo") More...
 
std::vector< MonitorElement * > get (unsigned int tag) const
 get all MonitorElements tagged as <tag> More...
 
std::vector< MonitorElement * > getAllContents (const std::string &path, uint32_t runNumber=0, uint32_t lumi=0) const
 
std::vector< MonitorElement * > getContents (const std::string &path) const
 
std::vector< MonitorElement * > getContents (const std::string &path, unsigned int tag) const
 same as above for tagged MonitorElements More...
 
void getContents (std::vector< std::string > &into, bool showContents=true) const
 
std::vector< MonitorElement * > getMatchingContents (const std::string &pattern, lat::Regexp::Syntax syntaxType=lat::Regexp::Wildcard) const
 
std::vector< std::string > getMEs () const
 get list of (non-dir) MEs of current directory More...
 
QCriteriongetQCriterion (const std::string &qtname) const
 
int getStatus (const std::string &path="") const
 
std::vector< std::string > getSubdirs () const
 
void goUp ()
 equivalent to "cd .." More...
 
bool isCollate () const
 
bool load (const std::string &filename, OpenRunDirs stripdirs=StripRunDirs, bool fileMustExist=true)
 
template<typename iFunc >
void meBookerGetter (iFunc f)
 
bool mtEnabled ()
 
bool open (const std::string &filename, bool overwrite=false, const std::string &path="", const std::string &prepend="", OpenRunDirs stripdirs=KeepRunDirs, bool fileMustExist=true)
 
const std::string & pwd () const
 
void removeContents ()
 erase all monitoring elements in current directory (not including subfolders); More...
 
void removeContents (const std::string &dir)
 remove all monitoring elements from directory; More...
 
void removeElement (const std::string &name)
 
void removeElement (const std::string &dir, const std::string &name, bool warning=true)
 
void rmdir (const std::string &fullpath)
 
void runQTests ()
 
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")
 
void savePB (const std::string &filename, const std::string &path="", const uint32_t run=0, const uint32_t lumi=0)
 
void scaleElements ()
 
void setCurrentFolder (const std::string &fullpath)
 
void setVerbose (unsigned level)
 
void showDirStructure () const
 
void softReset (MonitorElement *me)
 
void tag (MonitorElement *me, unsigned int myTag)
 
void tag (const std::string &path, unsigned int myTag)
 tag ME specified by full pathname (e.g. "my/long/dir/my_histo") More...
 
void tagAllContents (const std::string &path, unsigned int myTag)
 
void tagContents (const std::string &path, unsigned int myTag)
 tag all children of folder (does NOT include subfolders) More...
 
void useQTest (const std::string &dir, const std::string &qtname)
 
int useQTestByMatch (const std::string &pattern, const std::string &qtname)
 attach quality test <qc> to monitor elements matching <pattern>. More...
 
 ~DQMStore ()
 

Private Types

using MEMap = std::set< MonitorElement >
 
using QAMap = std::map< std::string, QCriterion *(*)(const std::string &)>
 
using QCMap = std::map< std::string, QCriterion * >
 
using QTestSpec = std::pair< fastmatch *, QCriterion * >
 
using QTestSpecs = std::list< QTestSpec >
 

Private Member Functions

MonitorElementbook1D_ (const std::string &dir, const std::string &name, TH1F *h)
 Book 1D histogram based on TH1F. More...
 
MonitorElementbook1DD_ (const std::string &dir, const std::string &name, TH1D *h)
 Book 1D histogram based on TH1D. More...
 
MonitorElementbook1S_ (const std::string &dir, const std::string &name, TH1S *h)
 Book 1D histogram based on TH1S. More...
 
MonitorElementbook2D_ (const std::string &dir, const std::string &name, TH2F *h)
 Book 2D histogram based on TH2F. More...
 
MonitorElementbook2DD_ (const std::string &dir, const std::string &name, TH2D *h)
 Book 2D histogram based on TH2D. More...
 
MonitorElementbook2S_ (const std::string &dir, const std::string &name, TH2S *h)
 Book 2D histogram based on TH2S. More...
 
MonitorElementbook3D_ (const std::string &dir, const std::string &name, TH3F *h)
 Book 3D histogram based on TH3F. More...
 
MonitorElementbook_ (const std::string &dir, const std::string &name, const char *context)
 
template<class HISTO , class COLLATE >
MonitorElementbook_ (const std::string &dir, const std::string &name, const char *context, int kind, HISTO *h, COLLATE collate)
 
MonitorElementbookFloat_ (const std::string &dir, const std::string &name)
 Book float. More...
 
MonitorElementbookInt_ (const std::string &dir, const std::string &name)
 Book int. More...
 
MonitorElementbookProfile2D_ (const std::string &dir, const std::string &name, TProfile2D *h)
 Book 2D profile histogram based on TProfile2D. More...
 
MonitorElementbookProfile_ (const std::string &dir, const std::string &name, TProfile *h)
 Book profile histogram based on TProfile. More...
 
MonitorElementbookString_ (const std::string &dir, const std::string &name, const std::string &value)
 Book string. More...
 
bool cdInto (const std::string &path) const
 
 DQMStore (const DQMStore &)
 
bool extract (TObject *obj, const std::string &dir, bool overwrite, bool collateHistograms)
 
TObject * extractNextObject (TBufferFile &) const
 
MonitorElementfindObject (const std::string &dir, const std::string &name, const uint32_t run=0, const uint32_t lumi=0, const uint32_t moduleId=0) const
 
void forceReset ()
 
void get_info (const dqmstorepb::ROOTFilePB_Histo &, std::string &dirname, std::string &objname, TObject **obj)
 
MonitorElementinitialise (MonitorElement *me, const std::string &path)
 
void initializeFrom (const edm::ParameterSet &)
 
bool isCollateME (MonitorElement *me) const
 
void makeDirectory (const std::string &path)
 
const DQMStoreoperator= (const DQMStore &)
 
void postGlobalBeginLumi (const edm::GlobalContext &)
 
void print_trace (const std::string &dir, const std::string &name)
 
unsigned int readDirectory (TFile *file, bool overwrite, const std::string &path, const std::string &prepend, const std::string &curdir, OpenRunDirs stripdirs)
 
bool readFile (const std::string &filename, bool overwrite=false, const std::string &path="", const std::string &prepend="", OpenRunDirs stripdirs=StripRunDirs, bool fileMustExist=true)
 
bool readFilePB (const std::string &filename, bool overwrite=false, const std::string &path="", const std::string &prepend="", OpenRunDirs stripdirs=StripRunDirs, bool fileMustExist=true)
 
void reset ()
 
void saveMonitorElementRangeToPB (std::string const &dir, unsigned int run, MEMap::const_iterator begin, MEMap::const_iterator end, dqmstorepb::ROOTFilePB &file, unsigned int &counter)
 
void saveMonitorElementRangeToROOT (std::string const &dir, std::string const &refpath, SaveReferenceTag ref, int minStatus, unsigned int run, MEMap::const_iterator begin, MEMap::const_iterator end, TFile &file, unsigned int &counter)
 
void saveMonitorElementToPB (MonitorElement const &me, dqmstorepb::ROOTFilePB &file)
 
void saveMonitorElementToROOT (MonitorElement const &me, TFile &file)
 
void setAccumulate (MonitorElement *me, bool flag)
 

Static Private Member Functions

static bool checkBinningMatches (MonitorElement *me, TH1 *h, unsigned verbose)
 
static void collate1D (MonitorElement *me, TH1F *h, unsigned verbose)
 
static void collate1DD (MonitorElement *me, TH1D *h, unsigned verbose)
 
static void collate1S (MonitorElement *me, TH1S *h, unsigned verbose)
 
static void collate2D (MonitorElement *me, TH2F *h, unsigned verbose)
 
static void collate2DD (MonitorElement *me, TH2D *h, unsigned verbose)
 
static void collate2S (MonitorElement *me, TH2S *h, unsigned verbose)
 
static void collate3D (MonitorElement *me, TH3F *h, unsigned verbose)
 
static void collateProfile (MonitorElement *me, TProfile *h, unsigned verbose)
 
static void collateProfile2D (MonitorElement *me, TProfile2D *h, unsigned verbose)
 

Private Attributes

std::mutex book_mutex_
 
bool collateHistograms_
 
MEMap data_
 
std::set< std::string > dirs_
 
bool enableMultiThread_
 
bool forceResetOnBeginLumi_
 
IBookeribooker_
 
IGetterigetter_
 
bool LSbasedMode_
 
uint32_t moduleId_
 
std::string pwd_
 
QAMap qalgos_
 
QCMap qtests_
 
QTestSpecs qtestspecs_
 
std::string readSelectedDirectory_
 
bool reset_
 
uint32_t run_
 
double scaleFlag_
 
std::ofstream * stream_
 
unsigned verbose_
 
unsigned verboseQT_
 

Friends

class DQMArchiver
 
class DQMFileSaver
 
class DQMNet
 
class DQMRootOutputModule
 
class DQMRootSource
 
class DQMService
 
class DQMStoreExample
 
class edm::DQMHttpSource
 
class MEtoEDMConverter
 

Detailed Description

Definition at line 78 of file DQMStore.h.

Member Typedef Documentation

using DQMStore::MEMap = std::set<MonitorElement>
private

Definition at line 801 of file DQMStore.h.

using DQMStore::QAMap = std::map<std::string, QCriterion *(*)(const std::string &)>
private

Definition at line 803 of file DQMStore.h.

using DQMStore::QCMap = std::map<std::string, QCriterion *>
private

Definition at line 802 of file DQMStore.h.

using DQMStore::QTestSpec = std::pair<fastmatch *, QCriterion *>
private

Definition at line 799 of file DQMStore.h.

Definition at line 800 of file DQMStore.h.

Member Enumeration Documentation

Enumerator
KeepRunDirs 
StripRunDirs 

Definition at line 87 of file DQMStore.h.

Enumerator
SaveWithoutReference 
SaveWithReference 
SaveWithReferenceForQTest 

Definition at line 81 of file DQMStore.h.

Constructor & Destructor Documentation

DQMStore::DQMStore ( const edm::ParameterSet pset,
edm::ActivityRegistry ar 
)

Definition at line 354 of file DQMStore.cc.

References edm::signalslot::Signal< T >::connect(), enableMultiThread_, forceReset(), forceResetOnBeginLumi_, edm::ParameterSet::getUntrackedParameter(), ibooker_, igetter_, initializeFrom(), edm::service::SystemBounds::maxNumberOfStreams(), postGlobalBeginLumi(), edm::ActivityRegistry::preallocateSignal_, edm::ActivityRegistry::watchPostGlobalBeginLumi(), edm::ActivityRegistry::watchPostSourceLumi(), and edm::ActivityRegistry::watchPostSourceRun().

355  : verbose_ (1),
356  verboseQT_ (1),
357  reset_ (false),
358  collateHistograms_ (false),
359  enableMultiThread_(false),
360  forceResetOnBeginLumi_(false),
362  run_(0),
363  moduleId_(0),
364  stream_(nullptr),
365  pwd_ (""),
366  ibooker_(nullptr),
367  igetter_(nullptr)
368 {
369  if (!ibooker_)
370  ibooker_ = new DQMStore::IBooker(this);
371  if (!igetter_)
372  igetter_ = new DQMStore::IGetter(this);
373  initializeFrom(pset);
374 
375  ar.preallocateSignal_.connect([this](edm::service::SystemBounds const& iBounds) {
376  if(iBounds.maxNumberOfStreams() > 1 ) {
377  enableMultiThread_ = true;
378  }
379  });
380  if(pset.getUntrackedParameter<bool>("forceResetOnBeginRun",false)) {
381  ar.watchPostSourceRun([this](edm::RunIndex){ forceReset(); });
382  }
383  if(pset.getUntrackedParameter<bool>("forceResetOnBeginLumi",false) && enableMultiThread_ == false) {
384  forceResetOnBeginLumi_ = true;
386  }
388 }
IGetter * igetter_
Definition: DQMStore.h:854
T getUntrackedParameter(std::string const &, T const &) const
void postGlobalBeginLumi(const edm::GlobalContext &)
Definition: DQMStore.cc:1944
void watchPostGlobalBeginLumi(PostGlobalBeginLumi::slot_type const &iSlot)
bool reset_
Definition: DQMStore.h:833
void initializeFrom(const edm::ParameterSet &)
Definition: DQMStore.cc:425
uint32_t moduleId_
Definition: DQMStore.h:841
void forceReset()
Definition: DQMStore.cc:1919
Preallocate preallocateSignal_
signal is emitted before beginJob
unsigned int maxNumberOfStreams() const
Definition: SystemBounds.h:43
unsigned verboseQT_
Definition: DQMStore.h:832
void watchPostSourceRun(PostSourceRun::slot_type const &iSlot)
uint32_t run_
Definition: DQMStore.h:840
std::string pwd_
Definition: DQMStore.h:844
IBooker * ibooker_
Definition: DQMStore.h:853
std::string readSelectedDirectory_
Definition: DQMStore.h:839
void watchPostSourceLumi(PostSourceLumi::slot_type const &iSlot)
unsigned verbose_
Definition: DQMStore.h:831
bool forceResetOnBeginLumi_
Definition: DQMStore.h:838
std::ofstream * stream_
Definition: DQMStore.h:842
bool collateHistograms_
Definition: DQMStore.h:835
void connect(U iFunc)
Definition: Signal.h:64
bool enableMultiThread_
Definition: DQMStore.h:836
DQMStore::DQMStore ( const edm::ParameterSet pset)

Definition at line 390 of file DQMStore.cc.

References ibooker_, igetter_, and initializeFrom().

391  : verbose_ (1),
392  verboseQT_ (1),
393  reset_ (false),
394  collateHistograms_ (false),
395  enableMultiThread_(false),
397  run_(0),
398  moduleId_(0),
399  stream_(nullptr),
400  pwd_ (""),
401  ibooker_(nullptr),
402  igetter_(nullptr)
403 {
404  if (!ibooker_)
405  ibooker_ = new DQMStore::IBooker(this);
406  if (!igetter_)
407  igetter_ = new DQMStore::IGetter(this);
408  initializeFrom(pset);
409 }
IGetter * igetter_
Definition: DQMStore.h:854
bool reset_
Definition: DQMStore.h:833
void initializeFrom(const edm::ParameterSet &)
Definition: DQMStore.cc:425
uint32_t moduleId_
Definition: DQMStore.h:841
unsigned verboseQT_
Definition: DQMStore.h:832
uint32_t run_
Definition: DQMStore.h:840
std::string pwd_
Definition: DQMStore.h:844
IBooker * ibooker_
Definition: DQMStore.h:853
std::string readSelectedDirectory_
Definition: DQMStore.h:839
unsigned verbose_
Definition: DQMStore.h:831
std::ofstream * stream_
Definition: DQMStore.h:842
bool collateHistograms_
Definition: DQMStore.h:835
bool enableMultiThread_
Definition: DQMStore.h:836
DQMStore::~DQMStore ( )

Definition at line 411 of file DQMStore.cc.

References qtests_, qtestspecs_, and stream_.

Referenced by meBookerGetter().

412 {
413  for (auto & qtest : qtests_)
414  delete qtest.second;
415 
416  for (auto & qtestspec : qtestspecs_)
417  delete qtestspec.first;
418 
419  if (stream_)
420  stream_->close();
421  delete stream_;
422 }
QCMap qtests_
Definition: DQMStore.h:848
QTestSpecs qtestspecs_
Definition: DQMStore.h:850
std::ofstream * stream_
Definition: DQMStore.h:842
DQMStore::DQMStore ( const DQMStore )
private

Member Function Documentation

MonitorElement * DQMStore::book1D ( const char *  name,
const char *  title,
int  nchX,
double  lowX,
double  highX 
)

Book 1D histogram.

Definition at line 882 of file DQMStore.cc.

References book1D_(), and pwd_.

Referenced by DQMFEDIntegrityClient::beginJob(), ConverterTester::beginJob(), SimplePhotonAnalyzer::beginJob(), APVValidationPlots::beginJob(), StripValidationPlots::beginJob(), MuonAlignment::beginJob(), RPCBxTest::beginRun(), hcaldqm::ContainerSingle1D::book(), MEtoMEComparitor::book(), hcaldqm::Container1D::book(), SiStripBaseCondObjDQM::bookCumulMEs(), TrackerOfflineValidationSummary::bookHarvestingHists(), PixelVTXMonitor::bookHistograms(), DQMLumiMonitor::bookHistograms(), SiStripBaseCondObjDQM::bookProfileMEs(), SiStripBaseCondObjDQM::bookSummaryCumulMEs(), dqmRegisterHistogram(), HarvestingAnalyzer::endJob(), HLTScalersClient::endLuminosityBlock(), DQMDcsInfoClient::endRun(), GlobalHitsProdHistStripper::endRun(), SiStripQualityDQM::fillGrandSummaryMEs(), SiStripSummaryCreator::getSummaryME(), HLTScalersClient::HLTScalersClient(), SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy::initializeDQMHistograms(), LaserDQM::initMonitors(), L1ScalersClient::L1ScalersClient(), meBookerGetter(), and MonitorElementsDb::MonitorElementsDb().

884 {
885  return book1D_(pwd_, name, new TH1F(name, title, nchX, lowX, highX));
886 }
std::string pwd_
Definition: DQMStore.h:844
MonitorElement * book1D_(const std::string &dir, const std::string &name, TH1F *h)
Book 1D histogram based on TH1F.
Definition: DQMStore.cc:861
MonitorElement * DQMStore::book1D ( const std::string &  name,
const std::string &  title,
int  nchX,
double  lowX,
double  highX 
)

Book 1D histogram.

Definition at line 890 of file DQMStore.cc.

References book1D_(), and pwd_.

892 {
893  return book1D_(pwd_, name, new TH1F(name.c_str(), title.c_str(), nchX, lowX, highX));
894 }
std::string pwd_
Definition: DQMStore.h:844
MonitorElement * book1D_(const std::string &dir, const std::string &name, TH1F *h)
Book 1D histogram based on TH1F.
Definition: DQMStore.cc:861
MonitorElement * DQMStore::book1D ( const char *  name,
const char *  title,
int  nchX,
const float *  xbinsize 
)

Book 1D variable bin histogram.

Definition at line 930 of file DQMStore.cc.

References book1D_(), and pwd_.

932 {
933  return book1D_(pwd_, name, new TH1F(name, title, nchX, xbinsize));
934 }
std::string pwd_
Definition: DQMStore.h:844
MonitorElement * book1D_(const std::string &dir, const std::string &name, TH1F *h)
Book 1D histogram based on TH1F.
Definition: DQMStore.cc:861
MonitorElement * DQMStore::book1D ( const std::string &  name,
const std::string &  title,
int  nchX,
const float *  xbinsize 
)

Book 1D variable bin histogram.

Definition at line 938 of file DQMStore.cc.

References book1D_(), and pwd_.

940 {
941  return book1D_(pwd_, name, new TH1F(name.c_str(), title.c_str(), nchX, xbinsize));
942 }
std::string pwd_
Definition: DQMStore.h:844
MonitorElement * book1D_(const std::string &dir, const std::string &name, TH1F *h)
Book 1D histogram based on TH1F.
Definition: DQMStore.cc:861
MonitorElement * DQMStore::book1D ( const char *  name,
TH1F *  h 
)

Book 1D histogram by cloning an existing histogram.

Definition at line 946 of file DQMStore.cc.

References book1D_(), and pwd_.

947 {
948  return book1D_(pwd_, name, static_cast<TH1F *>(source->Clone(name)));
949 }
std::string pwd_
Definition: DQMStore.h:844
MonitorElement * book1D_(const std::string &dir, const std::string &name, TH1F *h)
Book 1D histogram based on TH1F.
Definition: DQMStore.cc:861
static std::string const source
Definition: EdmProvDump.cc:43
MonitorElement * DQMStore::book1D ( const std::string &  name,
TH1F *  h 
)

Book 1D histogram by cloning an existing histogram.

Definition at line 953 of file DQMStore.cc.

References book1D_(), and pwd_.

954 {
955  return book1D_(pwd_, name, static_cast<TH1F *>(source->Clone(name.c_str())));
956 }
std::string pwd_
Definition: DQMStore.h:844
MonitorElement * book1D_(const std::string &dir, const std::string &name, TH1F *h)
Book 1D histogram based on TH1F.
Definition: DQMStore.cc:861
static std::string const source
Definition: EdmProvDump.cc:43
MonitorElement * DQMStore::book1D_ ( const std::string &  dir,
const std::string &  name,
TH1F *  h 
)
private

Book 1D histogram based on TH1F.

Definition at line 861 of file DQMStore.cc.

References book_(), collate1D(), and MonitorElement::DQM_KIND_TH1F.

Referenced by book1D(), extract(), and mtEnabled().

862 {
863  return book_(dir, name, "book1D", MonitorElement::DQM_KIND_TH1F, h, collate1D);
864 }
MonitorElement * book_(const std::string &dir, const std::string &name, const char *context)
Definition: DQMStore.cc:737
static void collate1D(MonitorElement *me, TH1F *h, unsigned verbose)
Definition: DQMStore.cc:1468
dbl *** dir
Definition: mlp_gen.cc:35
MonitorElement * DQMStore::book1DD ( const char *  name,
const char *  title,
int  nchX,
double  lowX,
double  highX 
)

Book 1S histogram.

Definition at line 914 of file DQMStore.cc.

References book1DD_(), and pwd_.

Referenced by MEtoMEComparitor::book(), and meBookerGetter().

916 {
917  return book1DD_(pwd_, name, new TH1D(name, title, nchX, lowX, highX));
918 }
std::string pwd_
Definition: DQMStore.h:844
MonitorElement * book1DD_(const std::string &dir, const std::string &name, TH1D *h)
Book 1D histogram based on TH1D.
Definition: DQMStore.cc:875
MonitorElement * DQMStore::book1DD ( const std::string &  name,
const std::string &  title,
int  nchX,
double  lowX,
double  highX 
)

Book 1S histogram.

Definition at line 922 of file DQMStore.cc.

References book1DD_(), and pwd_.

924 {
925  return book1DD_(pwd_, name, new TH1D(name.c_str(), title.c_str(), nchX, lowX, highX));
926 }
std::string pwd_
Definition: DQMStore.h:844
MonitorElement * book1DD_(const std::string &dir, const std::string &name, TH1D *h)
Book 1D histogram based on TH1D.
Definition: DQMStore.cc:875
MonitorElement* DQMStore::book1DD ( const char *  name,
const char *  title,
int  nchX,
const float *  xbinsize 
)
MonitorElement* DQMStore::book1DD ( const std::string &  name,
const std::string &  title,
int  nchX,
const float *  xbinsize 
)
MonitorElement * DQMStore::book1DD ( const char *  name,
TH1D *  h 
)

Book 1D double histogram by cloning an existing histogram.

Definition at line 974 of file DQMStore.cc.

References book1DD_(), and pwd_.

975 {
976  return book1DD_(pwd_, name, static_cast<TH1D *>(source->Clone(name)));
977 }
std::string pwd_
Definition: DQMStore.h:844
MonitorElement * book1DD_(const std::string &dir, const std::string &name, TH1D *h)
Book 1D histogram based on TH1D.
Definition: DQMStore.cc:875
static std::string const source
Definition: EdmProvDump.cc:43
MonitorElement * DQMStore::book1DD ( const std::string &  name,
TH1D *  h 
)

Book 1D double histogram by cloning an existing histogram.

Definition at line 981 of file DQMStore.cc.

References book1DD_(), and pwd_.

982 {
983  return book1DD_(pwd_, name, static_cast<TH1D *>(source->Clone(name.c_str())));
984 }
std::string pwd_
Definition: DQMStore.h:844
MonitorElement * book1DD_(const std::string &dir, const std::string &name, TH1D *h)
Book 1D histogram based on TH1D.
Definition: DQMStore.cc:875
static std::string const source
Definition: EdmProvDump.cc:43
MonitorElement * DQMStore::book1DD_ ( const std::string &  dir,
const std::string &  name,
TH1D *  h 
)
private

Book 1D histogram based on TH1D.

Definition at line 875 of file DQMStore.cc.

References book_(), collate1DD(), and MonitorElement::DQM_KIND_TH1D.

Referenced by book1DD(), extract(), and mtEnabled().

876 {
877  return book_(dir, name, "book1DD", MonitorElement::DQM_KIND_TH1D, h, collate1DD);
878 }
static void collate1DD(MonitorElement *me, TH1D *h, unsigned verbose)
Definition: DQMStore.cc:1482
MonitorElement * book_(const std::string &dir, const std::string &name, const char *context)
Definition: DQMStore.cc:737
dbl *** dir
Definition: mlp_gen.cc:35
MonitorElement * DQMStore::book1S ( const char *  name,
const char *  title,
int  nchX,
double  lowX,
double  highX 
)

Book 1S histogram.

Definition at line 898 of file DQMStore.cc.

References book1S_(), and pwd_.

Referenced by MEtoMEComparitor::book(), dqmRegisterHistogram(), and meBookerGetter().

900 {
901  return book1S_(pwd_, name, new TH1S(name, title, nchX, lowX, highX));
902 }
std::string pwd_
Definition: DQMStore.h:844
MonitorElement * book1S_(const std::string &dir, const std::string &name, TH1S *h)
Book 1D histogram based on TH1S.
Definition: DQMStore.cc:868
MonitorElement * DQMStore::book1S ( const std::string &  name,
const std::string &  title,
int  nchX,
double  lowX,
double  highX 
)

Book 1S histogram.

Definition at line 906 of file DQMStore.cc.

References book1S_(), and pwd_.

908 {
909  return book1S_(pwd_, name, new TH1S(name.c_str(), title.c_str(), nchX, lowX, highX));
910 }
std::string pwd_
Definition: DQMStore.h:844
MonitorElement * book1S_(const std::string &dir, const std::string &name, TH1S *h)
Book 1D histogram based on TH1S.
Definition: DQMStore.cc:868
MonitorElement* DQMStore::book1S ( const char *  name,
const char *  title,
int  nchX,
const float *  xbinsize 
)
MonitorElement* DQMStore::book1S ( const std::string &  name,
const std::string &  title,
int  nchX,
const float *  xbinsize 
)
MonitorElement * DQMStore::book1S ( const char *  name,
TH1S *  h 
)

Book 1S histogram by cloning an existing histogram.

Definition at line 960 of file DQMStore.cc.

References book1S_(), and pwd_.

961 {
962  return book1S_(pwd_, name, static_cast<TH1S *>(source->Clone(name)));
963 }
std::string pwd_
Definition: DQMStore.h:844
static std::string const source
Definition: EdmProvDump.cc:43
MonitorElement * book1S_(const std::string &dir, const std::string &name, TH1S *h)
Book 1D histogram based on TH1S.
Definition: DQMStore.cc:868
MonitorElement * DQMStore::book1S ( const std::string &  name,
TH1S *  h 
)

Book 1S histogram by cloning an existing histogram.

Definition at line 967 of file DQMStore.cc.

References book1S_(), and pwd_.

968 {
969  return book1S_(pwd_, name, static_cast<TH1S *>(source->Clone(name.c_str())));
970 }
std::string pwd_
Definition: DQMStore.h:844
static std::string const source
Definition: EdmProvDump.cc:43
MonitorElement * book1S_(const std::string &dir, const std::string &name, TH1S *h)
Book 1D histogram based on TH1S.
Definition: DQMStore.cc:868
MonitorElement * DQMStore::book1S_ ( const std::string &  dir,
const std::string &  name,
TH1S *  h 
)
private

Book 1D histogram based on TH1S.

Definition at line 868 of file DQMStore.cc.

References book_(), collate1S(), and MonitorElement::DQM_KIND_TH1S.

Referenced by book1S(), extract(), and mtEnabled().

869 {
870  return book_(dir, name, "book1S", MonitorElement::DQM_KIND_TH1S, h, collate1S);
871 }
MonitorElement * book_(const std::string &dir, const std::string &name, const char *context)
Definition: DQMStore.cc:737
static void collate1S(MonitorElement *me, TH1S *h, unsigned verbose)
Definition: DQMStore.cc:1475
dbl *** dir
Definition: mlp_gen.cc:35
MonitorElement * DQMStore::book2D ( const char *  name,
const char *  title,
int  nchX,
double  lowX,
double  highX,
int  nchY,
double  lowY,
double  highY 
)
MonitorElement * DQMStore::book2D ( const std::string &  name,
const std::string &  title,
int  nchX,
double  lowX,
double  highX,
int  nchY,
double  lowY,
double  highY 
)

Book 2D histogram.

Definition at line 1021 of file DQMStore.cc.

References book2D_(), and pwd_.

1024 {
1025  return book2D_(pwd_, name, new TH2F(name.c_str(), title.c_str(),
1026  nchX, lowX, highX,
1027  nchY, lowY, highY));
1028 }
MonitorElement * book2D_(const std::string &dir, const std::string &name, TH2F *h)
Book 2D histogram based on TH2F.
Definition: DQMStore.cc:989
std::string pwd_
Definition: DQMStore.h:844
MonitorElement * DQMStore::book2D ( const char *  name,
const char *  title,
int  nchX,
const float *  xbinsize,
int  nchY,
const float *  ybinsize 
)

Book 2D variable bin histogram.

Definition at line 1076 of file DQMStore.cc.

References book2D_(), and pwd_.

1078 {
1079  return book2D_(pwd_, name, new TH2F(name, title,
1080  nchX, xbinsize, nchY, ybinsize));
1081 }
MonitorElement * book2D_(const std::string &dir, const std::string &name, TH2F *h)
Book 2D histogram based on TH2F.
Definition: DQMStore.cc:989
std::string pwd_
Definition: DQMStore.h:844
MonitorElement * DQMStore::book2D ( const std::string &  name,
const std::string &  title,
int  nchX,
const float *  xbinsize,
int  nchY,
const float *  ybinsize 
)

Book 2D variable bin histogram.

Definition at line 1085 of file DQMStore.cc.

References book2D_(), and pwd_.

1087 {
1088  return book2D_(pwd_, name, new TH2F(name.c_str(), title.c_str(),
1089  nchX, xbinsize, nchY, ybinsize));
1090 }
MonitorElement * book2D_(const std::string &dir, const std::string &name, TH2F *h)
Book 2D histogram based on TH2F.
Definition: DQMStore.cc:989
std::string pwd_
Definition: DQMStore.h:844
MonitorElement * DQMStore::book2D ( const char *  name,
TH2F *  h 
)

Book 2D histogram by cloning an existing histogram.

Definition at line 1113 of file DQMStore.cc.

References book2D_(), and pwd_.

1114 {
1115  return book2D_(pwd_, name, static_cast<TH2F *>(source->Clone(name)));
1116 }
MonitorElement * book2D_(const std::string &dir, const std::string &name, TH2F *h)
Book 2D histogram based on TH2F.
Definition: DQMStore.cc:989
std::string pwd_
Definition: DQMStore.h:844
static std::string const source
Definition: EdmProvDump.cc:43
MonitorElement * DQMStore::book2D ( const std::string &  name,
TH2F *  h 
)

Book 2D histogram by cloning an existing histogram.

Definition at line 1120 of file DQMStore.cc.

References book2D_(), and pwd_.

1121 {
1122  return book2D_(pwd_, name, static_cast<TH2F *>(source->Clone(name.c_str())));
1123 }
MonitorElement * book2D_(const std::string &dir, const std::string &name, TH2F *h)
Book 2D histogram based on TH2F.
Definition: DQMStore.cc:989
std::string pwd_
Definition: DQMStore.h:844
static std::string const source
Definition: EdmProvDump.cc:43
MonitorElement * DQMStore::book2D_ ( const std::string &  dir,
const std::string &  name,
TH2F *  h 
)
private

Book 2D histogram based on TH2F.

Definition at line 989 of file DQMStore.cc.

References book_(), collate2D(), and MonitorElement::DQM_KIND_TH2F.

Referenced by book2D(), extract(), and mtEnabled().

990 {
991  return book_(dir, name, "book2D", MonitorElement::DQM_KIND_TH2F, h, collate2D);
992 }
MonitorElement * book_(const std::string &dir, const std::string &name, const char *context)
Definition: DQMStore.cc:737
dbl *** dir
Definition: mlp_gen.cc:35
static void collate2D(MonitorElement *me, TH2F *h, unsigned verbose)
Definition: DQMStore.cc:1489
MonitorElement * DQMStore::book2DD ( const char *  name,
const char *  title,
int  nchX,
double  lowX,
double  highX,
int  nchY,
double  lowY,
double  highY 
)

Book 2D double histogram.

Definition at line 1054 of file DQMStore.cc.

References book2DD_(), and pwd_.

Referenced by meBookerGetter().

1057 {
1058  return book2DD_(pwd_, name, new TH2D(name, title,
1059  nchX, lowX, highX,
1060  nchY, lowY, highY));
1061 }
MonitorElement * book2DD_(const std::string &dir, const std::string &name, TH2D *h)
Book 2D histogram based on TH2D.
Definition: DQMStore.cc:1003
std::string pwd_
Definition: DQMStore.h:844
MonitorElement * DQMStore::book2DD ( const std::string &  name,
const std::string &  title,
int  nchX,
double  lowX,
double  highX,
int  nchY,
double  lowY,
double  highY 
)

Book 2S histogram.

Definition at line 1065 of file DQMStore.cc.

References book2DD_(), and pwd_.

1068 {
1069  return book2DD_(pwd_, name, new TH2D(name.c_str(), title.c_str(),
1070  nchX, lowX, highX,
1071  nchY, lowY, highY));
1072 }
MonitorElement * book2DD_(const std::string &dir, const std::string &name, TH2D *h)
Book 2D histogram based on TH2D.
Definition: DQMStore.cc:1003
std::string pwd_
Definition: DQMStore.h:844
MonitorElement* DQMStore::book2DD ( const char *  name,
const char *  title,
int  nchX,
const float *  xbinsize,
int  nchY,
const float *  ybinsize 
)
MonitorElement* DQMStore::book2DD ( const std::string &  name,
const std::string &  title,
int  nchX,
const float *  xbinsize,
int  nchY,
const float *  ybinsize 
)
MonitorElement * DQMStore::book2DD ( const char *  name,
TH2D *  h 
)

Book 2DS histogram by cloning an existing histogram.

Definition at line 1141 of file DQMStore.cc.

References book2DD_(), and pwd_.

1142 {
1143  return book2DD_(pwd_, name, static_cast<TH2D *>(source->Clone(name)));
1144 }
MonitorElement * book2DD_(const std::string &dir, const std::string &name, TH2D *h)
Book 2D histogram based on TH2D.
Definition: DQMStore.cc:1003
std::string pwd_
Definition: DQMStore.h:844
static std::string const source
Definition: EdmProvDump.cc:43
MonitorElement * DQMStore::book2DD ( const std::string &  name,
TH2D *  h 
)

Book 2DS histogram by cloning an existing histogram.

Definition at line 1148 of file DQMStore.cc.

References book2DD_(), and pwd_.

1149 {
1150  return book2DD_(pwd_, name, static_cast<TH2D *>(source->Clone(name.c_str())));
1151 }
MonitorElement * book2DD_(const std::string &dir, const std::string &name, TH2D *h)
Book 2D histogram based on TH2D.
Definition: DQMStore.cc:1003
std::string pwd_
Definition: DQMStore.h:844
static std::string const source
Definition: EdmProvDump.cc:43
MonitorElement * DQMStore::book2DD_ ( const std::string &  dir,
const std::string &  name,
TH2D *  h 
)
private

Book 2D histogram based on TH2D.

Definition at line 1003 of file DQMStore.cc.

References book_(), collate2DD(), and MonitorElement::DQM_KIND_TH2D.

Referenced by book2DD(), extract(), and mtEnabled().

1004 {
1005  return book_(dir, name, "book2DD", MonitorElement::DQM_KIND_TH2D, h, collate2DD);
1006 }
static void collate2DD(MonitorElement *me, TH2D *h, unsigned verbose)
Definition: DQMStore.cc:1503
MonitorElement * book_(const std::string &dir, const std::string &name, const char *context)
Definition: DQMStore.cc:737
dbl *** dir
Definition: mlp_gen.cc:35
MonitorElement * DQMStore::book2S ( const char *  name,
const char *  title,
int  nchX,
double  lowX,
double  highX,
int  nchY,
double  lowY,
double  highY 
)

Book 2S histogram.

Definition at line 1032 of file DQMStore.cc.

References book2S_(), and pwd_.

Referenced by dqmRegisterHistogram(), and meBookerGetter().

1035 {
1036  return book2S_(pwd_, name, new TH2S(name, title,
1037  nchX, lowX, highX,
1038  nchY, lowY, highY));
1039 }
std::string pwd_
Definition: DQMStore.h:844
MonitorElement * book2S_(const std::string &dir, const std::string &name, TH2S *h)
Book 2D histogram based on TH2S.
Definition: DQMStore.cc:996
MonitorElement * DQMStore::book2S ( const std::string &  name,
const std::string &  title,
int  nchX,
double  lowX,
double  highX,
int  nchY,
double  lowY,
double  highY 
)

Book 2S histogram.

Definition at line 1043 of file DQMStore.cc.

References book2S_(), and pwd_.

1046 {
1047  return book2S_(pwd_, name, new TH2S(name.c_str(), title.c_str(),
1048  nchX, lowX, highX,
1049  nchY, lowY, highY));
1050 }
std::string pwd_
Definition: DQMStore.h:844
MonitorElement * book2S_(const std::string &dir, const std::string &name, TH2S *h)
Book 2D histogram based on TH2S.
Definition: DQMStore.cc:996
MonitorElement * DQMStore::book2S ( const char *  name,
const char *  title,
int  nchX,
const float *  xbinsize,
int  nchY,
const float *  ybinsize 
)

Book 2S variable bin histogram.

Definition at line 1094 of file DQMStore.cc.

References book2S_(), and pwd_.

1096 {
1097 
1098  return book2S_(pwd_, name, new TH2S(name, title,
1099  nchX, xbinsize, nchY, ybinsize));
1100 }
std::string pwd_
Definition: DQMStore.h:844
MonitorElement * book2S_(const std::string &dir, const std::string &name, TH2S *h)
Book 2D histogram based on TH2S.
Definition: DQMStore.cc:996
MonitorElement * DQMStore::book2S ( const std::string &  name,
const std::string &  title,
int  nchX,
const float *  xbinsize,
int  nchY,
const float *  ybinsize 
)

Book 2S variable bin histogram.

Definition at line 1104 of file DQMStore.cc.

References book2S_(), and pwd_.

1106 {
1107  return book2S_(pwd_, name, new TH2S(name.c_str(), title.c_str(),
1108  nchX, xbinsize, nchY, ybinsize));
1109 }
std::string pwd_
Definition: DQMStore.h:844
MonitorElement * book2S_(const std::string &dir, const std::string &name, TH2S *h)
Book 2D histogram based on TH2S.
Definition: DQMStore.cc:996
MonitorElement * DQMStore::book2S ( const char *  name,
TH2S *  h 
)

Book 2DS histogram by cloning an existing histogram.

Definition at line 1127 of file DQMStore.cc.

References book2S_(), and pwd_.

1128 {
1129  return book2S_(pwd_, name, static_cast<TH2S *>(source->Clone(name)));
1130 }
std::string pwd_
Definition: DQMStore.h:844
MonitorElement * book2S_(const std::string &dir, const std::string &name, TH2S *h)
Book 2D histogram based on TH2S.
Definition: DQMStore.cc:996
static std::string const source
Definition: EdmProvDump.cc:43
MonitorElement * DQMStore::book2S ( const std::string &  name,
TH2S *  h 
)

Book 2DS histogram by cloning an existing histogram.

Definition at line 1134 of file DQMStore.cc.

References book2S_(), and pwd_.

1135 {
1136  return book2S_(pwd_, name, static_cast<TH2S *>(source->Clone(name.c_str())));
1137 }
std::string pwd_
Definition: DQMStore.h:844
MonitorElement * book2S_(const std::string &dir, const std::string &name, TH2S *h)
Book 2D histogram based on TH2S.
Definition: DQMStore.cc:996
static std::string const source
Definition: EdmProvDump.cc:43
MonitorElement * DQMStore::book2S_ ( const std::string &  dir,
const std::string &  name,
TH2S *  h 
)
private

Book 2D histogram based on TH2S.

Definition at line 996 of file DQMStore.cc.

References book_(), collate2S(), and MonitorElement::DQM_KIND_TH2S.

Referenced by book2S(), extract(), and mtEnabled().

997 {
998  return book_(dir, name, "book2S", MonitorElement::DQM_KIND_TH2S, h, collate2S);
999 }
MonitorElement * book_(const std::string &dir, const std::string &name, const char *context)
Definition: DQMStore.cc:737
dbl *** dir
Definition: mlp_gen.cc:35
static void collate2S(MonitorElement *me, TH2S *h, unsigned verbose)
Definition: DQMStore.cc:1496
MonitorElement * DQMStore::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 at line 1163 of file DQMStore.cc.

References book3D_(), and pwd_.

Referenced by ConverterTester::beginJob(), dqmRegisterHistogram(), and meBookerGetter().

1167 {
1168  return book3D_(pwd_, name, new TH3F(name, title,
1169  nchX, lowX, highX,
1170  nchY, lowY, highY,
1171  nchZ, lowZ, highZ));
1172 }
MonitorElement * book3D_(const std::string &dir, const std::string &name, TH3F *h)
Book 3D histogram based on TH3F.
Definition: DQMStore.cc:1156
std::string pwd_
Definition: DQMStore.h:844
MonitorElement * DQMStore::book3D ( const std::string &  name,
const std::string &  title,
int  nchX,
double  lowX,
double  highX,
int  nchY,
double  lowY,
double  highY,
int  nchZ,
double  lowZ,
double  highZ 
)

Book 3D histogram.

Definition at line 1176 of file DQMStore.cc.

References book3D_(), and pwd_.

1180 {
1181  return book3D_(pwd_, name, new TH3F(name.c_str(), title.c_str(),
1182  nchX, lowX, highX,
1183  nchY, lowY, highY,
1184  nchZ, lowZ, highZ));
1185 }
MonitorElement * book3D_(const std::string &dir, const std::string &name, TH3F *h)
Book 3D histogram based on TH3F.
Definition: DQMStore.cc:1156
std::string pwd_
Definition: DQMStore.h:844
MonitorElement * DQMStore::book3D ( const char *  name,
TH3F *  h 
)

Book 3D histogram by cloning an existing histogram.

Definition at line 1189 of file DQMStore.cc.

References book3D_(), and pwd_.

1190 {
1191  return book3D_(pwd_, name, static_cast<TH3F *>(source->Clone(name)));
1192 }
MonitorElement * book3D_(const std::string &dir, const std::string &name, TH3F *h)
Book 3D histogram based on TH3F.
Definition: DQMStore.cc:1156
std::string pwd_
Definition: DQMStore.h:844
static std::string const source
Definition: EdmProvDump.cc:43
MonitorElement * DQMStore::book3D ( const std::string &  name,
TH3F *  h 
)

Book 3D histogram by cloning an existing histogram.

Definition at line 1196 of file DQMStore.cc.

References book3D_(), and pwd_.

1197 {
1198  return book3D_(pwd_, name, static_cast<TH3F *>(source->Clone(name.c_str())));
1199 }
MonitorElement * book3D_(const std::string &dir, const std::string &name, TH3F *h)
Book 3D histogram based on TH3F.
Definition: DQMStore.cc:1156
std::string pwd_
Definition: DQMStore.h:844
static std::string const source
Definition: EdmProvDump.cc:43
MonitorElement * DQMStore::book3D_ ( const std::string &  dir,
const std::string &  name,
TH3F *  h 
)
private

Book 3D histogram based on TH3F.

Definition at line 1156 of file DQMStore.cc.

References book_(), collate3D(), and MonitorElement::DQM_KIND_TH3F.

Referenced by book3D(), extract(), and mtEnabled().

1157 {
1158  return book_(dir, name, "book3D", MonitorElement::DQM_KIND_TH3F, h, collate3D);
1159 }
static void collate3D(MonitorElement *me, TH3F *h, unsigned verbose)
Definition: DQMStore.cc:1510
MonitorElement * book_(const std::string &dir, const std::string &name, const char *context)
Definition: DQMStore.cc:737
dbl *** dir
Definition: mlp_gen.cc:35
MonitorElement * DQMStore::book_ ( const std::string &  dir,
const std::string &  name,
const char *  context 
)
private

Definition at line 737 of file DQMStore.cc.

References gather_cfg::cout, data_, dirs_, findObject(), mergePath(), moduleId_, eostools::move(), dataset::name, callgraph::path, print_trace(), run_, AlCaHLTBitMon_QueryRunRegistry::string, and verbose_.

Referenced by book1D_(), book1DD_(), book1S_(), book2D_(), book2DD_(), book2S_(), book3D_(), bookFloat_(), bookInt_(), bookProfile2D_(), bookProfile_(), bookString_(), and mtEnabled().

740 {
741  assert(name.find('/') == std::string::npos);
742  if (verbose_ > 3)
743  print_trace(dir, name);
744 
745  // Check if the request monitor element already exists.
746  if (MonitorElement *me = findObject(dir, name, run_, 0, moduleId_))
747  {
748  if (verbose_ > 1)
749  {
751  mergePath(path, dir, name);
752 
753  std::cout << "DQMStore: "
754  << context << ": monitor element '"
755  << path << "' already exists, resetting" << std::endl;
756  }
757  me->Reset();
758  return me;
759  }
760  else
761  {
762  // Create it and return for initialisation.
763  assert(dirs_.count(dir));
764  MonitorElement proto(&*dirs_.find(dir), name, run_, moduleId_);
765  return &const_cast<MonitorElement &>(*data_.insert(std::move(proto)).first);
766  }
767 }
static void mergePath(std::string &path, const std::string &dir, const std::string &name)
Definition: DQMStore.cc:113
uint32_t moduleId_
Definition: DQMStore.h:841
uint32_t run_
Definition: DQMStore.h:840
MonitorElement * findObject(const std::string &dir, const std::string &name, const uint32_t run=0, const uint32_t lumi=0, const uint32_t moduleId=0) const
Definition: DQMStore.cc:1784
unsigned verbose_
Definition: DQMStore.h:831
MEMap data_
Definition: DQMStore.h:845
void print_trace(const std::string &dir, const std::string &name)
Definition: DQMStore.cc:487
dbl *** dir
Definition: mlp_gen.cc:35
std::set< std::string > dirs_
Definition: DQMStore.h:846
def move(src, dest)
Definition: eostools.py:510
template<class HISTO , class COLLATE >
MonitorElement * DQMStore::book_ ( const std::string &  dir,
const std::string &  name,
const char *  context,
int  kind,
HISTO *  h,
COLLATE  collate 
)
private

Definition at line 661 of file DQMStore.cc.

References collateHistograms_, gather_cfg::cout, data_, dir, dirs_, DQMNet::DQM_PROP_HAS_REFERENCE, findObject(), h, initialise(), callgraph::kind, mergePath(), moduleId_, eostools::move(), dataset::name, MonitorElement::object_, callgraph::path, print_trace(), qtestspecs_, MonitorElement::Reset(), run_, s_referenceDirName, AlCaHLTBitMon_QueryRunRegistry::string, and verbose_.

664 {
665  assert(name.find('/') == std::string::npos);
666  if (verbose_ > 3)
667  print_trace(dir, name);
669  mergePath(path, dir, name);
670 
671  // Put us in charge of h.
672  h->SetDirectory(nullptr);
673 
674  // Check if the request monitor element already exists.
676  if (me)
677  {
678  if (collateHistograms_)
679  {
680  collate(me, h, verbose_);
681  delete h;
682  return me;
683  }
684  else
685  {
686  if (verbose_ > 1)
687  std::cout << "DQMStore: "
688  << context << ": monitor element '"
689  << path << "' already exists, collating" << std::endl;
690  me->Reset();
691  collate(me, h, verbose_);
692  delete h;
693  return me;
694  }
695  }
696  else
697  {
698  // Create and initialise core object.
699  assert(dirs_.count(dir));
700  MonitorElement proto(&*dirs_.find(dir), name, run_, moduleId_);
701  me = const_cast<MonitorElement &>(*data_.insert(std::move(proto)).first)
703 
704  // Initialise quality test information.
705  auto qi = qtestspecs_.begin();
706  auto qe = qtestspecs_.end();
707  for ( ; qi != qe; ++qi)
708  {
709  if ( qi->first->match(path) )
710  me->addQReport(qi->second);
711  }
712 
713  // If we just booked a (plain) MonitorElement, and there is a reference
714  // MonitorElement with the same name, link the two together.
715  // The other direction is handled by the extract method.
716  std::string refdir;
717  refdir.reserve(s_referenceDirName.size() + dir.size() + 1);
718  refdir += s_referenceDirName;
719  refdir += '/';
720  refdir += dir;
721  MonitorElement* referenceME = findObject(refdir, name);
722  if (referenceME) {
723  // We have booked a new MonitorElement with a specific dir and name.
724  // Then, if we can find the corresponding MonitorElement in the reference
725  // dir we assign the object_ of the reference MonitorElement to the
726  // reference_ property of our new MonitorElement.
727  me->data_.flags |= DQMNet::DQM_PROP_HAS_REFERENCE;
728  me->reference_ = referenceME->object_;
729  }
730 
731  // Return the monitor element.
732  return me;
733  }
734 }
static void mergePath(std::string &path, const std::string &dir, const std::string &name)
Definition: DQMStore.cc:113
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
uint32_t moduleId_
Definition: DQMStore.h:841
static const uint32_t DQM_PROP_HAS_REFERENCE
Definition: DQMNet.h:54
QTestSpecs qtestspecs_
Definition: DQMStore.h:850
uint32_t run_
Definition: DQMStore.h:840
void Reset()
reset ME (ie. contents, errors, etc)
MonitorElement * findObject(const std::string &dir, const std::string &name, const uint32_t run=0, const uint32_t lumi=0, const uint32_t moduleId=0) const
Definition: DQMStore.cc:1784
MonitorElement * initialise(MonitorElement *me, const std::string &path)
unsigned verbose_
Definition: DQMStore.h:831
MEMap data_
Definition: DQMStore.h:845
static const std::string s_referenceDirName
Definition: DQMStore.cc:58
void print_trace(const std::string &dir, const std::string &name)
Definition: DQMStore.cc:487
dbl *** dir
Definition: mlp_gen.cc:35
std::set< std::string > dirs_
Definition: DQMStore.h:846
bool collateHistograms_
Definition: DQMStore.h:835
def move(src, dest)
Definition: eostools.py:510
template<typename iFunc >
void DQMStore::bookConcurrentTransaction ( iFunc  f,
uint32_t  run 
)
inline

Definition at line 374 of file DQMStore.h.

References book_mutex_, enableMultiThread_, f, findQualityFiles::run, and run_.

374  {
375  std::lock_guard<std::mutex> guard(book_mutex_);
376  /* Set the run_ member only if enableMultiThread is enabled */
377  if (enableMultiThread_) {
378  run_ = run;
379  }
380  ConcurrentBooker booker(this);
381  f(booker);
382 
383  /* Reset the run_ member only if enableMultiThread is enabled */
384  if (enableMultiThread_) {
385  run_ = 0;
386  }
387  }
std::mutex book_mutex_
Definition: DQMStore.h:852
double f[11][100]
uint32_t run_
Definition: DQMStore.h:840
bool enableMultiThread_
Definition: DQMStore.h:836
MonitorElement * DQMStore::bookFloat ( const char *  name)
MonitorElement * DQMStore::bookFloat ( const std::string &  name)

Book float.

Definition at line 824 of file DQMStore.cc.

References bookFloat_(), and pwd_.

825 {
826  return bookFloat_(pwd_, name);
827 }
std::string pwd_
Definition: DQMStore.h:844
MonitorElement * bookFloat_(const std::string &dir, const std::string &name)
Book float.
Definition: DQMStore.cc:802
MonitorElement * DQMStore::bookFloat_ ( const std::string &  dir,
const std::string &  name 
)
private

Book float.

Definition at line 802 of file DQMStore.cc.

References book_(), collateHistograms_, MonitorElement::DQM_KIND_REAL, MonitorElement::Fill(), findObject(), MonitorElement::initialise(), moduleId_, and run_.

Referenced by bookFloat(), extract(), and mtEnabled().

803 {
804  if (collateHistograms_)
805  {
806  if (MonitorElement *me = findObject(dir, name, run_, 0, moduleId_))
807  {
808  me->Fill(0.);
809  return me;
810  }
811  }
812 
813  return book_(dir, name, "bookFloat")
815 }
MonitorElement * initialise(Kind kind)
uint32_t moduleId_
Definition: DQMStore.h:841
uint32_t run_
Definition: DQMStore.h:840
MonitorElement * findObject(const std::string &dir, const std::string &name, const uint32_t run=0, const uint32_t lumi=0, const uint32_t moduleId=0) const
Definition: DQMStore.cc:1784
MonitorElement * book_(const std::string &dir, const std::string &name, const char *context)
Definition: DQMStore.cc:737
dbl *** dir
Definition: mlp_gen.cc:35
bool collateHistograms_
Definition: DQMStore.h:835
MonitorElement * DQMStore::bookInt ( const char *  name)

Book int.

Definition at line 789 of file DQMStore.cc.

References bookInt_(), and pwd_.

Referenced by SiStripDcsInfo::addBadModules(), ConverterTester::beginJob(), CalibrationScanTask::book(), CalibrationTask::book(), FineDelayTask::book(), SiStripQualityChecker::fillFaultyModuleStatus(), SiStripDaqInfo::findExcludedModule(), and meBookerGetter().

790 { return bookInt_(pwd_, name); }
MonitorElement * bookInt_(const std::string &dir, const std::string &name)
Book int.
Definition: DQMStore.cc:772
std::string pwd_
Definition: DQMStore.h:844
MonitorElement * DQMStore::bookInt ( const std::string &  name)

Book int.

Definition at line 794 of file DQMStore.cc.

References bookInt_(), and pwd_.

795 {
796  return bookInt_(pwd_, name);
797 }
MonitorElement * bookInt_(const std::string &dir, const std::string &name)
Book int.
Definition: DQMStore.cc:772
std::string pwd_
Definition: DQMStore.h:844
MonitorElement * DQMStore::bookInt_ ( const std::string &  dir,
const std::string &  name 
)
private

Book int.

Definition at line 772 of file DQMStore.cc.

References book_(), collateHistograms_, MonitorElement::DQM_KIND_INT, MonitorElement::Fill(), findObject(), MonitorElement::initialise(), moduleId_, and run_.

Referenced by bookInt(), extract(), and mtEnabled().

773 {
774  if (collateHistograms_)
775  {
776  if (MonitorElement *me = findObject(dir, name, run_, 0, moduleId_))
777  {
778  me->Fill(0);
779  return me;
780  }
781  }
782 
783  return book_(dir, name, "bookInt")
785 }
MonitorElement * initialise(Kind kind)
uint32_t moduleId_
Definition: DQMStore.h:841
uint32_t run_
Definition: DQMStore.h:840
MonitorElement * findObject(const std::string &dir, const std::string &name, const uint32_t run=0, const uint32_t lumi=0, const uint32_t moduleId=0) const
Definition: DQMStore.cc:1784
MonitorElement * book_(const std::string &dir, const std::string &name, const char *context)
Definition: DQMStore.cc:737
dbl *** dir
Definition: mlp_gen.cc:35
bool collateHistograms_
Definition: DQMStore.h:835
MonitorElement * DQMStore::bookProfile ( const char *  name,
const char *  title,
int  nchX,
double  lowX,
double  highX,
int  nchY,
double  lowY,
double  highY,
const char *  option = "s" 
)

Book profile. Option is one of: " ", "s" (default), "i", "G" (see TProfile::BuildOptions). The number of channels in Y is disregarded in a profile plot.

Definition at line 1215 of file DQMStore.cc.

References bookProfile_(), and pwd_.

Referenced by ConverterTester::beginJob(), StripValidationPlots::beginJob(), SiStripLAProfileBooker::beginRun(), hcaldqm::ContainerSingleProf1D::book(), hcaldqm::ContainerProf1D::book(), DQMLumiMonitor::bookHistograms(), SiStripBaseCondObjDQM::bookSummaryMEs(), SiStripBaseCondObjDQM::bookSummaryProfileMEs(), dqmRegisterHistogram(), SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy::initializeDQMHistograms(), meBookerGetter(), and MonitorElementsDb::MonitorElementsDb().

1219 {
1220  return bookProfile_(pwd_, name, new TProfile(name, title,
1221  nchX, lowX, highX,
1222  lowY, highY,
1223  option));
1224 }
MonitorElement * bookProfile_(const std::string &dir, const std::string &name, TProfile *h)
Book profile histogram based on TProfile.
Definition: DQMStore.cc:1204
std::string pwd_
Definition: DQMStore.h:844
MonitorElement * DQMStore::bookProfile ( const std::string &  name,
const std::string &  title,
int  nchX,
double  lowX,
double  highX,
int  nchY,
double  lowY,
double  highY,
const char *  option = "s" 
)

Book profile. Option is one of: " ", "s" (default), "i", "G" (see TProfile::BuildOptions). The number of channels in Y is disregarded in a profile plot.

Definition at line 1230 of file DQMStore.cc.

References bookProfile_(), TSGForRoadSearch_cfi::option, and pwd_.

1234 {
1235  return bookProfile_(pwd_, name, new TProfile(name.c_str(), title.c_str(),
1236  nchX, lowX, highX,
1237  lowY, highY,
1238  option));
1239 }
MonitorElement * bookProfile_(const std::string &dir, const std::string &name, TProfile *h)
Book profile histogram based on TProfile.
Definition: DQMStore.cc:1204
std::string pwd_
Definition: DQMStore.h:844
MonitorElement * DQMStore::bookProfile ( const char *  name,
const char *  title,
int  nchX,
double  lowX,
double  highX,
double  lowY,
double  highY,
const char *  option = "s" 
)

Book profile. Option is one of: " ", "s" (default), "i", "G" (see TProfile::BuildOptions). The number of channels in Y is disregarded in a profile plot.

Definition at line 1245 of file DQMStore.cc.

References bookProfile_(), and pwd_.

1249 {
1250  return bookProfile_(pwd_, name, new TProfile(name, title,
1251  nchX, lowX, highX,
1252  lowY, highY,
1253  option));
1254 }
MonitorElement * bookProfile_(const std::string &dir, const std::string &name, TProfile *h)
Book profile histogram based on TProfile.
Definition: DQMStore.cc:1204
std::string pwd_
Definition: DQMStore.h:844
MonitorElement * DQMStore::bookProfile ( const std::string &  name,
const std::string &  title,
int  nchX,
double  lowX,
double  highX,
double  lowY,
double  highY,
const char *  option = "s" 
)

Book profile. Option is one of: " ", "s" (default), "i", "G" (see TProfile::BuildOptions). The number of channels in Y is disregarded in a profile plot.

Definition at line 1260 of file DQMStore.cc.

References bookProfile_(), TSGForRoadSearch_cfi::option, and pwd_.

1264 {
1265  return bookProfile_(pwd_, name, new TProfile(name.c_str(), title.c_str(),
1266  nchX, lowX, highX,
1267  lowY, highY,
1268  option));
1269 }
MonitorElement * bookProfile_(const std::string &dir, const std::string &name, TProfile *h)
Book profile histogram based on TProfile.
Definition: DQMStore.cc:1204
std::string pwd_
Definition: DQMStore.h:844
MonitorElement * DQMStore::bookProfile ( const char *  name,
const char *  title,
int  nchX,
const double *  xbinsize,
int  nchY,
double  lowY,
double  highY,
const char *  option = "s" 
)

Book variable bin profile. Option is one of: " ", "s" (default), "i", "G" (see TProfile::BuildOptions). The number of channels in Y is disregarded in a profile plot.

Definition at line 1275 of file DQMStore.cc.

References bookProfile_(), and pwd_.

1279 {
1280  return bookProfile_(pwd_, name, new TProfile(name, title,
1281  nchX, xbinsize,
1282  lowY, highY,
1283  option));
1284 }
MonitorElement * bookProfile_(const std::string &dir, const std::string &name, TProfile *h)
Book profile histogram based on TProfile.
Definition: DQMStore.cc:1204
std::string pwd_
Definition: DQMStore.h:844
MonitorElement * DQMStore::bookProfile ( const std::string &  name,
const std::string &  title,
int  nchX,
const double *  xbinsize,
int  nchY,
double  lowY,
double  highY,
const char *  option = "s" 
)

Book variable bin profile. Option is one of: " ", "s" (default), "i", "G" (see TProfile::BuildOptions). The number of channels in Y is disregarded in a profile plot.

Definition at line 1290 of file DQMStore.cc.

References bookProfile_(), TSGForRoadSearch_cfi::option, and pwd_.

1294 {
1295  return bookProfile_(pwd_, name, new TProfile(name.c_str(), title.c_str(),
1296  nchX, xbinsize,
1297  lowY, highY,
1298  option));
1299 }
MonitorElement * bookProfile_(const std::string &dir, const std::string &name, TProfile *h)
Book profile histogram based on TProfile.
Definition: DQMStore.cc:1204
std::string pwd_
Definition: DQMStore.h:844
MonitorElement * DQMStore::bookProfile ( const char *  name,
const char *  title,
int  nchX,
const double *  xbinsize,
double  lowY,
double  highY,
const char *  option = "s" 
)

Book variable bin profile. Option is one of: " ", "s" (default), "i", "G" (see TProfile::BuildOptions). The number of channels in Y is disregarded in a profile plot.

Definition at line 1305 of file DQMStore.cc.

References bookProfile_(), and pwd_.

1309 {
1310  return bookProfile_(pwd_, name, new TProfile(name, title,
1311  nchX, xbinsize,
1312  lowY, highY,
1313  option));
1314 }
MonitorElement * bookProfile_(const std::string &dir, const std::string &name, TProfile *h)
Book profile histogram based on TProfile.
Definition: DQMStore.cc:1204
std::string pwd_
Definition: DQMStore.h:844
MonitorElement * DQMStore::bookProfile ( const std::string &  name,
const std::string &  title,
int  nchX,
const double *  xbinsize,
double  lowY,
double  highY,
const char *  option = "s" 
)

Book variable bin profile. Option is one of: " ", "s" (default), "i", "G" (see TProfile::BuildOptions). The number of channels in Y is disregarded in a profile plot.

Definition at line 1320 of file DQMStore.cc.

References bookProfile_(), TSGForRoadSearch_cfi::option, and pwd_.

1324 {
1325  return bookProfile_(pwd_, name, new TProfile(name.c_str(), title.c_str(),
1326  nchX, xbinsize,
1327  lowY, highY,
1328  option));
1329 }
MonitorElement * bookProfile_(const std::string &dir, const std::string &name, TProfile *h)
Book profile histogram based on TProfile.
Definition: DQMStore.cc:1204
std::string pwd_
Definition: DQMStore.h:844
MonitorElement * DQMStore::bookProfile ( const char *  name,
TProfile *  h 
)

Book TProfile by cloning an existing profile.

Definition at line 1333 of file DQMStore.cc.

References bookProfile_(), and pwd_.

1334 {
1335  return bookProfile_(pwd_, name, static_cast<TProfile *>(source->Clone(name)));
1336 }
MonitorElement * bookProfile_(const std::string &dir, const std::string &name, TProfile *h)
Book profile histogram based on TProfile.
Definition: DQMStore.cc:1204
std::string pwd_
Definition: DQMStore.h:844
static std::string const source
Definition: EdmProvDump.cc:43
MonitorElement * DQMStore::bookProfile ( const std::string &  name,
TProfile *  h 
)

Book TProfile by cloning an existing profile.

Definition at line 1340 of file DQMStore.cc.

References bookProfile_(), and pwd_.

1341 {
1342  return bookProfile_(pwd_, name, static_cast<TProfile *>(source->Clone(name.c_str())));
1343 }
MonitorElement * bookProfile_(const std::string &dir, const std::string &name, TProfile *h)
Book profile histogram based on TProfile.
Definition: DQMStore.cc:1204
std::string pwd_
Definition: DQMStore.h:844
static std::string const source
Definition: EdmProvDump.cc:43
MonitorElement * DQMStore::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" 
)

Book 2-D profile. Option is one of: " ", "s" (default), "i", "G" (see TProfile2D::BuildOptions). The number of channels in Z is disregarded in a 2-D profile.

Definition at line 1359 of file DQMStore.cc.

References bookProfile2D_(), and pwd_.

Referenced by ConverterTester::beginJob(), hcaldqm::ContainerSingleProf2D::book(), hcaldqm::ContainerProf2D::book(), DQMLumiMonitor::bookHistograms(), dqmRegisterHistogram(), meBookerGetter(), and MonitorElementsDb::MonitorElementsDb().

1364 {
1365  return bookProfile2D_(pwd_, name, new TProfile2D(name, title,
1366  nchX, lowX, highX,
1367  nchY, lowY, highY,
1368  lowZ, highZ,
1369  option));
1370 }
MonitorElement * bookProfile2D_(const std::string &dir, const std::string &name, TProfile2D *h)
Book 2D profile histogram based on TProfile2D.
Definition: DQMStore.cc:1348
std::string pwd_
Definition: DQMStore.h:844
MonitorElement * DQMStore::bookProfile2D ( const std::string &  name,
const std::string &  title,
int  nchX,
double  lowX,
double  highX,
int  nchY,
double  lowY,
double  highY,
int  nchZ,
double  lowZ,
double  highZ,
const char *  option = "s" 
)

Book 2-D profile. Option is one of: " ", "s" (default), "i", "G" (see TProfile2D::BuildOptions). The number of channels in Z is disregarded in a 2-D profile.

Definition at line 1376 of file DQMStore.cc.

References bookProfile2D_(), TSGForRoadSearch_cfi::option, and pwd_.

1381 {
1382  return bookProfile2D_(pwd_, name, new TProfile2D(name.c_str(), title.c_str(),
1383  nchX, lowX, highX,
1384  nchY, lowY, highY,
1385  lowZ, highZ,
1386  option));
1387 }
MonitorElement * bookProfile2D_(const std::string &dir, const std::string &name, TProfile2D *h)
Book 2D profile histogram based on TProfile2D.
Definition: DQMStore.cc:1348
std::string pwd_
Definition: DQMStore.h:844
MonitorElement * DQMStore::bookProfile2D ( const char *  name,
const char *  title,
int  nchX,
double  lowX,
double  highX,
int  nchY,
double  lowY,
double  highY,
double  lowZ,
double  highZ,
const char *  option = "s" 
)

Book 2-D profile. Option is one of: " ", "s" (default), "i", "G" (see TProfile2D::BuildOptions). The number of channels in Z is disregarded in a 2-D profile.

Definition at line 1393 of file DQMStore.cc.

References bookProfile2D_(), and pwd_.

1398 {
1399  return bookProfile2D_(pwd_, name, new TProfile2D(name, title,
1400  nchX, lowX, highX,
1401  nchY, lowY, highY,
1402  lowZ, highZ,
1403  option));
1404 }
MonitorElement * bookProfile2D_(const std::string &dir, const std::string &name, TProfile2D *h)
Book 2D profile histogram based on TProfile2D.
Definition: DQMStore.cc:1348
std::string pwd_
Definition: DQMStore.h:844
MonitorElement * DQMStore::bookProfile2D ( const std::string &  name,
const std::string &  title,
int  nchX,
double  lowX,
double  highX,
int  nchY,
double  lowY,
double  highY,
double  lowZ,
double  highZ,
const char *  option = "s" 
)

Book 2-D profile. Option is one of: " ", "s" (default), "i", "G" (see TProfile2D::BuildOptions). The number of channels in Z is disregarded in a 2-D profile.

Definition at line 1410 of file DQMStore.cc.

References bookProfile2D_(), TSGForRoadSearch_cfi::option, and pwd_.

1415 {
1416  return bookProfile2D_(pwd_, name, new TProfile2D(name.c_str(), title.c_str(),
1417  nchX, lowX, highX,
1418  nchY, lowY, highY,
1419  lowZ, highZ,
1420  option));
1421 }
MonitorElement * bookProfile2D_(const std::string &dir, const std::string &name, TProfile2D *h)
Book 2D profile histogram based on TProfile2D.
Definition: DQMStore.cc:1348
std::string pwd_
Definition: DQMStore.h:844
MonitorElement * DQMStore::bookProfile2D ( const char *  name,
TProfile2D *  h 
)

Book TProfile2D by cloning an existing profile.

Definition at line 1425 of file DQMStore.cc.

References bookProfile2D_(), and pwd_.

1426 {
1427  return bookProfile2D_(pwd_, name, static_cast<TProfile2D *>(source->Clone(name)));
1428 }
MonitorElement * bookProfile2D_(const std::string &dir, const std::string &name, TProfile2D *h)
Book 2D profile histogram based on TProfile2D.
Definition: DQMStore.cc:1348
std::string pwd_
Definition: DQMStore.h:844
static std::string const source
Definition: EdmProvDump.cc:43
MonitorElement * DQMStore::bookProfile2D ( const std::string &  name,
TProfile2D *  h 
)

Book TProfile2D by cloning an existing profile.

Definition at line 1432 of file DQMStore.cc.

References bookProfile2D_(), and pwd_.

1433 {
1434  return bookProfile2D_(pwd_, name, static_cast<TProfile2D *>(source->Clone(name.c_str())));
1435 }
MonitorElement * bookProfile2D_(const std::string &dir, const std::string &name, TProfile2D *h)
Book 2D profile histogram based on TProfile2D.
Definition: DQMStore.cc:1348
std::string pwd_
Definition: DQMStore.h:844
static std::string const source
Definition: EdmProvDump.cc:43
MonitorElement * DQMStore::bookProfile2D_ ( const std::string &  dir,
const std::string &  name,
TProfile2D *  h 
)
private

Book 2D profile histogram based on TProfile2D.

Definition at line 1348 of file DQMStore.cc.

References book_(), collateProfile2D(), and MonitorElement::DQM_KIND_TPROFILE2D.

Referenced by bookProfile2D(), extract(), and mtEnabled().

1349 {
1350  return book_(dir, name, "bookProfile2D",
1352  h, collateProfile2D);
1353 }
static void collateProfile2D(MonitorElement *me, TProfile2D *h, unsigned verbose)
Definition: DQMStore.cc:1527
MonitorElement * book_(const std::string &dir, const std::string &name, const char *context)
Definition: DQMStore.cc:737
dbl *** dir
Definition: mlp_gen.cc:35
MonitorElement * DQMStore::bookProfile_ ( const std::string &  dir,
const std::string &  name,
TProfile *  h 
)
private

Book profile histogram based on TProfile.

Definition at line 1204 of file DQMStore.cc.

References book_(), collateProfile(), and MonitorElement::DQM_KIND_TPROFILE.

Referenced by bookProfile(), extract(), and mtEnabled().

1205 {
1206  return book_(dir, name, "bookProfile",
1208  h, collateProfile);
1209 }
static void collateProfile(MonitorElement *me, TProfile *h, unsigned verbose)
Definition: DQMStore.cc:1517
MonitorElement * book_(const std::string &dir, const std::string &name, const char *context)
Definition: DQMStore.cc:737
dbl *** dir
Definition: mlp_gen.cc:35
MonitorElement * DQMStore::bookString ( const char *  name,
const char *  value 
)

Book string.

Definition at line 848 of file DQMStore.cc.

References bookString_(), and pwd_.

Referenced by DQMFileReader::beginJob(), ConverterTester::beginJob(), DQMDcsInfoClient::beginRun(), meBookerGetter(), and DQMFileSaver::saveForOffline().

849 { return bookString_(pwd_, name, value); }
MonitorElement * bookString_(const std::string &dir, const std::string &name, const std::string &value)
Book string.
Definition: DQMStore.cc:832
Definition: value.py:1
std::string pwd_
Definition: DQMStore.h:844
MonitorElement * DQMStore::bookString ( const std::string &  name,
const std::string &  value 
)

Book string.

Definition at line 853 of file DQMStore.cc.

References bookString_(), and pwd_.

854 {
855  return bookString_(pwd_, name, value);
856 }
MonitorElement * bookString_(const std::string &dir, const std::string &name, const std::string &value)
Book string.
Definition: DQMStore.cc:832
Definition: value.py:1
std::string pwd_
Definition: DQMStore.h:844
MonitorElement * DQMStore::bookString_ ( const std::string &  dir,
const std::string &  name,
const std::string &  value 
)
private

Book string.

Definition at line 832 of file DQMStore.cc.

References book_(), collateHistograms_, MonitorElement::DQM_KIND_STRING, findObject(), MonitorElement::initialise(), moduleId_, and run_.

Referenced by bookString(), extract(), and mtEnabled().

835 {
836  if (collateHistograms_)
837  {
838  if (MonitorElement *me = findObject(dir, name, run_, 0, moduleId_))
839  return me;
840  }
841 
842  return book_(dir, name, "bookString")
844 }
MonitorElement * initialise(Kind kind)
uint32_t moduleId_
Definition: DQMStore.h:841
uint32_t run_
Definition: DQMStore.h:840
Definition: value.py:1
MonitorElement * findObject(const std::string &dir, const std::string &name, const uint32_t run=0, const uint32_t lumi=0, const uint32_t moduleId=0) const
Definition: DQMStore.cc:1784
MonitorElement * book_(const std::string &dir, const std::string &name, const char *context)
Definition: DQMStore.cc:737
dbl *** dir
Definition: mlp_gen.cc:35
bool collateHistograms_
Definition: DQMStore.h:835
template<typename iFunc >
void DQMStore::bookTransaction ( iFunc  f,
uint32_t  run,
uint32_t  moduleId 
)
inline

Definition at line 355 of file DQMStore.h.

References book_mutex_, enableMultiThread_, f, ibooker_, moduleId_, findQualityFiles::run, and run_.

355  {
356  std::lock_guard<std::mutex> guard(book_mutex_);
357  /* Set the run number and module id only if multithreading is enabled */
358  if (enableMultiThread_) {
359  run_ = run;
360  moduleId_ = moduleId;
361  }
362  f(*ibooker_);
363 
364  /* Reset the run number and module id only if multithreading is enabled */
365  if (enableMultiThread_) {
366  run_ = 0;
367  moduleId_ = 0;
368  }
369  }
uint32_t moduleId_
Definition: DQMStore.h:841
std::mutex book_mutex_
Definition: DQMStore.h:852
double f[11][100]
uint32_t run_
Definition: DQMStore.h:840
IBooker * ibooker_
Definition: DQMStore.h:853
bool enableMultiThread_
Definition: DQMStore.h:836
void DQMStore::cd ( )

go to top directory (ie. root)

Definition at line 565 of file DQMStore.cc.

References setCurrentFolder().

Referenced by SiStripDcsInfo::addBadModules(), DQMFileReader::beginJob(), DQMDcsInfoClient::beginRun(), DQMStore::IBooker::bookProfile2D(), SiStripCertificationInfo::bookSiStripCertificationMEs(), SiStripQualityChecker::bookStatus(), SiStripDaqInfo::bookStatus(), SiStripDcsInfo::bookStatus(), SiStripTrackerMapCreator::createForOffline(), SiStripTrackerMapCreator::createInfoFile(), SiStripSummaryCreator::createSummary(), SiStripActionExecutor::createSummary(), SiStripActionExecutor::createSummaryOffline(), APVValidationPlots::endJob(), StripValidationPlots::endJob(), DQMDcsInfoClient::endRun(), SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy::extractBadAPVSandStrips(), SiStripQualityChecker::fillDetectorStatus(), SiStripQualityChecker::fillDetectorStatusAtLumi(), SiStripQualityChecker::fillFaultyModuleStatus(), SiStripSummaryCreator::fillGrandSummaryHistos(), SiStripCertificationInfo::fillSiStripCertificationMEs(), SiStripCertificationInfo::fillSiStripCertificationMEsAtLumi(), SiStripQualityChecker::fillSubDetStatus(), SiStripSummaryCreator::fillSummaryHistos(), SiStripDaqInfo::findExcludedModule(), dqm_interfaces.DQMcommunicator::get_root_objects_list_recursive(), dqm_interfaces.DQMcommunicator::get_root_objects_names_list_recursive(), dqm_interfaces.DQMcommunicator::get_root_objects_recursive(), SiStripTrackerMapCreator::getDetectorFlagAndComment(), SiStripUtility::getModuleFolderList(), SiStripBadModuleFedErrESSource::getProcessedEvents(), SiStripSummaryCreator::getSummaryME(), SiStripUtility::getTopFolderPath(), SiStripUtility::goToDir(), meBookerGetter(), SiStripInformationExtractor::printAlarmList(), SiStripActionExecutor::printFaultyModuleList(), SiStripInformationExtractor::printNonGeomHistoList(), SiStripInformationExtractor::printSummaryHistoList(), readFilePB(), DQMStore::IGetter::removeElement(), DQMFileSaver::saveForOffline(), DQMFileSaver::saveForOnline(), SiStripTrackerMapCreator::setTkMapFromHistogram(), and dqm_interfaces.DirWalkerFile::walk().

566 { setCurrentFolder(""); }
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:588
void DQMStore::cd ( const std::string &  subdir)

cd to subdirectory (if there)

Definition at line 570 of file DQMStore.cc.

References clean, cleanTrailingSlashes(), dirExists(), raiseDQMError(), setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by dqm_interfaces.DQMcommunicator::get_root_objects_list_recursive(), dqm_interfaces.DQMcommunicator::get_root_objects_names_list_recursive(), dqm_interfaces.DQMcommunicator::get_root_objects_recursive(), and dqm_interfaces.DirWalkerFile::walk().

571 {
573  const std::string *cleaned = nullptr;
574  cleanTrailingSlashes(subdir, clean, cleaned);
575 
576  if (! dirExists(*cleaned))
577  raiseDQMError("DQMStore", "Cannot 'cd' into non-existent directory '%s'",
578  cleaned->c_str());
579 
580  setCurrentFolder(*cleaned);
581 }
static void cleanTrailingSlashes(const std::string &path, std::string &clean, const std::string *&cleaned)
Definition: DQMStore.cc:83
std::vector< T * > clean
Definition: MVATrainer.cc:156
bool dirExists(const std::string &path) const
true if directory exists
Definition: DQMStore.cc:653
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:588
void raiseDQMError(const char *context, const char *fmt,...)
Definition: DQMError.cc:11
bool DQMStore::cdInto ( const std::string &  path) const
private

Use this for saving monitoring objects in ROOT files with dir structure; cd into directory (create first if it doesn't exist); returns success flag

Definition at line 2396 of file DQMStore.cc.

References end, connectstrParser::o, raiseDQMError(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by mtEnabled(), and save().

2397 {
2398  assert(! path.empty());
2399 
2400  // Find the first path component.
2401  size_t start = 0;
2402  size_t end = path.find('/', start);
2403  if (end == std::string::npos)
2404  end = path.size();
2405 
2406  while (true)
2407  {
2408  // Check if this subdirectory component exists. If yes, make sure
2409  // it is actually a subdirectory. Otherwise create or cd into it.
2410  std::string part(path, start, end-start);
2411  TObject *o = gDirectory->Get(part.c_str());
2412  if (o && ! dynamic_cast<TDirectory *>(o))
2413  raiseDQMError("DQMStore", "Attempt to create directory '%s' in a file"
2414  " fails because the part '%s' already exists and is not"
2415  " directory", path.c_str(), part.c_str());
2416  else if (! o)
2417  gDirectory->mkdir(part.c_str());
2418 
2419  if (! gDirectory->cd(part.c_str()))
2420  raiseDQMError("DQMStore", "Attempt to create directory '%s' in a file"
2421  " fails because could not cd into subdirectory '%s'",
2422  path.c_str(), part.c_str());
2423 
2424  // Stop if we reached the end, ignoring any trailing '/'.
2425  if (end+1 >= path.size())
2426  break;
2427 
2428  // Find the next path component.
2429  start = end+1;
2430  end = path.find('/', start);
2431  if (end == std::string::npos)
2432  end = path.size();
2433  }
2434 
2435  return true;
2436 }
Definition: start.py:1
#define end
Definition: vmac.h:39
part
Definition: HCALResponse.h:20
void raiseDQMError(const char *context, const char *fmt,...)
Definition: DQMError.cc:11
bool DQMStore::checkBinningMatches ( MonitorElement me,
TH1 *  h,
unsigned  verbose 
)
staticprivate

Definition at line 1441 of file DQMStore.cc.

References MonitorElement::CheckBinLabels(), gather_cfg::cout, MonitorElement::getFullname(), and MonitorElement::getTH1().

Referenced by collate1D(), collate1DD(), collate1S(), collate2D(), collate2DD(), collate2S(), collate3D(), collateProfile(), collateProfile2D(), utils.BinToBin::do_test(), utils.BinToBin1percent::do_test(), and mtEnabled().

1442 {
1443  if (me->getTH1()->GetNbinsX() != h->GetNbinsX()
1444  || me->getTH1()->GetNbinsY() != h->GetNbinsY()
1445  || me->getTH1()->GetNbinsZ() != h->GetNbinsZ()
1446  || me->getTH1()->GetXaxis()->GetXmin() != h->GetXaxis()->GetXmin()
1447  || me->getTH1()->GetYaxis()->GetXmin() != h->GetYaxis()->GetXmin()
1448  || me->getTH1()->GetZaxis()->GetXmin() != h->GetZaxis()->GetXmin()
1449  || me->getTH1()->GetXaxis()->GetXmax() != h->GetXaxis()->GetXmax()
1450  || me->getTH1()->GetYaxis()->GetXmax() != h->GetYaxis()->GetXmax()
1451  || me->getTH1()->GetZaxis()->GetXmax() != h->GetZaxis()->GetXmax()
1452  || !MonitorElement::CheckBinLabels((TAxis*)me->getTH1()->GetXaxis(),(TAxis*)h->GetXaxis())
1453  || !MonitorElement::CheckBinLabels((TAxis*)me->getTH1()->GetYaxis(),(TAxis*)h->GetYaxis())
1454  || !MonitorElement::CheckBinLabels((TAxis*)me->getTH1()->GetZaxis(),(TAxis*)h->GetZaxis()) )
1455  {
1456  if(verbose > 0)
1457  std::cout << "*** DQMStore: WARNING:"
1458  << "checkBinningMatches: different binning - cannot add object '"
1459  << h->GetName() << "' of type "
1460  << h->IsA()->GetName() << " to existing ME: '"
1461  << me->getFullname() << "'\n";
1462  return false;
1463  }
1464  return true;
1465 }
TH1 * getTH1() const
const std::string getFullname() const
get full name of ME including Pathname
static bool CheckBinLabels(const TAxis *a1, const TAxis *a2)
Check the consistency of the axis labels.
void DQMStore::cloneLumiHistograms ( uint32_t  run,
uint32_t  lumi,
uint32_t  moduleId 
)

Clone the lumisection-based histograms from the 'global' ones (which have lumi = 0) into per-lumi ones (with the lumi number) and reset the global ones. The per-lumi histograms can be saved by the output modules, and will be deleted at the beginninng of the next lumisection.

Definition at line 1978 of file DQMStore.cc.

References book_mutex_, clone(), gather_cfg::cout, data_, MillePedeFileConverter_cfg::e, mps_fire::i, LSbasedMode_, eostools::move(), HcalObjRepresent::Reset(), AlCaHLTBitMon_QueryRunRegistry::string, and verbose_.

Referenced by mtEnabled().

1979 {
1980  if (verbose_ > 1) {
1981  std::cout << "DQMStore::cloneLumiHistograms - Preparing lumi histograms for run: "
1982  << run << ", lumi: " << lumi << ", module: " << moduleId << std::endl;
1983  }
1984 
1985  // acquire the global lock since this accesses the undelying data structure
1986  std::lock_guard<std::mutex> guard(book_mutex_);
1987 
1988  // MEs are sorted by (run, lumi, stream id, module id, directory, name)
1989  // lumi deafults to 0
1990  // stream id is always 0
1991  std::string null_str("");
1992  auto i = data_.lower_bound(MonitorElement(&null_str, null_str, run, moduleId));
1993  auto e = data_.lower_bound(MonitorElement(&null_str, null_str, run, moduleId + 1));
1994  for (; i != e; ++i) {
1995  // handle only lumisection-based histograms
1996  if (not LSbasedMode_ and not i->getLumiFlag())
1997  continue;
1998 
1999  // clone the lumisection-based histograms
2001  clone.globalize();
2002  clone.setLumi(lumi);
2003  clone.markToDelete();
2004  data_.insert(std::move(clone));
2005 
2006  // reset the ME for the next lumisection
2007  const_cast<MonitorElement*>(&*i)->Reset();
2008  }
2009 }
std::mutex book_mutex_
Definition: DQMStore.h:852
unsigned verbose_
Definition: DQMStore.h:831
MEMap data_
Definition: DQMStore.h:845
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
void Reset(std::vector< TH2F > &depth)
bool LSbasedMode_
Definition: DQMStore.h:837
def move(src, dest)
Definition: eostools.py:510
void DQMStore::cloneRunHistograms ( uint32_t  run,
uint32_t  moduleId 
)

Same as above, but for run histograms.

Definition at line 2015 of file DQMStore.cc.

References book_mutex_, clone(), gather_cfg::cout, data_, MillePedeFileConverter_cfg::e, mps_fire::i, LSbasedMode_, eostools::move(), or, HcalObjRepresent::Reset(), AlCaHLTBitMon_QueryRunRegistry::string, and verbose_.

Referenced by mtEnabled().

2016 {
2017  if (verbose_ > 1) {
2018  std::cout << "DQMStore::cloneRunHistograms - Preparing run histograms for run: "
2019  << run << ", module: " << moduleId << std::endl;
2020  }
2021 
2022  // acquire the global lock since this accesses the undelying data structure
2023  std::lock_guard<std::mutex> guard(book_mutex_);
2024 
2025  // MEs are sorted by (run, lumi, stream id, module id, directory, name)
2026  // lumi deafults to 0
2027  // stream id is always 0
2028  std::string null_str("");
2029  auto i = data_.lower_bound(MonitorElement(&null_str, null_str, run, moduleId));
2030  auto e = data_.lower_bound(MonitorElement(&null_str, null_str, run, moduleId + 1));
2031  for (; i != e; ++i) {
2032  // handle only non lumisection-based histograms
2033  if (LSbasedMode_ or i->getLumiFlag())
2034  continue;
2035 
2036  // clone the lumisection-based histograms
2038  clone.globalize();
2039  clone.markToDelete();
2040  data_.insert(std::move(clone));
2041 
2042  // reset the ME for the next lumisection
2043  const_cast<MonitorElement*>(&*i)->Reset();
2044  }
2045 }
std::mutex book_mutex_
Definition: DQMStore.h:852
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
unsigned verbose_
Definition: DQMStore.h:831
MEMap data_
Definition: DQMStore.h:845
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
void Reset(std::vector< TH2F > &depth)
bool LSbasedMode_
Definition: DQMStore.h:837
def move(src, dest)
Definition: eostools.py:510
void DQMStore::collate1D ( MonitorElement me,
TH1F *  h,
unsigned  verbose 
)
staticprivate

Definition at line 1468 of file DQMStore.cc.

References checkBinningMatches(), and MonitorElement::getTH1F().

Referenced by book1D_(), extract(), and mtEnabled().

1469 {
1470  if (checkBinningMatches(me,h,verbose))
1471  me->getTH1F()->Add(h);
1472 }
TH1F * getTH1F() const
static bool checkBinningMatches(MonitorElement *me, TH1 *h, unsigned verbose)
Definition: DQMStore.cc:1441
void DQMStore::collate1DD ( MonitorElement me,
TH1D *  h,
unsigned  verbose 
)
staticprivate

Definition at line 1482 of file DQMStore.cc.

References checkBinningMatches(), and MonitorElement::getTH1D().

Referenced by book1DD_(), extract(), and mtEnabled().

1483 {
1484  if (checkBinningMatches(me,h,verbose))
1485  me->getTH1D()->Add(h);
1486 }
TH1D * getTH1D() const
static bool checkBinningMatches(MonitorElement *me, TH1 *h, unsigned verbose)
Definition: DQMStore.cc:1441
void DQMStore::collate1S ( MonitorElement me,
TH1S *  h,
unsigned  verbose 
)
staticprivate

Definition at line 1475 of file DQMStore.cc.

References checkBinningMatches(), and MonitorElement::getTH1S().

Referenced by book1S_(), extract(), and mtEnabled().

1476 {
1477  if (checkBinningMatches(me,h,verbose))
1478  me->getTH1S()->Add(h);
1479 }
TH1S * getTH1S() const
static bool checkBinningMatches(MonitorElement *me, TH1 *h, unsigned verbose)
Definition: DQMStore.cc:1441
void DQMStore::collate2D ( MonitorElement me,
TH2F *  h,
unsigned  verbose 
)
staticprivate

Definition at line 1489 of file DQMStore.cc.

References checkBinningMatches(), and MonitorElement::getTH2F().

Referenced by book2D_(), extract(), and mtEnabled().

1490 {
1491  if (checkBinningMatches(me,h,verbose))
1492  me->getTH2F()->Add(h);
1493 }
TH2F * getTH2F() const
static bool checkBinningMatches(MonitorElement *me, TH1 *h, unsigned verbose)
Definition: DQMStore.cc:1441
void DQMStore::collate2DD ( MonitorElement me,
TH2D *  h,
unsigned  verbose 
)
staticprivate

Definition at line 1503 of file DQMStore.cc.

References checkBinningMatches(), and MonitorElement::getTH2D().

Referenced by book2DD_(), extract(), and mtEnabled().

1504 {
1505  if (checkBinningMatches(me,h,verbose))
1506  me->getTH2D()->Add(h);
1507 }
TH2D * getTH2D() const
static bool checkBinningMatches(MonitorElement *me, TH1 *h, unsigned verbose)
Definition: DQMStore.cc:1441
void DQMStore::collate2S ( MonitorElement me,
TH2S *  h,
unsigned  verbose 
)
staticprivate

Definition at line 1496 of file DQMStore.cc.

References checkBinningMatches(), and MonitorElement::getTH2S().

Referenced by book2S_(), extract(), and mtEnabled().

1497 {
1498  if (checkBinningMatches(me,h,verbose))
1499  me->getTH2S()->Add(h);
1500 }
TH2S * getTH2S() const
static bool checkBinningMatches(MonitorElement *me, TH1 *h, unsigned verbose)
Definition: DQMStore.cc:1441
void DQMStore::collate3D ( MonitorElement me,
TH3F *  h,
unsigned  verbose 
)
staticprivate

Definition at line 1510 of file DQMStore.cc.

References checkBinningMatches(), and MonitorElement::getTH3F().

Referenced by book3D_(), extract(), and mtEnabled().

1511 {
1512  if (checkBinningMatches(me,h,verbose))
1513  me->getTH3F()->Add(h);
1514 }
TH3F * getTH3F() const
static bool checkBinningMatches(MonitorElement *me, TH1 *h, unsigned verbose)
Definition: DQMStore.cc:1441
void DQMStore::collateProfile ( MonitorElement me,
TProfile *  h,
unsigned  verbose 
)
staticprivate

Definition at line 1517 of file DQMStore.cc.

References MonitorElement::addProfiles(), checkBinningMatches(), and MonitorElement::getTProfile().

Referenced by bookProfile_(), extract(), and mtEnabled().

1518 {
1519  if (checkBinningMatches(me,h,verbose))
1520  {
1521  TProfile *meh = me->getTProfile();
1522  me->addProfiles(h, meh, meh, 1, 1);
1523  }
1524 }
TProfile * getTProfile() const
void addProfiles(TProfile *h1, TProfile *h2, TProfile *sum, float c1, float c2)
static bool checkBinningMatches(MonitorElement *me, TH1 *h, unsigned verbose)
Definition: DQMStore.cc:1441
void DQMStore::collateProfile2D ( MonitorElement me,
TProfile2D *  h,
unsigned  verbose 
)
staticprivate

Definition at line 1527 of file DQMStore.cc.

References MonitorElement::addProfiles(), checkBinningMatches(), and MonitorElement::getTProfile2D().

Referenced by bookProfile2D_(), extract(), and mtEnabled().

1528 {
1529  if (checkBinningMatches(me,h,verbose))
1530  {
1531  TProfile2D *meh = me->getTProfile2D();
1532  me->addProfiles(h, meh, meh, 1, 1);
1533  }
1534 }
TProfile2D * getTProfile2D() const
void addProfiles(TProfile *h1, TProfile *h2, TProfile *sum, float c1, float c2)
static bool checkBinningMatches(MonitorElement *me, TH1 *h, unsigned verbose)
Definition: DQMStore.cc:1441
bool DQMStore::containsAnyMonitorable ( const std::string &  path) const

true if directory (or any subfolder at any level below it) contains at least one monitorable element

Definition at line 1645 of file DQMStore.cc.

References data_, MillePedeFileConverter_cfg::e, mps_fire::i, isSubdirectory(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by meBookerGetter(), and DQMStore::IGetter::removeElement().

1646 {
1647  MonitorElement proto(&path, std::string());
1648  auto e = data_.end();
1649  auto i = data_.lower_bound(proto);
1650  return (i != e && isSubdirectory(path, *i->data_.dirname));
1651 }
static bool isSubdirectory(const std::string &ofdir, const std::string &path)
Definition: DQMStore.cc:73
MEMap data_
Definition: DQMStore.h:845
QCriterion * DQMStore::createQTest ( const std::string &  algoname,
const std::string &  qtname 
)

create quality test with unique name <qtname> (analogous to ME name); quality test can then be attached to ME with useQTest method (<algo_name> must match one of known algorithms)

Definition at line 3275 of file DQMStore.cc.

References mps_fire::i, qalgos_, qtests_, raiseDQMError(), QCriterion::setVerbose(), and verboseQT_.

Referenced by QTestConfigure::EnableCheckVarianceTest(), QTestConfigure::EnableComp2Ref2DChi2Test(), QTestConfigure::EnableComp2RefChi2Test(), QTestConfigure::EnableComp2RefEqualHTest(), QTestConfigure::EnableComp2RefKolmogorovTest(), QTestConfigure::EnableCompareLastFilledBinTest(), QTestConfigure::EnableCompareToMedianTest(), QTestConfigure::EnableContentSigmaTest(), QTestConfigure::EnableContentsWithinExpectedTest(), QTestConfigure::EnableDeadChannelTest(), QTestConfigure::EnableMeanWithinExpectedTest(), QTestConfigure::EnableNoisyChannelTest(), QTestConfigure::EnableXRangeTest(), QTestConfigure::EnableYRangeTest(), and mtEnabled().

3276 {
3277  if (qtests_.count(qtname))
3278  raiseDQMError("DQMStore", "Attempt to create duplicate quality test '%s'",
3279  qtname.c_str());
3280 
3281  auto i = qalgos_.find(algoname);
3282  if (i == qalgos_.end())
3283  raiseDQMError("DQMStore", "Cannot create a quality test using unknown"
3284  " algorithm '%s'", algoname.c_str());
3285 
3286  QCriterion *qc = i->second(qtname);
3287  qc->setVerbose(verboseQT_);
3288 
3289  qtests_[qtname] = qc;
3290  return qc;
3291 }
QCMap qtests_
Definition: DQMStore.h:848
unsigned verboseQT_
Definition: DQMStore.h:832
QAMap qalgos_
Definition: DQMStore.h:849
void setVerbose(int verbose)
probability limits for warnings, errors
Definition: QTest.h:119
void raiseDQMError(const char *context, const char *fmt,...)
Definition: DQMError.cc:11
void DQMStore::deleteUnusedLumiHistograms ( uint32_t  run,
uint32_t  lumi 
)

Delete global histograms which are no longer in use. Such histograms are created at the end of each lumi and should be deleted after the last globalEndLuminosityBlock.

Definition at line 2053 of file DQMStore.cc.

References book_mutex_, gather_cfg::cout, data_, MillePedeFileConverter_cfg::e, enableMultiThread_, mps_fire::i, MonitorElement::setLumi(), AlCaHLTBitMon_QueryRunRegistry::string, and verbose_.

Referenced by DQMFileSaver::globalEndLuminosityBlock(), and mtEnabled().

2054 {
2055  if (!enableMultiThread_)
2056  return;
2057 
2058  std::lock_guard<std::mutex> guard(book_mutex_);
2059 
2060  std::string null_str("");
2061  MonitorElement proto(&null_str, null_str, run, 0);
2062  proto.setLumi(lumi);
2063 
2064  auto e = data_.end();
2065  auto i = data_.lower_bound(proto);
2066 
2067  while (i != e) {
2068  if (i->data_.moduleId != 0)
2069  break;
2070  if (i->data_.lumi != lumi)
2071  break;
2072  if (i->data_.run != run)
2073  break;
2074  if (not i->markedToDelete()) {
2075  ++i;
2076  continue;
2077  }
2078 
2079  if (verbose_ > 1) {
2080  std::cout << "DQMStore::deleteUnusedLumiHistograms: deleted monitor element '"
2081  << *i->data_.dirname << "/" << i->data_.objname << "'"
2082  << "flags " << i->data_.flags << "\n";
2083  }
2084 
2085  i = data_.erase(i);
2086  }
2087 }
std::mutex book_mutex_
Definition: DQMStore.h:852
unsigned verbose_
Definition: DQMStore.h:831
MEMap data_
Definition: DQMStore.h:845
bool enableMultiThread_
Definition: DQMStore.h:836
bool DQMStore::dirExists ( const std::string &  path) const
void DQMStore::disableSoftReset ( MonitorElement me)

Definition at line 3409 of file DQMStore.cc.

References MonitorElement::disableSoftReset().

Referenced by meBookerGetter(), and ecaldqm::MESet::recoverStats().

3410 {
3411  if (me)
3412  me->disableSoftReset();
3413 }
void disableSoftReset()
reverts action of softReset
bool DQMStore::extract ( TObject *  obj,
const std::string &  dir,
bool  overwrite,
bool  collateHistograms 
)
private

extract object (TH1F, TH2F, ...) from <to>; return success flag flag fromRemoteNode indicating if ME arrived from different node

Definition at line 2095 of file DQMStore.cc.

References MonitorElement::addQReport(), DQMNet::QValue::algorithm, book1D_(), book1DD_(), book1S_(), book2D_(), book2DD_(), book2S_(), book3D_(), bookFloat_(), bookInt_(), bookProfile2D_(), bookProfile_(), bookString_(), DQMNet::QValue::code, collate1D(), collate1DD(), collate1S(), collate2D(), collate2DD(), collate2S(), collate3D(), collateHistograms_, collateProfile(), collateProfile2D(), MonitorElement::copyFrom(), gather_cfg::cout, dot(), DQMNet::DQM_PROP_HAS_REFERENCE, MonitorElement::Fill(), findObject(), isCollateME(), isSubdirectory(), callgraph::kind, diffTwoXMLs::label, funct::m, funct::master(), DQMNet::QValue::message, gen::n, MonitorElement::object_, DQMNet::QValue::qtname, DQMNet::QValue::qtresult, alignCSCRings::s, s_referenceDirName, s_rxmeqr1(), s_rxmeqr2(), s_rxmeval(), MonitorElement::setEfficiencyFlag(), AlCaHLTBitMon_QueryRunRegistry::string, tag(), heppy_batch::val, and verbose_.

Referenced by readDirectory(), and readFilePB().

2097 {
2098  // NB: Profile histograms inherit from TH*D, checking order matters.
2099  MonitorElement *refcheck = nullptr;
2100  if (auto *h = dynamic_cast<TProfile *>(obj))
2101  {
2102  MonitorElement *me = findObject(dir, h->GetName());
2103  if (! me)
2104  me = bookProfile_(dir, h->GetName(), (TProfile *) h->Clone());
2105  else if (overwrite)
2106  me->copyFrom(h);
2107  else if (isCollateME(me) || collateHistograms)
2108  collateProfile(me, h, verbose_);
2109  refcheck = me;
2110  }
2111  else if (auto *h = dynamic_cast<TProfile2D *>(obj))
2112  {
2113  MonitorElement *me = findObject(dir, h->GetName());
2114  if (! me)
2115  me = bookProfile2D_(dir, h->GetName(), (TProfile2D *) h->Clone());
2116  else if (overwrite)
2117  me->copyFrom(h);
2118  else if (isCollateME(me) || collateHistograms)
2119  collateProfile2D(me, h, verbose_);
2120  refcheck = me;
2121  }
2122  else if (auto *h = dynamic_cast<TH1F *>(obj))
2123  {
2124  MonitorElement *me = findObject(dir, h->GetName());
2125  if (! me)
2126  me = book1D_(dir, h->GetName(), (TH1F *) h->Clone());
2127  else if (overwrite)
2128  me->copyFrom(h);
2129  else if (isCollateME(me) || collateHistograms)
2130  collate1D(me, h, verbose_);
2131  refcheck = me;
2132  }
2133  else if (auto *h = dynamic_cast<TH1S *>(obj))
2134  {
2135  MonitorElement *me = findObject(dir, h->GetName());
2136  if (! me)
2137  me = book1S_(dir, h->GetName(), (TH1S *) h->Clone());
2138  else if (overwrite)
2139  me->copyFrom(h);
2140  else if (isCollateME(me) || collateHistograms)
2141  collate1S(me, h, verbose_);
2142  refcheck = me;
2143  }
2144  else if (auto *h = dynamic_cast<TH1D *>(obj))
2145  {
2146  MonitorElement *me = findObject(dir, h->GetName());
2147  if (! me)
2148  me = book1DD_(dir, h->GetName(), (TH1D *) h->Clone());
2149  else if (overwrite)
2150  me->copyFrom(h);
2151  else if (isCollateME(me) || collateHistograms)
2152  collate1DD(me, h, verbose_);
2153  refcheck = me;
2154  }
2155  else if (auto *h = dynamic_cast<TH2F *>(obj))
2156  {
2157  MonitorElement *me = findObject(dir, h->GetName());
2158  if (! me)
2159  me = book2D_(dir, h->GetName(), (TH2F *) h->Clone());
2160  else if (overwrite)
2161  me->copyFrom(h);
2162  else if (isCollateME(me) || collateHistograms)
2163  collate2D(me, h, verbose_);
2164  refcheck = me;
2165  }
2166  else if (auto *h = dynamic_cast<TH2S *>(obj))
2167  {
2168  MonitorElement *me = findObject(dir, h->GetName());
2169  if (! me)
2170  me = book2S_(dir, h->GetName(), (TH2S *) h->Clone());
2171  else if (overwrite)
2172  me->copyFrom(h);
2173  else if (isCollateME(me) || collateHistograms)
2174  collate2S(me, h, verbose_);
2175  refcheck = me;
2176  }
2177  else if (auto *h = dynamic_cast<TH2D *>(obj))
2178  {
2179  MonitorElement *me = findObject(dir, h->GetName());
2180  if (! me)
2181  me = book2DD_(dir, h->GetName(), (TH2D *) h->Clone());
2182  else if (overwrite)
2183  me->copyFrom(h);
2184  else if (isCollateME(me) || collateHistograms)
2185  collate2DD(me, h, verbose_);
2186  refcheck = me;
2187  }
2188  else if (auto *h = dynamic_cast<TH3F *>(obj))
2189  {
2190  MonitorElement *me = findObject(dir, h->GetName());
2191  if (! me)
2192  me = book3D_(dir, h->GetName(), (TH3F *) h->Clone());
2193  else if (overwrite)
2194  me->copyFrom(h);
2195  else if (isCollateME(me) || collateHistograms)
2196  collate3D(me, h, verbose_);
2197  refcheck = me;
2198  }
2199  else if (dynamic_cast<TObjString *>(obj))
2200  {
2201  lat::RegexpMatch m;
2202  if (! s_rxmeval.match(obj->GetName(), 0, 0, &m))
2203  {
2204  if (strstr(obj->GetName(), "CMSSW"))
2205  {
2206  if (verbose_)
2207  std::cout << "Input file version: " << obj->GetName() << std::endl;
2208  return true;
2209  }
2210  else if (strstr(obj->GetName(), "DQMPATCH"))
2211  {
2212  if (verbose_)
2213  std::cout << "DQM patch version: " << obj->GetName() << std::endl;
2214  return true;
2215  }
2216  else
2217  {
2218  std::cout << "*** DQMStore: WARNING: cannot extract object '"
2219  << obj->GetName() << "' of type '"
2220  << obj->IsA()->GetName() << "'\n";
2221  return false;
2222  }
2223  }
2224 
2225  std::string label = m.matchString(obj->GetName(), 1);
2226  std::string kind = m.matchString(obj->GetName(), 2);
2227  std::string value = m.matchString(obj->GetName(), 3);
2228 
2229  if (kind == "i")
2230  {
2231  MonitorElement *me = findObject(dir, label);
2232  if (! me || overwrite)
2233  {
2234  if (! me) me = bookInt_(dir, label);
2235  me->Fill(atoll(value.c_str()));
2236  }
2237  }
2238  else if (kind == "f")
2239  {
2240  MonitorElement *me = findObject(dir, label);
2241  if (! me || overwrite)
2242  {
2243  if (! me) me = bookFloat_(dir, label);
2244  me->Fill(atof(value.c_str()));
2245  }
2246  }
2247  else if (kind == "s")
2248  {
2249  MonitorElement *me = findObject(dir, label);
2250  if (! me)
2251  me = bookString_(dir, label, value);
2252  else if (overwrite)
2253  me->Fill(value);
2254  }
2255  else if (kind == "e")
2256  {
2257  MonitorElement *me = findObject(dir, label);
2258  if (! me)
2259  {
2260  std::cout << "*** DQMStore: WARNING: no monitor element '"
2261  << label << "' in directory '"
2262  << dir << "' to be marked as efficiency plot.\n";
2263  return false;
2264  }
2265  me->setEfficiencyFlag();
2266  }
2267  else if (kind == "t")
2268  {
2269  MonitorElement *me = findObject(dir, label);
2270  if (! me)
2271  {
2272  std::cout << "*** DQMStore: WARNING: no monitor element '"
2273  << label << "' in directory '"
2274  << dir << "' for a tag\n";
2275  return false;
2276  }
2277  errno = 0;
2278  char *endp = nullptr;
2279  unsigned long val = strtoul(value.c_str(), &endp, 10);
2280  if ((val == 0 && errno) || *endp || val > ~uint32_t(0))
2281  {
2282  std::cout << "*** DQMStore: WARNING: cannot restore tag '"
2283  << value << "' for monitor element '"
2284  << label << "' in directory '"
2285  << dir << "' - invalid value\n";
2286  return false;
2287  }
2288  tag(me, val);
2289  }
2290  else if (kind == "qr")
2291  {
2292  // Handle qreports, but skip them while reading in references.
2294  {
2295  size_t dot = label.find('.');
2296  if (dot == std::string::npos)
2297  {
2298  std::cout << "*** DQMStore: WARNING: quality report label in '" << label
2299  << "' is missing a '.' and cannot be extracted\n";
2300  return false;
2301  }
2302 
2303  std::string mename (label, 0, dot);
2304  std::string qrname (label, dot+1, std::string::npos);
2305 
2306  m.reset();
2307  DQMNet::QValue qv;
2308  if (s_rxmeqr1.match(value, 0, 0, &m))
2309  {
2310  qv.code = atoi(m.matchString(value, 1).c_str());
2311  qv.qtresult = strtod(m.matchString(value, 2).c_str(), nullptr);
2312  qv.message = m.matchString(value, 4);
2313  qv.qtname = qrname;
2314  qv.algorithm = m.matchString(value, 3);
2315  }
2316  else if (s_rxmeqr2.match(value, 0, 0, &m))
2317  {
2318  qv.code = atoi(m.matchString(value, 1).c_str());
2319  qv.qtresult = 0; // unavailable in old format
2320  qv.message = m.matchString(value, 2);
2321  qv.qtname = qrname;
2322  // qv.algorithm unavailable in old format
2323  }
2324  else
2325  {
2326  std::cout << "*** DQMStore: WARNING: quality test value '"
2327  << value << "' is incorrectly formatted\n";
2328  return false;
2329  }
2330 
2331  MonitorElement *me = findObject(dir, mename);
2332  if (! me)
2333  {
2334  std::cout << "*** DQMStore: WARNING: no monitor element '"
2335  << mename << "' in directory '"
2336  << dir << "' for quality test '"
2337  << label << "'\n";
2338  return false;
2339  }
2340 
2341  me->addQReport(qv, /* FIXME: getQTest(qv.qtname)? */ nullptr);
2342  }
2343  }
2344  else
2345  {
2346  std::cout << "*** DQMStore: WARNING: cannot extract object '"
2347  << obj->GetName() << "' of type '"
2348  << obj->IsA()->GetName() << "'\n";
2349  return false;
2350  }
2351  }
2352  else if (auto *n = dynamic_cast<TNamed *>(obj))
2353  {
2354  // For old DQM data.
2355  std::string s;
2356  s.reserve(6 + strlen(n->GetTitle()) + 2*strlen(n->GetName()));
2357  s += '<'; s += n->GetName(); s += '>';
2358  s += n->GetTitle();
2359  s += '<'; s += '/'; s += n->GetName(); s += '>';
2360  TObjString os(s.c_str());
2361  return extract(&os, dir, overwrite, collateHistograms_);
2362  }
2363  else
2364  {
2365  std::cout << "*** DQMStore: WARNING: cannot extract object '"
2366  << obj->GetName() << "' of type '" << obj->IsA()->GetName()
2367  << "' and with title '" << obj->GetTitle() << "'\n";
2368  return false;
2369  }
2370 
2371  // If we just read in a reference MonitorElement, and there is a
2372  // MonitorElement with the same name, link the two together.
2373  // The other direction is handled by the book() method.
2374  if (refcheck && isSubdirectory(s_referenceDirName, dir))
2375  {
2376  std::string mdir(dir, s_referenceDirName.size()+1, std::string::npos);
2377  if (MonitorElement *master = findObject(mdir, obj->GetName()))
2378  {
2379  // We have extracted a MonitorElement, and it's located in the reference
2380  // dir. Then we find the corresponding MonitorElement in the
2381  // non-reference dir and assign the object_ of the reference
2382  // MonitorElement to the reference_ property of the corresponding
2383  // non-reference MonitorElement.
2384  master->data_.flags |= DQMNet::DQM_PROP_HAS_REFERENCE;
2385  master->reference_ = refcheck->object_;
2386  }
2387  }
2388 
2389  return true;
2390 }
MonitorElement * book2DD_(const std::string &dir, const std::string &name, TH2D *h)
Book 2D histogram based on TH2D.
Definition: DQMStore.cc:1003
Master< F > master(const F &f)
Definition: FunctClone.h:68
static const lat::Regexp s_rxmeqr2("^st\\.(\\d+)\\.(.*)$")
bool isCollateME(MonitorElement *me) const
Definition: DQMStore.cc:3457
void copyFrom(TH1 *from)
MonitorElement * bookProfile2D_(const std::string &dir, const std::string &name, TProfile2D *h)
Book 2D profile histogram based on TProfile2D.
Definition: DQMStore.cc:1348
std::string algorithm
Definition: DQMNet.h:94
static void collate3D(MonitorElement *me, TH3F *h, unsigned verbose)
Definition: DQMStore.cc:1510
static void collateProfile(MonitorElement *me, TProfile *h, unsigned verbose)
Definition: DQMStore.cc:1517
static void collate2DD(MonitorElement *me, TH2D *h, unsigned verbose)
Definition: DQMStore.cc:1503
void Fill(long long x)
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1541
MonitorElement * book2D_(const std::string &dir, const std::string &name, TH2F *h)
Book 2D histogram based on TH2F.
Definition: DQMStore.cc:989
static const lat::Regexp s_rxmeval("^<(.*)>(i|f|s|e|t|qr)=(.*)</\\1>$")
static bool isSubdirectory(const std::string &ofdir, const std::string &path)
Definition: DQMStore.cc:73
void setEfficiencyFlag()
static const uint32_t DQM_PROP_HAS_REFERENCE
Definition: DQMNet.h:54
MonitorElement * bookString_(const std::string &dir, const std::string &name, const std::string &value)
Book string.
Definition: DQMStore.cc:832
MonitorElement * book3D_(const std::string &dir, const std::string &name, TH3F *h)
Book 3D histogram based on TH3F.
Definition: DQMStore.cc:1156
static void collateProfile2D(MonitorElement *me, TProfile2D *h, unsigned verbose)
Definition: DQMStore.cc:1527
MonitorElement * bookInt_(const std::string &dir, const std::string &name)
Book int.
Definition: DQMStore.cc:772
MonitorElement * bookProfile_(const std::string &dir, const std::string &name, TProfile *h)
Book profile histogram based on TProfile.
Definition: DQMStore.cc:1204
Definition: value.py:1
std::string qtname
Definition: DQMNet.h:93
MonitorElement * findObject(const std::string &dir, const std::string &name, const uint32_t run=0, const uint32_t lumi=0, const uint32_t moduleId=0) const
Definition: DQMStore.cc:1784
static void collate1DD(MonitorElement *me, TH1D *h, unsigned verbose)
Definition: DQMStore.cc:1482
unsigned verbose_
Definition: DQMStore.h:831
MonitorElement * book2S_(const std::string &dir, const std::string &name, TH2S *h)
Book 2D histogram based on TH2S.
Definition: DQMStore.cc:996
static const std::string s_referenceDirName
Definition: DQMStore.cc:58
MonitorElement * book1D_(const std::string &dir, const std::string &name, TH1F *h)
Book 1D histogram based on TH1F.
Definition: DQMStore.cc:861
static void collate1D(MonitorElement *me, TH1F *h, unsigned verbose)
Definition: DQMStore.cc:1468
MonitorElement * book1DD_(const std::string &dir, const std::string &name, TH1D *h)
Book 1D histogram based on TH1D.
Definition: DQMStore.cc:875
bool extract(TObject *obj, const std::string &dir, bool overwrite, bool collateHistograms)
Definition: DQMStore.cc:2095
T dot(const Basic3DVector &v) const
Scalar product, or "dot" product, with a vector of same type.
std::string message
Definition: DQMNet.h:92
static void collate1S(MonitorElement *me, TH1S *h, unsigned verbose)
Definition: DQMStore.cc:1475
dbl *** dir
Definition: mlp_gen.cc:35
MonitorElement * bookFloat_(const std::string &dir, const std::string &name)
Book float.
Definition: DQMStore.cc:802
static void collate2D(MonitorElement *me, TH2F *h, unsigned verbose)
Definition: DQMStore.cc:1489
float qtresult
Definition: DQMNet.h:91
bool collateHistograms_
Definition: DQMStore.h:835
void addQReport(const DQMNet::QValue &desc, QCriterion *qc)
Add quality report, from DQMStore.
static const lat::Regexp s_rxmeqr1("^st:(\\d+):([-+e.\\d]+):([^:]*):(.*)$")
static void collate2S(MonitorElement *me, TH2S *h, unsigned verbose)
Definition: DQMStore.cc:1496
MonitorElement * book1S_(const std::string &dir, const std::string &name, TH1S *h)
Book 1D histogram based on TH1S.
Definition: DQMStore.cc:868
TObject * DQMStore::extractNextObject ( TBufferFile &  buf) const
inlineprivate

Extract the next serialised ROOT object from buf. Returns null if there are no more objects in the buffer, or a null pointer was serialised at this location.

Definition at line 3086 of file DQMStore.cc.

Referenced by get_info().

3086  {
3087  if (buf.Length() == buf.BufferSize())
3088  return nullptr;
3089  buf.InitMap();
3090  void *ptr = buf.ReadObjectAny(nullptr);
3091  return reinterpret_cast<TObject *>(ptr);
3092 }
MonitorElement * DQMStore::findObject ( const std::string &  dir,
const std::string &  name,
const uint32_t  run = 0,
const uint32_t  lumi = 0,
const uint32_t  moduleId = 0 
) const
private

get MonitorElement <name> in directory <dir> (null if MonitorElement does not exist)

Definition at line 1784 of file DQMStore.cc.

References MonitorElement::data_, data_, dir, DQMNet::CoreObject::dirname, csvLumiCalc::lumi, DQMNet::CoreObject::lumi, DQMNet::CoreObject::moduleId, dataset::name, DQMNet::CoreObject::objname, raiseDQMError(), DQMNet::CoreObject::run, findQualityFiles::run, and s_safe.

Referenced by book_(), bookFloat_(), bookInt_(), bookString_(), extract(), makeDirectory(), mtEnabled(), readFilePB(), and tag().

1789 {
1790  if (dir.find_first_not_of(s_safe) != std::string::npos)
1791  raiseDQMError("DQMStore", "Monitor element path name '%s' uses"
1792  " unacceptable characters", dir.c_str());
1793  if (name.find_first_not_of(s_safe) != std::string::npos)
1794  raiseDQMError("DQMStore", "Monitor element path name '%s' uses"
1795  " unacceptable characters", name.c_str());
1796 
1797  MonitorElement proto;
1798  proto.data_.dirname = &dir;
1799  proto.data_.objname = name;
1800  proto.data_.run = run;
1801  proto.data_.lumi = lumi;
1802  proto.data_.moduleId = moduleId;
1803 
1804  auto mepos = data_.find(proto);
1805  return (mepos == data_.end() ? nullptr
1806  : const_cast<MonitorElement *>(&*mepos));
1807 }
uint32_t moduleId
Definition: DQMNet.h:105
static const std::string s_safe
Definition: DQMStore.cc:60
const std::string * dirname
Definition: DQMNet.h:106
uint32_t run
Definition: DQMNet.h:102
uint32_t lumi
Definition: DQMNet.h:103
std::string objname
Definition: DQMNet.h:107
DQMNet::CoreObject data_
MEMap data_
Definition: DQMStore.h:845
dbl *** dir
Definition: mlp_gen.cc:35
void raiseDQMError(const char *context, const char *fmt,...)
Definition: DQMError.cc:11
void DQMStore::forceReset ( )
private

Invoke this method after flushing all recently changed monitoring. Clears updated flag on all MEs and calls their Reset() method.

Definition at line 1919 of file DQMStore.cc.

References data_, forceResetOnBeginLumi_, MonitorElement::Reset(), and reset_.

Referenced by DQMStore(), and mtEnabled().

1920 {
1921  auto mi = data_.begin();
1922  auto me = data_.end();
1923  for ( ; mi != me; ++mi)
1924  {
1925  if (forceResetOnBeginLumi_ && ((*mi).getLumiFlag() == false))
1926  continue;
1927  auto &me = const_cast<MonitorElement &>(*mi);
1928  me.Reset();
1929  me.resetUpdate();
1930  }
1931 
1932  reset_ = true;
1933 }
bool reset_
Definition: DQMStore.h:833
void Reset()
reset ME (ie. contents, errors, etc)
MEMap data_
Definition: DQMStore.h:845
bool forceResetOnBeginLumi_
Definition: DQMStore.h:838
MonitorElement * DQMStore::get ( const std::string &  path) const

get ME from full pathname (e.g. "my/long/dir/my_histo")

Definition at line 1655 of file DQMStore.cc.

References data_, dir, dataset::name, splitPath(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), SiStripDcsInfo::addBadModules(), TrackerOfflineValidationSummary::associateModuleHistsWithTree(), RPCBxTest::beginRun(), CalibrationScanTask::book(), CalibrationTask::book(), util.rrapi.RRApi::columns(), rrapi.RRApi::columns(), util.rrapi.RRApi::count(), rrapi.RRApi::count(), SiStripActionExecutor::createShiftReport(), util.rrapi.RRApi::data(), rrapi.RRApi::data(), dqmCopyRecursively(), HarvestingAnalyzer::endJob(), MuonAlignment::endJob(), DQMDcsInfoClient::endLuminosityBlock(), L1ScalersClient::endLuminosityBlock(), HLTScalersClient::endLuminosityBlock(), DQMDcsInfoClient::endRun(), TauDQMHistPlotter::endRun(), SiStripQualityChecker::fillDetectorStatusAtLumi(), SiStripQualityChecker::fillFaultyModuleStatus(), DQMFEDIntegrityClient::fillHistograms(), SiStripCertificationInfo::fillSiStripCertificationMEs(), SiStripCertificationInfo::fillSiStripCertificationMEsAtLumi(), PFDQMEventSelector::filter(), SiStripDaqInfo::findExcludedModule(), betterConfigParser.BetterConfigParser::getCompares(), SiStripTrackerMapCreator::getDetectorFlagAndComment(), EgHLTOfflineSummaryClient::getEgHLTSumHist_(), betterConfigParser.BetterConfigParser::getGeneral(), SiStripQualityChecker::getModuleStatus(), SiStripBadModuleFedErrESSource::getProcessedEvents(), betterConfigParser.BetterConfigParser::getResultingSection(), hcaldqm::Container1D::load(), SiStripHistoPlotter::makePlot(), SiStripInformationExtractor::plotHistosFromLayout(), SiStripActionExecutor::printShiftHistoParameters(), QTestStatusChecker::processAlarms(), util.rrapi.RRApi::report(), rrapi.RRApi::report(), rrapi.RRApi::reports(), util.rrapi.RRApi::reports(), EgHLTOfflineSummaryClient::runClient_(), DQMFileSaver::saveForOffline(), DQMFileSaver::saveForOnline(), util.rrapi.RRApi::tables(), rrapi.RRApi::tables(), util.rrapi.RRApi::tags(), rrapi.RRApi::tags(), rrapi.RRApi::templates(), util.rrapi.RRApi::templates(), util.rrapi.RRApi::workspaces(), and rrapi.RRApi::workspaces().

1656 {
1657  std::string dir;
1658  std::string name;
1659  splitPath(dir, name, path);
1660  MonitorElement proto(&dir, name);
1661  auto mepos = data_.find(proto);
1662  return (mepos == data_.end() ? nullptr
1663  : const_cast<MonitorElement *>(&*mepos));
1664 }
static void splitPath(std::string &dir, std::string &name, const std::string &path)
Definition: DQMStore.cc:100
MEMap data_
Definition: DQMStore.h:845
dbl *** dir
Definition: mlp_gen.cc:35
std::vector< MonitorElement * > DQMStore::get ( unsigned int  tag) const

get all MonitorElements tagged as <tag>

Definition at line 1668 of file DQMStore.cc.

References data_, DQMNet::DQM_PROP_TAGGED, and mps_fire::result.

Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), util.rrapi.RRApi::columns(), rrapi.RRApi::columns(), util.rrapi.RRApi::count(), rrapi.RRApi::count(), rrapi.RRApi::data(), util.rrapi.RRApi::data(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), betterConfigParser.BetterConfigParser::getResultingSection(), rrapi.RRApi::report(), util.rrapi.RRApi::report(), rrapi.RRApi::reports(), util.rrapi.RRApi::reports(), util.rrapi.RRApi::tables(), rrapi.RRApi::tables(), rrapi.RRApi::tags(), util.rrapi.RRApi::tags(), rrapi.RRApi::templates(), util.rrapi.RRApi::templates(), util.rrapi.RRApi::workspaces(), and rrapi.RRApi::workspaces().

1669 {
1670  // FIXME: Use reverse map [tag -> path] / [tag -> dir]?
1671  std::vector<MonitorElement *> result;
1672  for (auto const & me : data_)
1673  {
1674  if ((me.data_.flags & DQMNet::DQM_PROP_TAGGED) && me.data_.tag == tag)
1675  result.push_back(const_cast<MonitorElement *>(&me));
1676  }
1677  return result;
1678 }
static const uint32_t DQM_PROP_TAGGED
Definition: DQMNet.h:55
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1541
MEMap data_
Definition: DQMStore.h:845
void DQMStore::get_info ( const dqmstorepb::ROOTFilePB_Histo h,
std::string &  dirname,
std::string &  objname,
TObject **  obj 
)
private

Definition at line 3094 of file DQMStore.cc.

References extractNextObject(), dqmstorepb::ROOTFilePB_Histo::full_pathname(), raiseDQMError(), dqmstorepb::ROOTFilePB_Histo::size(), pickleFileParser::slash, and dqmstorepb::ROOTFilePB_Histo::streamed_histo().

Referenced by readFilePB().

3097  {
3098 
3099  size_t slash = h.full_pathname().rfind('/');
3100  size_t dirpos = (slash == std::string::npos ? 0 : slash);
3101  size_t namepos = (slash == std::string::npos ? 0 : slash+1);
3102  dirname.assign(h.full_pathname(), 0, dirpos);
3103  objname.assign(h.full_pathname(), namepos, std::string::npos);
3104  TBufferFile buf(TBufferFile::kRead, h.size(),
3105  (void*)h.streamed_histo().data(),
3106  kFALSE);
3107  buf.Reset();
3108  *obj = extractNextObject(buf);
3109  if (!*obj) {
3110  raiseDQMError("DQMStore", "Error reading element:'%s'" , h.full_pathname().c_str());
3111  }
3112 }
::google::protobuf::uint32 size() const
const ::std::string & full_pathname() const
const ::std::string & streamed_histo() const
TObject * extractNextObject(TBufferFile &) const
Definition: DQMStore.cc:3086
void raiseDQMError(const char *context, const char *fmt,...)
Definition: DQMError.cc:11
std::vector< MonitorElement * > DQMStore::getAllContents ( const std::string &  path,
uint32_t  run = 0,
uint32_t  lumi = 0 
) const

get vector with children of folder, including all subfolders + their children; must use an exact pathname

Definition at line 1812 of file DQMStore.cc.

References clean, cleanTrailingSlashes(), data_, MillePedeFileConverter_cfg::e, enableMultiThread_, mps_fire::i, isSubdirectory(), or, mps_fire::result, MonitorElement::setLumi(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by SiStripCalibLorentzAngle::algoBeginJob(), edmtest::DQMReferenceHistogramRootFileEventSetupAnalyzer::beginRun(), SiStripQualityHotStripIdentifierRoot::bookHistos(), StatisticsFilter::filter(), mtEnabled(), DQMStore::IGetter::removeElement(), DQMRootOutputModule::writeLuminosityBlock(), and DQMRootOutputModule::writeRun().

1815 {
1817  const std::string *cleaned = nullptr;
1818  cleanTrailingSlashes(path, clean, cleaned);
1819  MonitorElement proto(cleaned, std::string(), run, 0);
1820  proto.setLumi(lumi);
1821 
1822  std::vector<MonitorElement *> result;
1823  auto e = data_.end();
1824  auto i = data_.lower_bound(proto);
1825  for ( ; i != e && isSubdirectory(*cleaned, *i->data_.dirname); ++i) {
1826  if (run != 0) {
1827  if (i->data_.run > run // TODO[rovere]: pleonastic? first we encounter local ME of the same run ...
1828  || i->data_.moduleId != 0)
1829  break;
1830  }
1831  if (lumi != 0) {
1832  if (i->data_.lumi > lumi
1833  || i->data_.moduleId != 0)
1834  break;
1835  }
1836  if (run != 0 or lumi !=0) {
1837  assert(i->data_.moduleId == 0);
1838  }
1839  result.push_back(const_cast<MonitorElement *>(&*i));
1840  }
1841 
1842  if (enableMultiThread_)
1843  {
1844  //save legacy modules when running MT
1845  i = data_.begin();
1846  for ( ; i != e && isSubdirectory(*cleaned, *i->data_.dirname); ++i) {
1847  if (i->data_.run != 0 or i->data_.moduleId != 0)
1848  break;
1849  result.push_back(const_cast<MonitorElement *>(&*i));
1850  }
1851  }
1852 
1853  return result;
1854 }
static void cleanTrailingSlashes(const std::string &path, std::string &clean, const std::string *&cleaned)
Definition: DQMStore.cc:83
static bool isSubdirectory(const std::string &ofdir, const std::string &path)
Definition: DQMStore.cc:73
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
std::vector< T * > clean
Definition: MVATrainer.cc:156
MEMap data_
Definition: DQMStore.h:845
bool enableMultiThread_
Definition: DQMStore.h:836
std::vector< MonitorElement * > DQMStore::getContents ( const std::string &  path) const

get vector with all children of folder (does NOT include contents of subfolders)

Definition at line 1683 of file DQMStore.cc.

References clean, cleanTrailingSlashes(), data_, MillePedeFileConverter_cfg::e, mps_fire::i, isSubdirectory(), mps_fire::result, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by SiStripSummaryCreator::fillGrandSummaryHistos(), SiStripCertificationInfo::fillSiStripCertificationMEs(), SiStripQualityChecker::fillSubDetStatus(), SiStripSummaryCreator::fillSummaryHistos(), QTestStatusChecker::fullPathNames(), SiStripSummaryCreator::getSummaryME(), SiStripHistoPlotter::makeCondDBPlots(), meBookerGetter(), SiStripInformationExtractor::printAlarmList(), SiStripActionExecutor::printFaultyModuleList(), SiStripInformationExtractor::printNonGeomHistoList(), SiStripInformationExtractor::printSummaryHistoList(), SiStripTrackerMapCreator::setTkMapFromHistogram(), and showDirStructure().

1684 {
1686  const std::string *cleaned = nullptr;
1687  cleanTrailingSlashes(path, clean, cleaned);
1688  MonitorElement proto(cleaned, std::string());
1689 
1690  std::vector<MonitorElement *> result;
1691  auto e = data_.end();
1692  auto i = data_.lower_bound(proto);
1693  for ( ; i != e && isSubdirectory(*cleaned, *i->data_.dirname); ++i)
1694  if (*cleaned == *i->data_.dirname)
1695  result.push_back(const_cast<MonitorElement *>(&*i));
1696 
1697  return result;
1698 }
static void cleanTrailingSlashes(const std::string &path, std::string &clean, const std::string *&cleaned)
Definition: DQMStore.cc:83
static bool isSubdirectory(const std::string &ofdir, const std::string &path)
Definition: DQMStore.cc:73
std::vector< T * > clean
Definition: MVATrainer.cc:156
MEMap data_
Definition: DQMStore.h:845
std::vector< MonitorElement * > DQMStore::getContents ( const std::string &  path,
unsigned int  tag 
) const

same as above for tagged MonitorElements

Definition at line 1702 of file DQMStore.cc.

References clean, cleanTrailingSlashes(), data_, DQMNet::DQM_PROP_TAGGED, MillePedeFileConverter_cfg::e, mps_fire::i, isSubdirectory(), mps_fire::result, AlCaHLTBitMon_QueryRunRegistry::string, and tag().

1703 {
1705  const std::string *cleaned = nullptr;
1706  cleanTrailingSlashes(path, clean, cleaned);
1707  MonitorElement proto(cleaned, std::string());
1708 
1709  std::vector<MonitorElement *> result;
1710  auto e = data_.end();
1711  auto i = data_.lower_bound(proto);
1712  for ( ; i != e && isSubdirectory(*cleaned, *i->data_.dirname); ++i)
1713  if (*cleaned == *i->data_.dirname
1714  && (i->data_.flags & DQMNet::DQM_PROP_TAGGED)
1715  && i->data_.tag == tag)
1716  result.push_back(const_cast<MonitorElement *>(&*i));
1717 
1718  return result;
1719 }
static const uint32_t DQM_PROP_TAGGED
Definition: DQMNet.h:55
static void cleanTrailingSlashes(const std::string &path, std::string &clean, const std::string *&cleaned)
Definition: DQMStore.cc:83
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1541
static bool isSubdirectory(const std::string &ofdir, const std::string &path)
Definition: DQMStore.cc:73
std::vector< T * > clean
Definition: MVATrainer.cc:156
MEMap data_
Definition: DQMStore.h:845
void DQMStore::getContents ( std::vector< std::string > &  into,
bool  showContents = true 
) const

get contents; return vector<string> of the form <dir pathname>="">:<obj1>,<obj2>,<obj3>; if showContents = false, change form to <dir pathname>="">: (useful for subscription requests; meant to imply "all contents")

Definition at line 1726 of file DQMStore.cc.

References data_, dirs_, isSubdirectory(), funct::m, and AlCaHLTBitMon_QueryRunRegistry::string.

1727 {
1728  into.clear();
1729  into.reserve(dirs_.size());
1730 
1731  auto me = data_.end();
1732  auto di = dirs_.begin();
1733  auto de = dirs_.end();
1734  for ( ; di != de; ++di)
1735  {
1736  MonitorElement proto(&*di, std::string());
1737  auto mi = data_.lower_bound(proto);
1738  auto m = mi;
1739  size_t sz = di->size() + 2;
1740  size_t nfound = 0;
1741  for ( ; m != me && isSubdirectory(*di, *m->data_.dirname); ++m)
1742  if (*di == *m->data_.dirname)
1743  {
1744  sz += m->data_.objname.size() + 1;
1745  ++nfound;
1746  }
1747 
1748  if (! nfound)
1749  continue;
1750 
1751  auto istr
1752  = into.insert(into.end(), std::string());
1753 
1754  if (showContents)
1755  {
1756  istr->reserve(sz);
1757 
1758  *istr += *di;
1759  *istr += ':';
1760  for (sz = 0; mi != m; ++mi)
1761  {
1762  if (*di != *mi->data_.dirname)
1763  continue;
1764 
1765  if (sz > 0)
1766  *istr += ',';
1767 
1768  *istr += mi->data_.objname;
1769  ++sz;
1770  }
1771  }
1772  else
1773  {
1774  istr->reserve(di->size() + 2);
1775  *istr += *di;
1776  *istr += ':';
1777  }
1778  }
1779 }
static bool isSubdirectory(const std::string &ofdir, const std::string &path)
Definition: DQMStore.cc:73
MEMap data_
Definition: DQMStore.h:845
std::set< std::string > dirs_
Definition: DQMStore.h:846
std::vector< MonitorElement * > DQMStore::getMatchingContents ( const std::string &  pattern,
lat::Regexp::Syntax  syntaxType = lat::Regexp::Wildcard 
) const

get vector with children of folder, including all subfolders + their children; matches names against a wildcard pattern matched against the full ME path

Definition at line 1859 of file DQMStore.cc.

References data_, MillePedeFileConverter_cfg::e, mps_fire::i, mergePath(), callgraph::path, raiseDQMError(), mps_fire::result, corrVsCorr::rx, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by EgHLTOfflineSummaryClient::getQTestResults_(), mtEnabled(), and DQMFileSaver::saveForOnline().

1860 {
1861  lat::Regexp rx;
1862  try
1863  {
1864  rx = lat::Regexp(pattern, 0, syntaxType);
1865  rx.study();
1866  }
1867  catch (lat::Error &e)
1868  {
1869  raiseDQMError("DQMStore", "Invalid regular expression '%s': %s",
1870  pattern.c_str(), e.explain().c_str());
1871  }
1872 
1873  std::string path;
1874  std::vector<MonitorElement *> result;
1875  auto i = data_.begin();
1876  auto e = data_.end();
1877  for ( ; i != e; ++i)
1878  {
1879  path.clear();
1880  mergePath(path, *i->data_.dirname, i->data_.objname);
1881  if (rx.match(path))
1882  result.push_back(const_cast<MonitorElement *>(&*i));
1883  }
1884 
1885  return result;
1886 }
edm::ErrorSummaryEntry Error
static void mergePath(std::string &path, const std::string &dir, const std::string &name)
Definition: DQMStore.cc:113
MEMap data_
Definition: DQMStore.h:845
void raiseDQMError(const char *context, const char *fmt,...)
Definition: DQMError.cc:11
std::vector< std::string > DQMStore::getMEs ( ) const

get list of (non-dir) MEs of current directory

Definition at line 1629 of file DQMStore.cc.

References data_, MillePedeFileConverter_cfg::e, mps_fire::i, isSubdirectory(), pwd_, mps_fire::result, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by CalibrationScanTask::book(), CalibrationTask::book(), dqmCopyRecursively(), meBookerGetter(), and DQMStore::IGetter::removeElement().

1630 {
1631  MonitorElement proto(&pwd_, std::string());
1632  std::vector<std::string> result;
1633  auto e = data_.end();
1634  auto i = data_.lower_bound(proto);
1635  for ( ; i != e && isSubdirectory(pwd_, *i->data_.dirname); ++i)
1636  if (pwd_ == *i->data_.dirname)
1637  result.push_back(i->getName());
1638 
1639  return result;
1640 }
static bool isSubdirectory(const std::string &ofdir, const std::string &path)
Definition: DQMStore.cc:73
std::string pwd_
Definition: DQMStore.h:844
MEMap data_
Definition: DQMStore.h:845
QCriterion * DQMStore::getQCriterion ( const std::string &  qtname) const
int DQMStore::getStatus ( const std::string &  path = "") const

get "global" folder <path> status (one of:STATUS_OK, WARNING, ERROR, OTHER); returns most sever error, where ERROR > WARNING > OTHER > STATUS_OK; see Core/interface/QTestStatus.h for details on "OTHER"

Definition at line 3370 of file DQMStore.cc.

References clean, cleanTrailingSlashes(), data_, dqm::qstatus::ERROR, isSubdirectory(), dqm::qstatus::OTHER, mps_update::status, dqm::qstatus::STATUS_OK, AlCaHLTBitMon_QueryRunRegistry::string, and dqm::qstatus::WARNING.

Referenced by QTestStatusChecker::checkGlobalStatus(), mtEnabled(), and SiStripInformationExtractor::printAlarmList().

3371 {
3373  const std::string *cleaned = nullptr;
3374  cleanTrailingSlashes(path, clean, cleaned);
3375 
3377  auto mi = data_.begin();
3378  auto me = data_.end();
3379  for ( ; mi != me; ++mi)
3380  {
3381  if (! cleaned->empty() && ! isSubdirectory(*cleaned, *mi->data_.dirname))
3382  continue;
3383 
3384  if (mi->hasError())
3385  return dqm::qstatus::ERROR;
3386  else if (mi->hasWarning())
3387  status = dqm::qstatus::WARNING;
3388  else if (status < dqm::qstatus::WARNING
3389  && mi->hasOtherReport())
3390  status = dqm::qstatus::OTHER;
3391  }
3392  return status;
3393 }
static const int OTHER
static const int WARNING
static void cleanTrailingSlashes(const std::string &path, std::string &clean, const std::string *&cleaned)
Definition: DQMStore.cc:83
static bool isSubdirectory(const std::string &ofdir, const std::string &path)
Definition: DQMStore.cc:73
std::vector< T * > clean
Definition: MVATrainer.cc:156
MEMap data_
Definition: DQMStore.h:845
static const int STATUS_OK
static const int ERROR
std::vector< std::string > DQMStore::getSubdirs ( ) const

get list of subdirectories of current directory

Definition at line 1606 of file DQMStore.cc.

References dirs_, MillePedeFileConverter_cfg::e, mps_fire::i, isSubdirectory(), pwd_, and mps_fire::result.

Referenced by SiStripSummaryCreator::createSummary(), dqmCopyRecursively(), TauDQMFileLoader::endRun(), SiStripSummaryCreator::fillGrandSummaryHistos(), SiStripQualityChecker::fillSubDetStatus(), SiStripSummaryCreator::fillSummaryHistos(), SiStripUtility::getModuleFolderList(), SiStripSummaryCreator::getSummaryME(), SiStripUtility::goToDir(), meBookerGetter(), SiStripInformationExtractor::printAlarmList(), SiStripInformationExtractor::printNonGeomHistoList(), SiStripInformationExtractor::printSummaryHistoList(), DQMStore::IGetter::removeElement(), DQMFileSaver::saveForOffline(), DQMFileSaver::saveForOnline(), and SiStripTrackerMapCreator::setTkMapFromHistogram().

1607 {
1608  std::vector<std::string> result;
1609  auto e = dirs_.end();
1610  auto i = dirs_.find(pwd_);
1611 
1612  // If we didn't find current directory, the tree is empty, so quit.
1613  if (i == e)
1614  return result;
1615 
1616  // Skip the current directory and then start looking for immediate
1617  // subdirectories in the dirs_ list. Stop when we are no longer in
1618  // (direct or indirect) subdirectories of pwd_. Note that we don't
1619  // "know" which order the set will sort A/B, A/B/C and A/D.
1620  while (++i != e && isSubdirectory(pwd_, *i))
1621  if (i->find('/', pwd_.size()+1) == std::string::npos)
1622  result.push_back(*i);
1623 
1624  return result;
1625 }
static bool isSubdirectory(const std::string &ofdir, const std::string &path)
Definition: DQMStore.cc:73
std::string pwd_
Definition: DQMStore.h:844
std::set< std::string > dirs_
Definition: DQMStore.h:846
void DQMStore::goUp ( )
MonitorElement* DQMStore::initialise ( MonitorElement me,
const std::string &  path 
)
private

Referenced by book_(), and mtEnabled().

void DQMStore::initializeFrom ( const edm::ParameterSet pset)
private

Definition at line 425 of file DQMStore.cc.

References collateHistograms_, gather_cfg::cout, enableMultiThread_, edm::ParameterSet::getUntrackedParameter(), LSbasedMode_, makeDirectory(), qalgos_, readFile(), reset(), s_referenceDirName, scaleFlag_, AlCaHLTBitMon_QueryRunRegistry::string, StripRunDirs, verbose_, and verboseQT_.

Referenced by DQMStore(), and mtEnabled().

425  {
426  makeDirectory("");
427  reset();
428 
429  // set steerable parameters
430  verbose_ = pset.getUntrackedParameter<int>("verbose", 0);
431  if (verbose_ > 0)
432  std::cout << "DQMStore: verbosity set to " << verbose_ << std::endl;
433 
434  verboseQT_ = pset.getUntrackedParameter<int>("verboseQT", 0);
435  if (verbose_ > 0)
436  std::cout << "DQMStore: QTest verbosity set to " << verboseQT_ << std::endl;
437 
438  collateHistograms_ = pset.getUntrackedParameter<bool>("collateHistograms", false);
439  if (collateHistograms_)
440  std::cout << "DQMStore: histogram collation is enabled\n";
441 
442  enableMultiThread_ = pset.getUntrackedParameter<bool>("enableMultiThread", false);
443  if (enableMultiThread_)
444  std::cout << "DQMStore: MultiThread option is enabled\n";
445 
446  LSbasedMode_ = pset.getUntrackedParameter<bool>("LSbasedMode", false);
447  if (LSbasedMode_)
448  std::cout << "DQMStore: LSbasedMode option is enabled\n";
449 
450  std::string ref = pset.getUntrackedParameter<std::string>("referenceFileName", "");
451  if (! ref.empty())
452  {
453  std::cout << "DQMStore: using reference file '" << ref << "'\n";
454  readFile(ref, true, "", s_referenceDirName, StripRunDirs, false);
455  }
456 
457  initQCriterion<Comp2RefChi2>(qalgos_);
458  initQCriterion<Comp2Ref2DChi2>(qalgos_);
459  initQCriterion<Comp2RefKolmogorov>(qalgos_);
460  initQCriterion<ContentsXRange>(qalgos_);
461  initQCriterion<ContentsYRange>(qalgos_);
462  initQCriterion<MeanWithinExpected>(qalgos_);
463  initQCriterion<Comp2RefEqualH>(qalgos_);
464  initQCriterion<DeadChannel>(qalgos_);
465  initQCriterion<NoisyChannel>(qalgos_);
466  initQCriterion<ContentSigma>(qalgos_);
467  initQCriterion<ContentsWithinExpected>(qalgos_);
468  initQCriterion<CompareToMedian>(qalgos_);
469  initQCriterion<CompareLastFilledBin>(qalgos_);
470  initQCriterion<CheckVariance>(qalgos_);
471 
472  scaleFlag_ = pset.getUntrackedParameter<double>("ScalingFlag", 0.0);
473  if (verbose_ > 0)
474  std::cout << "DQMStore: Scaling Flag set to " << scaleFlag_ << std::endl;
475 }
T getUntrackedParameter(std::string const &, T const &) const
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:3031
unsigned verboseQT_
Definition: DQMStore.h:832
double scaleFlag_
Definition: DQMStore.h:834
QAMap qalgos_
Definition: DQMStore.h:849
unsigned verbose_
Definition: DQMStore.h:831
static const std::string s_referenceDirName
Definition: DQMStore.cc:58
bool collateHistograms_
Definition: DQMStore.h:835
bool LSbasedMode_
Definition: DQMStore.h:837
void makeDirectory(const std::string &path)
Definition: DQMStore.cc:612
void reset()
Definition: DQMStore.cc:1895
bool enableMultiThread_
Definition: DQMStore.h:836
bool DQMStore::isCollate ( ) const

Definition at line 3448 of file DQMStore.cc.

References collateHistograms_.

Referenced by mtEnabled().

3449 {
3450  return collateHistograms_;
3451 }
bool collateHistograms_
Definition: DQMStore.h:835
bool DQMStore::isCollateME ( MonitorElement me) const
private

Definition at line 3457 of file DQMStore.cc.

References MonitorElement::data_, DQMNet::CoreObject::dirname, isSubdirectory(), and s_collateDirName.

Referenced by extract(), and mtEnabled().

3458 { return me && isSubdirectory(s_collateDirName, *me->data_.dirname); }
const std::string * dirname
Definition: DQMNet.h:106
static const std::string s_collateDirName
Definition: DQMStore.cc:59
static bool isSubdirectory(const std::string &ofdir, const std::string &path)
Definition: DQMStore.cc:73
DQMNet::CoreObject data_
bool DQMStore::load ( const std::string &  filename,
OpenRunDirs  stripdirs = StripRunDirs,
bool  fileMustExist = true 
)

public load root file <filename>, and copy MonitorElements; overwrite identical MonitorElements (default: true); set DQMStore.collateHistograms to true to sum several files note: by default this method strips off run dir structure

Definition at line 3004 of file DQMStore.cc.

References collateHistograms_, gather_cfg::cout, readFile(), readFilePB(), s_rxpbfile(), and verbose_.

Referenced by DQMFileReader::beginJob().

3007 {
3008  bool overwrite = true;
3009  if (collateHistograms_) overwrite = false;
3010  if (verbose_)
3011  {
3012  std::cout << "DQMStore::load: reading from file '" << filename << "'\n";
3013  if (collateHistograms_)
3014  std::cout << "DQMStore::load: in collate mode " << "\n";
3015  else
3016  std::cout << "DQMStore::load: in overwrite mode " << "\n";
3017  }
3018 
3019  if (!s_rxpbfile.match(filename, 0, 0))
3020  return readFile(filename, overwrite, "", "", stripdirs, fileMustExist);
3021  else
3022  return readFilePB(filename, overwrite, "", "", stripdirs, fileMustExist);
3023 }
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:3031
unsigned verbose_
Definition: DQMStore.h:831
static const lat::Regexp s_rxpbfile(".*\\.pb$")
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:3115
bool collateHistograms_
Definition: DQMStore.h:835
void DQMStore::makeDirectory ( const std::string &  path)
private

get folder corresponding to inpath wrt to root (create subdirs if necessary)

Definition at line 612 of file DQMStore.cc.

References dirs_, findObject(), dataset::name, raiseDQMError(), pickleFileParser::slash, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by initializeFrom(), mtEnabled(), readDirectory(), and setCurrentFolder().

613 {
614  std::string prev;
615  std::string subdir;
617  prev.reserve(path.size());
618  subdir.reserve(path.size());
619  name.reserve(path.size());
620  size_t prevname = 0;
621  size_t slash = 0;
622 
623  while (true)
624  {
625  // Create this subdirectory component.
626  subdir.clear();
627  subdir.append(path, 0, slash);
628  name.clear();
629  name.append(subdir, prevname, std::string::npos);
630  if (! prev.empty() && findObject(prev, name))
631  raiseDQMError("DQMStore", "Attempt to create subdirectory '%s'"
632  " which already exists as a monitor element",
633  subdir.c_str());
634 
635  if (! dirs_.count(subdir))
636  dirs_.insert(subdir);
637 
638  // Stop if we've reached the end (including possibly a trailing slash).
639  if (slash+1 >= path.size())
640  break;
641 
642  // Find the next slash, making sure we progress. If reach the end,
643  // process the last path component; the next loop round will terminate.
644  prevname = slash ? slash+1 : slash;
645  prev = subdir;
646  if ((slash = path.find('/', ++slash)) == std::string::npos)
647  slash = path.size();
648  }
649 }
MonitorElement * findObject(const std::string &dir, const std::string &name, const uint32_t run=0, const uint32_t lumi=0, const uint32_t moduleId=0) const
Definition: DQMStore.cc:1784
std::set< std::string > dirs_
Definition: DQMStore.h:846
void raiseDQMError(const char *context, const char *fmt,...)
Definition: DQMError.cc:11
template<typename iFunc >
void DQMStore::meBookerGetter ( iFunc  f)
inline
bool DQMStore::mtEnabled ( )
inline
bool DQMStore::open ( const std::string &  filename,
bool  overwrite = false,
const std::string &  onlypath = "",
const std::string &  prepend = "",
OpenRunDirs  stripdirs = KeepRunDirs,
bool  fileMustExist = true 
)

public open/read root file <filename>, and copy MonitorElements; if flag=true, overwrite identical MonitorElements (default: false); if onlypath != "", read only selected directory if prepend !="", prepend string to path note: by default this method keeps the dir structure as in file and does not update monitor element references!

Definition at line 2989 of file DQMStore.cc.

References readFile().

Referenced by SiStripCalibLorentzAngle::algoBeginJob(), DQMFileReader::beginJob(), edmtest::DQMReferenceHistogramRootFileEventSetupAnalyzer::beginRun(), EcalCondDBWriter::EcalCondDBWriter(), TauDQMFileLoader::endRun(), Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController::importConfig(), meBookerGetter(), PFDQMEventSelector::openInputFile(), SiStripOfflineDQM::openInputFile(), BuildTrackerMapPlugin::read(), readFilePB(), savePB(), and StatisticsFilter::StatisticsFilter().

2995 {
2996  return readFile(filename,overwrite,onlypath,prepend,stripdirs,fileMustExist);
2997 }
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:3031
const DQMStore& DQMStore::operator= ( const DQMStore )
private
void DQMStore::postGlobalBeginLumi ( const edm::GlobalContext gc)
private

Called after all globalBeginLuminosityBlock. Reset global per-lumi MEs (or all MEs if LSbasedMode) so that they can be reused.

Definition at line 1944 of file DQMStore.cc.

References begin, data_, MillePedeFileConverter_cfg::e, end, mps_fire::i, LSbasedMode_, edm::GlobalContext::luminosityBlockID(), MonitorElement::Reset(), findQualityFiles::run, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by DQMStore(), and mtEnabled().

1945 {
1946  static const std::string null_str("");
1947 
1948  auto const& lumiblock = gc.luminosityBlockID();
1949  uint32_t run = lumiblock.run();
1950 
1951  // find the range of non-legacy global MEs for the current run:
1952  // run != 0, lumi == 0 (implicit), stream id == 0, module id == 0
1953  const MonitorElement begin(&null_str, null_str, run, 0);
1954  const MonitorElement end(&null_str, null_str, run, 1);
1955  auto i = data_.lower_bound(begin);
1956  const auto e = data_.lower_bound(end);
1957  while (i != e) {
1958  auto& me = const_cast<MonitorElement&>(*i++);
1959  // skip per-run MEs
1960  if (not LSbasedMode_ and not me.getLumiFlag())
1961  continue;
1962  me.Reset();
1963  me.resetUpdate();
1964  }
1965 }
LuminosityBlockID const & luminosityBlockID() const
Definition: GlobalContext.h:57
#define end
Definition: vmac.h:39
void Reset()
reset ME (ie. contents, errors, etc)
MEMap data_
Definition: DQMStore.h:845
#define begin
Definition: vmac.h:32
bool LSbasedMode_
Definition: DQMStore.h:837
void DQMStore::print_trace ( const std::string &  dir,
const std::string &  name 
)
private

Definition at line 487 of file DQMStore.cc.

References mps_check::array, symbols::demangled, mps_fire::i, hcalDigis_cfi::level, funct::m, alignCSCRings::r, s_rxself(), s_rxtrace(), findQualityFiles::size, stream_, nano_cff::strings, and verbose_.

Referenced by book_(), and mtEnabled().

488 {
489  // the access to the member stream_ is implicitely protected against
490  // concurrency problems because the print_trace method is always called behind
491  // a lock (see bookTransaction).
492  if (!stream_)
493  stream_ = new std::ofstream("histogramBookingBT.log");
494 
495  void *array[10];
496  size_t size;
497  char **strings;
498  int r=0;
499  lat::RegexpMatch m;
500  m.reset();
501 
502  size = backtrace (array, 10);
503  strings = backtrace_symbols (array, size);
504 
505  size_t level = 1;
506  char * demangled = nullptr;
507  for (; level < size; level++) {
508  if (!s_rxtrace.match(strings[level], 0, 0, &m)) continue;
509  demangled = abi::__cxa_demangle(m.matchString(strings[level], 2).c_str(), nullptr, nullptr, &r);
510  if (!demangled) continue;
511  if (!s_rxself.match(demangled, 0, 0)) break;
512  free(demangled);
513  demangled = nullptr;
514  }
515 
516  if (demangled != nullptr) {
517  *stream_ << "\"" << dir << "/"
518  << name << "\" "
519  << (r ? m.matchString(strings[level], 2) : demangled) << " "
520  << m.matchString(strings[level], 1) << "\n";
521  free(demangled);
522  } else {
523  *stream_ << "Skipping "<< dir << "/" << name
524  << " with stack size " << size << "\n";
525  }
526 
527  /* In this case print the full stack trace, up to main or to the
528  * maximum stack size, i.e. 10. */
529  if (verbose_ > 4 || demangled == nullptr)
530  {
531  size_t i;
532  m.reset();
533 
534  for (i = 0; i < size; i++)
535  if (s_rxtrace.match(strings[i], 0, 0, &m))
536  {
537  char * demangled = abi::__cxa_demangle(m.matchString(strings[i], 2).c_str(), nullptr, nullptr, &r);
538  *stream_ << "\t\t" << i << "/" << size << " "
539  << (r ? m.matchString(strings[i], 2) : demangled) << " "
540  << m.matchString(strings[i], 1) << std::endl;
541  free (demangled);
542  }
543  }
544  free (strings);
545 }
size
Write out results.
static const lat::Regexp s_rxtrace("(.*)\\((.*)\\+0x.*\\).*")
static const lat::Regexp s_rxself("^[^()]*DQMStore::.*")
demangled
Definition: symbols.py:61
unsigned verbose_
Definition: DQMStore.h:831
std::ofstream * stream_
Definition: DQMStore.h:842
dbl *** dir
Definition: mlp_gen.cc:35
const std::string & DQMStore::pwd ( ) const
unsigned int DQMStore::readDirectory ( TFile *  file,
bool  overwrite,
const std::string &  onlypath,
const std::string &  prepend,
const std::string &  curdir,
OpenRunDirs  stripdirs 
)
private

read ROOT objects from file <file> in directory <onlypath>; return total # of ROOT objects read

Definition at line 2834 of file DQMStore.cc.

References collateHistograms_, KineDebug3::count(), gather_cfg::cout, extract(), isSubdirectory(), crabWrapper::key, makeDirectory(), GetRecoTauVFromDQM_MC_cff::next, GetRecoTauVFromDQM_MC_cff::obj, raiseDQMError(), s_collateDirName, s_monitorDirName, s_referenceDirName, createPayload::skip, pickleFileParser::slash, AlCaHLTBitMon_QueryRunRegistry::string, StripRunDirs, and verbose_.

Referenced by mtEnabled(), and readFile().

2840 {
2841  unsigned int ntot = 0;
2842  unsigned int count = 0;
2843 
2844  if (! file->cd(curdir.c_str()))
2845  raiseDQMError("DQMStore", "Failed to process directory '%s' while"
2846  " reading file '%s'", curdir.c_str(), file->GetName());
2847 
2848  // Figure out current directory name, but strip out the top
2849  // directory into which we dump everything.
2850  std::string dirpart = curdir;
2851  if (dirpart.compare(0, s_monitorDirName.size(), s_monitorDirName) == 0)
2852  {
2853  if (dirpart.size() == s_monitorDirName.size())
2854  dirpart.clear();
2855  else if (dirpart[s_monitorDirName.size()] == '/')
2856  dirpart.erase(0, s_monitorDirName.size()+1);
2857  }
2858 
2859  // See if we are going to skip this directory.
2860  bool skip = (! onlypath.empty() && ! isSubdirectory(onlypath, dirpart));
2861 
2862  if (prepend == s_collateDirName ||
2863  prepend == s_referenceDirName ||
2864  stripdirs == StripRunDirs )
2865  {
2866  // Remove Run # and RunSummary dirs
2867  // first look for Run summary,
2868  // if that is found and erased, also erase Run dir
2869  size_t slash = dirpart.find('/');
2870  size_t pos = dirpart.find("/Run summary");
2871  if (slash != std::string::npos && pos !=std::string::npos)
2872  {
2873  dirpart.erase(pos,12);
2874 
2875  pos = dirpart.find("Run ");
2876  size_t length = dirpart.find('/',pos+1)-pos+1;
2877  if (pos !=std::string::npos)
2878  dirpart.erase(pos,length);
2879  }
2880  }
2881 
2882  // If we are prepending, add it to the directory name,
2883  // and suppress reading of already existing reference histograms
2884  if (prepend == s_collateDirName ||
2885  prepend == s_referenceDirName)
2886  {
2887  size_t slash = dirpart.find('/');
2888  // If we are reading reference, skip previous reference.
2889  if (slash == std::string::npos // skip if Reference is toplevel folder, i.e. no slash
2890  && slash+1+s_referenceDirName.size() == dirpart.size()
2891  && dirpart.compare(slash+1, s_referenceDirName.size(), s_referenceDirName) == 0)
2892  return 0;
2893 
2894  slash = dirpart.find('/');
2895  // Skip reading of EventInfo subdirectory.
2896  if (slash != std::string::npos
2897  && slash + 10 == dirpart.size()
2898  && dirpart.compare( slash+1 , 9 , "EventInfo") == 0) {
2899  if (verbose_)
2900  std::cout << "DQMStore::readDirectory: skipping '" << dirpart << "'\n";
2901  return 0;
2902  }
2903 
2904  // Add prefix.
2905  if (dirpart.empty())
2906  dirpart = prepend;
2907  else
2908  dirpart = prepend + '/' + dirpart;
2909  }
2910  else if (! prepend.empty())
2911  {
2912  if (dirpart.empty())
2913  dirpart = prepend;
2914  else
2915  dirpart = prepend + '/' + dirpart;
2916  }
2917 
2918  // Loop over the contents of this directory in the file.
2919  // Post-pone string object handling to happen after other
2920  // objects have been read in so we are guaranteed to have
2921  // histograms by the time we read in quality tests and tags.
2922  TKey *key;
2923  TIter next (gDirectory->GetListOfKeys());
2924  std::list<TObject *> delayed;
2925  while ((key = (TKey *) next()))
2926  {
2927  std::unique_ptr<TObject> obj(key->ReadObj());
2928  if (dynamic_cast<TDirectory *>(obj.get()))
2929  {
2930  std::string subdir;
2931  subdir.reserve(curdir.size() + strlen(obj->GetName()) + 2);
2932  subdir += curdir;
2933  if (! curdir.empty())
2934  subdir += '/';
2935  subdir += obj->GetName();
2936 
2937  ntot += readDirectory(file, overwrite, onlypath, prepend, subdir, stripdirs);
2938  }
2939  else if (skip)
2940  ;
2941  else if (dynamic_cast<TObjString *>(obj.get()))
2942  {
2943  delayed.push_back(obj.release());
2944  }
2945  else
2946  {
2947  if (verbose_ > 2)
2948  std::cout << "DQMStore: reading object '" << obj->GetName()
2949  << "' of type '" << obj->IsA()->GetName()
2950  << "' from '" << file->GetName()
2951  << "' into '" << dirpart << "'\n";
2952 
2953  makeDirectory(dirpart);
2954  if (extract(obj.get(), dirpart, overwrite, collateHistograms_))
2955  ++count;
2956  }
2957  }
2958 
2959  while (! delayed.empty())
2960  {
2961  if (verbose_ > 2)
2962  std::cout << "DQMStore: reading object '" << delayed.front()->GetName()
2963  << "' of type '" << delayed.front()->IsA()->GetName()
2964  << "' from '" << file->GetName()
2965  << "' into '" << dirpart << "'\n";
2966 
2967  makeDirectory(dirpart);
2968  if (extract(delayed.front(), dirpart, overwrite, collateHistograms_))
2969  ++count;
2970 
2971  delete delayed.front();
2972  delayed.pop_front();
2973  }
2974 
2975  if (verbose_ > 1)
2976  std::cout << "DQMStore: read " << count << '/' << ntot
2977  << " objects from directory '" << dirpart << "'\n";
2978 
2979  return ntot + count;
2980 }
static const std::string s_collateDirName
Definition: DQMStore.cc:59
static const std::string s_monitorDirName
name of global monitoring folder (containing all sources subdirectories)
Definition: DQMStore.cc:57
static bool isSubdirectory(const std::string &ofdir, const std::string &path)
Definition: DQMStore.cc:73
unsigned verbose_
Definition: DQMStore.h:831
static const std::string s_referenceDirName
Definition: DQMStore.cc:58
unsigned int readDirectory(TFile *file, bool overwrite, const std::string &path, const std::string &prepend, const std::string &curdir, OpenRunDirs stripdirs)
Definition: DQMStore.cc:2834
bool extract(TObject *obj, const std::string &dir, bool overwrite, bool collateHistograms)
Definition: DQMStore.cc:2095
bool collateHistograms_
Definition: DQMStore.h:835
void makeDirectory(const std::string &path)
Definition: DQMStore.cc:612
void raiseDQMError(const char *context, const char *fmt,...)
Definition: DQMError.cc:11
bool DQMStore::readFile ( const std::string &  filename,
bool  overwrite = false,
const std::string &  onlypath = "",
const std::string &  prepend = "",
OpenRunDirs  stripdirs = StripRunDirs,
bool  fileMustExist = true 
)
private

private readFile <filename>, and copy MonitorElements; if flag=true, overwrite identical MonitorElements (default: false); if onlypath != "", read only selected directory if prepend !="", prepend string to path if StripRunDirs is set the run and run summary folders are erased.

Definition at line 3031 of file DQMStore.cc.

References gather_cfg::cout, data_, cppFunctionSkipper::exception, f, gen::n, raiseDQMError(), readDirectory(), and verbose_.

Referenced by initializeFrom(), load(), mtEnabled(), Vispa.Plugins.EventBrowser.EventBrowserTabController.EventBrowserTabController::navigate(), Vispa.Main.TabController.TabController::open(), open(), and Vispa.Main.TabController.TabController::refresh().

3037 {
3038 
3039  if (verbose_)
3040  std::cout << "DQMStore::readFile: reading from file '" << filename << "'\n";
3041 
3042  std::unique_ptr<TFile> f;
3043 
3044  try
3045  {
3046  f.reset(TFile::Open(filename.c_str()));
3047  if (! f.get() || f->IsZombie())
3048  raiseDQMError("DQMStore", "Failed to open file '%s'", filename.c_str());
3049  }
3050  catch (std::exception &)
3051  {
3052  if (fileMustExist)
3053  throw;
3054  else
3055  {
3056  if (verbose_)
3057  std::cout << "DQMStore::readFile: file '" << filename << "' does not exist, continuing\n";
3058  return false;
3059  }
3060  }
3061 
3062  unsigned n = readDirectory(f.get(), overwrite, onlypath, prepend, "", stripdirs);
3063  f->Close();
3064 
3065  auto mi = data_.begin();
3066  auto me = data_.end();
3067  for ( ; mi != me; ++mi)
3068  const_cast<MonitorElement &>(*mi).updateQReportStats();
3069 
3070  if (verbose_)
3071  {
3072  std::cout << "DQMStore::open: successfully read " << n
3073  << " objects from file '" << filename << "'";
3074  if (! onlypath.empty())
3075  std::cout << " from directory '" << onlypath << "'";
3076  if (! prepend.empty())
3077  std::cout << " into directory '" << prepend << "'";
3078  std::cout << std::endl;
3079  }
3080  return true;
3081 }
double f[11][100]
unsigned verbose_
Definition: DQMStore.h:831
MEMap data_
Definition: DQMStore.h:845
unsigned int readDirectory(TFile *file, bool overwrite, const std::string &path, const std::string &prepend, const std::string &curdir, OpenRunDirs stripdirs)
Definition: DQMStore.cc:2834
void raiseDQMError(const char *context, const char *fmt,...)
Definition: DQMError.cc:11
bool DQMStore::readFilePB ( const std::string &  filename,
bool  overwrite = false,
const std::string &  path = "",
const std::string &  prepend = "",
OpenRunDirs  stripdirs = StripRunDirs,
bool  fileMustExist = true 
)
private

Definition at line 3115 of file DQMStore.cc.

References cd(), gather_cfg::cout, MonitorElement::data_, DQMNet::DQM_PROP_LUMI, extract(), groupFilesInBlocks::fin, findObject(), DQMNet::CoreObject::flags, dqmstorepb::ROOTFilePB_Histo::flags(), get_info(), dqmstorepb::ROOTFilePB::histo(), dqmstorepb::ROOTFilePB::histo_size(), mps_fire::i, input, GetRecoTauVFromDQM_MC_cff::obj, open(), callgraph::path, raiseDQMError(), setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, and verbose_.

Referenced by load(), and mtEnabled().

3121 {
3122  using google::protobuf::io::FileInputStream;
3123  using google::protobuf::io::FileOutputStream;
3124  using google::protobuf::io::GzipInputStream;
3125  using google::protobuf::io::GzipOutputStream;
3126  using google::protobuf::io::CodedInputStream;
3127  using google::protobuf::io::ArrayInputStream;
3128 
3129  if (verbose_)
3130  std::cout << "DQMStore::readFile: reading from file '" << filename << "'\n";
3131 
3132  int filedescriptor;
3133  if ((filedescriptor = ::open(filename.c_str(), O_RDONLY)) == -1) {
3134  if (fileMustExist)
3135  raiseDQMError("DQMStore", "Failed to open file '%s'", filename.c_str());
3136  else
3137  if (verbose_)
3138  std::cout << "DQMStore::readFile: file '" << filename << "' does not exist, continuing\n";
3139  return false;
3140  }
3141 
3142  dqmstorepb::ROOTFilePB dqmstore_message;
3143  FileInputStream fin(filedescriptor);
3144  GzipInputStream input(&fin);
3145  CodedInputStream input_coded(&input);
3146  input_coded.SetTotalBytesLimit(1024*1024*1024, -1);
3147  if (!dqmstore_message.ParseFromCodedStream(&input_coded)) {
3148  raiseDQMError("DQMStore", "Fatal parsing file '%s'", filename.c_str());
3149  return false;
3150  }
3151  ::close(filedescriptor);
3152 
3153  for (int i = 0; i < dqmstore_message.histo_size(); i++) {
3154  std::string path;
3155  std::string objname;
3156 
3157  TObject *obj = nullptr;
3158  const dqmstorepb::ROOTFilePB::Histo &h = dqmstore_message.histo(i);
3159  get_info(h, path, objname, &obj);
3160 
3161  setCurrentFolder(path);
3162  if (obj)
3163  {
3164  /* Before calling the extract() check if histogram exists:
3165  * if it does - flags for the given monitor are already set (and merged)
3166  * else - set the flags after the histogram is created.
3167  */
3168  MonitorElement *me = findObject(path, objname);
3169 
3170  /* Run histograms should be collated and not overwritten,
3171  * Lumi histograms should be overwritten (and collate flag is not checked)
3172  */
3173  bool overwrite = h.flags() & DQMNet::DQM_PROP_LUMI;
3174  bool collate = !(h.flags() & DQMNet::DQM_PROP_LUMI);
3175  extract(static_cast<TObject *>(obj), path, overwrite, collate);
3176 
3177  if (me == nullptr) {
3178  me = findObject(path, objname);
3179  me->data_.flags = h.flags();
3180  }
3181 
3182  delete obj;
3183  }
3184  }
3185 
3186  cd();
3187  return true;
3188 }
uint32_t flags
Definition: DQMNet.h:99
static std::string const input
Definition: EdmProvDump.cc:44
void get_info(const dqmstorepb::ROOTFilePB_Histo &, std::string &dirname, std::string &objname, TObject **obj)
Definition: DQMStore.cc:3094
DQMNet::CoreObject data_
MonitorElement * findObject(const std::string &dir, const std::string &name, const uint32_t run=0, const uint32_t lumi=0, const uint32_t moduleId=0) const
Definition: DQMStore.cc:1784
void cd()
go to top directory (ie. root)
Definition: DQMStore.cc:565
const ::dqmstorepb::ROOTFilePB_Histo & histo(int index) const
unsigned verbose_
Definition: DQMStore.h:831
bool extract(TObject *obj, const std::string &dir, bool overwrite, bool collateHistograms)
Definition: DQMStore.cc:2095
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:2989
::google::protobuf::uint32 flags() const
static const uint32_t DQM_PROP_LUMI
Definition: DQMNet.h:61
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:588
void raiseDQMError(const char *context, const char *fmt,...)
Definition: DQMError.cc:11
void DQMStore::removeContents ( )

erase all monitoring elements in current directory (not including subfolders);

Definition at line 3230 of file DQMStore.cc.

References pwd_.

Referenced by meBookerGetter().

3231 {
3233 }
std::string pwd_
Definition: DQMStore.h:844
void removeContents()
erase all monitoring elements in current directory (not including subfolders);
Definition: DQMStore.cc:3230
void DQMStore::removeContents ( const std::string &  dir)

remove all monitoring elements from directory;

Definition at line 3216 of file DQMStore.cc.

References data_, MillePedeFileConverter_cfg::e, mps_fire::i, isSubdirectory(), and AlCaHLTBitMon_QueryRunRegistry::string.

3217 {
3218  MonitorElement proto(&dir, std::string());
3219  auto e = data_.end();
3220  auto i = data_.lower_bound(proto);
3221  while (i != e && isSubdirectory(dir, *i->data_.dirname))
3222  if (dir == *i->data_.dirname)
3223  data_.erase(i++);
3224  else
3225  ++i;
3226 }
static bool isSubdirectory(const std::string &ofdir, const std::string &path)
Definition: DQMStore.cc:73
MEMap data_
Definition: DQMStore.h:845
dbl *** dir
Definition: mlp_gen.cc:35
void DQMStore::removeElement ( const std::string &  name)

erase monitoring element in current directory (opposite of book1D,2D,etc. action);

Definition at line 3238 of file DQMStore.cc.

References pwd_.

Referenced by RPCBxTest::beginRun(), MonitorElementsDb::endJob(), DQMDcsInfoClient::endRun(), TrackerOfflineValidationSummary::fillTree(), and meBookerGetter().

3239 {
3241 }
void removeElement(const std::string &name)
Definition: DQMStore.cc:3238
std::string pwd_
Definition: DQMStore.h:844
void DQMStore::removeElement ( const std::string &  dir,
const std::string &  name,
bool  warning = true 
)

remove monitoring element from directory; if warning = true, print message if element does not exist

Definition at line 3246 of file DQMStore.cc.

References gather_cfg::cout, and data_.

3247 {
3248  MonitorElement proto(&dir, name);
3249  auto pos = data_.find(proto);
3250  if (pos != data_.end())
3251  data_.erase(pos);
3252  else if (warning) {
3253  std::cout << "DQMStore: WARNING: attempt to remove non-existent"
3254  << " monitor element '" << name << "' in '" << dir << "'\n";
3255  }
3256 }
MEMap data_
Definition: DQMStore.h:845
dbl *** dir
Definition: mlp_gen.cc:35
void DQMStore::reset ( void  )
private

Invoke this method after flushing all recently changed monitoring. Clears updated flag on all recently updated MEs and calls their Reset() method for those that have resetMe = true.

Definition at line 1895 of file DQMStore.cc.

References data_, MonitorElement::Reset(), and reset_.

Referenced by DQMService::flushStandalone(), and initializeFrom().

1896 {
1897  auto mi = data_.begin();
1898  auto me = data_.end();
1899  for ( ; mi != me; ++mi)
1900  {
1901  auto &me = const_cast<MonitorElement &>(*mi);
1902  if (mi->wasUpdated())
1903  {
1904  if (me.resetMe())
1905  me.Reset();
1906  me.resetUpdate();
1907  }
1908  }
1909 
1910  reset_ = true;
1911 }
bool reset_
Definition: DQMStore.h:833
void Reset()
reset ME (ie. contents, errors, etc)
MEMap data_
Definition: DQMStore.h:845
void DQMStore::rmdir ( const std::string &  path)

delete directory and all contents; delete directory (all contents + subfolders);

Definition at line 3196 of file DQMStore.cc.

References clean, cleanTrailingSlashes(), data_, dirs_, MillePedeFileConverter_cfg::e, mps_fire::i, isSubdirectory(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by dqmCopyRecursively(), and meBookerGetter().

3197 {
3199  const std::string *cleaned = nullptr;
3200  cleanTrailingSlashes(path, clean, cleaned);
3201  MonitorElement proto(cleaned, std::string());
3202 
3203  auto e = data_.end();
3204  auto i = data_.lower_bound(proto);
3205  while (i != e && isSubdirectory(*cleaned, *i->data_.dirname))
3206  data_.erase(i++);
3207 
3208  auto de = dirs_.end();
3209  auto di = dirs_.lower_bound(*cleaned);
3210  while (di != de && isSubdirectory(*cleaned, *di))
3211  dirs_.erase(di++);
3212 }
static void cleanTrailingSlashes(const std::string &path, std::string &clean, const std::string *&cleaned)
Definition: DQMStore.cc:83
static bool isSubdirectory(const std::string &ofdir, const std::string &path)
Definition: DQMStore.cc:73
std::vector< T * > clean
Definition: MVATrainer.cc:156
MEMap data_
Definition: DQMStore.h:845
std::set< std::string > dirs_
Definition: DQMStore.h:846
void DQMStore::runQTests ( )

run quality tests (also finds updated contents in last monitoring cycle, including newly added content)

Definition at line 3349 of file DQMStore.cc.

References gather_cfg::cout, data_, isSubdirectory(), reset_, MonitorElement::runQTests(), s_referenceDirName, and verbose_.

Referenced by mtEnabled().

3350 {
3351 
3352  if (verbose_ > 0)
3353  std::cout << "DQMStore: running runQTests() with reset = "
3354  << ( reset_ ? "true" : "false" ) << std::endl;
3355 
3356  // Apply quality tests to each monitor element, skipping references.
3357  auto mi = data_.begin();
3358  auto me = data_.end();
3359  for ( ; mi != me; ++mi)
3360  if (! isSubdirectory(s_referenceDirName, *mi->data_.dirname))
3361  const_cast<MonitorElement &>(*mi).runQTests();
3362 
3363  reset_ = false;
3364 }
bool reset_
Definition: DQMStore.h:833
static bool isSubdirectory(const std::string &ofdir, const std::string &path)
Definition: DQMStore.cc:73
void runQTests()
run all quality tests
unsigned verbose_
Definition: DQMStore.h:831
MEMap data_
Definition: DQMStore.h:845
static const std::string s_referenceDirName
Definition: DQMStore.cc:58
void DQMStore::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" 
)

save directory with monitoring objects into protobuf file <filename>; if directory="", save full monitoring structure

Definition at line 2555 of file DQMStore.cc.

References begin, book_mutex_, cdInto(), gather_cfg::cout, data_, dir, dirs_, enableMultiThread_, end, f, FrontierConditions_GlobalTag_cff::file, isSubdirectory(), LSbasedMode_, callgraph::path, raiseDQMError(), python.rootplot.root2matplotlib::replace(), s_monitorDirName, s_referenceDirName, saveMonitorElementRangeToROOT(), MonitorElement::setLumi(), AlCaHLTBitMon_QueryRunRegistry::string, and verbose_.

Referenced by Vispa.Main.TabController.TabController::allowClose(), CalibrationScanTask::checkAndSave(), CalibrationTask::checkAndSave(), Vispa.Main.TabController.TabController::checkModificationTimestamp(), doSaveForOnline(), TauDQMSimpleFileSaver::endJob(), TrackingTruthValid::endJob(), SiStripDigiValid::endJob(), SiPixelDigiValid::endJob(), LaserDQM::endJob(), SiStripLAProfileBooker::endJob(), dEdxAnalyzer::endJob(), TrackerHitAnalyzer::endJob(), StripValidationPlots::endJob(), TrackEfficiencyMonitor::endJob(), APVValidationPlots::endJob(), LogMessageMonitor::endJob(), MuonAlignment::endJob(), SiStripMonitorQuality::endRun(), SiStripMonitorRawData::endRun(), SiStripMonitorPedestals::endRun(), SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy::extractBadAPVSandStrips(), TkHistoMap::save(), DQMFileSaver::saveForFilterUnit(), DQMFileSaver::saveForOffline(), GlobalHitsProdHistStripper::~GlobalHitsProdHistStripper(), and SiPixelTrackingRecHitsValid::~SiPixelTrackingRecHitsValid().

2564 {
2565  // TFile flushes to disk with fsync() on every TDirectory written to
2566  // the file. This makes DQM file saving painfully slow, and
2567  // ironically makes it _more_ likely the file saving gets
2568  // interrupted and corrupts the file. The utility class below
2569  // simply ignores the flush synchronisation.
2570  class TFileNoSync : public TFile
2571  {
2572  public:
2573  TFileNoSync(const char *file, const char *opt) : TFile(file, opt) {}
2574  Int_t SysSync(Int_t) override { return 0; }
2575  };
2576 
2577  std::lock_guard<std::mutex> guard(book_mutex_);
2578 
2579  unsigned int nme = 0;
2580 
2581  // open output file, on 1st save recreate, later update
2582  if (verbose_) {
2583  std::cout << "DQMStore::save: Opening TFile '" << filename
2584  << "' with option '" << fileupdate << "'"
2585  << std::endl;
2586  }
2587 
2588  TFileNoSync f(filename.c_str(), fileupdate.c_str()); // open file
2589  if(f.IsZombie())
2590  raiseDQMError("DQMStore", "Failed to create/update file '%s'", filename.c_str());
2591  f.cd();
2592 
2593  // Construct a regular expression from the pattern string.
2594  std::unique_ptr<lat::Regexp> rxpat;
2595  if (not pattern.empty())
2596  rxpat = std::make_unique<lat::Regexp>(pattern);
2597 
2598  // Prepare a path for the reference object selection.
2599  std::string refpath;
2600  refpath.reserve(s_referenceDirName.size() + path.size() + 2);
2601  refpath += s_referenceDirName;
2602  if (not path.empty())
2603  {
2604  refpath += '/';
2605  refpath += path;
2606  }
2607 
2608  // Loop over the directory structure.
2609  for (auto const& dir: dirs_)
2610  {
2611  // Check if we should process this directory. We process the
2612  // requested part of the object tree, including references.
2613  if (not path.empty()
2614  and not isSubdirectory(refpath, dir)
2615  and not isSubdirectory(path, dir))
2616  continue;
2617 
2618  if (verbose_ > 1) {
2619  std::cout << "DQMStore::save: DQM folder " << dir << "/" << std::endl;
2620  }
2621 
2622  // Create the directory.
2623  gDirectory->cd("/");
2624  if (dir.empty())
2626  else if (rxpat.get())
2627  cdInto(s_monitorDirName + '/' + lat::StringOps::replace(dir, *rxpat, rewrite));
2628  else
2629  cdInto(s_monitorDirName + '/' + dir);
2630 
2631  // Loop over monitor elements in this directory.
2632  if (not enableMultiThread_) {
2633  MonitorElement proto(&dir, std::string(), run, 0);
2634  auto begin = data_.lower_bound(proto);
2635  auto end = data_.end();
2636  saveMonitorElementRangeToROOT(dir, refpath, ref, minStatus, run, begin, end, f, nme);
2637  } else {
2638  // Restrict the loop to the monitor elements for the current lumisection
2639  MonitorElement proto(&dir, std::string(), run, 0);
2640  proto.setLumi(lumi);
2641  auto begin = data_.lower_bound(proto);
2642  proto.setLumi(lumi+1);
2643  auto end = data_.lower_bound(proto);
2644  saveMonitorElementRangeToROOT(dir, refpath, ref, minStatus, run, begin, end, f, nme);
2645  }
2646 
2647  // In LSbasedMode, loop also over the (run, 0) global histograms;
2648  // these could be the merged global histrograms of their per-stream
2649  // counterparts after the streamEndRun transition - but they are not
2650  // produced in LSbasedMode.
2651  if (enableMultiThread_ and LSbasedMode_ and lumi != 0) {
2652  auto begin = data_.lower_bound(MonitorElement(&dir, std::string(), run, 0));
2653  auto end = data_.lower_bound(MonitorElement(&dir, std::string(), run, 1));
2654  saveMonitorElementRangeToROOT(dir, refpath, ref, minStatus, run, begin, end, f, nme);
2655  }
2656  }
2657 
2658  f.Close();
2659 
2660  // Maybe make some noise.
2661  if (verbose_) {
2662  std::cout << "DQMStore::save: successfully wrote " << nme
2663  << " objects from path '" << path << "/"
2664  << "' into DQM file '" << filename << "'\n";
2665  }
2666 }
bool cdInto(const std::string &path) const
Definition: DQMStore.cc:2396
def replace(string, replacements)
static const std::string s_monitorDirName
name of global monitoring folder (containing all sources subdirectories)
Definition: DQMStore.cc:57
std::mutex book_mutex_
Definition: DQMStore.h:852
void saveMonitorElementRangeToROOT(std::string const &dir, std::string const &refpath, SaveReferenceTag ref, int minStatus, unsigned int run, MEMap::const_iterator begin, MEMap::const_iterator end, TFile &file, unsigned int &counter)
Definition: DQMStore.cc:2470
static bool isSubdirectory(const std::string &ofdir, const std::string &path)
Definition: DQMStore.cc:73
double f[11][100]
#define end
Definition: vmac.h:39
unsigned verbose_
Definition: DQMStore.h:831
MEMap data_
Definition: DQMStore.h:845
static const std::string s_referenceDirName
Definition: DQMStore.cc:58
#define begin
Definition: vmac.h:32
if(dp >Float(M_PI)) dp-
dbl *** dir
Definition: mlp_gen.cc:35
std::set< std::string > dirs_
Definition: DQMStore.h:846
bool LSbasedMode_
Definition: DQMStore.h:837
bool enableMultiThread_
Definition: DQMStore.h:836
void raiseDQMError(const char *context, const char *fmt,...)
Definition: DQMError.cc:11
void DQMStore::saveMonitorElementRangeToPB ( std::string const &  dir,
unsigned int  run,
MEMap::const_iterator  begin,
MEMap::const_iterator  end,
dqmstorepb::ROOTFilePB file,
unsigned int &  counter 
)
private

Definition at line 2698 of file DQMStore.cc.

References counter, gather_cfg::cout, isSubdirectory(), saveMonitorElementToPB(), and verbose_.

Referenced by savePB().

2705 {
2706  for (auto const& me: boost::make_iterator_range(begin, end))
2707  {
2708  if (not isSubdirectory(dir, *me.data_.dirname))
2709  break;
2710 
2711  if (verbose_ > 1)
2712  std::cout << "DQMStore::savePB:"
2713  << " run: " << me.run()
2714  << " lumi: " << me.lumi()
2715  << " lumiFlag: " << me.getLumiFlag()
2716  << " moduleId: " << me.moduleId()
2717  << " fullpathname: " << me.getFullname()
2718  << " flags: " << std::hex << me.data_.flags
2719  << std::endl;
2720 
2721  // Skip MonitorElements in a subdirectory of the current one.
2722  if (dir != *me.data_.dirname) {
2723  if (verbose_ > 1) {
2724  std::cout << "DQMStore::savePB: skipping monitor element in a subfolder of " << dir << "/" << std::endl;
2725  }
2726  continue;
2727  }
2728 
2729  // Handle reference histograms, with three distinct cases:
2730  // XXX not supported by protobuf files.
2731 
2732  if (verbose_ > 1) {
2733  std::cout << "DQMStore::savePB: saving monitor element" << std::endl;
2734  }
2735 
2736  saveMonitorElementToPB(me, file);
2737 
2738  // Count saved histograms
2739  ++counter;
2740  }
2741 }
static bool isSubdirectory(const std::string &ofdir, const std::string &path)
Definition: DQMStore.cc:73
#define end
Definition: vmac.h:39
void saveMonitorElementToPB(MonitorElement const &me, dqmstorepb::ROOTFilePB &file)
Definition: DQMStore.cc:2669
unsigned verbose_
Definition: DQMStore.h:831
#define begin
Definition: vmac.h:32
static std::atomic< unsigned int > counter
dbl *** dir
Definition: mlp_gen.cc:35
void DQMStore::saveMonitorElementRangeToROOT ( std::string const &  dir,
std::string const &  refpath,
SaveReferenceTag  ref,
int  minStatus,
unsigned int  run,
MEMap::const_iterator  begin,
MEMap::const_iterator  end,
TFile &  file,
unsigned int &  counter 
)
private

Definition at line 2470 of file DQMStore.cc.

References counter, gather_cfg::cout, MillePedeFileConverter_cfg::e, mps_fire::i, isSubdirectory(), funct::master(), SiStripPI::max, or, s_referenceDirName, saveMonitorElementToROOT(), SaveWithoutReference, SaveWithReference, SaveWithReferenceForQTest, mps_update::status, AlCaHLTBitMon_QueryRunRegistry::string, and verbose_.

Referenced by save().

2480 {
2481  for (auto const& me: boost::make_iterator_range(begin, end))
2482  {
2483  if (not isSubdirectory(dir, *me.data_.dirname))
2484  break;
2485 
2486  if (verbose_ > 1)
2487  std::cout << "DQMStore::save:"
2488  << " run: " << me.run()
2489  << " lumi: " << me.lumi()
2490  << " lumiFlag: " << me.getLumiFlag()
2491  << " moduleId: " << me.moduleId()
2492  << " fullpathname: " << me.getFullname()
2493  << " flags: " << std::hex << me.data_.flags
2494  << std::endl;
2495 
2496  // Skip MonitorElements in a subdirectory of the current one.
2497  if (dir != *me.data_.dirname) {
2498  if (verbose_ > 1) {
2499  std::cout << "DQMStore::save: skipping monitor element in a subfolder of " << dir << "/" << std::endl;
2500  }
2501  continue;
2502  }
2503 
2504  // Handle reference histograms, with three distinct cases:
2505  // 1) Skip all references entirely on saving.
2506  // 2) Blanket saving of all references.
2507  // 3) Save only references for monitor elements with qtests.
2508  // The latter two are affected by "path" sub-tree selection,
2509  // i.e. references are saved only in the selected tree part.
2510  if (isSubdirectory(refpath, *me.data_.dirname))
2511  {
2512  if (ref == SaveWithoutReference)
2513  // Skip the reference entirely.
2514  continue;
2515  else if (ref == SaveWithReference)
2516  // Save all references regardless of qtests.
2517  ;
2518  else if (ref == SaveWithReferenceForQTest)
2519  {
2520  // Save only references for monitor elements with qtests
2521  // with an optional cut on minimum quality test result.
2522  int status = -1;
2523  std::string mname(me.getFullname(), s_referenceDirName.size()+1, std::string::npos);
2524  MonitorElement *master = get(mname);
2525  if (master)
2526  for (size_t i = 0, e = master->data_.qreports.size(); i != e; ++i)
2527  status = std::max(status, master->data_.qreports[i].code);
2528 
2529  if (not master or status < minStatus)
2530  {
2531  if (verbose_ > 1)
2532  std::cout << "DQMStore::save: skipping monitor element '"
2533  << me.data_.objname << "' while saving, status is "
2534  << status << ", required minimum status is "
2535  << minStatus << std::endl;
2536  continue;
2537  }
2538  }
2539  }
2540 
2541  if (verbose_ > 1) {
2542  std::cout << "DQMStore::save: saving monitor element" << std::endl;
2543  }
2544 
2546 
2547  // Count saved histograms
2548  ++counter;
2549  }
2550 }
Master< F > master(const F &f)
Definition: FunctClone.h:68
static bool isSubdirectory(const std::string &ofdir, const std::string &path)
Definition: DQMStore.cc:73
void saveMonitorElementToROOT(MonitorElement const &me, TFile &file)
Definition: DQMStore.cc:2439
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
#define end
Definition: vmac.h:39
unsigned verbose_
Definition: DQMStore.h:831
static const std::string s_referenceDirName
Definition: DQMStore.cc:58
#define begin
Definition: vmac.h:32
static std::atomic< unsigned int > counter
dbl *** dir
Definition: mlp_gen.cc:35
void DQMStore::saveMonitorElementToPB ( MonitorElement const &  me,
dqmstorepb::ROOTFilePB file 
)
private

Definition at line 2669 of file DQMStore.cc.

References dqmstorepb::ROOTFilePB::add_histo(), edmScanValgrind::buffer, MonitorElement::data_, DQMNet::CoreObject::dirname, MonitorElement::DQM_KIND_TH1F, DQMNet::CoreObject::flags, trackerHits::histo, MonitorElement::kind(), resolutioncreator_cfi::object, MonitorElement::object_, DQMNet::CoreObject::objname, dqmstorepb::ROOTFilePB_Histo::set_flags(), dqmstorepb::ROOTFilePB_Histo::set_full_pathname(), dqmstorepb::ROOTFilePB_Histo::set_size(), dqmstorepb::ROOTFilePB_Histo::set_streamed_histo(), and MonitorElement::tagString().

Referenced by saveMonitorElementRangeToPB().

2672 {
2673  // Save the object.
2674  TBufferFile buffer(TBufferFile::kWrite);
2675  if (me.kind() < MonitorElement::DQM_KIND_TH1F) {
2676  TObjString object(me.tagString().c_str());
2677  buffer.WriteObject(&object);
2678  } else {
2679  buffer.WriteObject(me.object_);
2680  }
2682  histo.set_full_pathname(*me.data_.dirname + '/' + me.data_.objname);
2683  histo.set_flags(me.data_.flags);
2684  histo.set_size(buffer.Length());
2685  histo.set_streamed_histo((const void*)buffer.Buffer(), buffer.Length());
2686 
2687  // Save quality reports if this is not in reference section.
2688  // XXX not supported by protobuf files.
2689 
2690  // Save efficiency tag, if any.
2691  // XXX not supported by protobuf files.
2692 
2693  // Save tag if any.
2694  // XXX not supported by protobuf files.
2695 }
void set_flags(::google::protobuf::uint32 value)
void set_size(::google::protobuf::uint32 value)
void set_full_pathname(const ::std::string &value)
::dqmstorepb::ROOTFilePB_Histo * add_histo()
void set_streamed_histo(const ::std::string &value)
void DQMStore::saveMonitorElementToROOT ( MonitorElement const &  me,
TFile &  file 
)
private

Definition at line 2439 of file DQMStore.cc.

References MonitorElement::data_, DQMNet::CoreObject::dirname, MonitorElement::DQM_KIND_TH1F, DQMNet::DQM_PROP_EFFICIENCY_PLOT, DQMNet::DQM_PROP_TAGGED, MonitorElement::effLabelString(), DQMNet::CoreObject::flags, isSubdirectory(), MonitorElement::kind(), MonitorElement::object_, DQMNet::CoreObject::qreports, MonitorElement::qualityTagString(), edmIntegrityCheck::report, s_referenceDirName, MonitorElement::tagLabelString(), and MonitorElement::tagString().

Referenced by saveMonitorElementRangeToROOT().

2442 {
2443  // Save the object.
2444  if (me.kind() < MonitorElement::DQM_KIND_TH1F) {
2445  TObjString(me.tagString().c_str()).Write();
2446  } else {
2447  me.object_->Write();
2448  }
2449 
2450  // Save quality reports if this is not in reference section.
2451  if (not isSubdirectory(s_referenceDirName, *me.data_.dirname))
2452  {
2453  for (auto const& report: me.data_.qreports) {
2454  TObjString(me.qualityTagString(report).c_str()).Write();
2455  }
2456  }
2457 
2458  // Save efficiency tag, if any.
2459  if (me.data_.flags & DQMNet::DQM_PROP_EFFICIENCY_PLOT) {
2460  TObjString(me.effLabelString().c_str()).Write();
2461  }
2462 
2463  // Save tag if any.
2464  if (me.data_.flags & DQMNet::DQM_PROP_TAGGED) {
2465  TObjString(me.tagLabelString().c_str()).Write();
2466  }
2467 }
static const uint32_t DQM_PROP_TAGGED
Definition: DQMNet.h:55
static const uint32_t DQM_PROP_EFFICIENCY_PLOT
Definition: DQMNet.h:64
static bool isSubdirectory(const std::string &ofdir, const std::string &path)
Definition: DQMStore.cc:73
static const std::string s_referenceDirName
Definition: DQMStore.cc:58
void DQMStore::savePB ( const std::string &  filename,
const std::string &  path = "",
const uint32_t  run = 0,
const uint32_t  lumi = 0 
)

save directory with monitoring objects into protobuf file <filename>; if directory="", save full monitoring structure

Definition at line 2746 of file DQMStore.cc.

References begin, book_mutex_, gather_cfg::cout, data_, dir, dirs_, enableMultiThread_, end, isSubdirectory(), LSbasedMode_, open(), AlcaSiPixelAliHarvester0T_cff::options, saveMonitorElementRangeToPB(), MonitorElement::setLumi(), AlCaHLTBitMon_QueryRunRegistry::string, and verbose_.

Referenced by doSaveForOnline(), meBookerGetter(), DQMFileSaver::saveForFilterUnit(), and DQMFileSaver::saveForOfflinePB().

2750 {
2751  using google::protobuf::io::FileOutputStream;
2752  using google::protobuf::io::GzipOutputStream;
2753  using google::protobuf::io::StringOutputStream;
2754 
2755  std::lock_guard<std::mutex> guard(book_mutex_);
2756 
2757  unsigned int nme = 0;
2758 
2759  if (verbose_) {
2760  std::cout << "DQMStore::savePB: Opening PBFile '" << filename << "'"
2761  << std::endl;
2762  }
2763  dqmstorepb::ROOTFilePB dqmstore_message;
2764 
2765  // Loop over the directory structure.
2766  for (auto const& dir: dirs_)
2767  {
2768  // Check if we should process this directory. We process the
2769  // requested part of the object tree, including references.
2770  if (not path.empty()
2771  and not isSubdirectory(path, dir))
2772  continue;
2773 
2774  if (verbose_ > 1) {
2775  std::cout << "DQMStore::savePB: DQM folder " << dir << "/" << std::endl;
2776  }
2777 
2778  // Loop over monitor elements in this directory.
2779  if (not enableMultiThread_) {
2780  MonitorElement proto(&dir, std::string(), run, 0);
2781  auto begin = data_.lower_bound(proto);
2782  auto end = data_.end();
2783  saveMonitorElementRangeToPB(dir, run, begin, end, dqmstore_message, nme);
2784  } else {
2785  // Restrict the loop to the monitor elements for the current lumisection
2786  MonitorElement proto(&dir, std::string(), run, 0);
2787  proto.setLumi(lumi);
2788  auto begin = data_.lower_bound(proto);
2789  proto.setLumi(lumi+1);
2790  auto end = data_.lower_bound(proto);
2791  saveMonitorElementRangeToPB(dir, run, begin, end, dqmstore_message, nme);
2792  }
2793 
2794  // In LSbasedMode, loop also over the (run, 0) global histograms;
2795  // these could be the merged global histrograms of their per-stream
2796  // counterparts after the streamEndRun transition - but they are not
2797  // produced in LSbasedMode.
2798  if (enableMultiThread_ and LSbasedMode_ and lumi != 0) {
2799  auto begin = data_.lower_bound(MonitorElement(&dir, std::string(), run, 0));
2800  auto end = data_.lower_bound(MonitorElement(&dir, std::string(), run, 1));
2801  saveMonitorElementRangeToPB(dir, run, begin, end, dqmstore_message, nme);
2802  }
2803  }
2804 
2805  int filedescriptor = ::open(filename.c_str(),
2806  O_WRONLY | O_CREAT | O_TRUNC,
2807  S_IRUSR | S_IWUSR |
2808  S_IRGRP | S_IWGRP |
2809  S_IROTH);
2810  FileOutputStream file_stream(filedescriptor);
2812  options.format = GzipOutputStream::GZIP;
2813  options.compression_level = 1;
2814  GzipOutputStream gzip_stream(&file_stream, options);
2815  dqmstore_message.SerializeToZeroCopyStream(&gzip_stream);
2816 
2817  // Flush the internal streams before closing the fd.
2818  gzip_stream.Close();
2819  file_stream.Close();
2820  ::close(filedescriptor);
2821 
2822  // Maybe make some noise.
2823  if (verbose_) {
2824  std::cout << "DQMStore::savePB: successfully wrote " << nme
2825  << " objects from path '" << path << "/"
2826  << "' into DQM file '" << filename << "'\n";
2827  }
2828 }
std::mutex book_mutex_
Definition: DQMStore.h:852
static bool isSubdirectory(const std::string &ofdir, const std::string &path)
Definition: DQMStore.cc:73
std::vector< std::shared_ptr< fireworks::OptionNode > > Options
void saveMonitorElementRangeToPB(std::string const &dir, unsigned int run, MEMap::const_iterator begin, MEMap::const_iterator end, dqmstorepb::ROOTFilePB &file, unsigned int &counter)
Definition: DQMStore.cc:2698
#define end
Definition: vmac.h:39
unsigned verbose_
Definition: DQMStore.h:831
MEMap data_
Definition: DQMStore.h:845
#define begin
Definition: vmac.h:32
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:2989
dbl *** dir
Definition: mlp_gen.cc:35
std::set< std::string > dirs_
Definition: DQMStore.h:846
bool LSbasedMode_
Definition: DQMStore.h:837
bool enableMultiThread_
Definition: DQMStore.h:836
void DQMStore::scaleElements ( )

Invoke this method after flushing all recently changed monitoring. Clears updated flag on all MEs and calls their Reset() method.

Definition at line 3465 of file DQMStore.cc.

References gather_cfg::cout, data_, dirExists(), MonitorElement::DQM_KIND_INT, MonitorElement::DQM_KIND_REAL, MonitorElement::DQM_KIND_TH1D, MonitorElement::DQM_KIND_TH1F, MonitorElement::DQM_KIND_TH1S, MonitorElement::DQM_KIND_TH2D, MonitorElement::DQM_KIND_TH2F, MonitorElement::DQM_KIND_TH2S, MonitorElement::DQM_KIND_TH3F, MonitorElement::DQM_KIND_TPROFILE, MonitorElement::DQM_KIND_TPROFILE2D, PatBasicFWLiteAnalyzer::events, MonitorElement::getFloatValue(), MonitorElement::getIntValue(), MonitorElement::kind(), scaleFlag_, and verbose_.

Referenced by mtEnabled().

3466 {
3467  if (scaleFlag_ == 0.0) return;
3468  if (verbose_ > 0)
3469  std::cout << " =========== " << " ScaleFlag " << scaleFlag_ << std::endl;
3470  double factor = scaleFlag_;
3471  int events = 1;
3472  if (dirExists("Info/EventInfo")) {
3473  if ( scaleFlag_ == -1.0) {
3474  MonitorElement * scale_me = get("Info/EventInfo/ScaleFactor");
3475  if (scale_me && scale_me->kind()==MonitorElement::DQM_KIND_REAL) factor = scale_me->getFloatValue();
3476  }
3477  MonitorElement * event_me = get("Info/EventInfo/processedEvents");
3478  if (event_me && event_me->kind()==MonitorElement::DQM_KIND_INT) events = event_me->getIntValue();
3479  }
3480  factor = factor/(events*1.0);
3481 
3482  auto mi = data_.begin();
3483  auto me = data_.end();
3484  for ( ; mi != me; ++mi)
3485  {
3486  auto &me = const_cast<MonitorElement &>(*mi);
3487  switch (me.kind())
3488  {
3490  {
3491  me.getTH1F()->Scale(factor);
3492  break;
3493  }
3495  {
3496  me.getTH1S()->Scale(factor);
3497  break;
3498  }
3500  {
3501  me.getTH1D()->Scale(factor);
3502  break;
3503  }
3505  {
3506  me.getTH2F()->Scale(factor);
3507  break;
3508  }
3510  {
3511  me.getTH2S()->Scale(factor);
3512  break;
3513  }
3515  {
3516  me.getTH2D()->Scale(factor);
3517  break;
3518  }
3520  {
3521  me.getTH3F()->Scale(factor);
3522  break;
3523  }
3525  {
3526  me.getTProfile()->Scale(factor);
3527  break;
3528  }
3530  {
3531  me.getTProfile2D()->Scale(factor);
3532  break;
3533  }
3534  default:
3535  if (verbose_ > 0)
3536  std::cout << " The DQM object '" << me.getFullname() << "' is not scalable object " << std::endl;
3537  continue;
3538  }
3539  }
3540 }
int64_t getIntValue() const
double getFloatValue() const
double scaleFlag_
Definition: DQMStore.h:834
bool dirExists(const std::string &path) const
true if directory exists
Definition: DQMStore.cc:653
unsigned verbose_
Definition: DQMStore.h:831
MEMap data_
Definition: DQMStore.h:845
Kind kind() const
Get the type of the monitor element.
void DQMStore::setAccumulate ( MonitorElement me,
bool  flag 
)
private

if true, will accumulate ME contents (over many periods) until method is called with flag = false again

Definition at line 3418 of file DQMStore.cc.

References MonitorElement::setAccumulate().

Referenced by mtEnabled().

3419 {
3420  if (me)
3421  me->setAccumulate(flag);
3422 }
void setAccumulate(bool)
void DQMStore::setCurrentFolder ( const std::string &  fullpath)

set the last directory in fullpath as the current directory(create if needed); to be invoked by user to specify directories for monitoring objects before booking; commands book1D (etc) & removeElement(name) imply elements in this directory!;

Definition at line 588 of file DQMStore.cc.

References clean, cleanTrailingSlashes(), makeDirectory(), pwd_, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by SiStripDcsInfo::addBadModules(), DQMFileReader::beginJob(), DQMFEDIntegrityClient::beginJob(), L1ScalersClient::beginJob(), ConverterTester::beginJob(), APVValidationPlots::beginJob(), StripValidationPlots::beginJob(), DQMDaqInfo::beginJob(), MuonAlignment::beginJob(), HLTScalersClient::beginJob(), RPCBxTest::beginRun(), DQMDcsInfoClient::beginRun(), CalibrationScanTask::book(), CalibrationTask::book(), FineDelayTask::book(), LatencyTask::book(), hcaldqm::ContainerSingleProf1D::book(), hcaldqm::ContainerSingleProf2D::book(), hcaldqm::ContainerSingle1D::book(), hcaldqm::ContainerProf1D::book(), hcaldqm::ContainerProf2D::book(), hcaldqm::ContainerSingle2D::book(), MEtoMEComparitor::book(), hcaldqm::Container2D::book(), hcaldqm::Container1D::book(), TrackerOfflineValidationSummary::bookHarvestingHists(), PixelVTXMonitor::bookHistograms(), DQMLumiMonitor::bookHistograms(), DQMStore::IBooker::bookProfile2D(), SiStripCertificationInfo::bookSiStripCertificationMEs(), SiStripQualityChecker::bookStatus(), SiStripDaqInfo::bookStatus(), SiStripDcsInfo::bookStatus(), cd(), dqmCopyRecursively(), HarvestingAnalyzer::endJob(), HLTScalersClient::endLuminosityBlock(), DQMDcsInfoClient::endRun(), TauDQMFileLoader::endRun(), GlobalHitsProdHistStripper::endRun(), SiStripQualityChecker::fillFaultyModuleStatus(), SiStripQualityDQM::fillGrandSummaryMEs(), TrackerOfflineValidationSummary::fillTree(), SiStripDaqInfo::findExcludedModule(), EgHLTOfflineSummaryClient::getEgHLTSumHist_(), goUp(), HLTScalersClient::HLTScalersClient(), SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy::initializeDQMHistograms(), LaserDQM::initMonitors(), L1ScalersClient::L1ScalersClient(), meBookerGetter(), MonitorElementsDb::MonitorElementsDb(), readFilePB(), DQMStore::IGetter::removeElement(), EgHLTOfflineSummaryClient::runClient_(), DQMFileSaver::saveForOffline(), SiStripFolderOrganizer::setDetectorFolder(), SiPixelFolderOrganizer::setFedFolder(), SiStripFolderOrganizer::setLayerFolder(), SiPixelFolderOrganizer::setModuleFolder(), SiStripFolderOrganizer::setSiStripControlFolder(), SiStripFolderOrganizer::setSiStripFolder(), and SiStripFolderOrganizer::setSiStripTopControlFolder().

589 {
591  const std::string *cleaned = nullptr;
592  cleanTrailingSlashes(fullpath, clean, cleaned);
593  makeDirectory(*cleaned);
594  pwd_ = *cleaned;
595 }
static void cleanTrailingSlashes(const std::string &path, std::string &clean, const std::string *&cleaned)
Definition: DQMStore.cc:83
std::string pwd_
Definition: DQMStore.h:844
std::vector< T * > clean
Definition: MVATrainer.cc:156
void makeDirectory(const std::string &path)
Definition: DQMStore.cc:612
void DQMStore::setVerbose ( unsigned  level)

set verbose level (0 turns all non-error messages off)

Definition at line 552 of file DQMStore.cc.

References AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by TrackerHitAnalyzer::bookHistograms(), GlobalHitsProdHistStripper::GlobalHitsProdHistStripper(), HLTScalersClient::HLTScalersClient(), and meBookerGetter().

553 { return; }
void DQMStore::showDirStructure ( ) const

Definition at line 3428 of file DQMStore.cc.

References relmon_rootfiles_spy::contents, popcon2dropbox::copy(), gather_cfg::cout, and getContents().

Referenced by TrackerHitAnalyzer::bookHistograms(), EcalBarrelMonitorDbModule::EcalBarrelMonitorDbModule(), dEdxAnalyzer::endJob(), TrackEfficiencyMonitor::endJob(), LogMessageMonitor::endJob(), HLTScalersClient::endLuminosityBlock(), TauDQMFileLoader::endRun(), GlobalHitsProdHistStripper::GlobalHitsProdHistStripper(), LaserDQM::initMonitors(), and mtEnabled().

3429 {
3430  std::vector<std::string> contents;
3431  getContents(contents);
3432 
3433  std::cout << " ------------------------------------------------------------\n"
3434  << " Directory structure: \n"
3435  << " ------------------------------------------------------------\n";
3436 
3437  std::copy(contents.begin(), contents.end(),
3438  std::ostream_iterator<std::string>(std::cout, "\n"));
3439 
3440  std::cout << " ------------------------------------------------------------\n";
3441 }
def copy(args, dbName)
std::vector< MonitorElement * > getContents(const std::string &path) const
Definition: DQMStore.cc:1683
void DQMStore::softReset ( MonitorElement me)

reset contents (does not erase contents permanently) (makes copy of current contents; will be subtracted from future contents)

Definition at line 3401 of file DQMStore.cc.

References MonitorElement::softReset().

Referenced by meBookerGetter(), and ecaldqm::MESet::softReset().

3402 {
3403  if (me)
3404  me->softReset();
3405 }
void DQMStore::tag ( MonitorElement me,
unsigned int  myTag 
)

tag ME as <myTag> (myTag > 0)

Definition at line 1541 of file DQMStore.cc.

References MonitorElement::data_, DQMNet::DQM_PROP_TAGGED, DQMNet::CoreObject::flags, MonitorElement::getFullname(), raiseDQMError(), and DQMNet::CoreObject::tag.

Referenced by ConverterTester::beginJob(), SiStripBaseCondObjDQM::bookCumulMEs(), SiStripBaseCondObjDQM::bookProfileMEs(), SiStripBaseCondObjDQM::bookSummaryCumulMEs(), SiStripBaseCondObjDQM::bookSummaryMEs(), SiStripBaseCondObjDQM::bookSummaryProfileMEs(), extract(), getContents(), tag(), tagAllContents(), and tagContents().

1542 {
1543  if (! myTag)
1544  raiseDQMError("DQMStore", "Attempt to tag monitor element '%s'"
1545  " with a zero tag", me->getFullname().c_str());
1546  if ((me->data_.flags & DQMNet::DQM_PROP_TAGGED) && myTag != me->data_.tag)
1547  raiseDQMError("DQMStore", "Attempt to tag monitor element '%s'"
1548  " twice with multiple tags", me->getFullname().c_str());
1549 
1550  me->data_.tag = myTag;
1552 }
uint32_t flags
Definition: DQMNet.h:99
static const uint32_t DQM_PROP_TAGGED
Definition: DQMNet.h:55
uint32_t tag
Definition: DQMNet.h:100
DQMNet::CoreObject data_
const std::string getFullname() const
get full name of ME including Pathname
void raiseDQMError(const char *context, const char *fmt,...)
Definition: DQMError.cc:11
void DQMStore::tag ( const std::string &  path,
unsigned int  myTag 
)

tag ME specified by full pathname (e.g. "my/long/dir/my_histo")

Definition at line 1556 of file DQMStore.cc.

References dir, findObject(), dataset::name, raiseDQMError(), splitPath(), AlCaHLTBitMon_QueryRunRegistry::string, and tag().

1557 {
1558  std::string dir;
1559  std::string name;
1560  splitPath(dir, name, path);
1561 
1562  if (MonitorElement *me = findObject(dir, name))
1563  tag(me, myTag);
1564  else
1565  raiseDQMError("DQMStore", "Attempt to tag non-existent monitor element"
1566  " '%s' with tag %u", path.c_str(), myTag);
1567 
1568 }
static void splitPath(std::string &dir, std::string &name, const std::string &path)
Definition: DQMStore.cc:100
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1541
MonitorElement * findObject(const std::string &dir, const std::string &name, const uint32_t run=0, const uint32_t lumi=0, const uint32_t moduleId=0) const
Definition: DQMStore.cc:1784
dbl *** dir
Definition: mlp_gen.cc:35
void raiseDQMError(const char *context, const char *fmt,...)
Definition: DQMError.cc:11
void DQMStore::tagAllContents ( const std::string &  path,
unsigned int  myTag 
)

tag all children of folder, including all subfolders and their children; path must be an exact path name

Definition at line 1584 of file DQMStore.cc.

References clean, cleanTrailingSlashes(), data_, MillePedeFileConverter_cfg::e, mps_fire::i, isSubdirectory(), AlCaHLTBitMon_QueryRunRegistry::string, and tag().

Referenced by meBookerGetter().

1585 {
1587  const std::string *cleaned = nullptr;
1588  cleanTrailingSlashes(path, clean, cleaned);
1589  MonitorElement proto(cleaned, std::string());
1590 
1591  // FIXME: WILDCARDS? Old one supported them, but nobody seemed to use them.
1592  auto e = data_.end();
1593  auto i = data_.lower_bound(proto);
1594  while (i != e && isSubdirectory(*cleaned, *i->data_.dirname))
1595  {
1596  tag(const_cast<MonitorElement *>(&*i), myTag);
1597  ++i;
1598  }
1599 }
static void cleanTrailingSlashes(const std::string &path, std::string &clean, const std::string *&cleaned)
Definition: DQMStore.cc:83
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1541
static bool isSubdirectory(const std::string &ofdir, const std::string &path)
Definition: DQMStore.cc:73
std::vector< T * > clean
Definition: MVATrainer.cc:156
MEMap data_
Definition: DQMStore.h:845
void DQMStore::tagContents ( const std::string &  path,
unsigned int  myTag 
)

tag all children of folder (does NOT include subfolders)

Definition at line 1572 of file DQMStore.cc.

References data_, MillePedeFileConverter_cfg::e, mps_fire::i, AlCaHLTBitMon_QueryRunRegistry::string, and tag().

Referenced by DQMStore::IBooker::bookProfile2D(), and meBookerGetter().

1573 {
1574  MonitorElement proto(&path, std::string());
1575  auto e = data_.end();
1576  auto i = data_.lower_bound(proto);
1577  for ( ; i != e && path == *i->data_.dirname; ++i)
1578  tag(const_cast<MonitorElement *>(&*i), myTag);
1579 }
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1541
MEMap data_
Definition: DQMStore.h:845
void DQMStore::useQTest ( const std::string &  dir,
const std::string &  qtname 
)

attach quality test <qtname> to directory contents (need exact pathname without wildcards, e.g. A/B/C);

Definition at line 3296 of file DQMStore.cc.

References clean, cleanTrailingSlashes(), raiseDQMError(), s_safe, AlCaHLTBitMon_QueryRunRegistry::string, and useQTestByMatch().

Referenced by mtEnabled().

3297 {
3298  // Clean the path
3300  const std::string *cleaned = nullptr;
3301  cleanTrailingSlashes(dir, clean, cleaned);
3302 
3303  // Validate the path.
3304  if (cleaned->find_first_not_of(s_safe) != std::string::npos)
3305  raiseDQMError("DQMStore", "Monitor element path name '%s'"
3306  " uses unacceptable characters", cleaned->c_str());
3307 
3308  // Redirect to the pattern match version.
3309  useQTestByMatch(*cleaned + "/*", qtname);
3310 }
static const std::string s_safe
Definition: DQMStore.cc:60
static void cleanTrailingSlashes(const std::string &path, std::string &clean, const std::string *&cleaned)
Definition: DQMStore.cc:83
std::vector< T * > clean
Definition: MVATrainer.cc:156
int useQTestByMatch(const std::string &pattern, const std::string &qtname)
attach quality test <qc> to monitor elements matching <pattern>.
Definition: DQMStore.cc:3314
dbl *** dir
Definition: mlp_gen.cc:35
void raiseDQMError(const char *context, const char *fmt,...)
Definition: DQMError.cc:11
int DQMStore::useQTestByMatch ( const std::string &  pattern,
const std::string &  qtname 
)

attach quality test <qc> to monitor elements matching <pattern>.

Definition at line 3314 of file DQMStore.cc.

References MonitorElement::addQReport(), data_, getQCriterion(), mergePath(), callgraph::path, qtestspecs_, raiseDQMError(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by QTestHandle::attachTests(), mtEnabled(), and useQTest().

3315 {
3316  QCriterion *qc = getQCriterion(qtname);
3317  if (! qc)
3318  raiseDQMError("DQMStore", "Cannot apply non-existent quality test '%s'",
3319  qtname.c_str());
3320 
3321  auto * fm = new fastmatch( pattern );
3322 
3323  // Record the test for future reference.
3324  QTestSpec qts(fm, qc);
3325  qtestspecs_.push_back(qts);
3326 
3327  // Apply the quality test.
3328  auto mi = data_.begin();
3329  auto me = data_.end();
3330  std::string path;
3331  int cases = 0;
3332  for ( ; mi != me; ++mi)
3333  {
3334  path.clear();
3335  mergePath(path, *mi->data_.dirname, mi->data_.objname);
3336  if (fm->match(path))
3337  {
3338  ++cases;
3339  const_cast<MonitorElement &>(*mi).addQReport(qts.second);
3340  }
3341  }
3342 
3343  //return the number of matched cases
3344  return cases;
3345 }
QCriterion * getQCriterion(const std::string &qtname) const
Definition: DQMStore.cc:3264
static void mergePath(std::string &path, const std::string &dir, const std::string &name)
Definition: DQMStore.cc:113
std::pair< fastmatch *, QCriterion * > QTestSpec
Definition: DQMStore.h:799
QTestSpecs qtestspecs_
Definition: DQMStore.h:850
MEMap data_
Definition: DQMStore.h:845
void addQReport(const DQMNet::QValue &desc, QCriterion *qc)
Add quality report, from DQMStore.
void raiseDQMError(const char *context, const char *fmt,...)
Definition: DQMError.cc:11

Friends And Related Function Documentation

friend class DQMArchiver
friend

Definition at line 859 of file DQMStore.h.

friend class DQMFileSaver
friend

Definition at line 863 of file DQMStore.h.

friend class DQMNet
friend

Definition at line 858 of file DQMStore.h.

friend class DQMRootOutputModule
friend

Definition at line 861 of file DQMStore.h.

friend class DQMRootSource
friend

Definition at line 862 of file DQMStore.h.

friend class DQMService
friend

Definition at line 857 of file DQMStore.h.

friend class DQMStoreExample
friend

Definition at line 860 of file DQMStore.h.

friend class edm::DQMHttpSource
friend

Definition at line 856 of file DQMStore.h.

friend class MEtoEDMConverter
friend

Definition at line 864 of file DQMStore.h.

Member Data Documentation

std::mutex DQMStore::book_mutex_
private
bool DQMStore::collateHistograms_
private
MEMap DQMStore::data_
private
std::set<std::string> DQMStore::dirs_
private

Definition at line 846 of file DQMStore.h.

Referenced by book_(), dirExists(), getContents(), getSubdirs(), makeDirectory(), rmdir(), save(), and savePB().

bool DQMStore::enableMultiThread_
private
bool DQMStore::forceResetOnBeginLumi_
private

Definition at line 838 of file DQMStore.h.

Referenced by DQMStore(), and forceReset().

IBooker* DQMStore::ibooker_
private

Definition at line 853 of file DQMStore.h.

Referenced by bookTransaction(), DQMStore(), and meBookerGetter().

IGetter* DQMStore::igetter_
private

Definition at line 854 of file DQMStore.h.

Referenced by DQMStore(), and meBookerGetter().

bool DQMStore::LSbasedMode_
private
uint32_t DQMStore::moduleId_
private

Definition at line 841 of file DQMStore.h.

Referenced by book_(), bookFloat_(), bookInt_(), bookString_(), and bookTransaction().

DQMStore::pwd_
private
DQMStore::qalgos_
private

Set of all the available quality test algorithms.

Definition at line 849 of file DQMStore.h.

Referenced by createQTest(), and initializeFrom().

DQMStore::qtests_
private

All the quality tests.

Definition at line 848 of file DQMStore.h.

Referenced by createQTest(), getQCriterion(), and ~DQMStore().

QTestSpecs DQMStore::qtestspecs_
private

Definition at line 850 of file DQMStore.h.

Referenced by book_(), useQTestByMatch(), and ~DQMStore().

DQMStore::readSelectedDirectory_
private

If non-empty, read from file only selected directory.

Definition at line 839 of file DQMStore.h.

DQMStore::reset_
private

Flag used to print out a warning when calling quality tests. twice without having called reset() in between; to be reset in DQMOldReceiver::runQualityTests.

Definition at line 833 of file DQMStore.h.

Referenced by forceReset(), reset(), and runQTests().

uint32_t DQMStore::run_
private
double DQMStore::scaleFlag_
private

Definition at line 834 of file DQMStore.h.

Referenced by initializeFrom(), and scaleElements().

std::ofstream* DQMStore::stream_
private

Definition at line 842 of file DQMStore.h.

Referenced by print_trace(), and ~DQMStore().

DQMStore::verbose_
private
DQMStore::verboseQT_
private

Verbose flag for xml-based QTests.

Definition at line 832 of file DQMStore.h.

Referenced by createQTest(), and initializeFrom().