CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 streamId, uint32_t moduleId)
 
void cd ()
 go to top directory (ie. root) More...
 
void cd (const std::string &subdir)
 cd to subdirectory (if there) More...
 
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
 
void getAllTags (std::vector< std::string > &into) 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)
 
template<typename iFunc >
void meGetter (iFunc f)
 
void mergeAndResetMEsLuminositySummaryCache (uint32_t run, uint32_t lumi, uint32_t streamId, uint32_t moduleId)
 
void mergeAndResetMEsRunSummaryCache (uint32_t run, uint32_t streamId, uint32_t moduleId)
 
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 streamId=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_
 
uint32_t streamId_
 
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 829 of file DQMStore.h.

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

Definition at line 831 of file DQMStore.h.

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

Definition at line 830 of file DQMStore.h.

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

Definition at line 827 of file DQMStore.h.

Definition at line 828 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 511 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().

512  : verbose_ (1),
513  verboseQT_ (1),
514  reset_ (false),
515  collateHistograms_ (false),
516  enableMultiThread_(false),
517  forceResetOnBeginLumi_(false),
519  run_(0),
520  streamId_(0),
521  moduleId_(0),
522  stream_(nullptr),
523  pwd_ (""),
524  ibooker_(nullptr),
525  igetter_(nullptr)
526 {
527  if (!ibooker_)
528  ibooker_ = new DQMStore::IBooker(this);
529  if (!igetter_)
530  igetter_ = new DQMStore::IGetter(this);
531  initializeFrom(pset);
532 
533  ar.preallocateSignal_.connect([this](edm::service::SystemBounds const& iBounds) {
534  if(iBounds.maxNumberOfStreams() > 1 ) {
535  enableMultiThread_ = true;
536  }
537  });
538  if(pset.getUntrackedParameter<bool>("forceResetOnBeginRun",false)) {
540  }
541  if(pset.getUntrackedParameter<bool>("forceResetOnBeginLumi",false) && enableMultiThread_ == false) {
542  forceResetOnBeginLumi_ = true;
544  }
546 }
IGetter * igetter_
Definition: DQMStore.h:883
T getUntrackedParameter(std::string const &, T const &) const
void postGlobalBeginLumi(const edm::GlobalContext &)
Definition: DQMStore.cc:2159
uint32_t streamId_
Definition: DQMStore.h:869
void watchPostGlobalBeginLumi(PostGlobalBeginLumi::slot_type const &iSlot)
bool reset_
Definition: DQMStore.h:861
void initializeFrom(const edm::ParameterSet &)
Definition: DQMStore.cc:584
uint32_t moduleId_
Definition: DQMStore.h:870
void forceReset()
Definition: DQMStore.cc:2134
Preallocate preallocateSignal_
signal is emitted before beginJob
unsigned int maxNumberOfStreams() const
Definition: SystemBounds.h:43
unsigned verboseQT_
Definition: DQMStore.h:860
void watchPostSourceRun(PostSourceRun::slot_type const &iSlot)
uint32_t run_
Definition: DQMStore.h:868
std::string pwd_
Definition: DQMStore.h:873
IBooker * ibooker_
Definition: DQMStore.h:882
std::string readSelectedDirectory_
Definition: DQMStore.h:867
void watchPostSourceLumi(PostSourceLumi::slot_type const &iSlot)
unsigned verbose_
Definition: DQMStore.h:859
bool forceResetOnBeginLumi_
Definition: DQMStore.h:866
std::ofstream * stream_
Definition: DQMStore.h:871
bool collateHistograms_
Definition: DQMStore.h:863
void connect(U iFunc)
Definition: Signal.h:63
bool enableMultiThread_
Definition: DQMStore.h:864
DQMStore::DQMStore ( const edm::ParameterSet pset)

Definition at line 548 of file DQMStore.cc.

References ibooker_, igetter_, and initializeFrom().

549  : verbose_ (1),
550  verboseQT_ (1),
551  reset_ (false),
552  collateHistograms_ (false),
553  enableMultiThread_(false),
555  run_(0),
556  streamId_(0),
557  moduleId_(0),
558  stream_(nullptr),
559  pwd_ (""),
560  ibooker_(nullptr),
561  igetter_(nullptr)
562 {
563  if (!ibooker_)
564  ibooker_ = new DQMStore::IBooker(this);
565  if (!igetter_)
566  igetter_ = new DQMStore::IGetter(this);
567  initializeFrom(pset);
568 }
IGetter * igetter_
Definition: DQMStore.h:883
uint32_t streamId_
Definition: DQMStore.h:869
bool reset_
Definition: DQMStore.h:861
void initializeFrom(const edm::ParameterSet &)
Definition: DQMStore.cc:584
uint32_t moduleId_
Definition: DQMStore.h:870
unsigned verboseQT_
Definition: DQMStore.h:860
uint32_t run_
Definition: DQMStore.h:868
std::string pwd_
Definition: DQMStore.h:873
IBooker * ibooker_
Definition: DQMStore.h:882
std::string readSelectedDirectory_
Definition: DQMStore.h:867
unsigned verbose_
Definition: DQMStore.h:859
std::ofstream * stream_
Definition: DQMStore.h:871
bool collateHistograms_
Definition: DQMStore.h:863
bool enableMultiThread_
Definition: DQMStore.h:864
DQMStore::~DQMStore ( )

Definition at line 570 of file DQMStore.cc.

References qtests_, qtestspecs_, and stream_.

Referenced by meGetter().

571 {
572  for (auto & qtest : qtests_)
573  delete qtest.second;
574 
575  for (auto & qtestspec : qtestspecs_)
576  delete qtestspec.first;
577 
578  if (stream_)
579  stream_->close();
580  delete stream_;
581 }
QCMap qtests_
Definition: DQMStore.h:877
QTestSpecs qtestspecs_
Definition: DQMStore.h:879
std::ofstream * stream_
Definition: DQMStore.h:871
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 1041 of file DQMStore.cc.

References book1D_(), and pwd_.

Referenced by DQMFEDIntegrityClient::beginJob(), ConverterTester::beginJob(), SimplePhotonAnalyzer::beginJob(), StripValidationPlots::beginJob(), APVValidationPlots::beginJob(), MuonAlignment::beginJob(), RPCBxTest::beginRun(), OuterTrackerMonitorTTStub::beginRun(), OuterTrackerMonitorTTCluster::beginRun(), OuterTrackerMonitorTTTrack::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(), TauDQMHistEffProducer::endRun(), GlobalHitsProdHistStripper::endRun(), SiStripQualityDQM::fillGrandSummaryMEs(), SiStripSummaryCreator::getSummaryME(), HEff1DHit::HEff1DHit(), HEff2DHit::HEff2DHit(), HEff4DHit::HEff4DHit(), HLTScalersClient::HLTScalersClient(), HRes1DHit::HRes1DHit(), HRes2DHit::HRes2DHit(), HRes4DHit::HRes4DHit(), SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy::initializeDQMHistograms(), LaserDQM::initMonitors(), L1ScalersClient::L1ScalersClient(), meGetter(), and MonitorElementsDb::MonitorElementsDb().

1043 {
1044  return book1D_(pwd_, name, new TH1F(name, title, nchX, lowX, highX));
1045 }
std::string pwd_
Definition: DQMStore.h:873
MonitorElement * book1D_(const std::string &dir, const std::string &name, TH1F *h)
Book 1D histogram based on TH1F.
Definition: DQMStore.cc:1020
MonitorElement * DQMStore::book1D ( const std::string &  name,
const std::string &  title,
int  nchX,
double  lowX,
double  highX 
)

Book 1D histogram.

Definition at line 1049 of file DQMStore.cc.

References book1D_(), and pwd_.

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

Book 1D variable bin histogram.

Definition at line 1089 of file DQMStore.cc.

References book1D_(), and pwd_.

1091 {
1092  return book1D_(pwd_, name, new TH1F(name, title, nchX, xbinsize));
1093 }
std::string pwd_
Definition: DQMStore.h:873
MonitorElement * book1D_(const std::string &dir, const std::string &name, TH1F *h)
Book 1D histogram based on TH1F.
Definition: DQMStore.cc:1020
MonitorElement * DQMStore::book1D ( const std::string &  name,
const std::string &  title,
int  nchX,
const float *  xbinsize 
)

Book 1D variable bin histogram.

Definition at line 1097 of file DQMStore.cc.

References book1D_(), and pwd_.

1099 {
1100  return book1D_(pwd_, name, new TH1F(name.c_str(), title.c_str(), nchX, xbinsize));
1101 }
std::string pwd_
Definition: DQMStore.h:873
MonitorElement * book1D_(const std::string &dir, const std::string &name, TH1F *h)
Book 1D histogram based on TH1F.
Definition: DQMStore.cc:1020
MonitorElement * DQMStore::book1D ( const char *  name,
TH1F *  h 
)

Book 1D histogram by cloning an existing histogram.

Definition at line 1105 of file DQMStore.cc.

References book1D_(), and pwd_.

1106 {
1107  return book1D_(pwd_, name, static_cast<TH1F *>(source->Clone(name)));
1108 }
std::string pwd_
Definition: DQMStore.h:873
MonitorElement * book1D_(const std::string &dir, const std::string &name, TH1F *h)
Book 1D histogram based on TH1F.
Definition: DQMStore.cc:1020
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 1112 of file DQMStore.cc.

References book1D_(), and pwd_.

1113 {
1114  return book1D_(pwd_, name, static_cast<TH1F *>(source->Clone(name.c_str())));
1115 }
std::string pwd_
Definition: DQMStore.h:873
MonitorElement * book1D_(const std::string &dir, const std::string &name, TH1F *h)
Book 1D histogram based on TH1F.
Definition: DQMStore.cc:1020
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 1020 of file DQMStore.cc.

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

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

1021 {
1022  return book_(dir, name, "book1D", MonitorElement::DQM_KIND_TH1F, h, collate1D);
1023 }
MonitorElement * book_(const std::string &dir, const std::string &name, const char *context)
Definition: DQMStore.cc:896
static void collate1D(MonitorElement *me, TH1F *h, unsigned verbose)
Definition: DQMStore.cc:1626
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 1073 of file DQMStore.cc.

References book1DD_(), and pwd_.

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

1075 {
1076  return book1DD_(pwd_, name, new TH1D(name, title, nchX, lowX, highX));
1077 }
std::string pwd_
Definition: DQMStore.h:873
MonitorElement * book1DD_(const std::string &dir, const std::string &name, TH1D *h)
Book 1D histogram based on TH1D.
Definition: DQMStore.cc:1034
MonitorElement * DQMStore::book1DD ( const std::string &  name,
const std::string &  title,
int  nchX,
double  lowX,
double  highX 
)

Book 1S histogram.

Definition at line 1081 of file DQMStore.cc.

References book1DD_(), and pwd_.

1083 {
1084  return book1DD_(pwd_, name, new TH1D(name.c_str(), title.c_str(), nchX, lowX, highX));
1085 }
std::string pwd_
Definition: DQMStore.h:873
MonitorElement * book1DD_(const std::string &dir, const std::string &name, TH1D *h)
Book 1D histogram based on TH1D.
Definition: DQMStore.cc:1034
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 1133 of file DQMStore.cc.

References book1DD_(), and pwd_.

1134 {
1135  return book1DD_(pwd_, name, static_cast<TH1D *>(source->Clone(name)));
1136 }
std::string pwd_
Definition: DQMStore.h:873
MonitorElement * book1DD_(const std::string &dir, const std::string &name, TH1D *h)
Book 1D histogram based on TH1D.
Definition: DQMStore.cc:1034
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 1140 of file DQMStore.cc.

References book1DD_(), and pwd_.

1141 {
1142  return book1DD_(pwd_, name, static_cast<TH1D *>(source->Clone(name.c_str())));
1143 }
std::string pwd_
Definition: DQMStore.h:873
MonitorElement * book1DD_(const std::string &dir, const std::string &name, TH1D *h)
Book 1D histogram based on TH1D.
Definition: DQMStore.cc:1034
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 1034 of file DQMStore.cc.

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

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

1035 {
1036  return book_(dir, name, "book1DD", MonitorElement::DQM_KIND_TH1D, h, collate1DD);
1037 }
static void collate1DD(MonitorElement *me, TH1D *h, unsigned verbose)
Definition: DQMStore.cc:1640
MonitorElement * book_(const std::string &dir, const std::string &name, const char *context)
Definition: DQMStore.cc:896
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 1057 of file DQMStore.cc.

References book1S_(), and pwd_.

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

1059 {
1060  return book1S_(pwd_, name, new TH1S(name, title, nchX, lowX, highX));
1061 }
std::string pwd_
Definition: DQMStore.h:873
MonitorElement * book1S_(const std::string &dir, const std::string &name, TH1S *h)
Book 1D histogram based on TH1S.
Definition: DQMStore.cc:1027
MonitorElement * DQMStore::book1S ( const std::string &  name,
const std::string &  title,
int  nchX,
double  lowX,
double  highX 
)

Book 1S histogram.

Definition at line 1065 of file DQMStore.cc.

References book1S_(), and pwd_.

1067 {
1068  return book1S_(pwd_, name, new TH1S(name.c_str(), title.c_str(), nchX, lowX, highX));
1069 }
std::string pwd_
Definition: DQMStore.h:873
MonitorElement * book1S_(const std::string &dir, const std::string &name, TH1S *h)
Book 1D histogram based on TH1S.
Definition: DQMStore.cc:1027
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 1119 of file DQMStore.cc.

References book1S_(), and pwd_.

1120 {
1121  return book1S_(pwd_, name, static_cast<TH1S *>(source->Clone(name)));
1122 }
std::string pwd_
Definition: DQMStore.h:873
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:1027
MonitorElement * DQMStore::book1S ( const std::string &  name,
TH1S *  h 
)

Book 1S histogram by cloning an existing histogram.

Definition at line 1126 of file DQMStore.cc.

References book1S_(), and pwd_.

1127 {
1128  return book1S_(pwd_, name, static_cast<TH1S *>(source->Clone(name.c_str())));
1129 }
std::string pwd_
Definition: DQMStore.h:873
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:1027
MonitorElement * DQMStore::book1S_ ( const std::string &  dir,
const std::string &  name,
TH1S *  h 
)
private

Book 1D histogram based on TH1S.

Definition at line 1027 of file DQMStore.cc.

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

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

1028 {
1029  return book_(dir, name, "book1S", MonitorElement::DQM_KIND_TH1S, h, collate1S);
1030 }
MonitorElement * book_(const std::string &dir, const std::string &name, const char *context)
Definition: DQMStore.cc:896
static void collate1S(MonitorElement *me, TH1S *h, unsigned verbose)
Definition: DQMStore.cc:1633
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 1180 of file DQMStore.cc.

References book2D_(), and pwd_.

1183 {
1184  return book2D_(pwd_, name, new TH2F(name.c_str(), title.c_str(),
1185  nchX, lowX, highX,
1186  nchY, lowY, highY));
1187 }
MonitorElement * book2D_(const std::string &dir, const std::string &name, TH2F *h)
Book 2D histogram based on TH2F.
Definition: DQMStore.cc:1148
std::string pwd_
Definition: DQMStore.h:873
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 1235 of file DQMStore.cc.

References book2D_(), and pwd_.

1237 {
1238  return book2D_(pwd_, name, new TH2F(name, title,
1239  nchX, xbinsize, nchY, ybinsize));
1240 }
MonitorElement * book2D_(const std::string &dir, const std::string &name, TH2F *h)
Book 2D histogram based on TH2F.
Definition: DQMStore.cc:1148
std::string pwd_
Definition: DQMStore.h:873
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 1244 of file DQMStore.cc.

References book2D_(), and pwd_.

1246 {
1247  return book2D_(pwd_, name, new TH2F(name.c_str(), title.c_str(),
1248  nchX, xbinsize, nchY, ybinsize));
1249 }
MonitorElement * book2D_(const std::string &dir, const std::string &name, TH2F *h)
Book 2D histogram based on TH2F.
Definition: DQMStore.cc:1148
std::string pwd_
Definition: DQMStore.h:873
MonitorElement * DQMStore::book2D ( const char *  name,
TH2F *  h 
)

Book 2D histogram by cloning an existing histogram.

Definition at line 1271 of file DQMStore.cc.

References book2D_(), and pwd_.

1272 {
1273  return book2D_(pwd_, name, static_cast<TH2F *>(source->Clone(name)));
1274 }
MonitorElement * book2D_(const std::string &dir, const std::string &name, TH2F *h)
Book 2D histogram based on TH2F.
Definition: DQMStore.cc:1148
std::string pwd_
Definition: DQMStore.h:873
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 1278 of file DQMStore.cc.

References book2D_(), and pwd_.

1279 {
1280  return book2D_(pwd_, name, static_cast<TH2F *>(source->Clone(name.c_str())));
1281 }
MonitorElement * book2D_(const std::string &dir, const std::string &name, TH2F *h)
Book 2D histogram based on TH2F.
Definition: DQMStore.cc:1148
std::string pwd_
Definition: DQMStore.h:873
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 1148 of file DQMStore.cc.

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

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

1149 {
1150  return book_(dir, name, "book2D", MonitorElement::DQM_KIND_TH2F, h, collate2D);
1151 }
MonitorElement * book_(const std::string &dir, const std::string &name, const char *context)
Definition: DQMStore.cc:896
dbl *** dir
Definition: mlp_gen.cc:35
static void collate2D(MonitorElement *me, TH2F *h, unsigned verbose)
Definition: DQMStore.cc:1647
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 1213 of file DQMStore.cc.

References book2DD_(), and pwd_.

Referenced by meGetter().

1216 {
1217  return book2DD_(pwd_, name, new TH2D(name, title,
1218  nchX, lowX, highX,
1219  nchY, lowY, highY));
1220 }
MonitorElement * book2DD_(const std::string &dir, const std::string &name, TH2D *h)
Book 2D histogram based on TH2D.
Definition: DQMStore.cc:1162
std::string pwd_
Definition: DQMStore.h:873
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 1224 of file DQMStore.cc.

References book2DD_(), and pwd_.

1227 {
1228  return book2DD_(pwd_, name, new TH2D(name.c_str(), title.c_str(),
1229  nchX, lowX, highX,
1230  nchY, lowY, highY));
1231 }
MonitorElement * book2DD_(const std::string &dir, const std::string &name, TH2D *h)
Book 2D histogram based on TH2D.
Definition: DQMStore.cc:1162
std::string pwd_
Definition: DQMStore.h:873
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 1299 of file DQMStore.cc.

References book2DD_(), and pwd_.

1300 {
1301  return book2DD_(pwd_, name, static_cast<TH2D *>(source->Clone(name)));
1302 }
MonitorElement * book2DD_(const std::string &dir, const std::string &name, TH2D *h)
Book 2D histogram based on TH2D.
Definition: DQMStore.cc:1162
std::string pwd_
Definition: DQMStore.h:873
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 1306 of file DQMStore.cc.

References book2DD_(), and pwd_.

1307 {
1308  return book2DD_(pwd_, name, static_cast<TH2D *>(source->Clone(name.c_str())));
1309 }
MonitorElement * book2DD_(const std::string &dir, const std::string &name, TH2D *h)
Book 2D histogram based on TH2D.
Definition: DQMStore.cc:1162
std::string pwd_
Definition: DQMStore.h:873
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 1162 of file DQMStore.cc.

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

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

1163 {
1164  return book_(dir, name, "book2DD", MonitorElement::DQM_KIND_TH2D, h, collate2DD);
1165 }
static void collate2DD(MonitorElement *me, TH2D *h, unsigned verbose)
Definition: DQMStore.cc:1661
MonitorElement * book_(const std::string &dir, const std::string &name, const char *context)
Definition: DQMStore.cc:896
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 1191 of file DQMStore.cc.

References book2S_(), and pwd_.

Referenced by dqmRegisterHistogram(), and meGetter().

1194 {
1195  return book2S_(pwd_, name, new TH2S(name, title,
1196  nchX, lowX, highX,
1197  nchY, lowY, highY));
1198 }
std::string pwd_
Definition: DQMStore.h:873
MonitorElement * book2S_(const std::string &dir, const std::string &name, TH2S *h)
Book 2D histogram based on TH2S.
Definition: DQMStore.cc:1155
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 1202 of file DQMStore.cc.

References book2S_(), and pwd_.

1205 {
1206  return book2S_(pwd_, name, new TH2S(name.c_str(), title.c_str(),
1207  nchX, lowX, highX,
1208  nchY, lowY, highY));
1209 }
std::string pwd_
Definition: DQMStore.h:873
MonitorElement * book2S_(const std::string &dir, const std::string &name, TH2S *h)
Book 2D histogram based on TH2S.
Definition: DQMStore.cc:1155
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 1253 of file DQMStore.cc.

References book2S_(), and pwd_.

1255 {
1256  return book2S_(pwd_, name, new TH2S(name, title,
1257  nchX, xbinsize, nchY, ybinsize));
1258 }
std::string pwd_
Definition: DQMStore.h:873
MonitorElement * book2S_(const std::string &dir, const std::string &name, TH2S *h)
Book 2D histogram based on TH2S.
Definition: DQMStore.cc:1155
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 1262 of file DQMStore.cc.

References book2S_(), and pwd_.

1264 {
1265  return book2S_(pwd_, name, new TH2S(name.c_str(), title.c_str(),
1266  nchX, xbinsize, nchY, ybinsize));
1267 }
std::string pwd_
Definition: DQMStore.h:873
MonitorElement * book2S_(const std::string &dir, const std::string &name, TH2S *h)
Book 2D histogram based on TH2S.
Definition: DQMStore.cc:1155
MonitorElement * DQMStore::book2S ( const char *  name,
TH2S *  h 
)

Book 2DS histogram by cloning an existing histogram.

Definition at line 1285 of file DQMStore.cc.

References book2S_(), and pwd_.

1286 {
1287  return book2S_(pwd_, name, static_cast<TH2S *>(source->Clone(name)));
1288 }
std::string pwd_
Definition: DQMStore.h:873
MonitorElement * book2S_(const std::string &dir, const std::string &name, TH2S *h)
Book 2D histogram based on TH2S.
Definition: DQMStore.cc:1155
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 1292 of file DQMStore.cc.

References book2S_(), and pwd_.

1293 {
1294  return book2S_(pwd_, name, static_cast<TH2S *>(source->Clone(name.c_str())));
1295 }
std::string pwd_
Definition: DQMStore.h:873
MonitorElement * book2S_(const std::string &dir, const std::string &name, TH2S *h)
Book 2D histogram based on TH2S.
Definition: DQMStore.cc:1155
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 1155 of file DQMStore.cc.

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

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

1156 {
1157  return book_(dir, name, "book2S", MonitorElement::DQM_KIND_TH2S, h, collate2S);
1158 }
MonitorElement * book_(const std::string &dir, const std::string &name, const char *context)
Definition: DQMStore.cc:896
dbl *** dir
Definition: mlp_gen.cc:35
static void collate2S(MonitorElement *me, TH2S *h, unsigned verbose)
Definition: DQMStore.cc:1654
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 1321 of file DQMStore.cc.

References book3D_(), and pwd_.

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

1325 {
1326  return book3D_(pwd_, name, new TH3F(name, title,
1327  nchX, lowX, highX,
1328  nchY, lowY, highY,
1329  nchZ, lowZ, highZ));
1330 }
MonitorElement * book3D_(const std::string &dir, const std::string &name, TH3F *h)
Book 3D histogram based on TH3F.
Definition: DQMStore.cc:1314
std::string pwd_
Definition: DQMStore.h:873
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 1334 of file DQMStore.cc.

References book3D_(), and pwd_.

1338 {
1339  return book3D_(pwd_, name, new TH3F(name.c_str(), title.c_str(),
1340  nchX, lowX, highX,
1341  nchY, lowY, highY,
1342  nchZ, lowZ, highZ));
1343 }
MonitorElement * book3D_(const std::string &dir, const std::string &name, TH3F *h)
Book 3D histogram based on TH3F.
Definition: DQMStore.cc:1314
std::string pwd_
Definition: DQMStore.h:873
MonitorElement * DQMStore::book3D ( const char *  name,
TH3F *  h 
)

Book 3D histogram by cloning an existing histogram.

Definition at line 1347 of file DQMStore.cc.

References book3D_(), and pwd_.

1348 {
1349  return book3D_(pwd_, name, static_cast<TH3F *>(source->Clone(name)));
1350 }
MonitorElement * book3D_(const std::string &dir, const std::string &name, TH3F *h)
Book 3D histogram based on TH3F.
Definition: DQMStore.cc:1314
std::string pwd_
Definition: DQMStore.h:873
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 1354 of file DQMStore.cc.

References book3D_(), and pwd_.

1355 {
1356  return book3D_(pwd_, name, static_cast<TH3F *>(source->Clone(name.c_str())));
1357 }
MonitorElement * book3D_(const std::string &dir, const std::string &name, TH3F *h)
Book 3D histogram based on TH3F.
Definition: DQMStore.cc:1314
std::string pwd_
Definition: DQMStore.h:873
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 1314 of file DQMStore.cc.

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

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

1315 {
1316  return book_(dir, name, "book3D", MonitorElement::DQM_KIND_TH3F, h, collate3D);
1317 }
static void collate3D(MonitorElement *me, TH3F *h, unsigned verbose)
Definition: DQMStore.cc:1668
MonitorElement * book_(const std::string &dir, const std::string &name, const char *context)
Definition: DQMStore.cc:896
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 896 of file DQMStore.cc.

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

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

899 {
900  assert(name.find('/') == std::string::npos);
901  if (verbose_ > 3)
902  print_trace(dir, name);
903 
904  // Check if the request monitor element already exists.
906  {
907  if (verbose_ > 1)
908  {
910  mergePath(path, dir, name);
911 
912  std::cout << "DQMStore: "
913  << context << ": monitor element '"
914  << path << "' already exists, resetting" << std::endl;
915  }
916  me->Reset();
917  return me;
918  }
919  else
920  {
921  // Create it and return for initialisation.
922  assert(dirs_.count(dir));
923  MonitorElement proto(&*dirs_.find(dir), name, run_, streamId_, moduleId_);
924  return &const_cast<MonitorElement &>(*data_.insert(std::move(proto)).first);
925  }
926 }
static void mergePath(std::string &path, const std::string &dir, const std::string &name)
Definition: DQMStore.cc:113
MonitorElement * findObject(const std::string &dir, const std::string &name, const uint32_t run=0, const uint32_t lumi=0, const uint32_t streamId=0, const uint32_t moduleId=0) const
Definition: DQMStore.cc:1942
uint32_t streamId_
Definition: DQMStore.h:869
uint32_t moduleId_
Definition: DQMStore.h:870
uint32_t run_
Definition: DQMStore.h:868
unsigned verbose_
Definition: DQMStore.h:859
MEMap data_
Definition: DQMStore.h:874
void print_trace(const std::string &dir, const std::string &name)
Definition: DQMStore.cc:646
dbl *** dir
Definition: mlp_gen.cc:35
std::set< std::string > dirs_
Definition: DQMStore.h:875
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 820 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, streamId_, AlCaHLTBitMon_QueryRunRegistry::string, and verbose_.

823 {
824  assert(name.find('/') == std::string::npos);
825  if (verbose_ > 3)
826  print_trace(dir, name);
828  mergePath(path, dir, name);
829 
830  // Put us in charge of h.
831  h->SetDirectory(nullptr);
832 
833  // Check if the request monitor element already exists.
835  if (me)
836  {
837  if (collateHistograms_)
838  {
839  collate(me, h, verbose_);
840  delete h;
841  return me;
842  }
843  else
844  {
845  if (verbose_ > 1)
846  std::cout << "DQMStore: "
847  << context << ": monitor element '"
848  << path << "' already exists, collating" << std::endl;
849  me->Reset();
850  collate(me, h, verbose_);
851  delete h;
852  return me;
853  }
854  }
855  else
856  {
857  // Create and initialise core object.
858  assert(dirs_.count(dir));
859  MonitorElement proto(&*dirs_.find(dir), name, run_, streamId_, moduleId_);
860  me = const_cast<MonitorElement &>(*data_.insert(std::move(proto)).first)
862 
863  // Initialise quality test information.
864  auto qi = qtestspecs_.begin();
865  auto qe = qtestspecs_.end();
866  for ( ; qi != qe; ++qi)
867  {
868  if ( qi->first->match(path) )
869  me->addQReport(qi->second);
870  }
871 
872  // If we just booked a (plain) MonitorElement, and there is a reference
873  // MonitorElement with the same name, link the two together.
874  // The other direction is handled by the extract method.
875  std::string refdir;
876  refdir.reserve(s_referenceDirName.size() + dir.size() + 1);
877  refdir += s_referenceDirName;
878  refdir += '/';
879  refdir += dir;
880  MonitorElement* referenceME = findObject(refdir, name);
881  if (referenceME) {
882  // We have booked a new MonitorElement with a specific dir and name.
883  // Then, if we can find the corresponding MonitorElement in the reference
884  // dir we assign the object_ of the reference MonitorElement to the
885  // reference_ property of our new MonitorElement.
886  me->data_.flags |= DQMNet::DQM_PROP_HAS_REFERENCE;
887  me->reference_ = referenceME->object_;
888  }
889 
890  // Return the monitor element.
891  return me;
892  }
893 }
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.
MonitorElement * findObject(const std::string &dir, const std::string &name, const uint32_t run=0, const uint32_t lumi=0, const uint32_t streamId=0, const uint32_t moduleId=0) const
Definition: DQMStore.cc:1942
uint32_t streamId_
Definition: DQMStore.h:869
uint32_t moduleId_
Definition: DQMStore.h:870
static const uint32_t DQM_PROP_HAS_REFERENCE
Definition: DQMNet.h:54
QTestSpecs qtestspecs_
Definition: DQMStore.h:879
uint32_t run_
Definition: DQMStore.h:868
void Reset()
reset ME (ie. contents, errors, etc)
MonitorElement * initialise(MonitorElement *me, const std::string &path)
unsigned verbose_
Definition: DQMStore.h:859
MEMap data_
Definition: DQMStore.h:874
static const std::string s_referenceDirName
Definition: DQMStore.cc:58
void print_trace(const std::string &dir, const std::string &name)
Definition: DQMStore.cc:646
dbl *** dir
Definition: mlp_gen.cc:35
std::set< std::string > dirs_
Definition: DQMStore.h:875
bool collateHistograms_
Definition: DQMStore.h:863
def move(src, dest)
Definition: eostools.py:510
template<typename iFunc >
void DQMStore::bookConcurrentTransaction ( iFunc  f,
uint32_t  run 
)
inline

Definition at line 383 of file DQMStore.h.

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

383  {
384  std::lock_guard<std::mutex> guard(book_mutex_);
385  /* Even if enableMultiThread_ is enabled, keep the streamId_
386  and moduleId_ to 0, since we want to book global histograms. */
387  if (enableMultiThread_) {
388  run_ = run;
389  }
390  ConcurrentBooker booker(this);
391  f(booker);
392 
393  /* Set back to 0 the run_ in case we run in mixed conditions
394  with DQMEDAnalyzers and legacy modules */
395  if (enableMultiThread_) {
396  run_ = 0;
397  }
398  }
std::mutex book_mutex_
Definition: DQMStore.h:881
double f[11][100]
uint32_t run_
Definition: DQMStore.h:868
bool enableMultiThread_
Definition: DQMStore.h:864
MonitorElement * DQMStore::bookFloat ( const char *  name)
MonitorElement * DQMStore::bookFloat ( const std::string &  name)

Book float.

Definition at line 983 of file DQMStore.cc.

References bookFloat_(), and pwd_.

984 {
985  return bookFloat_(pwd_, name);
986 }
std::string pwd_
Definition: DQMStore.h:873
MonitorElement * bookFloat_(const std::string &dir, const std::string &name)
Book float.
Definition: DQMStore.cc:961
MonitorElement * DQMStore::bookFloat_ ( const std::string &  dir,
const std::string &  name 
)
private

Book float.

Definition at line 961 of file DQMStore.cc.

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

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

962 {
963  if (collateHistograms_)
964  {
966  {
967  me->Fill(0.);
968  return me;
969  }
970  }
971 
972  return book_(dir, name, "bookFloat")
974 }
MonitorElement * initialise(Kind kind)
MonitorElement * findObject(const std::string &dir, const std::string &name, const uint32_t run=0, const uint32_t lumi=0, const uint32_t streamId=0, const uint32_t moduleId=0) const
Definition: DQMStore.cc:1942
uint32_t streamId_
Definition: DQMStore.h:869
uint32_t moduleId_
Definition: DQMStore.h:870
uint32_t run_
Definition: DQMStore.h:868
MonitorElement * book_(const std::string &dir, const std::string &name, const char *context)
Definition: DQMStore.cc:896
dbl *** dir
Definition: mlp_gen.cc:35
bool collateHistograms_
Definition: DQMStore.h:863
MonitorElement * DQMStore::bookInt ( const char *  name)

Book int.

Definition at line 948 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 meGetter().

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

Book int.

Definition at line 953 of file DQMStore.cc.

References bookInt_(), and pwd_.

954 {
955  return bookInt_(pwd_, name);
956 }
MonitorElement * bookInt_(const std::string &dir, const std::string &name)
Book int.
Definition: DQMStore.cc:931
std::string pwd_
Definition: DQMStore.h:873
MonitorElement * DQMStore::bookInt_ ( const std::string &  dir,
const std::string &  name 
)
private

Book int.

Definition at line 931 of file DQMStore.cc.

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

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

932 {
933  if (collateHistograms_)
934  {
936  {
937  me->Fill(0);
938  return me;
939  }
940  }
941 
942  return book_(dir, name, "bookInt")
944 }
MonitorElement * initialise(Kind kind)
MonitorElement * findObject(const std::string &dir, const std::string &name, const uint32_t run=0, const uint32_t lumi=0, const uint32_t streamId=0, const uint32_t moduleId=0) const
Definition: DQMStore.cc:1942
uint32_t streamId_
Definition: DQMStore.h:869
uint32_t moduleId_
Definition: DQMStore.h:870
uint32_t run_
Definition: DQMStore.h:868
MonitorElement * book_(const std::string &dir, const std::string &name, const char *context)
Definition: DQMStore.cc:896
dbl *** dir
Definition: mlp_gen.cc:35
bool collateHistograms_
Definition: DQMStore.h:863
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 1373 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(), meGetter(), and MonitorElementsDb::MonitorElementsDb().

1377 {
1378  return bookProfile_(pwd_, name, new TProfile(name, title,
1379  nchX, lowX, highX,
1380  lowY, highY,
1381  option));
1382 }
MonitorElement * bookProfile_(const std::string &dir, const std::string &name, TProfile *h)
Book profile histogram based on TProfile.
Definition: DQMStore.cc:1362
std::string pwd_
Definition: DQMStore.h:873
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 1388 of file DQMStore.cc.

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

1392 {
1393  return bookProfile_(pwd_, name, new TProfile(name.c_str(), title.c_str(),
1394  nchX, lowX, highX,
1395  lowY, highY,
1396  option));
1397 }
MonitorElement * bookProfile_(const std::string &dir, const std::string &name, TProfile *h)
Book profile histogram based on TProfile.
Definition: DQMStore.cc:1362
std::string pwd_
Definition: DQMStore.h:873
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 1403 of file DQMStore.cc.

References bookProfile_(), and pwd_.

1407 {
1408  return bookProfile_(pwd_, name, new TProfile(name, title,
1409  nchX, lowX, highX,
1410  lowY, highY,
1411  option));
1412 }
MonitorElement * bookProfile_(const std::string &dir, const std::string &name, TProfile *h)
Book profile histogram based on TProfile.
Definition: DQMStore.cc:1362
std::string pwd_
Definition: DQMStore.h:873
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 1418 of file DQMStore.cc.

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

1422 {
1423  return bookProfile_(pwd_, name, new TProfile(name.c_str(), title.c_str(),
1424  nchX, lowX, highX,
1425  lowY, highY,
1426  option));
1427 }
MonitorElement * bookProfile_(const std::string &dir, const std::string &name, TProfile *h)
Book profile histogram based on TProfile.
Definition: DQMStore.cc:1362
std::string pwd_
Definition: DQMStore.h:873
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 1433 of file DQMStore.cc.

References bookProfile_(), and pwd_.

1437 {
1438  return bookProfile_(pwd_, name, new TProfile(name, title,
1439  nchX, xbinsize,
1440  lowY, highY,
1441  option));
1442 }
MonitorElement * bookProfile_(const std::string &dir, const std::string &name, TProfile *h)
Book profile histogram based on TProfile.
Definition: DQMStore.cc:1362
std::string pwd_
Definition: DQMStore.h:873
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 1448 of file DQMStore.cc.

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

1452 {
1453  return bookProfile_(pwd_, name, new TProfile(name.c_str(), title.c_str(),
1454  nchX, xbinsize,
1455  lowY, highY,
1456  option));
1457 }
MonitorElement * bookProfile_(const std::string &dir, const std::string &name, TProfile *h)
Book profile histogram based on TProfile.
Definition: DQMStore.cc:1362
std::string pwd_
Definition: DQMStore.h:873
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 1463 of file DQMStore.cc.

References bookProfile_(), and pwd_.

1467 {
1468  return bookProfile_(pwd_, name, new TProfile(name, title,
1469  nchX, xbinsize,
1470  lowY, highY,
1471  option));
1472 }
MonitorElement * bookProfile_(const std::string &dir, const std::string &name, TProfile *h)
Book profile histogram based on TProfile.
Definition: DQMStore.cc:1362
std::string pwd_
Definition: DQMStore.h:873
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 1478 of file DQMStore.cc.

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

1482 {
1483  return bookProfile_(pwd_, name, new TProfile(name.c_str(), title.c_str(),
1484  nchX, xbinsize,
1485  lowY, highY,
1486  option));
1487 }
MonitorElement * bookProfile_(const std::string &dir, const std::string &name, TProfile *h)
Book profile histogram based on TProfile.
Definition: DQMStore.cc:1362
std::string pwd_
Definition: DQMStore.h:873
MonitorElement * DQMStore::bookProfile ( const char *  name,
TProfile *  h 
)

Book TProfile by cloning an existing profile.

Definition at line 1491 of file DQMStore.cc.

References bookProfile_(), and pwd_.

1492 {
1493  return bookProfile_(pwd_, name, static_cast<TProfile *>(source->Clone(name)));
1494 }
MonitorElement * bookProfile_(const std::string &dir, const std::string &name, TProfile *h)
Book profile histogram based on TProfile.
Definition: DQMStore.cc:1362
std::string pwd_
Definition: DQMStore.h:873
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 1498 of file DQMStore.cc.

References bookProfile_(), and pwd_.

1499 {
1500  return bookProfile_(pwd_, name, static_cast<TProfile *>(source->Clone(name.c_str())));
1501 }
MonitorElement * bookProfile_(const std::string &dir, const std::string &name, TProfile *h)
Book profile histogram based on TProfile.
Definition: DQMStore.cc:1362
std::string pwd_
Definition: DQMStore.h:873
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 1517 of file DQMStore.cc.

References bookProfile2D_(), and pwd_.

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

1522 {
1523  return bookProfile2D_(pwd_, name, new TProfile2D(name, title,
1524  nchX, lowX, highX,
1525  nchY, lowY, highY,
1526  lowZ, highZ,
1527  option));
1528 }
MonitorElement * bookProfile2D_(const std::string &dir, const std::string &name, TProfile2D *h)
Book 2D profile histogram based on TProfile2D.
Definition: DQMStore.cc:1506
std::string pwd_
Definition: DQMStore.h:873
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 1534 of file DQMStore.cc.

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

1539 {
1540  return bookProfile2D_(pwd_, name, new TProfile2D(name.c_str(), title.c_str(),
1541  nchX, lowX, highX,
1542  nchY, lowY, highY,
1543  lowZ, highZ,
1544  option));
1545 }
MonitorElement * bookProfile2D_(const std::string &dir, const std::string &name, TProfile2D *h)
Book 2D profile histogram based on TProfile2D.
Definition: DQMStore.cc:1506
std::string pwd_
Definition: DQMStore.h:873
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 1551 of file DQMStore.cc.

References bookProfile2D_(), and pwd_.

1556 {
1557  return bookProfile2D_(pwd_, name, new TProfile2D(name, title,
1558  nchX, lowX, highX,
1559  nchY, lowY, highY,
1560  lowZ, highZ,
1561  option));
1562 }
MonitorElement * bookProfile2D_(const std::string &dir, const std::string &name, TProfile2D *h)
Book 2D profile histogram based on TProfile2D.
Definition: DQMStore.cc:1506
std::string pwd_
Definition: DQMStore.h:873
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 1568 of file DQMStore.cc.

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

1573 {
1574  return bookProfile2D_(pwd_, name, new TProfile2D(name.c_str(), title.c_str(),
1575  nchX, lowX, highX,
1576  nchY, lowY, highY,
1577  lowZ, highZ,
1578  option));
1579 }
MonitorElement * bookProfile2D_(const std::string &dir, const std::string &name, TProfile2D *h)
Book 2D profile histogram based on TProfile2D.
Definition: DQMStore.cc:1506
std::string pwd_
Definition: DQMStore.h:873
MonitorElement * DQMStore::bookProfile2D ( const char *  name,
TProfile2D *  h 
)

Book TProfile2D by cloning an existing profile.

Definition at line 1583 of file DQMStore.cc.

References bookProfile2D_(), and pwd_.

1584 {
1585  return bookProfile2D_(pwd_, name, static_cast<TProfile2D *>(source->Clone(name)));
1586 }
MonitorElement * bookProfile2D_(const std::string &dir, const std::string &name, TProfile2D *h)
Book 2D profile histogram based on TProfile2D.
Definition: DQMStore.cc:1506
std::string pwd_
Definition: DQMStore.h:873
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 1590 of file DQMStore.cc.

References bookProfile2D_(), and pwd_.

1591 {
1592  return bookProfile2D_(pwd_, name, static_cast<TProfile2D *>(source->Clone(name.c_str())));
1593 }
MonitorElement * bookProfile2D_(const std::string &dir, const std::string &name, TProfile2D *h)
Book 2D profile histogram based on TProfile2D.
Definition: DQMStore.cc:1506
std::string pwd_
Definition: DQMStore.h:873
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 1506 of file DQMStore.cc.

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

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

1507 {
1508  return book_(dir, name, "bookProfile2D",
1510  h, collateProfile2D);
1511 }
static void collateProfile2D(MonitorElement *me, TProfile2D *h, unsigned verbose)
Definition: DQMStore.cc:1685
MonitorElement * book_(const std::string &dir, const std::string &name, const char *context)
Definition: DQMStore.cc:896
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 1362 of file DQMStore.cc.

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

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

1363 {
1364  return book_(dir, name, "bookProfile",
1366  h, collateProfile);
1367 }
static void collateProfile(MonitorElement *me, TProfile *h, unsigned verbose)
Definition: DQMStore.cc:1675
MonitorElement * book_(const std::string &dir, const std::string &name, const char *context)
Definition: DQMStore.cc:896
dbl *** dir
Definition: mlp_gen.cc:35
MonitorElement * DQMStore::bookString ( const char *  name,
const char *  value 
)

Book string.

Definition at line 1007 of file DQMStore.cc.

References bookString_(), and pwd_.

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

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

Book string.

Definition at line 1012 of file DQMStore.cc.

References bookString_(), and pwd_.

1013 {
1014  return bookString_(pwd_, name, value);
1015 }
MonitorElement * bookString_(const std::string &dir, const std::string &name, const std::string &value)
Book string.
Definition: DQMStore.cc:991
Definition: value.py:1
std::string pwd_
Definition: DQMStore.h:873
MonitorElement * DQMStore::bookString_ ( const std::string &  dir,
const std::string &  name,
const std::string &  value 
)
private

Book string.

Definition at line 991 of file DQMStore.cc.

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

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

994 {
995  if (collateHistograms_)
996  {
998  return me;
999  }
1000 
1001  return book_(dir, name, "bookString")
1003 }
MonitorElement * initialise(Kind kind)
MonitorElement * findObject(const std::string &dir, const std::string &name, const uint32_t run=0, const uint32_t lumi=0, const uint32_t streamId=0, const uint32_t moduleId=0) const
Definition: DQMStore.cc:1942
uint32_t streamId_
Definition: DQMStore.h:869
uint32_t moduleId_
Definition: DQMStore.h:870
uint32_t run_
Definition: DQMStore.h:868
Definition: value.py:1
MonitorElement * book_(const std::string &dir, const std::string &name, const char *context)
Definition: DQMStore.cc:896
dbl *** dir
Definition: mlp_gen.cc:35
bool collateHistograms_
Definition: DQMStore.h:863
template<typename iFunc >
void DQMStore::bookTransaction ( iFunc  f,
uint32_t  run,
uint32_t  streamId,
uint32_t  moduleId 
)
inline

Definition at line 355 of file DQMStore.h.

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

Referenced by DQMEDAnalyzer::beginRun(), and thread_unsafe::DQMEDAnalyzer::beginRun().

358  {
359  std::lock_guard<std::mutex> guard(book_mutex_);
360  /* If enableMultiThread is not enabled we do not set run_,
361  streamId_ and moduleId_ to 0, since we rely on their default
362  initialization in DQMStore constructor. */
363  if (enableMultiThread_) {
364  run_ = run;
365  streamId_ = streamId;
366  moduleId_ = moduleId;
367  }
368  f(*ibooker_);
369 
370  /* Initialize to 0 the run_, streamId_ and moduleId_ variables
371  in case we run in mixed conditions with DQMEDAnalyzers and
372  legacy modules */
373  if (enableMultiThread_) {
374  run_ = 0;
375  streamId_ = 0;
376  moduleId_ = 0;
377  }
378  }
uint32_t streamId_
Definition: DQMStore.h:869
uint32_t moduleId_
Definition: DQMStore.h:870
std::mutex book_mutex_
Definition: DQMStore.h:881
double f[11][100]
uint32_t run_
Definition: DQMStore.h:868
IBooker * ibooker_
Definition: DQMStore.h:882
bool enableMultiThread_
Definition: DQMStore.h:864
void DQMStore::cd ( )

go to top directory (ie. root)

Definition at line 724 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(), meGetter(), SiStripInformationExtractor::printAlarmList(), SiStripActionExecutor::printFaultyModuleList(), SiStripInformationExtractor::printNonGeomHistoList(), SiStripInformationExtractor::printSummaryHistoList(), readFilePB(), DQMStore::IGetter::removeElement(), DQMFileSaver::saveForOffline(), DQMFileSaver::saveForOnline(), SiStripTrackerMapCreator::setTkMapFromHistogram(), and dqm_interfaces.DirWalkerFile::walk().

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

cd to subdirectory (if there)

Definition at line 729 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().

730 {
732  const std::string *cleaned = nullptr;
733  cleanTrailingSlashes(subdir, clean, cleaned);
734 
735  if (! dirExists(*cleaned))
736  raiseDQMError("DQMStore", "Cannot 'cd' into non-existent directory '%s'",
737  cleaned->c_str());
738 
739  setCurrentFolder(*cleaned);
740 }
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:812
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:747
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 2534 of file DQMStore.cc.

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

Referenced by mtEnabled(), and save().

2535 {
2536  assert(! path.empty());
2537 
2538  // Find the first path component.
2539  size_t start = 0;
2540  size_t end = path.find('/', start);
2541  if (end == std::string::npos)
2542  end = path.size();
2543 
2544  while (true)
2545  {
2546  // Check if this subdirectory component exists. If yes, make sure
2547  // it is actually a subdirectory. Otherwise create or cd into it.
2548  std::string part(path, start, end-start);
2549  TObject *o = gDirectory->Get(part.c_str());
2550  if (o && ! dynamic_cast<TDirectory *>(o))
2551  raiseDQMError("DQMStore", "Attempt to create directory '%s' in a file"
2552  " fails because the part '%s' already exists and is not"
2553  " directory", path.c_str(), part.c_str());
2554  else if (! o)
2555  gDirectory->mkdir(part.c_str());
2556 
2557  if (! gDirectory->cd(part.c_str()))
2558  raiseDQMError("DQMStore", "Attempt to create directory '%s' in a file"
2559  " fails because could not cd into subdirectory '%s'",
2560  path.c_str(), part.c_str());
2561 
2562  // Stop if we reached the end, ignoring any trailing '/'.
2563  if (end+1 >= path.size())
2564  break;
2565 
2566  // Find the next path component.
2567  start = end+1;
2568  end = path.find('/', start);
2569  if (end == std::string::npos)
2570  end = path.size();
2571  }
2572 
2573  return true;
2574 }
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 1599 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().

1600 {
1601  if (me->getTH1()->GetNbinsX() != h->GetNbinsX()
1602  || me->getTH1()->GetNbinsY() != h->GetNbinsY()
1603  || me->getTH1()->GetNbinsZ() != h->GetNbinsZ()
1604  || me->getTH1()->GetXaxis()->GetXmin() != h->GetXaxis()->GetXmin()
1605  || me->getTH1()->GetYaxis()->GetXmin() != h->GetYaxis()->GetXmin()
1606  || me->getTH1()->GetZaxis()->GetXmin() != h->GetZaxis()->GetXmin()
1607  || me->getTH1()->GetXaxis()->GetXmax() != h->GetXaxis()->GetXmax()
1608  || me->getTH1()->GetYaxis()->GetXmax() != h->GetYaxis()->GetXmax()
1609  || me->getTH1()->GetZaxis()->GetXmax() != h->GetZaxis()->GetXmax()
1610  || !MonitorElement::CheckBinLabels((TAxis*)me->getTH1()->GetXaxis(),(TAxis*)h->GetXaxis())
1611  || !MonitorElement::CheckBinLabels((TAxis*)me->getTH1()->GetYaxis(),(TAxis*)h->GetYaxis())
1612  || !MonitorElement::CheckBinLabels((TAxis*)me->getTH1()->GetZaxis(),(TAxis*)h->GetZaxis()) )
1613  {
1614  if(verbose > 0)
1615  std::cout << "*** DQMStore: WARNING:"
1616  << "checkBinningMatches: different binning - cannot add object '"
1617  << h->GetName() << "' of type "
1618  << h->IsA()->GetName() << " to existing ME: '"
1619  << me->getFullname() << "'\n";
1620  return false;
1621  }
1622  return true;
1623 }
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::collate1D ( MonitorElement me,
TH1F *  h,
unsigned  verbose 
)
staticprivate

Definition at line 1626 of file DQMStore.cc.

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

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

1627 {
1628  if (checkBinningMatches(me,h,verbose))
1629  me->getTH1F()->Add(h);
1630 }
TH1F * getTH1F() const
static bool checkBinningMatches(MonitorElement *me, TH1 *h, unsigned verbose)
Definition: DQMStore.cc:1599
void DQMStore::collate1DD ( MonitorElement me,
TH1D *  h,
unsigned  verbose 
)
staticprivate

Definition at line 1640 of file DQMStore.cc.

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

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

1641 {
1642  if (checkBinningMatches(me,h,verbose))
1643  me->getTH1D()->Add(h);
1644 }
TH1D * getTH1D() const
static bool checkBinningMatches(MonitorElement *me, TH1 *h, unsigned verbose)
Definition: DQMStore.cc:1599
void DQMStore::collate1S ( MonitorElement me,
TH1S *  h,
unsigned  verbose 
)
staticprivate

Definition at line 1633 of file DQMStore.cc.

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

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

1634 {
1635  if (checkBinningMatches(me,h,verbose))
1636  me->getTH1S()->Add(h);
1637 }
TH1S * getTH1S() const
static bool checkBinningMatches(MonitorElement *me, TH1 *h, unsigned verbose)
Definition: DQMStore.cc:1599
void DQMStore::collate2D ( MonitorElement me,
TH2F *  h,
unsigned  verbose 
)
staticprivate

Definition at line 1647 of file DQMStore.cc.

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

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

1648 {
1649  if (checkBinningMatches(me,h,verbose))
1650  me->getTH2F()->Add(h);
1651 }
TH2F * getTH2F() const
static bool checkBinningMatches(MonitorElement *me, TH1 *h, unsigned verbose)
Definition: DQMStore.cc:1599
void DQMStore::collate2DD ( MonitorElement me,
TH2D *  h,
unsigned  verbose 
)
staticprivate

Definition at line 1661 of file DQMStore.cc.

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

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

1662 {
1663  if (checkBinningMatches(me,h,verbose))
1664  me->getTH2D()->Add(h);
1665 }
TH2D * getTH2D() const
static bool checkBinningMatches(MonitorElement *me, TH1 *h, unsigned verbose)
Definition: DQMStore.cc:1599
void DQMStore::collate2S ( MonitorElement me,
TH2S *  h,
unsigned  verbose 
)
staticprivate

Definition at line 1654 of file DQMStore.cc.

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

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

1655 {
1656  if (checkBinningMatches(me,h,verbose))
1657  me->getTH2S()->Add(h);
1658 }
TH2S * getTH2S() const
static bool checkBinningMatches(MonitorElement *me, TH1 *h, unsigned verbose)
Definition: DQMStore.cc:1599
void DQMStore::collate3D ( MonitorElement me,
TH3F *  h,
unsigned  verbose 
)
staticprivate

Definition at line 1668 of file DQMStore.cc.

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

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

1669 {
1670  if (checkBinningMatches(me,h,verbose))
1671  me->getTH3F()->Add(h);
1672 }
TH3F * getTH3F() const
static bool checkBinningMatches(MonitorElement *me, TH1 *h, unsigned verbose)
Definition: DQMStore.cc:1599
void DQMStore::collateProfile ( MonitorElement me,
TProfile *  h,
unsigned  verbose 
)
staticprivate

Definition at line 1675 of file DQMStore.cc.

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

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

1676 {
1677  if (checkBinningMatches(me,h,verbose))
1678  {
1679  TProfile *meh = me->getTProfile();
1680  me->addProfiles(h, meh, meh, 1, 1);
1681  }
1682 }
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:1599
void DQMStore::collateProfile2D ( MonitorElement me,
TProfile2D *  h,
unsigned  verbose 
)
staticprivate

Definition at line 1685 of file DQMStore.cc.

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

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

1686 {
1687  if (checkBinningMatches(me,h,verbose))
1688  {
1689  TProfile2D *meh = me->getTProfile2D();
1690  me->addProfiles(h, meh, meh, 1, 1);
1691  }
1692 }
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:1599
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 1803 of file DQMStore.cc.

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

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

1804 {
1805  MonitorElement proto(&path, std::string());
1806  auto e = data_.end();
1807  auto i = data_.lower_bound(proto);
1808  return (i != e && isSubdirectory(path, *i->data_.dirname));
1809 }
static bool isSubdirectory(const std::string &ofdir, const std::string &path)
Definition: DQMStore.cc:73
MEMap data_
Definition: DQMStore.h:874
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 3432 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().

3433 {
3434  if (qtests_.count(qtname))
3435  raiseDQMError("DQMStore", "Attempt to create duplicate quality test '%s'",
3436  qtname.c_str());
3437 
3438  auto i = qalgos_.find(algoname);
3439  if (i == qalgos_.end())
3440  raiseDQMError("DQMStore", "Cannot create a quality test using unknown"
3441  " algorithm '%s'", algoname.c_str());
3442 
3443  QCriterion *qc = i->second(qtname);
3444  qc->setVerbose(verboseQT_);
3445 
3446  qtests_[qtname] = qc;
3447  return qc;
3448 }
QCMap qtests_
Definition: DQMStore.h:877
unsigned verboseQT_
Definition: DQMStore.h:860
QAMap qalgos_
Definition: DQMStore.h:878
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 2190 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().

2191 {
2192  if (!enableMultiThread_)
2193  return;
2194 
2195  std::lock_guard<std::mutex> guard(book_mutex_);
2196 
2197  std::string null_str("");
2198  MonitorElement proto(&null_str, null_str, run, 0, 0);
2199  proto.setLumi(lumi);
2200 
2201  auto e = data_.end();
2202  auto i = data_.lower_bound(proto);
2203 
2204  while (i != e) {
2205  if (i->data_.streamId != 0 ||
2206  i->data_.moduleId != 0)
2207  break;
2208  if (i->data_.lumi != lumi)
2209  break;
2210  if (i->data_.run != run)
2211  break;
2212  if (not i->markedToDelete()) {
2213  ++i;
2214  continue;
2215  }
2216 
2217  if (verbose_ > 1) {
2218  std::cout << "DQMStore::deleteUnusedLumiHistograms: deleted monitor element '"
2219  << *i->data_.dirname << "/" << i->data_.objname << "'"
2220  << "flags " << i->data_.flags << "\n";
2221  }
2222 
2223  i = data_.erase(i);
2224  }
2225 }
std::mutex book_mutex_
Definition: DQMStore.h:881
unsigned verbose_
Definition: DQMStore.h:859
MEMap data_
Definition: DQMStore.h:874
bool enableMultiThread_
Definition: DQMStore.h:864
bool DQMStore::dirExists ( const std::string &  path) const
void DQMStore::disableSoftReset ( MonitorElement me)

Definition at line 3566 of file DQMStore.cc.

References MonitorElement::disableSoftReset().

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

3567 {
3568  if (me)
3569  me->disableSoftReset();
3570 }
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 2233 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().

2235 {
2236  // NB: Profile histograms inherit from TH*D, checking order matters.
2237  MonitorElement *refcheck = nullptr;
2238  if (auto *h = dynamic_cast<TProfile *>(obj))
2239  {
2240  MonitorElement *me = findObject(dir, h->GetName());
2241  if (! me)
2242  me = bookProfile_(dir, h->GetName(), (TProfile *) h->Clone());
2243  else if (overwrite)
2244  me->copyFrom(h);
2245  else if (isCollateME(me) || collateHistograms)
2246  collateProfile(me, h, verbose_);
2247  refcheck = me;
2248  }
2249  else if (auto *h = dynamic_cast<TProfile2D *>(obj))
2250  {
2251  MonitorElement *me = findObject(dir, h->GetName());
2252  if (! me)
2253  me = bookProfile2D_(dir, h->GetName(), (TProfile2D *) h->Clone());
2254  else if (overwrite)
2255  me->copyFrom(h);
2256  else if (isCollateME(me) || collateHistograms)
2257  collateProfile2D(me, h, verbose_);
2258  refcheck = me;
2259  }
2260  else if (auto *h = dynamic_cast<TH1F *>(obj))
2261  {
2262  MonitorElement *me = findObject(dir, h->GetName());
2263  if (! me)
2264  me = book1D_(dir, h->GetName(), (TH1F *) h->Clone());
2265  else if (overwrite)
2266  me->copyFrom(h);
2267  else if (isCollateME(me) || collateHistograms)
2268  collate1D(me, h, verbose_);
2269  refcheck = me;
2270  }
2271  else if (auto *h = dynamic_cast<TH1S *>(obj))
2272  {
2273  MonitorElement *me = findObject(dir, h->GetName());
2274  if (! me)
2275  me = book1S_(dir, h->GetName(), (TH1S *) h->Clone());
2276  else if (overwrite)
2277  me->copyFrom(h);
2278  else if (isCollateME(me) || collateHistograms)
2279  collate1S(me, h, verbose_);
2280  refcheck = me;
2281  }
2282  else if (auto *h = dynamic_cast<TH1D *>(obj))
2283  {
2284  MonitorElement *me = findObject(dir, h->GetName());
2285  if (! me)
2286  me = book1DD_(dir, h->GetName(), (TH1D *) h->Clone());
2287  else if (overwrite)
2288  me->copyFrom(h);
2289  else if (isCollateME(me) || collateHistograms)
2290  collate1DD(me, h, verbose_);
2291  refcheck = me;
2292  }
2293  else if (auto *h = dynamic_cast<TH2F *>(obj))
2294  {
2295  MonitorElement *me = findObject(dir, h->GetName());
2296  if (! me)
2297  me = book2D_(dir, h->GetName(), (TH2F *) h->Clone());
2298  else if (overwrite)
2299  me->copyFrom(h);
2300  else if (isCollateME(me) || collateHistograms)
2301  collate2D(me, h, verbose_);
2302  refcheck = me;
2303  }
2304  else if (auto *h = dynamic_cast<TH2S *>(obj))
2305  {
2306  MonitorElement *me = findObject(dir, h->GetName());
2307  if (! me)
2308  me = book2S_(dir, h->GetName(), (TH2S *) h->Clone());
2309  else if (overwrite)
2310  me->copyFrom(h);
2311  else if (isCollateME(me) || collateHistograms)
2312  collate2S(me, h, verbose_);
2313  refcheck = me;
2314  }
2315  else if (auto *h = dynamic_cast<TH2D *>(obj))
2316  {
2317  MonitorElement *me = findObject(dir, h->GetName());
2318  if (! me)
2319  me = book2DD_(dir, h->GetName(), (TH2D *) h->Clone());
2320  else if (overwrite)
2321  me->copyFrom(h);
2322  else if (isCollateME(me) || collateHistograms)
2323  collate2DD(me, h, verbose_);
2324  refcheck = me;
2325  }
2326  else if (auto *h = dynamic_cast<TH3F *>(obj))
2327  {
2328  MonitorElement *me = findObject(dir, h->GetName());
2329  if (! me)
2330  me = book3D_(dir, h->GetName(), (TH3F *) h->Clone());
2331  else if (overwrite)
2332  me->copyFrom(h);
2333  else if (isCollateME(me) || collateHistograms)
2334  collate3D(me, h, verbose_);
2335  refcheck = me;
2336  }
2337  else if (dynamic_cast<TObjString *>(obj))
2338  {
2339  lat::RegexpMatch m;
2340  if (! s_rxmeval.match(obj->GetName(), 0, 0, &m))
2341  {
2342  if (strstr(obj->GetName(), "CMSSW"))
2343  {
2344  if (verbose_)
2345  std::cout << "Input file version: " << obj->GetName() << std::endl;
2346  return true;
2347  }
2348  else if (strstr(obj->GetName(), "DQMPATCH"))
2349  {
2350  if (verbose_)
2351  std::cout << "DQM patch version: " << obj->GetName() << std::endl;
2352  return true;
2353  }
2354  else
2355  {
2356  std::cout << "*** DQMStore: WARNING: cannot extract object '"
2357  << obj->GetName() << "' of type '"
2358  << obj->IsA()->GetName() << "'\n";
2359  return false;
2360  }
2361  }
2362 
2363  std::string label = m.matchString(obj->GetName(), 1);
2364  std::string kind = m.matchString(obj->GetName(), 2);
2365  std::string value = m.matchString(obj->GetName(), 3);
2366 
2367  if (kind == "i")
2368  {
2369  MonitorElement *me = findObject(dir, label);
2370  if (! me || overwrite)
2371  {
2372  if (! me) me = bookInt_(dir, label);
2373  me->Fill(atoll(value.c_str()));
2374  }
2375  }
2376  else if (kind == "f")
2377  {
2378  MonitorElement *me = findObject(dir, label);
2379  if (! me || overwrite)
2380  {
2381  if (! me) me = bookFloat_(dir, label);
2382  me->Fill(atof(value.c_str()));
2383  }
2384  }
2385  else if (kind == "s")
2386  {
2387  MonitorElement *me = findObject(dir, label);
2388  if (! me)
2389  me = bookString_(dir, label, value);
2390  else if (overwrite)
2391  me->Fill(value);
2392  }
2393  else if (kind == "e")
2394  {
2395  MonitorElement *me = findObject(dir, label);
2396  if (! me)
2397  {
2398  std::cout << "*** DQMStore: WARNING: no monitor element '"
2399  << label << "' in directory '"
2400  << dir << "' to be marked as efficiency plot.\n";
2401  return false;
2402  }
2403  me->setEfficiencyFlag();
2404  }
2405  else if (kind == "t")
2406  {
2407  MonitorElement *me = findObject(dir, label);
2408  if (! me)
2409  {
2410  std::cout << "*** DQMStore: WARNING: no monitor element '"
2411  << label << "' in directory '"
2412  << dir << "' for a tag\n";
2413  return false;
2414  }
2415  errno = 0;
2416  char *endp = nullptr;
2417  unsigned long val = strtoul(value.c_str(), &endp, 10);
2418  if ((val == 0 && errno) || *endp || val > ~uint32_t(0))
2419  {
2420  std::cout << "*** DQMStore: WARNING: cannot restore tag '"
2421  << value << "' for monitor element '"
2422  << label << "' in directory '"
2423  << dir << "' - invalid value\n";
2424  return false;
2425  }
2426  tag(me, val);
2427  }
2428  else if (kind == "qr")
2429  {
2430  // Handle qreports, but skip them while reading in references.
2432  {
2433  size_t dot = label.find('.');
2434  if (dot == std::string::npos)
2435  {
2436  std::cout << "*** DQMStore: WARNING: quality report label in '" << label
2437  << "' is missing a '.' and cannot be extracted\n";
2438  return false;
2439  }
2440 
2441  std::string mename (label, 0, dot);
2442  std::string qrname (label, dot+1, std::string::npos);
2443 
2444  m.reset();
2445  DQMNet::QValue qv;
2446  if (s_rxmeqr1.match(value, 0, 0, &m))
2447  {
2448  qv.code = atoi(m.matchString(value, 1).c_str());
2449  qv.qtresult = strtod(m.matchString(value, 2).c_str(), nullptr);
2450  qv.message = m.matchString(value, 4);
2451  qv.qtname = qrname;
2452  qv.algorithm = m.matchString(value, 3);
2453  }
2454  else if (s_rxmeqr2.match(value, 0, 0, &m))
2455  {
2456  qv.code = atoi(m.matchString(value, 1).c_str());
2457  qv.qtresult = 0; // unavailable in old format
2458  qv.message = m.matchString(value, 2);
2459  qv.qtname = qrname;
2460  // qv.algorithm unavailable in old format
2461  }
2462  else
2463  {
2464  std::cout << "*** DQMStore: WARNING: quality test value '"
2465  << value << "' is incorrectly formatted\n";
2466  return false;
2467  }
2468 
2469  MonitorElement *me = findObject(dir, mename);
2470  if (! me)
2471  {
2472  std::cout << "*** DQMStore: WARNING: no monitor element '"
2473  << mename << "' in directory '"
2474  << dir << "' for quality test '"
2475  << label << "'\n";
2476  return false;
2477  }
2478 
2479  me->addQReport(qv, /* FIXME: getQTest(qv.qtname)? */ nullptr);
2480  }
2481  }
2482  else
2483  {
2484  std::cout << "*** DQMStore: WARNING: cannot extract object '"
2485  << obj->GetName() << "' of type '"
2486  << obj->IsA()->GetName() << "'\n";
2487  return false;
2488  }
2489  }
2490  else if (auto *n = dynamic_cast<TNamed *>(obj))
2491  {
2492  // For old DQM data.
2493  std::string s;
2494  s.reserve(6 + strlen(n->GetTitle()) + 2*strlen(n->GetName()));
2495  s += '<'; s += n->GetName(); s += '>';
2496  s += n->GetTitle();
2497  s += '<'; s += '/'; s += n->GetName(); s += '>';
2498  TObjString os(s.c_str());
2499  return extract(&os, dir, overwrite, collateHistograms_);
2500  }
2501  else
2502  {
2503  std::cout << "*** DQMStore: WARNING: cannot extract object '"
2504  << obj->GetName() << "' of type '" << obj->IsA()->GetName()
2505  << "' and with title '" << obj->GetTitle() << "'\n";
2506  return false;
2507  }
2508 
2509  // If we just read in a reference MonitorElement, and there is a
2510  // MonitorElement with the same name, link the two together.
2511  // The other direction is handled by the book() method.
2512  if (refcheck && isSubdirectory(s_referenceDirName, dir))
2513  {
2514  std::string mdir(dir, s_referenceDirName.size()+1, std::string::npos);
2515  if (MonitorElement *master = findObject(mdir, obj->GetName()))
2516  {
2517  // We have extracted a MonitorElement, and it's located in the reference
2518  // dir. Then we find the corresponding MonitorElement in the
2519  // non-reference dir and assign the object_ of the reference
2520  // MonitorElement to the reference_ property of the corresponding
2521  // non-reference MonitorElement.
2522  master->data_.flags |= DQMNet::DQM_PROP_HAS_REFERENCE;
2523  master->reference_ = refcheck->object_;
2524  }
2525  }
2526 
2527  return true;
2528 }
MonitorElement * book2DD_(const std::string &dir, const std::string &name, TH2D *h)
Book 2D histogram based on TH2D.
Definition: DQMStore.cc:1162
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:3614
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:1506
std::string algorithm
Definition: DQMNet.h:94
static void collate3D(MonitorElement *me, TH3F *h, unsigned verbose)
Definition: DQMStore.cc:1668
MonitorElement * findObject(const std::string &dir, const std::string &name, const uint32_t run=0, const uint32_t lumi=0, const uint32_t streamId=0, const uint32_t moduleId=0) const
Definition: DQMStore.cc:1942
static void collateProfile(MonitorElement *me, TProfile *h, unsigned verbose)
Definition: DQMStore.cc:1675
static void collate2DD(MonitorElement *me, TH2D *h, unsigned verbose)
Definition: DQMStore.cc:1661
void Fill(long long x)
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1699
MonitorElement * book2D_(const std::string &dir, const std::string &name, TH2F *h)
Book 2D histogram based on TH2F.
Definition: DQMStore.cc:1148
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:991
MonitorElement * book3D_(const std::string &dir, const std::string &name, TH3F *h)
Book 3D histogram based on TH3F.
Definition: DQMStore.cc:1314
static void collateProfile2D(MonitorElement *me, TProfile2D *h, unsigned verbose)
Definition: DQMStore.cc:1685
MonitorElement * bookInt_(const std::string &dir, const std::string &name)
Book int.
Definition: DQMStore.cc:931
MonitorElement * bookProfile_(const std::string &dir, const std::string &name, TProfile *h)
Book profile histogram based on TProfile.
Definition: DQMStore.cc:1362
Definition: value.py:1
std::string qtname
Definition: DQMNet.h:93
static void collate1DD(MonitorElement *me, TH1D *h, unsigned verbose)
Definition: DQMStore.cc:1640
unsigned verbose_
Definition: DQMStore.h:859
MonitorElement * book2S_(const std::string &dir, const std::string &name, TH2S *h)
Book 2D histogram based on TH2S.
Definition: DQMStore.cc:1155
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:1020
static void collate1D(MonitorElement *me, TH1F *h, unsigned verbose)
Definition: DQMStore.cc:1626
MonitorElement * book1DD_(const std::string &dir, const std::string &name, TH1D *h)
Book 1D histogram based on TH1D.
Definition: DQMStore.cc:1034
bool extract(TObject *obj, const std::string &dir, bool overwrite, bool collateHistograms)
Definition: DQMStore.cc:2233
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:1633
dbl *** dir
Definition: mlp_gen.cc:35
MonitorElement * bookFloat_(const std::string &dir, const std::string &name)
Book float.
Definition: DQMStore.cc:961
static void collate2D(MonitorElement *me, TH2F *h, unsigned verbose)
Definition: DQMStore.cc:1647
float qtresult
Definition: DQMNet.h:91
bool collateHistograms_
Definition: DQMStore.h:863
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:1654
MonitorElement * book1S_(const std::string &dir, const std::string &name, TH1S *h)
Book 1D histogram based on TH1S.
Definition: DQMStore.cc:1027
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 3244 of file DQMStore.cc.

Referenced by get_info().

3244  {
3245  if (buf.Length() == buf.BufferSize())
3246  return nullptr;
3247  buf.InitMap();
3248  void *ptr = buf.ReadObjectAny(nullptr);
3249  return reinterpret_cast<TObject *>(ptr);
3250 }
MonitorElement * DQMStore::findObject ( const std::string &  dir,
const std::string &  name,
const uint32_t  run = 0,
const uint32_t  lumi = 0,
const uint32_t  streamId = 0,
const uint32_t  moduleId = 0 
) const
private

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

Definition at line 1942 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, s_safe, and DQMNet::CoreObject::streamId.

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

1948 {
1949  if (dir.find_first_not_of(s_safe) != std::string::npos)
1950  raiseDQMError("DQMStore", "Monitor element path name '%s' uses"
1951  " unacceptable characters", dir.c_str());
1952  if (name.find_first_not_of(s_safe) != std::string::npos)
1953  raiseDQMError("DQMStore", "Monitor element path name '%s' uses"
1954  " unacceptable characters", name.c_str());
1955 
1956  MonitorElement proto;
1957  proto.data_.dirname = &dir;
1958  proto.data_.objname = name;
1959  proto.data_.run = run;
1960  proto.data_.lumi = lumi;
1961  proto.data_.streamId = streamId;
1962  proto.data_.moduleId = moduleId;
1963 
1964  auto mepos = data_.find(proto);
1965  return (mepos == data_.end() ? nullptr
1966  : const_cast<MonitorElement *>(&*mepos));
1967 }
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:874
dbl *** dir
Definition: mlp_gen.cc:35
uint32_t streamId
Definition: DQMNet.h:104
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 2134 of file DQMStore.cc.

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

Referenced by DQMStore(), and mtEnabled().

2135 {
2136  auto mi = data_.begin();
2137  auto me = data_.end();
2138  for ( ; mi != me; ++mi)
2139  {
2140  if (forceResetOnBeginLumi_ && ((*mi).getLumiFlag() == false))
2141  continue;
2142  auto &me = const_cast<MonitorElement &>(*mi);
2143  me.Reset();
2144  me.resetUpdate();
2145  }
2146 
2147  reset_ = true;
2148 }
bool reset_
Definition: DQMStore.h:861
void Reset()
reset ME (ie. contents, errors, etc)
MEMap data_
Definition: DQMStore.h:874
bool forceResetOnBeginLumi_
Definition: DQMStore.h:866
MonitorElement * DQMStore::get ( const std::string &  path) const

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

Definition at line 1813 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(), TauDQMHistEffProducer::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(), TkHistoMap::loadTkHistoMap(), SiStripHistoPlotter::makePlot(), SiStripInformationExtractor::plotHistosFromLayout(), SiStripActionExecutor::printShiftHistoParameters(), QTestStatusChecker::processAlarms(), rrapi.RRApi::report(), util.rrapi.RRApi::report(), rrapi.RRApi::reports(), util.rrapi.RRApi::reports(), EgHLTOfflineSummaryClient::runClient_(), DQMFileSaver::saveForOffline(), DQMFileSaver::saveForOnline(), util.rrapi.RRApi::tables(), rrapi.RRApi::tables(), rrapi.RRApi::tags(), util.rrapi.RRApi::tags(), rrapi.RRApi::templates(), util.rrapi.RRApi::templates(), rrapi.RRApi::workspaces(), and util.rrapi.RRApi::workspaces().

1814 {
1815  std::string dir;
1816  std::string name;
1817  splitPath(dir, name, path);
1818  MonitorElement proto(&dir, name);
1819  auto mepos = data_.find(proto);
1820  return (mepos == data_.end() ? nullptr
1821  : const_cast<MonitorElement *>(&*mepos));
1822 }
static void splitPath(std::string &dir, std::string &name, const std::string &path)
Definition: DQMStore.cc:100
MEMap data_
Definition: DQMStore.h:874
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 1826 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().

1827 {
1828  // FIXME: Use reverse map [tag -> path] / [tag -> dir]?
1829  std::vector<MonitorElement *> result;
1830  for (auto const & me : data_)
1831  {
1832  if ((me.data_.flags & DQMNet::DQM_PROP_TAGGED) && me.data_.tag == tag)
1833  result.push_back(const_cast<MonitorElement *>(&me));
1834  }
1835  return result;
1836 }
static const uint32_t DQM_PROP_TAGGED
Definition: DQMNet.h:55
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1699
MEMap data_
Definition: DQMStore.h:874
void DQMStore::get_info ( const dqmstorepb::ROOTFilePB_Histo h,
std::string &  dirname,
std::string &  objname,
TObject **  obj 
)
private

Definition at line 3252 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().

3255  {
3256 
3257  size_t slash = h.full_pathname().rfind('/');
3258  size_t dirpos = (slash == std::string::npos ? 0 : slash);
3259  size_t namepos = (slash == std::string::npos ? 0 : slash+1);
3260  dirname.assign(h.full_pathname(), 0, dirpos);
3261  objname.assign(h.full_pathname(), namepos, std::string::npos);
3262  TBufferFile buf(TBufferFile::kRead, h.size(),
3263  (void*)h.streamed_histo().data(),
3264  kFALSE);
3265  buf.Reset();
3266  *obj = extractNextObject(buf);
3267  if (!*obj) {
3268  raiseDQMError("DQMStore", "Error reading element:'%s'" , h.full_pathname().c_str());
3269  }
3270 }
::google::protobuf::uint32 size() const
const ::std::string & full_pathname() const
const ::std::string & streamed_histo() const
TObject * extractNextObject(TBufferFile &) const
Definition: DQMStore.cc:3244
void raiseDQMError(const char *context, const char *fmt,...)
Definition: DQMError.cc:11
std::vector< MonitorElement * > DQMStore::getAllContents ( const std::string &  path,
uint32_t  runNumber = 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 2025 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().

2028 {
2030  const std::string *cleaned = nullptr;
2031  cleanTrailingSlashes(path, clean, cleaned);
2032  MonitorElement proto(cleaned, std::string(), runNumber);
2033  proto.setLumi(lumi);
2034 
2035  std::vector<MonitorElement *> result;
2036  auto e = data_.end();
2037  auto i = data_.lower_bound(proto);
2038  for ( ; i != e && isSubdirectory(*cleaned, *i->data_.dirname); ++i) {
2039  if (runNumber != 0) {
2040  if (i->data_.run > runNumber // TODO[rovere]: pleonastic? first we encounter local ME of the same run ...
2041  || i->data_.streamId != 0
2042  || i->data_.moduleId != 0)
2043  break;
2044  }
2045  if (lumi != 0) {
2046  if (i->data_.lumi > lumi
2047  || i->data_.streamId != 0
2048  || i->data_.moduleId != 0)
2049  break;
2050  }
2051  if (runNumber != 0 or lumi !=0) {
2052  assert(i->data_.streamId == 0);
2053  assert(i->data_.moduleId == 0);
2054  }
2055  result.push_back(const_cast<MonitorElement *>(&*i));
2056  }
2057 
2058  if (enableMultiThread_)
2059  {
2060  //save legacy modules when running MT
2061  i = data_.begin();
2062  for ( ; i != e && isSubdirectory(*cleaned, *i->data_.dirname); ++i) {
2063  if (i->data_.run != 0 || i->data_.streamId != 0 || i->data_.moduleId != 0) break;
2064  result.push_back(const_cast<MonitorElement *>(&*i));
2065  }
2066  }
2067 
2068  return result;
2069 }
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:874
bool enableMultiThread_
Definition: DQMStore.h:864
void DQMStore::getAllTags ( std::vector< std::string > &  into) const

get tags for various maps, return vector with strings of the form <dir pathname>="">:<obj1>/<tag1>/<tag2>,<obj2>/<tag1>/<tag3>, etc.

Definition at line 1972 of file DQMStore.cc.

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

Referenced by mtEnabled().

1973 {
1974  into.clear();
1975  into.reserve(dirs_.size());
1976 
1977  auto me = data_.end();
1978  auto di = dirs_.begin();
1979  auto de = dirs_.end();
1980  char tagbuf[32]; // more than enough for '/' and up to 10 digits
1981 
1982  for ( ; di != de; ++di)
1983  {
1984  MonitorElement proto(&*di, std::string());
1985  auto mi = data_.lower_bound(proto);
1986  auto m = mi;
1987  size_t sz = di->size() + 2;
1988  size_t nfound = 0;
1989  for ( ; m != me && isSubdirectory(*di, *m->data_.dirname); ++m)
1990  if (*di == *m->data_.dirname && (m->data_.flags & DQMNet::DQM_PROP_TAGGED))
1991  {
1992  // the tags count for '/' + up to 10 digits, otherwise ',' + ME name
1993  sz += 1 + m->data_.objname.size() + 11;
1994  ++nfound;
1995  }
1996 
1997  if (! nfound)
1998  continue;
1999 
2000  auto istr
2001  = into.insert(into.end(), std::string());
2002 
2003  istr->reserve(sz);
2004 
2005  *istr += *di;
2006  *istr += ':';
2007  for (sz = 0; mi != m; ++mi)
2008  {
2009  if (*di == *m->data_.dirname && (m->data_.flags & DQMNet::DQM_PROP_TAGGED))
2010  {
2011  sprintf(tagbuf, "/%u", mi->data_.tag);
2012  if (sz > 0)
2013  *istr += ',';
2014  *istr += m->data_.objname;
2015  *istr += tagbuf;
2016  ++sz;
2017  }
2018  }
2019  }
2020 }
static const uint32_t DQM_PROP_TAGGED
Definition: DQMNet.h:55
static bool isSubdirectory(const std::string &ofdir, const std::string &path)
Definition: DQMStore.cc:73
MEMap data_
Definition: DQMStore.h:874
std::set< std::string > dirs_
Definition: DQMStore.h:875
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 1841 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(), meGetter(), SiStripInformationExtractor::printAlarmList(), SiStripActionExecutor::printFaultyModuleList(), SiStripInformationExtractor::printNonGeomHistoList(), SiStripInformationExtractor::printSummaryHistoList(), SiStripTrackerMapCreator::setTkMapFromHistogram(), and showDirStructure().

1842 {
1844  const std::string *cleaned = nullptr;
1845  cleanTrailingSlashes(path, clean, cleaned);
1846  MonitorElement proto(cleaned, std::string());
1847 
1848  std::vector<MonitorElement *> result;
1849  auto e = data_.end();
1850  auto i = data_.lower_bound(proto);
1851  for ( ; i != e && isSubdirectory(*cleaned, *i->data_.dirname); ++i)
1852  if (*cleaned == *i->data_.dirname)
1853  result.push_back(const_cast<MonitorElement *>(&*i));
1854 
1855  return result;
1856 }
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:874
std::vector< MonitorElement * > DQMStore::getContents ( const std::string &  path,
unsigned int  tag 
) const

same as above for tagged MonitorElements

Definition at line 1860 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().

1861 {
1863  const std::string *cleaned = nullptr;
1864  cleanTrailingSlashes(path, clean, cleaned);
1865  MonitorElement proto(cleaned, std::string());
1866 
1867  std::vector<MonitorElement *> result;
1868  auto e = data_.end();
1869  auto i = data_.lower_bound(proto);
1870  for ( ; i != e && isSubdirectory(*cleaned, *i->data_.dirname); ++i)
1871  if (*cleaned == *i->data_.dirname
1872  && (i->data_.flags & DQMNet::DQM_PROP_TAGGED)
1873  && i->data_.tag == tag)
1874  result.push_back(const_cast<MonitorElement *>(&*i));
1875 
1876  return result;
1877 }
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:1699
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:874
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 1884 of file DQMStore.cc.

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

1885 {
1886  into.clear();
1887  into.reserve(dirs_.size());
1888 
1889  auto me = data_.end();
1890  auto di = dirs_.begin();
1891  auto de = dirs_.end();
1892  for ( ; di != de; ++di)
1893  {
1894  MonitorElement proto(&*di, std::string());
1895  auto mi = data_.lower_bound(proto);
1896  auto m = mi;
1897  size_t sz = di->size() + 2;
1898  size_t nfound = 0;
1899  for ( ; m != me && isSubdirectory(*di, *m->data_.dirname); ++m)
1900  if (*di == *m->data_.dirname)
1901  {
1902  sz += m->data_.objname.size() + 1;
1903  ++nfound;
1904  }
1905 
1906  if (! nfound)
1907  continue;
1908 
1909  auto istr
1910  = into.insert(into.end(), std::string());
1911 
1912  if (showContents)
1913  {
1914  istr->reserve(sz);
1915 
1916  *istr += *di;
1917  *istr += ':';
1918  for (sz = 0; mi != m; ++mi)
1919  {
1920  if (*di != *mi->data_.dirname)
1921  continue;
1922 
1923  if (sz > 0)
1924  *istr += ',';
1925 
1926  *istr += mi->data_.objname;
1927  ++sz;
1928  }
1929  }
1930  else
1931  {
1932  istr->reserve(di->size() + 2);
1933  *istr += *di;
1934  *istr += ':';
1935  }
1936  }
1937 }
static bool isSubdirectory(const std::string &ofdir, const std::string &path)
Definition: DQMStore.cc:73
MEMap data_
Definition: DQMStore.h:874
std::set< std::string > dirs_
Definition: DQMStore.h:875
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 2074 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().

2075 {
2076  lat::Regexp rx;
2077  try
2078  {
2079  rx = lat::Regexp(pattern, 0, syntaxType);
2080  rx.study();
2081  }
2082  catch (lat::Error &e)
2083  {
2084  raiseDQMError("DQMStore", "Invalid regular expression '%s': %s",
2085  pattern.c_str(), e.explain().c_str());
2086  }
2087 
2088  std::string path;
2089  std::vector<MonitorElement *> result;
2090  auto i = data_.begin();
2091  auto e = data_.end();
2092  for ( ; i != e; ++i)
2093  {
2094  path.clear();
2095  mergePath(path, *i->data_.dirname, i->data_.objname);
2096  if (rx.match(path))
2097  result.push_back(const_cast<MonitorElement *>(&*i));
2098  }
2099 
2100  return result;
2101 }
static void mergePath(std::string &path, const std::string &dir, const std::string &name)
Definition: DQMStore.cc:113
MEMap data_
Definition: DQMStore.h:874
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 1787 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(), meGetter(), and DQMStore::IGetter::removeElement().

1788 {
1789  MonitorElement proto(&pwd_, std::string());
1790  std::vector<std::string> result;
1791  auto e = data_.end();
1792  auto i = data_.lower_bound(proto);
1793  for ( ; i != e && isSubdirectory(pwd_, *i->data_.dirname); ++i)
1794  if (pwd_ == *i->data_.dirname)
1795  result.push_back(i->getName());
1796 
1797  return result;
1798 }
static bool isSubdirectory(const std::string &ofdir, const std::string &path)
Definition: DQMStore.cc:73
std::string pwd_
Definition: DQMStore.h:873
MEMap data_
Definition: DQMStore.h:874
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 3527 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().

3528 {
3530  const std::string *cleaned = nullptr;
3531  cleanTrailingSlashes(path, clean, cleaned);
3532 
3534  auto mi = data_.begin();
3535  auto me = data_.end();
3536  for ( ; mi != me; ++mi)
3537  {
3538  if (! cleaned->empty() && ! isSubdirectory(*cleaned, *mi->data_.dirname))
3539  continue;
3540 
3541  if (mi->hasError())
3542  return dqm::qstatus::ERROR;
3543  else if (mi->hasWarning())
3544  status = dqm::qstatus::WARNING;
3545  else if (status < dqm::qstatus::WARNING
3546  && mi->hasOtherReport())
3547  status = dqm::qstatus::OTHER;
3548  }
3549  return status;
3550 }
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:874
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 1764 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(), meGetter(), SiStripInformationExtractor::printAlarmList(), SiStripInformationExtractor::printNonGeomHistoList(), SiStripInformationExtractor::printSummaryHistoList(), DQMStore::IGetter::removeElement(), DQMFileSaver::saveForOffline(), DQMFileSaver::saveForOnline(), and SiStripTrackerMapCreator::setTkMapFromHistogram().

1765 {
1766  std::vector<std::string> result;
1767  auto e = dirs_.end();
1768  auto i = dirs_.find(pwd_);
1769 
1770  // If we didn't find current directory, the tree is empty, so quit.
1771  if (i == e)
1772  return result;
1773 
1774  // Skip the current directory and then start looking for immediate
1775  // subdirectories in the dirs_ list. Stop when we are no longer in
1776  // (direct or indirect) subdirectories of pwd_. Note that we don't
1777  // "know" which order the set will sort A/B, A/B/C and A/D.
1778  while (++i != e && isSubdirectory(pwd_, *i))
1779  if (i->find('/', pwd_.size()+1) == std::string::npos)
1780  result.push_back(*i);
1781 
1782  return result;
1783 }
static bool isSubdirectory(const std::string &ofdir, const std::string &path)
Definition: DQMStore.cc:73
std::string pwd_
Definition: DQMStore.h:873
std::set< std::string > dirs_
Definition: DQMStore.h:875
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 584 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().

584  {
585  makeDirectory("");
586  reset();
587 
588  // set steerable parameters
589  verbose_ = pset.getUntrackedParameter<int>("verbose", 0);
590  if (verbose_ > 0)
591  std::cout << "DQMStore: verbosity set to " << verbose_ << std::endl;
592 
593  verboseQT_ = pset.getUntrackedParameter<int>("verboseQT", 0);
594  if (verbose_ > 0)
595  std::cout << "DQMStore: QTest verbosity set to " << verboseQT_ << std::endl;
596 
597  collateHistograms_ = pset.getUntrackedParameter<bool>("collateHistograms", false);
598  if (collateHistograms_)
599  std::cout << "DQMStore: histogram collation is enabled\n";
600 
601  enableMultiThread_ = pset.getUntrackedParameter<bool>("enableMultiThread", false);
602  if (enableMultiThread_)
603  std::cout << "DQMStore: MultiThread option is enabled\n";
604 
605  LSbasedMode_ = pset.getUntrackedParameter<bool>("LSbasedMode", false);
606  if (LSbasedMode_)
607  std::cout << "DQMStore: LSbasedMode option is enabled\n";
608 
609  std::string ref = pset.getUntrackedParameter<std::string>("referenceFileName", "");
610  if (! ref.empty())
611  {
612  std::cout << "DQMStore: using reference file '" << ref << "'\n";
613  readFile(ref, true, "", s_referenceDirName, StripRunDirs, false);
614  }
615 
616  initQCriterion<Comp2RefChi2>(qalgos_);
617  initQCriterion<Comp2Ref2DChi2>(qalgos_);
618  initQCriterion<Comp2RefKolmogorov>(qalgos_);
619  initQCriterion<ContentsXRange>(qalgos_);
620  initQCriterion<ContentsYRange>(qalgos_);
621  initQCriterion<MeanWithinExpected>(qalgos_);
622  initQCriterion<Comp2RefEqualH>(qalgos_);
623  initQCriterion<DeadChannel>(qalgos_);
624  initQCriterion<NoisyChannel>(qalgos_);
625  initQCriterion<ContentSigma>(qalgos_);
626  initQCriterion<ContentsWithinExpected>(qalgos_);
627  initQCriterion<CompareToMedian>(qalgos_);
628  initQCriterion<CompareLastFilledBin>(qalgos_);
629  initQCriterion<CheckVariance>(qalgos_);
630 
631  scaleFlag_ = pset.getUntrackedParameter<double>("ScalingFlag", 0.0);
632  if (verbose_ > 0)
633  std::cout << "DQMStore: Scaling Flag set to " << scaleFlag_ << std::endl;
634 }
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:3189
unsigned verboseQT_
Definition: DQMStore.h:860
double scaleFlag_
Definition: DQMStore.h:862
QAMap qalgos_
Definition: DQMStore.h:878
unsigned verbose_
Definition: DQMStore.h:859
static const std::string s_referenceDirName
Definition: DQMStore.cc:58
bool collateHistograms_
Definition: DQMStore.h:863
bool LSbasedMode_
Definition: DQMStore.h:865
void makeDirectory(const std::string &path)
Definition: DQMStore.cc:771
void reset()
Definition: DQMStore.cc:2110
bool enableMultiThread_
Definition: DQMStore.h:864
bool DQMStore::isCollate ( ) const

Definition at line 3605 of file DQMStore.cc.

References collateHistograms_.

Referenced by mtEnabled().

3606 {
3607  return collateHistograms_;
3608 }
bool collateHistograms_
Definition: DQMStore.h:863
bool DQMStore::isCollateME ( MonitorElement me) const
private

Definition at line 3614 of file DQMStore.cc.

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

Referenced by extract(), and mtEnabled().

3615 { 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 3162 of file DQMStore.cc.

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

Referenced by DQMFileReader::beginJob().

3165 {
3166  bool overwrite = true;
3167  if (collateHistograms_) overwrite = false;
3168  if (verbose_)
3169  {
3170  std::cout << "DQMStore::load: reading from file '" << filename << "'\n";
3171  if (collateHistograms_)
3172  std::cout << "DQMStore::load: in collate mode " << "\n";
3173  else
3174  std::cout << "DQMStore::load: in overwrite mode " << "\n";
3175  }
3176 
3177  if (!s_rxpbfile.match(filename, 0, 0))
3178  return readFile(filename, overwrite, "", "", stripdirs, fileMustExist);
3179  else
3180  return readFilePB(filename, overwrite, "", "", stripdirs, fileMustExist);
3181 }
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:3189
unsigned verbose_
Definition: DQMStore.h:859
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:3273
bool collateHistograms_
Definition: DQMStore.h:863
void DQMStore::makeDirectory ( const std::string &  path)
private

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

Definition at line 771 of file DQMStore.cc.

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

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

772 {
773  std::string prev;
774  std::string subdir;
776  prev.reserve(path.size());
777  subdir.reserve(path.size());
778  name.reserve(path.size());
779  size_t prevname = 0;
780  size_t slash = 0;
781 
782  while (true)
783  {
784  // Create this subdirectory component.
785  subdir.clear();
786  subdir.append(path, 0, slash);
787  name.clear();
788  name.append(subdir, prevname, std::string::npos);
789  if (! prev.empty() && findObject(prev, name))
790  raiseDQMError("DQMStore", "Attempt to create subdirectory '%s'"
791  " which already exists as a monitor element",
792  subdir.c_str());
793 
794  if (! dirs_.count(subdir))
795  dirs_.insert(subdir);
796 
797  // Stop if we've reached the end (including possibly a trailing slash).
798  if (slash+1 >= path.size())
799  break;
800 
801  // Find the next slash, making sure we progress. If reach the end,
802  // process the last path component; the next loop round will terminate.
803  prevname = slash ? slash+1 : slash;
804  prev = subdir;
805  if ((slash = path.find('/', ++slash)) == std::string::npos)
806  slash = path.size();
807  }
808 }
MonitorElement * findObject(const std::string &dir, const std::string &name, const uint32_t run=0, const uint32_t lumi=0, const uint32_t streamId=0, const uint32_t moduleId=0) const
Definition: DQMStore.cc:1942
std::set< std::string > dirs_
Definition: DQMStore.h:875
void raiseDQMError(const char *context, const char *fmt,...)
Definition: DQMError.cc:11
template<typename iFunc >
void DQMStore::meBookerGetter ( iFunc  f)
inline

Definition at line 406 of file DQMStore.h.

References f, ibooker_, and igetter_.

Referenced by DQMEDHarvester::endJob(), and DQMEDHarvester::endLuminosityBlock().

406  {
407  f(*ibooker_, *igetter_);
408  }
IGetter * igetter_
Definition: DQMStore.h:883
double f[11][100]
IBooker * ibooker_
Definition: DQMStore.h:882
template<typename iFunc >
void DQMStore::meGetter ( iFunc  f)
inline
void DQMStore::mergeAndResetMEsLuminositySummaryCache ( uint32_t  run,
uint32_t  lumi,
uint32_t  streamId,
uint32_t  moduleId 
)

Definition at line 437 of file DQMStore.cc.

References gather_cfg::cout, MonitorElement::DQM_KIND_TH1F, MillePedeFileConverter_cfg::e, MonitorElement::globalize(), mps_fire::i, list(), MonitorElement::markToDelete(), eostools::move(), HcalObjRepresent::Reset(), MonitorElement::setLumi(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by DQMEDAnalyzer::endLuminosityBlockSummary(), and mtEnabled().

440  {
441  if (verbose_ > 1)
442  std::cout << "DQMStore::mergeAndResetMEsLuminositySummaryCache - Merging objects from run: "
443  << run << " lumi: " << lumi
444  << ", stream: " << streamId
445  << " module: " << moduleId << std::endl;
446  std::string null_str("");
447  MonitorElement proto(&null_str, null_str, run, streamId, moduleId);
448 
449  // Since this accesses the data, the operation must be
450  // be locked.
451  std::lock_guard<std::mutex> guard(book_mutex_);
452 
453  auto e = data_.end();
454  auto i = data_.lower_bound(proto);
455 
456  while (i != e) {
457  if (i->data_.run != run
458  || i->data_.streamId != streamId
459  || i->data_.moduleId != moduleId)
460  break;
461 
462  // Handle LS-based histograms only.
463  if (not (i->getLumiFlag() || LSbasedMode_)) {
464  ++i;
465  continue;
466  }
467 
469  global_me.globalize();
470  global_me.setLumi(lumi);
471  auto me = data_.find(global_me);
472  if (me != data_.end()) {
473  if (verbose_ > 1)
474  std::cout << "Found global Object, using it --> " << me->getFullname() << std::endl;
475 
476  //don't take any action if the ME is an INT || FLOAT || STRING
477  if(me->kind() >= MonitorElement::DQM_KIND_TH1F)
478  {
479  if(me->getTH1()->CanExtendAllAxes() && i->getTH1()->CanExtendAllAxes()) {
480  TList list;
481  list.Add(i->getTH1());
482  if( -1 == me->getTH1()->Merge(&list)) {
483  std::cout << "mergeAndResetMEsLuminositySummaryCache: Failed to merge DQM element "<<me->getFullname();
484  }
485  }
486  else {
487  if (i->getTH1()->GetEntries())
488  me->getTH1()->Add(i->getTH1());
489  }
490  }
491  } else {
492  if (verbose_ > 1)
493  std::cout << "No global Object found. " << std::endl;
494  std::pair<std::set<MonitorElement>::const_iterator, bool> gme;
495 
496  // this makes an actual and a single copy with Clone()'ed th1
497  MonitorElement actual_global_me(*i);
498  actual_global_me.globalize();
499  actual_global_me.setLumi(lumi);
500  actual_global_me.markToDelete();
501  gme = data_.insert(std::move(actual_global_me));
502  assert(gme.second);
503  }
504  // make the ME reusable for the next LS
505  const_cast<MonitorElement*>(&*i)->Reset();
506  ++i;
507  }
508 }
std::mutex book_mutex_
Definition: DQMStore.h:881
unsigned verbose_
Definition: DQMStore.h:859
MEMap data_
Definition: DQMStore.h:874
void Reset(std::vector< TH2F > &depth)
bool LSbasedMode_
Definition: DQMStore.h:865
def move(src, dest)
Definition: eostools.py:510
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
void DQMStore::mergeAndResetMEsRunSummaryCache ( uint32_t  run,
uint32_t  streamId,
uint32_t  moduleId 
)

Function to transfer the local copies of histograms from each stream into the global ROOT Object. Since this involves de-facto a booking action in the case in which the global object is not yet there, the function requires the acquisition of the central lock into the DQMStore. In case we book the global object for the first time, no Add action is needed since the ROOT histograms is cloned starting from the local one.

Definition at line 362 of file DQMStore.cc.

References gather_cfg::cout, MonitorElement::DQM_KIND_TH1F, MillePedeFileConverter_cfg::e, MonitorElement::globalize(), mps_fire::i, list(), MonitorElement::markToDelete(), eostools::move(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by DQMEDAnalyzer::endRunSummary(), and mtEnabled().

364  {
365  if (verbose_ > 1)
366  std::cout << "DQMStore::mergeAndResetMEsRunSummaryCache - Merging objects from run: "
367  << run
368  << ", stream: " << streamId
369  << " module: " << moduleId << std::endl;
370 
371  if (LSbasedMode_) {
372  return;
373  }
374 
375  std::string null_str("");
376  MonitorElement proto(&null_str, null_str, run, streamId, moduleId);
377  // Since this accesses the data, the operation must be
378  // be locked.
379  std::lock_guard<std::mutex> guard(book_mutex_);
380 
381  auto e = data_.end();
382  auto i = data_.lower_bound(proto);
383  while (i != e) {
384  if (i->data_.run != run
385  || i->data_.streamId != streamId
386  || i->data_.moduleId != moduleId)
387  break;
388 
389  // Handle Run-based histograms only.
390  if (i->getLumiFlag() || LSbasedMode_) {
391  ++i;
392  continue;
393  }
394 
395  // don't call the copy constructor
396  // we are just searching for a global histogram - a copy is not necessary
398  global_me.globalize();
399 
400  auto me = data_.find(global_me);
401  if (me != data_.end()) {
402  if (verbose_ > 1)
403  std::cout << "Found global Object, using it --> " << me->getFullname() << std::endl;
404 
405  //don't take any action if the ME is an INT || FLOAT || STRING
406  if(me->kind() >= MonitorElement::DQM_KIND_TH1F)
407  {
408  if(me->getTH1()->CanExtendAllAxes() && i->getTH1()->CanExtendAllAxes()) {
409  TList list;
410  list.Add(i->getTH1());
411  if( -1 == me->getTH1()->Merge(&list)) {
412  std::cout << "mergeAndResetMEsRunSummaryCache: Failed to merge DQM element "<<me->getFullname();
413  }
414  }
415  else {
416  if (i->getTH1()->GetEntries())
417  me->getTH1()->Add(i->getTH1());
418  }
419  }
420  } else {
421  if (verbose_ > 1)
422  std::cout << "No global Object found. " << std::endl;
423  std::pair<std::set<MonitorElement>::const_iterator, bool> gme;
424 
425  // this makes an actual and a single copy with Clone()'ed th1
426  MonitorElement actual_global_me(*i);
427  actual_global_me.globalize();
428  actual_global_me.markToDelete();
429  gme = data_.insert(std::move(actual_global_me));
430  assert(gme.second);
431  }
432  // TODO(rovere): eventually reset the local object and mark it as reusable??
433  ++i;
434  }
435 }
std::mutex book_mutex_
Definition: DQMStore.h:881
unsigned verbose_
Definition: DQMStore.h:859
MEMap data_
Definition: DQMStore.h:874
bool LSbasedMode_
Definition: DQMStore.h:865
def move(src, dest)
Definition: eostools.py:510
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
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 3147 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(), meGetter(), PFDQMEventSelector::openInputFile(), SiStripOfflineDQM::openInputFile(), BuildTrackerMapPlugin::read(), readFilePB(), savePB(), and StatisticsFilter::StatisticsFilter().

3153 {
3154  return readFile(filename,overwrite,onlypath,prepend,stripdirs,fileMustExist);
3155 }
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:3189
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 2159 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().

2160 {
2161  static const std::string null_str("");
2162 
2163  auto const& lumiblock = gc.luminosityBlockID();
2164  uint32_t run = lumiblock.run();
2165 
2166  // find the range of non-legacy global MEs for the current run:
2167  // run != 0, lumi == 0 (implicit), stream id == 0, module id == 0
2168  const MonitorElement begin(&null_str, null_str, run, 0, 0);
2169  const MonitorElement end(&null_str, null_str, run, 0, 1);
2170  auto i = data_.lower_bound(begin);
2171  const auto e = data_.lower_bound(end);
2172  while (i != e) {
2173  auto& me = const_cast<MonitorElement&>(*i++);
2174  // skip per-run MEs
2175  if (not LSbasedMode_ and not me.getLumiFlag())
2176  continue;
2177  me.Reset();
2178  me.resetUpdate();
2179  }
2180 }
LuminosityBlockID const & luminosityBlockID() const
Definition: GlobalContext.h:52
#define end
Definition: vmac.h:39
void Reset()
reset ME (ie. contents, errors, etc)
MEMap data_
Definition: DQMStore.h:874
#define begin
Definition: vmac.h:32
bool LSbasedMode_
Definition: DQMStore.h:865
void DQMStore::print_trace ( const std::string &  dir,
const std::string &  name 
)
private

Definition at line 646 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().

647 {
648  // the access to the member stream_ is implicitely protected against
649  // concurrency problems because the print_trace method is always called behind
650  // a lock (see bookTransaction).
651  if (!stream_)
652  stream_ = new std::ofstream("histogramBookingBT.log");
653 
654  void *array[10];
655  size_t size;
656  char **strings;
657  int r=0;
658  lat::RegexpMatch m;
659  m.reset();
660 
661  size = backtrace (array, 10);
662  strings = backtrace_symbols (array, size);
663 
664  size_t level = 1;
665  char * demangled = nullptr;
666  for (; level < size; level++) {
667  if (!s_rxtrace.match(strings[level], 0, 0, &m)) continue;
668  demangled = abi::__cxa_demangle(m.matchString(strings[level], 2).c_str(), nullptr, nullptr, &r);
669  if (!demangled) continue;
670  if (!s_rxself.match(demangled, 0, 0)) break;
671  free(demangled);
672  demangled = nullptr;
673  }
674 
675  if (demangled != nullptr) {
676  *stream_ << "\"" << dir << "/"
677  << name << "\" "
678  << (r ? m.matchString(strings[level], 2) : demangled) << " "
679  << m.matchString(strings[level], 1) << "\n";
680  free(demangled);
681  } else {
682  *stream_ << "Skipping "<< dir << "/" << name
683  << " with stack size " << size << "\n";
684  }
685 
686  /* In this case print the full stack trace, up to main or to the
687  * maximum stack size, i.e. 10. */
688  if (verbose_ > 4 || demangled == nullptr)
689  {
690  size_t i;
691  m.reset();
692 
693  for (i = 0; i < size; i++)
694  if (s_rxtrace.match(strings[i], 0, 0, &m))
695  {
696  char * demangled = abi::__cxa_demangle(m.matchString(strings[i], 2).c_str(), nullptr, nullptr, &r);
697  *stream_ << "\t\t" << i << "/" << size << " "
698  << (r ? m.matchString(strings[i], 2) : demangled) << " "
699  << m.matchString(strings[i], 1) << std::endl;
700  free (demangled);
701  }
702  }
703  free (strings);
704 }
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:859
std::ofstream * stream_
Definition: DQMStore.h:871
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 2992 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().

2998 {
2999  unsigned int ntot = 0;
3000  unsigned int count = 0;
3001 
3002  if (! file->cd(curdir.c_str()))
3003  raiseDQMError("DQMStore", "Failed to process directory '%s' while"
3004  " reading file '%s'", curdir.c_str(), file->GetName());
3005 
3006  // Figure out current directory name, but strip out the top
3007  // directory into which we dump everything.
3008  std::string dirpart = curdir;
3009  if (dirpart.compare(0, s_monitorDirName.size(), s_monitorDirName) == 0)
3010  {
3011  if (dirpart.size() == s_monitorDirName.size())
3012  dirpart.clear();
3013  else if (dirpart[s_monitorDirName.size()] == '/')
3014  dirpart.erase(0, s_monitorDirName.size()+1);
3015  }
3016 
3017  // See if we are going to skip this directory.
3018  bool skip = (! onlypath.empty() && ! isSubdirectory(onlypath, dirpart));
3019 
3020  if (prepend == s_collateDirName ||
3021  prepend == s_referenceDirName ||
3022  stripdirs == StripRunDirs )
3023  {
3024  // Remove Run # and RunSummary dirs
3025  // first look for Run summary,
3026  // if that is found and erased, also erase Run dir
3027  size_t slash = dirpart.find('/');
3028  size_t pos = dirpart.find("/Run summary");
3029  if (slash != std::string::npos && pos !=std::string::npos)
3030  {
3031  dirpart.erase(pos,12);
3032 
3033  pos = dirpart.find("Run ");
3034  size_t length = dirpart.find('/',pos+1)-pos+1;
3035  if (pos !=std::string::npos)
3036  dirpart.erase(pos,length);
3037  }
3038  }
3039 
3040  // If we are prepending, add it to the directory name,
3041  // and suppress reading of already existing reference histograms
3042  if (prepend == s_collateDirName ||
3043  prepend == s_referenceDirName)
3044  {
3045  size_t slash = dirpart.find('/');
3046  // If we are reading reference, skip previous reference.
3047  if (slash == std::string::npos // skip if Reference is toplevel folder, i.e. no slash
3048  && slash+1+s_referenceDirName.size() == dirpart.size()
3049  && dirpart.compare(slash+1, s_referenceDirName.size(), s_referenceDirName) == 0)
3050  return 0;
3051 
3052  slash = dirpart.find('/');
3053  // Skip reading of EventInfo subdirectory.
3054  if (slash != std::string::npos
3055  && slash + 10 == dirpart.size()
3056  && dirpart.compare( slash+1 , 9 , "EventInfo") == 0) {
3057  if (verbose_)
3058  std::cout << "DQMStore::readDirectory: skipping '" << dirpart << "'\n";
3059  return 0;
3060  }
3061 
3062  // Add prefix.
3063  if (dirpart.empty())
3064  dirpart = prepend;
3065  else
3066  dirpart = prepend + '/' + dirpart;
3067  }
3068  else if (! prepend.empty())
3069  {
3070  if (dirpart.empty())
3071  dirpart = prepend;
3072  else
3073  dirpart = prepend + '/' + dirpart;
3074  }
3075 
3076  // Loop over the contents of this directory in the file.
3077  // Post-pone string object handling to happen after other
3078  // objects have been read in so we are guaranteed to have
3079  // histograms by the time we read in quality tests and tags.
3080  TKey *key;
3081  TIter next (gDirectory->GetListOfKeys());
3082  std::list<TObject *> delayed;
3083  while ((key = (TKey *) next()))
3084  {
3085  std::unique_ptr<TObject> obj(key->ReadObj());
3086  if (dynamic_cast<TDirectory *>(obj.get()))
3087  {
3088  std::string subdir;
3089  subdir.reserve(curdir.size() + strlen(obj->GetName()) + 2);
3090  subdir += curdir;
3091  if (! curdir.empty())
3092  subdir += '/';
3093  subdir += obj->GetName();
3094 
3095  ntot += readDirectory(file, overwrite, onlypath, prepend, subdir, stripdirs);
3096  }
3097  else if (skip)
3098  ;
3099  else if (dynamic_cast<TObjString *>(obj.get()))
3100  {
3101  delayed.push_back(obj.release());
3102  }
3103  else
3104  {
3105  if (verbose_ > 2)
3106  std::cout << "DQMStore: reading object '" << obj->GetName()
3107  << "' of type '" << obj->IsA()->GetName()
3108  << "' from '" << file->GetName()
3109  << "' into '" << dirpart << "'\n";
3110 
3111  makeDirectory(dirpart);
3112  if (extract(obj.get(), dirpart, overwrite, collateHistograms_))
3113  ++count;
3114  }
3115  }
3116 
3117  while (! delayed.empty())
3118  {
3119  if (verbose_ > 2)
3120  std::cout << "DQMStore: reading object '" << delayed.front()->GetName()
3121  << "' of type '" << delayed.front()->IsA()->GetName()
3122  << "' from '" << file->GetName()
3123  << "' into '" << dirpart << "'\n";
3124 
3125  makeDirectory(dirpart);
3126  if (extract(delayed.front(), dirpart, overwrite, collateHistograms_))
3127  ++count;
3128 
3129  delete delayed.front();
3130  delayed.pop_front();
3131  }
3132 
3133  if (verbose_ > 1)
3134  std::cout << "DQMStore: read " << count << '/' << ntot
3135  << " objects from directory '" << dirpart << "'\n";
3136 
3137  return ntot + count;
3138 }
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:859
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:2992
bool extract(TObject *obj, const std::string &dir, bool overwrite, bool collateHistograms)
Definition: DQMStore.cc:2233
bool collateHistograms_
Definition: DQMStore.h:863
void makeDirectory(const std::string &path)
Definition: DQMStore.cc:771
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 3189 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().

3195 {
3196 
3197  if (verbose_)
3198  std::cout << "DQMStore::readFile: reading from file '" << filename << "'\n";
3199 
3200  std::unique_ptr<TFile> f;
3201 
3202  try
3203  {
3204  f.reset(TFile::Open(filename.c_str()));
3205  if (! f.get() || f->IsZombie())
3206  raiseDQMError("DQMStore", "Failed to open file '%s'", filename.c_str());
3207  }
3208  catch (std::exception &)
3209  {
3210  if (fileMustExist)
3211  throw;
3212  else
3213  {
3214  if (verbose_)
3215  std::cout << "DQMStore::readFile: file '" << filename << "' does not exist, continuing\n";
3216  return false;
3217  }
3218  }
3219 
3220  unsigned n = readDirectory(f.get(), overwrite, onlypath, prepend, "", stripdirs);
3221  f->Close();
3222 
3223  auto mi = data_.begin();
3224  auto me = data_.end();
3225  for ( ; mi != me; ++mi)
3226  const_cast<MonitorElement &>(*mi).updateQReportStats();
3227 
3228  if (verbose_)
3229  {
3230  std::cout << "DQMStore::open: successfully read " << n
3231  << " objects from file '" << filename << "'";
3232  if (! onlypath.empty())
3233  std::cout << " from directory '" << onlypath << "'";
3234  if (! prepend.empty())
3235  std::cout << " into directory '" << prepend << "'";
3236  std::cout << std::endl;
3237  }
3238  return true;
3239 }
double f[11][100]
unsigned verbose_
Definition: DQMStore.h:859
MEMap data_
Definition: DQMStore.h:874
unsigned int readDirectory(TFile *file, bool overwrite, const std::string &path, const std::string &prepend, const std::string &curdir, OpenRunDirs stripdirs)
Definition: DQMStore.cc:2992
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 3273 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().

3279 {
3280  using google::protobuf::io::FileInputStream;
3281  using google::protobuf::io::FileOutputStream;
3282  using google::protobuf::io::GzipInputStream;
3283  using google::protobuf::io::GzipOutputStream;
3284  using google::protobuf::io::CodedInputStream;
3285  using google::protobuf::io::ArrayInputStream;
3286 
3287  if (verbose_)
3288  std::cout << "DQMStore::readFile: reading from file '" << filename << "'\n";
3289 
3290  int filedescriptor;
3291  if ((filedescriptor = ::open(filename.c_str(), O_RDONLY)) == -1) {
3292  if (fileMustExist)
3293  raiseDQMError("DQMStore", "Failed to open file '%s'", filename.c_str());
3294  else
3295  if (verbose_)
3296  std::cout << "DQMStore::readFile: file '" << filename << "' does not exist, continuing\n";
3297  return false;
3298  }
3299 
3300  dqmstorepb::ROOTFilePB dqmstore_message;
3301  FileInputStream fin(filedescriptor);
3302  GzipInputStream input(&fin);
3303  CodedInputStream input_coded(&input);
3304  input_coded.SetTotalBytesLimit(1024*1024*1024, -1);
3305  if (!dqmstore_message.ParseFromCodedStream(&input_coded)) {
3306  raiseDQMError("DQMStore", "Fatal parsing file '%s'", filename.c_str());
3307  return false;
3308  }
3309  ::close(filedescriptor);
3310 
3311  for (int i = 0; i < dqmstore_message.histo_size(); i++) {
3312  std::string path;
3313  std::string objname;
3314 
3315  TObject *obj = nullptr;
3316  const dqmstorepb::ROOTFilePB::Histo &h = dqmstore_message.histo(i);
3317  get_info(h, path, objname, &obj);
3318 
3319  setCurrentFolder(path);
3320  if (obj)
3321  {
3322  /* Before calling the extract() check if histogram exists:
3323  * if it does - flags for the given monitor are already set (and merged)
3324  * else - set the flags after the histogram is created.
3325  */
3326  MonitorElement *me = findObject(path, objname);
3327 
3328  /* Run histograms should be collated and not overwritten,
3329  * Lumi histograms should be overwritten (and collate flag is not checked)
3330  */
3331  bool overwrite = h.flags() & DQMNet::DQM_PROP_LUMI;
3332  bool collate = !(h.flags() & DQMNet::DQM_PROP_LUMI);
3333  extract(static_cast<TObject *>(obj), path, overwrite, collate);
3334 
3335  if (me == nullptr) {
3336  me = findObject(path, objname);
3337  me->data_.flags = h.flags();
3338  }
3339 
3340  delete obj;
3341  }
3342  }
3343 
3344  cd();
3345  return true;
3346 }
MonitorElement * findObject(const std::string &dir, const std::string &name, const uint32_t run=0, const uint32_t lumi=0, const uint32_t streamId=0, const uint32_t moduleId=0) const
Definition: DQMStore.cc:1942
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:3252
DQMNet::CoreObject data_
void cd()
go to top directory (ie. root)
Definition: DQMStore.cc:724
const ::dqmstorepb::ROOTFilePB_Histo & histo(int index) const
unsigned verbose_
Definition: DQMStore.h:859
bool extract(TObject *obj, const std::string &dir, bool overwrite, bool collateHistograms)
Definition: DQMStore.cc:2233
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:3147
::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:747
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 3388 of file DQMStore.cc.

References pwd_.

Referenced by meGetter().

3389 {
3391 }
std::string pwd_
Definition: DQMStore.h:873
void removeContents()
erase all monitoring elements in current directory (not including subfolders);
Definition: DQMStore.cc:3388
void DQMStore::removeContents ( const std::string &  dir)

remove all monitoring elements from directory;

Definition at line 3374 of file DQMStore.cc.

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

3375 {
3376  MonitorElement proto(&dir, std::string());
3377  auto e = data_.end();
3378  auto i = data_.lower_bound(proto);
3379  while (i != e && isSubdirectory(dir, *i->data_.dirname))
3380  if (dir == *i->data_.dirname)
3381  data_.erase(i++);
3382  else
3383  ++i;
3384 }
static bool isSubdirectory(const std::string &ofdir, const std::string &path)
Definition: DQMStore.cc:73
MEMap data_
Definition: DQMStore.h:874
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 3396 of file DQMStore.cc.

References pwd_.

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

3397 {
3399 }
void removeElement(const std::string &name)
Definition: DQMStore.cc:3396
std::string pwd_
Definition: DQMStore.h:873
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 3404 of file DQMStore.cc.

References gather_cfg::cout, and data_.

3405 {
3406  MonitorElement proto(&dir, name);
3407  auto pos = data_.find(proto);
3408  if (pos != data_.end())
3409  data_.erase(pos);
3410  else if (warning)
3411  std::cout << "DQMStore: WARNING: attempt to remove non-existent"
3412  << " monitor element '" << name << "' in '" << dir << "'\n";
3413 }
MEMap data_
Definition: DQMStore.h:874
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 2110 of file DQMStore.cc.

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

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

2111 {
2112  auto mi = data_.begin();
2113  auto me = data_.end();
2114  for ( ; mi != me; ++mi)
2115  {
2116  auto &me = const_cast<MonitorElement &>(*mi);
2117  if (mi->wasUpdated())
2118  {
2119  if (me.resetMe())
2120  me.Reset();
2121  me.resetUpdate();
2122  }
2123  }
2124 
2125  reset_ = true;
2126 }
bool reset_
Definition: DQMStore.h:861
void Reset()
reset ME (ie. contents, errors, etc)
MEMap data_
Definition: DQMStore.h:874
void DQMStore::rmdir ( const std::string &  path)

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

Definition at line 3354 of file DQMStore.cc.

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

Referenced by dqmCopyRecursively(), and meGetter().

3355 {
3357  const std::string *cleaned = nullptr;
3358  cleanTrailingSlashes(path, clean, cleaned);
3359  MonitorElement proto(cleaned, std::string());
3360 
3361  auto e = data_.end();
3362  auto i = data_.lower_bound(proto);
3363  while (i != e && isSubdirectory(*cleaned, *i->data_.dirname))
3364  data_.erase(i++);
3365 
3366  auto de = dirs_.end();
3367  auto di = dirs_.lower_bound(*cleaned);
3368  while (di != de && isSubdirectory(*cleaned, *di))
3369  dirs_.erase(di++);
3370 }
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:874
std::set< std::string > dirs_
Definition: DQMStore.h:875
void DQMStore::runQTests ( )

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

Definition at line 3506 of file DQMStore.cc.

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

Referenced by mtEnabled().

3507 {
3508 
3509  if (verbose_ > 0)
3510  std::cout << "DQMStore: running runQTests() with reset = "
3511  << ( reset_ ? "true" : "false" ) << std::endl;
3512 
3513  // Apply quality tests to each monitor element, skipping references.
3514  auto mi = data_.begin();
3515  auto me = data_.end();
3516  for ( ; mi != me; ++mi)
3517  if (! isSubdirectory(s_referenceDirName, *mi->data_.dirname))
3518  const_cast<MonitorElement &>(*mi).runQTests();
3519 
3520  reset_ = false;
3521 }
bool reset_
Definition: DQMStore.h:861
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:859
MEMap data_
Definition: DQMStore.h:874
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 2703 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().

2712 {
2713  // TFile flushes to disk with fsync() on every TDirectory written to
2714  // the file. This makes DQM file saving painfully slow, and
2715  // ironically makes it _more_ likely the file saving gets
2716  // interrupted and corrupts the file. The utility class below
2717  // simply ignores the flush synchronisation.
2718  class TFileNoSync : public TFile
2719  {
2720  public:
2721  TFileNoSync(const char *file, const char *opt) : TFile(file, opt) {}
2722  Int_t SysSync(Int_t) override { return 0; }
2723  };
2724 
2725  std::lock_guard<std::mutex> guard(book_mutex_);
2726 
2727  unsigned int nme = 0;
2728 
2729  // open output file, on 1st save recreate, later update
2730  if (verbose_) {
2731  std::cout << "DQMStore::save: Opening TFile '" << filename
2732  << "' with option '" << fileupdate << "'"
2733  << std::endl;
2734  }
2735 
2736  TFileNoSync f(filename.c_str(), fileupdate.c_str()); // open file
2737  if(f.IsZombie())
2738  raiseDQMError("DQMStore", "Failed to create/update file '%s'", filename.c_str());
2739  f.cd();
2740 
2741  // Construct a regular expression from the pattern string.
2742  std::unique_ptr<lat::Regexp> rxpat;
2743  if (not pattern.empty())
2744  rxpat = std::make_unique<lat::Regexp>(pattern);
2745 
2746  // Prepare a path for the reference object selection.
2747  std::string refpath;
2748  refpath.reserve(s_referenceDirName.size() + path.size() + 2);
2749  refpath += s_referenceDirName;
2750  if (not path.empty())
2751  {
2752  refpath += '/';
2753  refpath += path;
2754  }
2755 
2756  // Loop over the directory structure.
2757  for (auto const& dir: dirs_)
2758  {
2759  // Check if we should process this directory. We process the
2760  // requested part of the object tree, including references.
2761  if (not path.empty()
2762  and not isSubdirectory(refpath, dir)
2763  and not isSubdirectory(path, dir))
2764  continue;
2765 
2766  if (verbose_ > 1) {
2767  std::cout << "DQMStore::save: DQM folder " << dir << "/" << std::endl;
2768  }
2769 
2770  // Create the directory.
2771  gDirectory->cd("/");
2772  if (dir.empty())
2774  else if (rxpat.get())
2775  cdInto(s_monitorDirName + '/' + lat::StringOps::replace(dir, *rxpat, rewrite));
2776  else
2777  cdInto(s_monitorDirName + '/' + dir);
2778 
2779  // Loop over monitor elements in this directory.
2780  if (not enableMultiThread_) {
2781  MonitorElement proto(&dir, std::string(), run, 0, 0);
2782  auto begin = data_.lower_bound(proto);
2783  auto end = data_.end();
2784  saveMonitorElementRangeToROOT(dir, refpath, ref, minStatus, run, begin, end, f, nme);
2785  } else {
2786  // Restrict the loop to the monitor elements for the current lumisection
2787  MonitorElement proto(&dir, std::string(), run, 0, 0);
2788  proto.setLumi(lumi);
2789  auto begin = data_.lower_bound(proto);
2790  proto.setLumi(lumi+1);
2791  auto end = data_.lower_bound(proto);
2792  saveMonitorElementRangeToROOT(dir, refpath, ref, minStatus, run, begin, end, f, nme);
2793  }
2794 
2795  // In LSbasedMode, loop also over the (run, 0, 0, 0) global histograms;
2796  // these could be the merged global histrograms of their per-stream
2797  // counterparts after the streamEndRun transition - but they are not
2798  // produced in LSbasedMode.
2799  if (enableMultiThread_ and LSbasedMode_ and lumi != 0) {
2800  auto begin = data_.lower_bound(MonitorElement(&dir, std::string(), run, 0, 0));
2801  auto end = data_.lower_bound(MonitorElement(&dir, std::string(), run, 0, 1));
2802  saveMonitorElementRangeToROOT(dir, refpath, ref, minStatus, run, begin, end, f, nme);
2803  }
2804  }
2805 
2806  f.Close();
2807 
2808  // Maybe make some noise.
2809  if (verbose_) {
2810  std::cout << "DQMStore::save: successfully wrote " << nme
2811  << " objects from path '" << path << "/"
2812  << "' into DQM file '" << filename << "'\n";
2813  }
2814 }
bool cdInto(const std::string &path) const
Definition: DQMStore.cc:2534
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:881
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:2608
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:859
MEMap data_
Definition: DQMStore.h:874
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:875
bool LSbasedMode_
Definition: DQMStore.h:865
bool enableMultiThread_
Definition: DQMStore.h:864
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 2846 of file DQMStore.cc.

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

Referenced by savePB().

2853 {
2854  for (auto const& me: boost::make_iterator_range(begin, end))
2855  {
2856  if (not isSubdirectory(dir, *me.data_.dirname))
2857  break;
2858 
2859  if (verbose_ > 1)
2860  std::cout << "DQMStore::savePB:"
2861  << " run: " << me.run()
2862  << " lumi: " << me.lumi()
2863  << " lumiFlag: " << me.getLumiFlag()
2864  << " streamId: " << me.streamId()
2865  << " moduleId: " << me.moduleId()
2866  << " fullpathname: " << me.getFullname()
2867  << " flags: " << std::hex << me.data_.flags
2868  << std::endl;
2869 
2870  // Skip MonitorElements in a subdirectory of the current one.
2871  if (dir != *me.data_.dirname) {
2872  if (verbose_ > 1) {
2873  std::cout << "DQMStore::savePB: skipping monitor element in a subfolder of " << dir << "/" << std::endl;
2874  }
2875  continue;
2876  }
2877 
2878  // For MonitorElements booked with the thread-safe approach, identified
2879  // by having run != 0, ignore the per-stream ones.
2880  if (run != 0 and (me.data_.streamId != 0 or me.data_.moduleId != 0)) {
2881  if (verbose_ > 1) {
2882  std::cout << "DQMStore::savePB: skipping per-stream monitor element" << std::endl;
2883  }
2884  continue;
2885  }
2886 
2887  // Handle reference histograms, with three distinct cases:
2888  // XXX not supported by protobuf files.
2889 
2890  if (verbose_ > 1) {
2891  std::cout << "DQMStore::savePB: saving monitor element" << std::endl;
2892  }
2893 
2894  saveMonitorElementToPB(me, file);
2895 
2896  // Count saved histograms
2897  ++counter;
2898  }
2899 }
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
#define end
Definition: vmac.h:39
void saveMonitorElementToPB(MonitorElement const &me, dqmstorepb::ROOTFilePB &file)
Definition: DQMStore.cc:2817
unsigned verbose_
Definition: DQMStore.h:859
#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 2608 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().

2618 {
2619  for (auto const& me: boost::make_iterator_range(begin, end))
2620  {
2621  if (not isSubdirectory(dir, *me.data_.dirname))
2622  break;
2623 
2624  if (verbose_ > 1)
2625  std::cout << "DQMStore::save:"
2626  << " run: " << me.run()
2627  << " lumi: " << me.lumi()
2628  << " lumiFlag: " << me.getLumiFlag()
2629  << " streamId: " << me.streamId()
2630  << " moduleId: " << me.moduleId()
2631  << " fullpathname: " << me.getFullname()
2632  << " flags: " << std::hex << me.data_.flags
2633  << std::endl;
2634 
2635  // Skip MonitorElements in a subdirectory of the current one.
2636  if (dir != *me.data_.dirname) {
2637  if (verbose_ > 1) {
2638  std::cout << "DQMStore::save: skipping monitor element in a subfolder of " << dir << "/" << std::endl;
2639  }
2640  continue;
2641  }
2642 
2643  // For MonitorElements booked with the thread-safe approach, identified
2644  // by having run != 0, ignore the per-stream ones.
2645  if (run != 0 and (me.data_.streamId != 0 or me.data_.moduleId != 0)) {
2646  if (verbose_ > 1) {
2647  std::cout << "DQMStore::save: skipping per-stream monitor element" << std::endl;
2648  }
2649  continue;
2650  }
2651 
2652  // Handle reference histograms, with three distinct cases:
2653  // 1) Skip all references entirely on saving.
2654  // 2) Blanket saving of all references.
2655  // 3) Save only references for monitor elements with qtests.
2656  // The latter two are affected by "path" sub-tree selection,
2657  // i.e. references are saved only in the selected tree part.
2658  if (isSubdirectory(refpath, *me.data_.dirname))
2659  {
2660  if (ref == SaveWithoutReference)
2661  // Skip the reference entirely.
2662  continue;
2663  else if (ref == SaveWithReference)
2664  // Save all references regardless of qtests.
2665  ;
2666  else if (ref == SaveWithReferenceForQTest)
2667  {
2668  // Save only references for monitor elements with qtests
2669  // with an optional cut on minimum quality test result.
2670  int status = -1;
2671  std::string mname(me.getFullname(), s_referenceDirName.size()+1, std::string::npos);
2672  MonitorElement *master = get(mname);
2673  if (master)
2674  for (size_t i = 0, e = master->data_.qreports.size(); i != e; ++i)
2675  status = std::max(status, master->data_.qreports[i].code);
2676 
2677  if (not master or status < minStatus)
2678  {
2679  if (verbose_ > 1)
2680  std::cout << "DQMStore::save: skipping monitor element '"
2681  << me.data_.objname << "' while saving, status is "
2682  << status << ", required minimum status is "
2683  << minStatus << std::endl;
2684  continue;
2685  }
2686  }
2687  }
2688 
2689  if (verbose_ > 1) {
2690  std::cout << "DQMStore::save: saving monitor element" << std::endl;
2691  }
2692 
2694 
2695  // Count saved histograms
2696  ++counter;
2697  }
2698 }
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:2577
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:859
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 2817 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().

2820 {
2821  // Save the object.
2822  TBufferFile buffer(TBufferFile::kWrite);
2823  if (me.kind() < MonitorElement::DQM_KIND_TH1F) {
2824  TObjString object(me.tagString().c_str());
2825  buffer.WriteObject(&object);
2826  } else {
2827  buffer.WriteObject(me.object_);
2828  }
2830  histo.set_full_pathname(*me.data_.dirname + '/' + me.data_.objname);
2831  histo.set_flags(me.data_.flags);
2832  histo.set_size(buffer.Length());
2833  histo.set_streamed_histo((const void*)buffer.Buffer(), buffer.Length());
2834 
2835  // Save quality reports if this is not in reference section.
2836  // XXX not supported by protobuf files.
2837 
2838  // Save efficiency tag, if any.
2839  // XXX not supported by protobuf files.
2840 
2841  // Save tag if any.
2842  // XXX not supported by protobuf files.
2843 }
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 2577 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().

2580 {
2581  // Save the object.
2582  if (me.kind() < MonitorElement::DQM_KIND_TH1F) {
2583  TObjString(me.tagString().c_str()).Write();
2584  } else {
2585  me.object_->Write();
2586  }
2587 
2588  // Save quality reports if this is not in reference section.
2589  if (not isSubdirectory(s_referenceDirName, *me.data_.dirname))
2590  {
2591  for (auto const& report: me.data_.qreports) {
2592  TObjString(me.qualityTagString(report).c_str()).Write();
2593  }
2594  }
2595 
2596  // Save efficiency tag, if any.
2597  if (me.data_.flags & DQMNet::DQM_PROP_EFFICIENCY_PLOT) {
2598  TObjString(me.effLabelString().c_str()).Write();
2599  }
2600 
2601  // Save tag if any.
2602  if (me.data_.flags & DQMNet::DQM_PROP_TAGGED) {
2603  TObjString(me.tagLabelString().c_str()).Write();
2604  }
2605 }
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 2904 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(), meGetter(), DQMFileSaver::saveForFilterUnit(), and DQMFileSaver::saveForOfflinePB().

2908 {
2909  using google::protobuf::io::FileOutputStream;
2910  using google::protobuf::io::GzipOutputStream;
2911  using google::protobuf::io::StringOutputStream;
2912 
2913  std::lock_guard<std::mutex> guard(book_mutex_);
2914 
2915  unsigned int nme = 0;
2916 
2917  if (verbose_) {
2918  std::cout << "DQMStore::savePB: Opening PBFile '" << filename << "'"
2919  << std::endl;
2920  }
2921  dqmstorepb::ROOTFilePB dqmstore_message;
2922 
2923  // Loop over the directory structure.
2924  for (auto const& dir: dirs_)
2925  {
2926  // Check if we should process this directory. We process the
2927  // requested part of the object tree, including references.
2928  if (not path.empty()
2929  and not isSubdirectory(path, dir))
2930  continue;
2931 
2932  if (verbose_ > 1) {
2933  std::cout << "DQMStore::savePB: DQM folder " << dir << "/" << std::endl;
2934  }
2935 
2936  // Loop over monitor elements in this directory.
2937  if (not enableMultiThread_) {
2938  MonitorElement proto(&dir, std::string(), run, 0, 0);
2939  auto begin = data_.lower_bound(proto);
2940  auto end = data_.end();
2941  saveMonitorElementRangeToPB(dir, run, begin, end, dqmstore_message, nme);
2942  } else {
2943  // Restrict the loop to the monitor elements for the current lumisection
2944  MonitorElement proto(&dir, std::string(), run, 0, 0);
2945  proto.setLumi(lumi);
2946  auto begin = data_.lower_bound(proto);
2947  proto.setLumi(lumi+1);
2948  auto end = data_.lower_bound(proto);
2949  saveMonitorElementRangeToPB(dir, run, begin, end, dqmstore_message, nme);
2950  }
2951 
2952  // In LSbasedMode, loop also over the (run, 0, 0, 0) global histograms;
2953  // these could be the merged global histrograms of their per-stream
2954  // counterparts after the streamEndRun transition - but they are not
2955  // produced in LSbasedMode.
2956  if (enableMultiThread_ and LSbasedMode_ and lumi != 0) {
2957  auto begin = data_.lower_bound(MonitorElement(&dir, std::string(), run, 0, 0));
2958  auto end = data_.lower_bound(MonitorElement(&dir, std::string(), run, 0, 1));
2959  saveMonitorElementRangeToPB(dir, run, begin, end, dqmstore_message, nme);
2960  }
2961  }
2962 
2963  int filedescriptor = ::open(filename.c_str(),
2964  O_WRONLY | O_CREAT | O_TRUNC,
2965  S_IRUSR | S_IWUSR |
2966  S_IRGRP | S_IWGRP |
2967  S_IROTH);
2968  FileOutputStream file_stream(filedescriptor);
2970  options.format = GzipOutputStream::GZIP;
2971  options.compression_level = 1;
2972  GzipOutputStream gzip_stream(&file_stream, options);
2973  dqmstore_message.SerializeToZeroCopyStream(&gzip_stream);
2974 
2975  // Flush the internal streams before closing the fd.
2976  gzip_stream.Close();
2977  file_stream.Close();
2978  ::close(filedescriptor);
2979 
2980  // Maybe make some noise.
2981  if (verbose_) {
2982  std::cout << "DQMStore::savePB: successfully wrote " << nme
2983  << " objects from path '" << path << "/"
2984  << "' into DQM file '" << filename << "'\n";
2985  }
2986 }
std::mutex book_mutex_
Definition: DQMStore.h:881
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:2846
#define end
Definition: vmac.h:39
unsigned verbose_
Definition: DQMStore.h:859
MEMap data_
Definition: DQMStore.h:874
#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:3147
dbl *** dir
Definition: mlp_gen.cc:35
std::set< std::string > dirs_
Definition: DQMStore.h:875
bool LSbasedMode_
Definition: DQMStore.h:865
bool enableMultiThread_
Definition: DQMStore.h:864
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 3622 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().

3623 {
3624  if (scaleFlag_ == 0.0) return;
3625  if (verbose_ > 0)
3626  std::cout << " =========== " << " ScaleFlag " << scaleFlag_ << std::endl;
3627  double factor = scaleFlag_;
3628  int events = 1;
3629  if (dirExists("Info/EventInfo")) {
3630  if ( scaleFlag_ == -1.0) {
3631  MonitorElement * scale_me = get("Info/EventInfo/ScaleFactor");
3632  if (scale_me && scale_me->kind()==MonitorElement::DQM_KIND_REAL) factor = scale_me->getFloatValue();
3633  }
3634  MonitorElement * event_me = get("Info/EventInfo/processedEvents");
3635  if (event_me && event_me->kind()==MonitorElement::DQM_KIND_INT) events = event_me->getIntValue();
3636  }
3637  factor = factor/(events*1.0);
3638 
3639  auto mi = data_.begin();
3640  auto me = data_.end();
3641  for ( ; mi != me; ++mi)
3642  {
3643  auto &me = const_cast<MonitorElement &>(*mi);
3644  switch (me.kind())
3645  {
3647  {
3648  me.getTH1F()->Scale(factor);
3649  break;
3650  }
3652  {
3653  me.getTH1S()->Scale(factor);
3654  break;
3655  }
3657  {
3658  me.getTH1D()->Scale(factor);
3659  break;
3660  }
3662  {
3663  me.getTH2F()->Scale(factor);
3664  break;
3665  }
3667  {
3668  me.getTH2S()->Scale(factor);
3669  break;
3670  }
3672  {
3673  me.getTH2D()->Scale(factor);
3674  break;
3675  }
3677  {
3678  me.getTH3F()->Scale(factor);
3679  break;
3680  }
3682  {
3683  me.getTProfile()->Scale(factor);
3684  break;
3685  }
3687  {
3688  me.getTProfile2D()->Scale(factor);
3689  break;
3690  }
3691  default:
3692  if (verbose_ > 0)
3693  std::cout << " The DQM object '" << me.getFullname() << "' is not scalable object " << std::endl;
3694  continue;
3695  }
3696  }
3697 }
int64_t getIntValue() const
double getFloatValue() const
double scaleFlag_
Definition: DQMStore.h:862
bool dirExists(const std::string &path) const
true if directory exists
Definition: DQMStore.cc:812
unsigned verbose_
Definition: DQMStore.h:859
MEMap data_
Definition: DQMStore.h:874
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 3575 of file DQMStore.cc.

References MonitorElement::setAccumulate().

Referenced by mtEnabled().

3576 {
3577  if (me)
3578  me->setAccumulate(flag);
3579 }
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 747 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(), OuterTrackerMonitorTTCluster::beginRun(), OuterTrackerMonitorTTStub::beginRun(), OuterTrackerMonitorTTTrack::beginRun(), DQMDcsInfoClient::beginRun(), CalibrationScanTask::book(), CalibrationTask::book(), LatencyTask::book(), FineDelayTask::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(), TauDQMHistEffProducer::endRun(), TauDQMFileLoader::endRun(), GlobalHitsProdHistStripper::endRun(), SiStripQualityChecker::fillFaultyModuleStatus(), SiStripQualityDQM::fillGrandSummaryMEs(), TrackerOfflineValidationSummary::fillTree(), SiStripDaqInfo::findExcludedModule(), TkHistoMap::folderDefinition(), EgHLTOfflineSummaryClient::getEgHLTSumHist_(), goUp(), HEff1DHit::HEff1DHit(), HEff2DHit::HEff2DHit(), HEff4DHit::HEff4DHit(), HLTScalersClient::HLTScalersClient(), HRes1DHit::HRes1DHit(), HRes2DHit::HRes2DHit(), HRes4DHit::HRes4DHit(), SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy::initializeDQMHistograms(), LaserDQM::initMonitors(), L1ScalersClient::L1ScalersClient(), meGetter(), 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().

748 {
750  const std::string *cleaned = nullptr;
751  cleanTrailingSlashes(fullpath, clean, cleaned);
752  makeDirectory(*cleaned);
753  pwd_ = *cleaned;
754 }
static void cleanTrailingSlashes(const std::string &path, std::string &clean, const std::string *&cleaned)
Definition: DQMStore.cc:83
std::string pwd_
Definition: DQMStore.h:873
std::vector< T * > clean
Definition: MVATrainer.cc:156
void makeDirectory(const std::string &path)
Definition: DQMStore.cc:771
void DQMStore::setVerbose ( unsigned  level)

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

Definition at line 711 of file DQMStore.cc.

References AlCaHLTBitMon_QueryRunRegistry::string.

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

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

Definition at line 3585 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().

3586 {
3587  std::vector<std::string> contents;
3588  getContents(contents);
3589 
3590  std::cout << " ------------------------------------------------------------\n"
3591  << " Directory structure: \n"
3592  << " ------------------------------------------------------------\n";
3593 
3594  std::copy(contents.begin(), contents.end(),
3595  std::ostream_iterator<std::string>(std::cout, "\n"));
3596 
3597  std::cout << " ------------------------------------------------------------\n";
3598 }
def copy(args, dbName)
std::vector< MonitorElement * > getContents(const std::string &path) const
Definition: DQMStore.cc:1841
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 3558 of file DQMStore.cc.

References MonitorElement::softReset().

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

3559 {
3560  if (me)
3561  me->softReset();
3562 }
void DQMStore::tag ( MonitorElement me,
unsigned int  myTag 
)

tag ME as <myTag> (myTag > 0)

Definition at line 1699 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().

1700 {
1701  if (! myTag)
1702  raiseDQMError("DQMStore", "Attempt to tag monitor element '%s'"
1703  " with a zero tag", me->getFullname().c_str());
1704  if ((me->data_.flags & DQMNet::DQM_PROP_TAGGED) && myTag != me->data_.tag)
1705  raiseDQMError("DQMStore", "Attempt to tag monitor element '%s'"
1706  " twice with multiple tags", me->getFullname().c_str());
1707 
1708  me->data_.tag = myTag;
1710 }
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 1714 of file DQMStore.cc.

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

1715 {
1716  std::string dir;
1717  std::string name;
1718  splitPath(dir, name, path);
1719 
1720  if (MonitorElement *me = findObject(dir, name))
1721  tag(me, myTag);
1722  else
1723  raiseDQMError("DQMStore", "Attempt to tag non-existent monitor element"
1724  " '%s' with tag %u", path.c_str(), myTag);
1725 
1726 }
MonitorElement * findObject(const std::string &dir, const std::string &name, const uint32_t run=0, const uint32_t lumi=0, const uint32_t streamId=0, const uint32_t moduleId=0) const
Definition: DQMStore.cc:1942
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:1699
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 1742 of file DQMStore.cc.

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

Referenced by meGetter().

1743 {
1745  const std::string *cleaned = nullptr;
1746  cleanTrailingSlashes(path, clean, cleaned);
1747  MonitorElement proto(cleaned, std::string());
1748 
1749  // FIXME: WILDCARDS? Old one supported them, but nobody seemed to use them.
1750  auto e = data_.end();
1751  auto i = data_.lower_bound(proto);
1752  while (i != e && isSubdirectory(*cleaned, *i->data_.dirname))
1753  {
1754  tag(const_cast<MonitorElement *>(&*i), myTag);
1755  ++i;
1756  }
1757 }
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:1699
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:874
void DQMStore::tagContents ( const std::string &  path,
unsigned int  myTag 
)

tag all children of folder (does NOT include subfolders)

Definition at line 1730 of file DQMStore.cc.

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

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

1731 {
1732  MonitorElement proto(&path, std::string());
1733  auto e = data_.end();
1734  auto i = data_.lower_bound(proto);
1735  for ( ; i != e && path == *i->data_.dirname; ++i)
1736  tag(const_cast<MonitorElement *>(&*i), myTag);
1737 }
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1699
MEMap data_
Definition: DQMStore.h:874
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 3453 of file DQMStore.cc.

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

Referenced by mtEnabled().

3454 {
3455  // Clean the path
3457  const std::string *cleaned = nullptr;
3458  cleanTrailingSlashes(dir, clean, cleaned);
3459 
3460  // Validate the path.
3461  if (cleaned->find_first_not_of(s_safe) != std::string::npos)
3462  raiseDQMError("DQMStore", "Monitor element path name '%s'"
3463  " uses unacceptable characters", cleaned->c_str());
3464 
3465  // Redirect to the pattern match version.
3466  useQTestByMatch(*cleaned + "/*", qtname);
3467 }
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:3471
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 3471 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().

3472 {
3473  QCriterion *qc = getQCriterion(qtname);
3474  if (! qc)
3475  raiseDQMError("DQMStore", "Cannot apply non-existent quality test '%s'",
3476  qtname.c_str());
3477 
3478  auto * fm = new fastmatch( pattern );
3479 
3480  // Record the test for future reference.
3481  QTestSpec qts(fm, qc);
3482  qtestspecs_.push_back(qts);
3483 
3484  // Apply the quality test.
3485  auto mi = data_.begin();
3486  auto me = data_.end();
3487  std::string path;
3488  int cases = 0;
3489  for ( ; mi != me; ++mi)
3490  {
3491  path.clear();
3492  mergePath(path, *mi->data_.dirname, mi->data_.objname);
3493  if (fm->match(path))
3494  {
3495  ++cases;
3496  const_cast<MonitorElement &>(*mi).addQReport(qts.second);
3497  }
3498  }
3499 
3500  //return the number of matched cases
3501  return cases;
3502 }
QCriterion * getQCriterion(const std::string &qtname) const
Definition: DQMStore.cc:3421
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:827
QTestSpecs qtestspecs_
Definition: DQMStore.h:879
MEMap data_
Definition: DQMStore.h:874
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 888 of file DQMStore.h.

friend class DQMFileSaver
friend

Definition at line 892 of file DQMStore.h.

friend class DQMNet
friend

Definition at line 887 of file DQMStore.h.

friend class DQMRootOutputModule
friend

Definition at line 890 of file DQMStore.h.

friend class DQMRootSource
friend

Definition at line 891 of file DQMStore.h.

friend class DQMService
friend

Definition at line 886 of file DQMStore.h.

friend class DQMStoreExample
friend

Definition at line 889 of file DQMStore.h.

friend class edm::DQMHttpSource
friend

Definition at line 885 of file DQMStore.h.

friend class MEtoEDMConverter
friend

Definition at line 893 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
bool DQMStore::enableMultiThread_
private
bool DQMStore::forceResetOnBeginLumi_
private

Definition at line 866 of file DQMStore.h.

Referenced by DQMStore(), and forceReset().

IBooker* DQMStore::ibooker_
private

Definition at line 882 of file DQMStore.h.

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

IGetter* DQMStore::igetter_
private

Definition at line 883 of file DQMStore.h.

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

bool DQMStore::LSbasedMode_
private

Definition at line 865 of file DQMStore.h.

Referenced by initializeFrom(), postGlobalBeginLumi(), save(), and savePB().

uint32_t DQMStore::moduleId_
private

Definition at line 870 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 878 of file DQMStore.h.

Referenced by createQTest(), and initializeFrom().

DQMStore::qtests_
private

All the quality tests.

Definition at line 877 of file DQMStore.h.

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

QTestSpecs DQMStore::qtestspecs_
private

Definition at line 879 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 867 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 861 of file DQMStore.h.

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

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

Definition at line 862 of file DQMStore.h.

Referenced by initializeFrom(), and scaleElements().

std::ofstream* DQMStore::stream_
private

Definition at line 871 of file DQMStore.h.

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

uint32_t DQMStore::streamId_
private

Definition at line 869 of file DQMStore.h.

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

DQMStore::verbose_
private
DQMStore::verboseQT_
private

Verbose flag for xml-based QTests.

Definition at line 860 of file DQMStore.h.

Referenced by createQTest(), and initializeFrom().