CMS 3D CMS Logo

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

#include <DQMStore.h>

Classes

class  ConcurrentBooker
 
class  IBooker
 
class  IGetter
 

Public Types

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

Public Member Functions

MonitorElementbook1D (const char *name, const char *title, int nchX, double lowX, double highX)
 Book 1D histogram. More...
 
MonitorElementbook1D (const std::string &name, const std::string &title, int nchX, double lowX, double highX)
 Book 1D histogram. More...
 
MonitorElementbook1D (const char *name, const char *title, int nchX, const float *xbinsize)
 Book 1D variable bin histogram. More...
 
MonitorElementbook1D (const std::string &name, const std::string &title, int nchX, const float *xbinsize)
 Book 1D variable bin histogram. More...
 
MonitorElementbook1D (const char *name, TH1F *h)
 Book 1D histogram by cloning an existing histogram. More...
 
MonitorElementbook1D (const std::string &name, TH1F *h)
 Book 1D histogram by cloning an existing histogram. More...
 
MonitorElementbook1DD (const char *name, const char *title, int nchX, double lowX, double highX)
 Book 1S histogram. More...
 
MonitorElementbook1DD (const std::string &name, const std::string &title, int nchX, double lowX, double highX)
 Book 1S histogram. More...
 
MonitorElementbook1DD (const char *name, const char *title, int nchX, const float *xbinsize)
 
MonitorElementbook1DD (const std::string &name, const std::string &title, int nchX, const float *xbinsize)
 
MonitorElementbook1DD (const char *name, TH1D *h)
 Book 1D double histogram by cloning an existing histogram. More...
 
MonitorElementbook1DD (const std::string &name, TH1D *h)
 Book 1D double histogram by cloning an existing histogram. More...
 
MonitorElementbook1S (const char *name, const char *title, int nchX, double lowX, double highX)
 Book 1S histogram. More...
 
MonitorElementbook1S (const std::string &name, const std::string &title, int nchX, double lowX, double highX)
 Book 1S histogram. More...
 
MonitorElementbook1S (const char *name, const char *title, int nchX, const float *xbinsize)
 
MonitorElementbook1S (const std::string &name, const std::string &title, int nchX, const float *xbinsize)
 
MonitorElementbook1S (const char *name, TH1S *h)
 Book 1S histogram by cloning an existing histogram. More...
 
MonitorElementbook1S (const std::string &name, TH1S *h)
 Book 1S histogram by cloning an existing histogram. More...
 
MonitorElementbook2D (const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
 Book 2D histogram. More...
 
MonitorElementbook2D (const std::string &name, const std::string &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
 Book 2D histogram. More...
 
MonitorElementbook2D (const char *name, const char *title, int nchX, const float *xbinsize, int nchY, const float *ybinsize)
 Book 2D variable bin histogram. More...
 
MonitorElementbook2D (const std::string &name, const std::string &title, int nchX, const float *xbinsize, int nchY, const float *ybinsize)
 Book 2D variable bin histogram. More...
 
MonitorElementbook2D (const char *name, TH2F *h)
 Book 2D histogram by cloning an existing histogram. More...
 
MonitorElementbook2D (const std::string &name, TH2F *h)
 Book 2D histogram by cloning an existing histogram. More...
 
MonitorElementbook2DD (const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
 Book 2D double histogram. More...
 
MonitorElementbook2DD (const std::string &name, const std::string &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
 Book 2S histogram. More...
 
MonitorElementbook2DD (const char *name, const char *title, int nchX, const float *xbinsize, int nchY, const float *ybinsize)
 
MonitorElementbook2DD (const std::string &name, const std::string &title, int nchX, const float *xbinsize, int nchY, const float *ybinsize)
 
MonitorElementbook2DD (const char *name, TH2D *h)
 Book 2DS histogram by cloning an existing histogram. More...
 
MonitorElementbook2DD (const std::string &name, TH2D *h)
 Book 2DS histogram by cloning an existing histogram. More...
 
MonitorElementbook2S (const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
 Book 2S histogram. More...
 
MonitorElementbook2S (const std::string &name, const std::string &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
 Book 2S histogram. More...
 
MonitorElementbook2S (const char *name, const char *title, int nchX, const float *xbinsize, int nchY, const float *ybinsize)
 Book 2S variable bin histogram. More...
 
MonitorElementbook2S (const std::string &name, const std::string &title, int nchX, const float *xbinsize, int nchY, const float *ybinsize)
 Book 2S variable bin histogram. More...
 
MonitorElementbook2S (const char *name, TH2S *h)
 Book 2DS histogram by cloning an existing histogram. More...
 
MonitorElementbook2S (const std::string &name, TH2S *h)
 Book 2DS histogram by cloning an existing histogram. More...
 
MonitorElementbook3D (const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ)
 Book 3D histogram. More...
 
MonitorElementbook3D (const std::string &name, const std::string &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ)
 Book 3D histogram. More...
 
MonitorElementbook3D (const char *name, TH3F *h)
 Book 3D histogram by cloning an existing histogram. More...
 
MonitorElementbook3D (const std::string &name, TH3F *h)
 Book 3D histogram by cloning an existing histogram. More...
 
template<typename iFunc >
void bookConcurrentTransaction (iFunc f, uint32_t run)
 
MonitorElementbookFloat (const char *name)
 Book float. More...
 
MonitorElementbookFloat (const std::string &name)
 Book float. More...
 
MonitorElementbookInt (const char *name)
 Book int. More...
 
MonitorElementbookInt (const std::string &name)
 Book int. More...
 
MonitorElementbookProfile (const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
 
MonitorElementbookProfile (const std::string &name, const std::string &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
 
MonitorElementbookProfile (const char *name, const char *title, int nchX, double lowX, double highX, double lowY, double highY, const char *option="s")
 
MonitorElementbookProfile (const std::string &name, const std::string &title, int nchX, double lowX, double highX, double lowY, double highY, const char *option="s")
 
MonitorElementbookProfile (const char *name, const char *title, int nchX, const double *xbinsize, int nchY, double lowY, double highY, const char *option="s")
 
MonitorElementbookProfile (const std::string &name, const std::string &title, int nchX, const double *xbinsize, int nchY, double lowY, double highY, const char *option="s")
 
MonitorElementbookProfile (const char *name, const char *title, int nchX, const double *xbinsize, double lowY, double highY, const char *option="s")
 
MonitorElementbookProfile (const std::string &name, const std::string &title, int nchX, const double *xbinsize, double lowY, double highY, const char *option="s")
 
MonitorElementbookProfile (const char *name, TProfile *h)
 Book TProfile by cloning an existing profile. More...
 
MonitorElementbookProfile (const std::string &name, TProfile *h)
 Book TProfile by cloning an existing profile. More...
 
MonitorElementbookProfile2D (const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ, const char *option="s")
 
MonitorElementbookProfile2D (const std::string &name, const std::string &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ, const char *option="s")
 
MonitorElementbookProfile2D (const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, double lowZ, double highZ, const char *option="s")
 
MonitorElementbookProfile2D (const std::string &name, const std::string &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, double lowZ, double highZ, const char *option="s")
 
MonitorElementbookProfile2D (const char *name, TProfile2D *h)
 Book TProfile2D by cloning an existing profile. More...
 
MonitorElementbookProfile2D (const std::string &name, TProfile2D *h)
 Book TProfile2D by cloning an existing profile. More...
 
MonitorElementbookString (const char *name, const char *value)
 Book string. More...
 
MonitorElementbookString (const std::string &name, const std::string &value)
 Book string. More...
 
template<typename iFunc >
void bookTransaction (iFunc f, uint32_t run, uint32_t 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:2158
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:2133
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 1040 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().

1042 {
1043  return book1D_(pwd_, name, new TH1F(name, title, nchX, lowX, highX));
1044 }
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:1019
MonitorElement * DQMStore::book1D ( const std::string &  name,
const std::string &  title,
int  nchX,
double  lowX,
double  highX 
)

Book 1D histogram.

Definition at line 1048 of file DQMStore.cc.

References book1D_(), and pwd_.

1050 {
1051  return book1D_(pwd_, name, new TH1F(name.c_str(), title.c_str(), nchX, lowX, highX));
1052 }
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:1019
MonitorElement * DQMStore::book1D ( const char *  name,
const char *  title,
int  nchX,
const float *  xbinsize 
)

Book 1D variable bin histogram.

Definition at line 1088 of file DQMStore.cc.

References book1D_(), and pwd_.

1090 {
1091  return book1D_(pwd_, name, new TH1F(name, title, nchX, xbinsize));
1092 }
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:1019
MonitorElement * DQMStore::book1D ( const std::string &  name,
const std::string &  title,
int  nchX,
const float *  xbinsize 
)

Book 1D variable bin histogram.

Definition at line 1096 of file DQMStore.cc.

References book1D_(), and pwd_.

1098 {
1099  return book1D_(pwd_, name, new TH1F(name.c_str(), title.c_str(), nchX, xbinsize));
1100 }
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:1019
MonitorElement * DQMStore::book1D ( const char *  name,
TH1F *  h 
)

Book 1D histogram by cloning an existing histogram.

Definition at line 1104 of file DQMStore.cc.

References book1D_(), and pwd_.

1105 {
1106  return book1D_(pwd_, name, static_cast<TH1F *>(source->Clone(name)));
1107 }
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:1019
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 1111 of file DQMStore.cc.

References book1D_(), and pwd_.

1112 {
1113  return book1D_(pwd_, name, static_cast<TH1F *>(source->Clone(name.c_str())));
1114 }
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:1019
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 1019 of file DQMStore.cc.

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

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

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

References book1DD_(), and pwd_.

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

1074 {
1075  return book1DD_(pwd_, name, new TH1D(name, title, nchX, lowX, highX));
1076 }
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:1033
MonitorElement * DQMStore::book1DD ( const std::string &  name,
const std::string &  title,
int  nchX,
double  lowX,
double  highX 
)

Book 1S histogram.

Definition at line 1080 of file DQMStore.cc.

References book1DD_(), and pwd_.

1082 {
1083  return book1DD_(pwd_, name, new TH1D(name.c_str(), title.c_str(), nchX, lowX, highX));
1084 }
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:1033
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 1132 of file DQMStore.cc.

References book1DD_(), and pwd_.

1133 {
1134  return book1DD_(pwd_, name, static_cast<TH1D *>(source->Clone(name)));
1135 }
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:1033
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 1139 of file DQMStore.cc.

References book1DD_(), and pwd_.

1140 {
1141  return book1DD_(pwd_, name, static_cast<TH1D *>(source->Clone(name.c_str())));
1142 }
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:1033
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 1033 of file DQMStore.cc.

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

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

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

References book1S_(), and pwd_.

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

1058 {
1059  return book1S_(pwd_, name, new TH1S(name, title, nchX, lowX, highX));
1060 }
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:1026
MonitorElement * DQMStore::book1S ( const std::string &  name,
const std::string &  title,
int  nchX,
double  lowX,
double  highX 
)

Book 1S histogram.

Definition at line 1064 of file DQMStore.cc.

References book1S_(), and pwd_.

1066 {
1067  return book1S_(pwd_, name, new TH1S(name.c_str(), title.c_str(), nchX, lowX, highX));
1068 }
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:1026
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 1118 of file DQMStore.cc.

References book1S_(), and pwd_.

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

Book 1S histogram by cloning an existing histogram.

Definition at line 1125 of file DQMStore.cc.

References book1S_(), and pwd_.

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

Book 1D histogram based on TH1S.

Definition at line 1026 of file DQMStore.cc.

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

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

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

References book2D_(), and pwd_.

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

References book2D_(), and pwd_.

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

References book2D_(), and pwd_.

1245 {
1246  return book2D_(pwd_, name, new TH2F(name.c_str(), title.c_str(),
1247  nchX, xbinsize, nchY, ybinsize));
1248 }
MonitorElement * book2D_(const std::string &dir, const std::string &name, TH2F *h)
Book 2D histogram based on TH2F.
Definition: DQMStore.cc:1147
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 1270 of file DQMStore.cc.

References book2D_(), and pwd_.

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

References book2D_(), and pwd_.

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

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

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

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

References book2DD_(), and pwd_.

Referenced by meGetter().

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

References book2DD_(), and pwd_.

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

References book2DD_(), and pwd_.

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

References book2DD_(), and pwd_.

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

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

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

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

References book2S_(), and pwd_.

Referenced by dqmRegisterHistogram(), and meGetter().

1193 {
1194  return book2S_(pwd_, name, new TH2S(name, title,
1195  nchX, lowX, highX,
1196  nchY, lowY, highY));
1197 }
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:1154
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 1201 of file DQMStore.cc.

References book2S_(), and pwd_.

1204 {
1205  return book2S_(pwd_, name, new TH2S(name.c_str(), title.c_str(),
1206  nchX, lowX, highX,
1207  nchY, lowY, highY));
1208 }
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:1154
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 1252 of file DQMStore.cc.

References book2S_(), and pwd_.

1254 {
1255  return book2S_(pwd_, name, new TH2S(name, title,
1256  nchX, xbinsize, nchY, ybinsize));
1257 }
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:1154
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 1261 of file DQMStore.cc.

References book2S_(), and pwd_.

1263 {
1264  return book2S_(pwd_, name, new TH2S(name.c_str(), title.c_str(),
1265  nchX, xbinsize, nchY, ybinsize));
1266 }
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:1154
MonitorElement * DQMStore::book2S ( const char *  name,
TH2S *  h 
)

Book 2DS histogram by cloning an existing histogram.

Definition at line 1284 of file DQMStore.cc.

References book2S_(), and pwd_.

1285 {
1286  return book2S_(pwd_, name, static_cast<TH2S *>(source->Clone(name)));
1287 }
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:1154
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 1291 of file DQMStore.cc.

References book2S_(), and pwd_.

1292 {
1293  return book2S_(pwd_, name, static_cast<TH2S *>(source->Clone(name.c_str())));
1294 }
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:1154
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 1154 of file DQMStore.cc.

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

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

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

References book3D_(), and pwd_.

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

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

References book3D_(), and pwd_.

1337 {
1338  return book3D_(pwd_, name, new TH3F(name.c_str(), title.c_str(),
1339  nchX, lowX, highX,
1340  nchY, lowY, highY,
1341  nchZ, lowZ, highZ));
1342 }
MonitorElement * book3D_(const std::string &dir, const std::string &name, TH3F *h)
Book 3D histogram based on TH3F.
Definition: DQMStore.cc:1313
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 1346 of file DQMStore.cc.

References book3D_(), and pwd_.

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

References book3D_(), and pwd_.

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

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

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

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

898 {
899  assert(name.find('/') == std::string::npos);
900  if (verbose_ > 3)
901  print_trace(dir, name);
902 
903  // Check if the request monitor element already exists.
905  {
906  if (verbose_ > 1)
907  {
909  mergePath(path, dir, name);
910 
911  std::cout << "DQMStore: "
912  << context << ": monitor element '"
913  << path << "' already exists, resetting" << std::endl;
914  }
915  me->Reset();
916  return me;
917  }
918  else
919  {
920  // Create it and return for initialisation.
921  assert(dirs_.count(dir));
922  MonitorElement proto(&*dirs_.find(dir), name, run_, streamId_, moduleId_);
923  return &const_cast<MonitorElement &>(*data_.insert(std::move(proto)).first);
924  }
925 }
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:1941
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:645
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 819 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_.

822 {
823  assert(name.find('/') == std::string::npos);
824  if (verbose_ > 3)
825  print_trace(dir, name);
827  mergePath(path, dir, name);
828 
829  // Put us in charge of h.
830  h->SetDirectory(nullptr);
831 
832  // Check if the request monitor element already exists.
834  if (me)
835  {
836  if (collateHistograms_)
837  {
838  collate(me, h, verbose_);
839  delete h;
840  return me;
841  }
842  else
843  {
844  if (verbose_ > 1)
845  std::cout << "DQMStore: "
846  << context << ": monitor element '"
847  << path << "' already exists, collating" << std::endl;
848  me->Reset();
849  collate(me, h, verbose_);
850  delete h;
851  return me;
852  }
853  }
854  else
855  {
856  // Create and initialise core object.
857  assert(dirs_.count(dir));
858  MonitorElement proto(&*dirs_.find(dir), name, run_, streamId_, moduleId_);
859  me = const_cast<MonitorElement &>(*data_.insert(std::move(proto)).first)
861 
862  // Initialise quality test information.
863  auto qi = qtestspecs_.begin();
864  auto qe = qtestspecs_.end();
865  for ( ; qi != qe; ++qi)
866  {
867  if ( qi->first->match(path) )
868  me->addQReport(qi->second);
869  }
870 
871  // If we just booked a (plain) MonitorElement, and there is a reference
872  // MonitorElement with the same name, link the two together.
873  // The other direction is handled by the extract method.
874  std::string refdir;
875  refdir.reserve(s_referenceDirName.size() + dir.size() + 1);
876  refdir += s_referenceDirName;
877  refdir += '/';
878  refdir += dir;
879  MonitorElement* referenceME = findObject(refdir, name);
880  if (referenceME) {
881  // We have booked a new MonitorElement with a specific dir and name.
882  // Then, if we can find the corresponding MonitorElement in the reference
883  // dir we assign the object_ of the reference MonitorElement to the
884  // reference_ property of our new MonitorElement.
885  me->data_.flags |= DQMNet::DQM_PROP_HAS_REFERENCE;
886  me->reference_ = referenceME->object_;
887  }
888 
889  // Return the monitor element.
890  return me;
891  }
892 }
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:1941
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:645
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 982 of file DQMStore.cc.

References bookFloat_(), and pwd_.

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

Book float.

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

961 {
962  if (collateHistograms_)
963  {
965  {
966  me->Fill(0.);
967  return me;
968  }
969  }
970 
971  return book_(dir, name, "bookFloat")
973 }
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:1941
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:895
dbl *** dir
Definition: mlp_gen.cc:35
bool collateHistograms_
Definition: DQMStore.h:863
MonitorElement * DQMStore::bookInt ( const char *  name)

Book int.

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

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

Book int.

Definition at line 952 of file DQMStore.cc.

References bookInt_(), and pwd_.

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

Book int.

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

931 {
932  if (collateHistograms_)
933  {
935  {
936  me->Fill(0);
937  return me;
938  }
939  }
940 
941  return book_(dir, name, "bookInt")
943 }
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:1941
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:895
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 1372 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().

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

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

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

References bookProfile_(), and pwd_.

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

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

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

References bookProfile_(), and pwd_.

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

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

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

References bookProfile_(), and pwd_.

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

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

1481 {
1482  return bookProfile_(pwd_, name, new TProfile(name.c_str(), title.c_str(),
1483  nchX, xbinsize,
1484  lowY, highY,
1485  option));
1486 }
MonitorElement * bookProfile_(const std::string &dir, const std::string &name, TProfile *h)
Book profile histogram based on TProfile.
Definition: DQMStore.cc:1361
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 1490 of file DQMStore.cc.

References bookProfile_(), and pwd_.

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

References bookProfile_(), and pwd_.

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

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

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

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

References bookProfile2D_(), and pwd_.

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

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

1572 {
1573  return bookProfile2D_(pwd_, name, new TProfile2D(name.c_str(), title.c_str(),
1574  nchX, lowX, highX,
1575  nchY, lowY, highY,
1576  lowZ, highZ,
1577  option));
1578 }
MonitorElement * bookProfile2D_(const std::string &dir, const std::string &name, TProfile2D *h)
Book 2D profile histogram based on TProfile2D.
Definition: DQMStore.cc:1505
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 1582 of file DQMStore.cc.

References bookProfile2D_(), and pwd_.

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

References bookProfile2D_(), and pwd_.

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

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

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

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

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

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

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

Book string.

Definition at line 1006 of file DQMStore.cc.

References bookString_(), and pwd_.

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

1007 { return bookString_(pwd_, name, value); }
MonitorElement * bookString_(const std::string &dir, const std::string &name, const std::string &value)
Book string.
Definition: DQMStore.cc:990
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 1011 of file DQMStore.cc.

References bookString_(), and pwd_.

1012 {
1013  return bookString_(pwd_, name, value);
1014 }
MonitorElement * bookString_(const std::string &dir, const std::string &name, const std::string &value)
Book string.
Definition: DQMStore.cc:990
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 990 of file DQMStore.cc.

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

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

993 {
994  if (collateHistograms_)
995  {
997  return me;
998  }
999 
1000  return book_(dir, name, "bookString")
1002 }
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:1941
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:895
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 723 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().

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

cd to subdirectory (if there)

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

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

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

Referenced by mtEnabled(), and save().

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

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

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

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

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

Definition at line 1639 of file DQMStore.cc.

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

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

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

Definition at line 1632 of file DQMStore.cc.

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

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

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

Definition at line 1646 of file DQMStore.cc.

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

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

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

Definition at line 1660 of file DQMStore.cc.

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

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

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

Definition at line 1653 of file DQMStore.cc.

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

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

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

Definition at line 1667 of file DQMStore.cc.

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

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

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

Definition at line 1674 of file DQMStore.cc.

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

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

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

Definition at line 1684 of file DQMStore.cc.

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

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

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

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

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

1803 {
1804  MonitorElement proto(&path, std::string());
1805  auto e = data_.end();
1806  auto i = data_.lower_bound(proto);
1807  return (i != e && isSubdirectory(path, *i->data_.dirname));
1808 }
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 3431 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::EnableContentsWithinExpectedTest(), QTestConfigure::EnableDeadChannelTest(), QTestConfigure::EnableMeanWithinExpectedTest(), QTestConfigure::EnableNoisyChannelTest(), QTestConfigure::EnableXRangeTest(), QTestConfigure::EnableYRangeTest(), and mtEnabled().

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

2190 {
2191  if (!enableMultiThread_)
2192  return;
2193 
2194  std::lock_guard<std::mutex> guard(book_mutex_);
2195 
2196  std::string null_str("");
2197  MonitorElement proto(&null_str, null_str, run, 0, 0);
2198  proto.setLumi(lumi);
2199 
2200  auto e = data_.end();
2201  auto i = data_.lower_bound(proto);
2202 
2203  while (i != e) {
2204  if (i->data_.streamId != 0 ||
2205  i->data_.moduleId != 0)
2206  break;
2207  if (i->data_.lumi != lumi)
2208  break;
2209  if (i->data_.run != run)
2210  break;
2211  if (not i->markedToDelete()) {
2212  ++i;
2213  continue;
2214  }
2215 
2216  if (verbose_ > 1) {
2217  std::cout << "DQMStore::deleteUnusedLumiHistograms: deleted monitor element '"
2218  << *i->data_.dirname << "/" << i->data_.objname << "'"
2219  << "flags " << i->data_.flags << "\n";
2220  }
2221 
2222  i = data_.erase(i);
2223  }
2224 }
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 3565 of file DQMStore.cc.

References MonitorElement::disableSoftReset().

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

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

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

Referenced by get_info().

3243  {
3244  if (buf.Length() == buf.BufferSize())
3245  return nullptr;
3246  buf.InitMap();
3247  void *ptr = buf.ReadObjectAny(nullptr);
3248  return reinterpret_cast<TObject *>(ptr);
3249 }
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 1941 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().

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

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

Referenced by DQMStore(), and mtEnabled().

2134 {
2135  auto mi = data_.begin();
2136  auto me = data_.end();
2137  for ( ; mi != me; ++mi)
2138  {
2139  if (forceResetOnBeginLumi_ && ((*mi).getLumiFlag() == false))
2140  continue;
2141  auto &me = const_cast<MonitorElement &>(*mi);
2142  me.Reset();
2143  me.resetUpdate();
2144  }
2145 
2146  reset_ = true;
2147 }
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 1812 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().

1813 {
1814  std::string dir;
1815  std::string name;
1816  splitPath(dir, name, path);
1817  MonitorElement proto(&dir, name);
1818  auto mepos = data_.find(proto);
1819  return (mepos == data_.end() ? nullptr
1820  : const_cast<MonitorElement *>(&*mepos));
1821 }
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 1825 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().

1826 {
1827  // FIXME: Use reverse map [tag -> path] / [tag -> dir]?
1828  std::vector<MonitorElement *> result;
1829  for (auto const & me : data_)
1830  {
1831  if ((me.data_.flags & DQMNet::DQM_PROP_TAGGED) && me.data_.tag == tag)
1832  result.push_back(const_cast<MonitorElement *>(&me));
1833  }
1834  return result;
1835 }
static const uint32_t DQM_PROP_TAGGED
Definition: DQMNet.h:55
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1698
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 3251 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().

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

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

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

Referenced by mtEnabled().

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

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

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

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

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

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

1787 {
1788  MonitorElement proto(&pwd_, std::string());
1789  std::vector<std::string> result;
1790  auto e = data_.end();
1791  auto i = data_.lower_bound(proto);
1792  for ( ; i != e && isSubdirectory(pwd_, *i->data_.dirname); ++i)
1793  if (pwd_ == *i->data_.dirname)
1794  result.push_back(i->getName());
1795 
1796  return result;
1797 }
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 3526 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().

3527 {
3529  const std::string *cleaned = nullptr;
3530  cleanTrailingSlashes(path, clean, cleaned);
3531 
3533  auto mi = data_.begin();
3534  auto me = data_.end();
3535  for ( ; mi != me; ++mi)
3536  {
3537  if (! cleaned->empty() && ! isSubdirectory(*cleaned, *mi->data_.dirname))
3538  continue;
3539 
3540  if (mi->hasError())
3541  return dqm::qstatus::ERROR;
3542  else if (mi->hasWarning())
3543  status = dqm::qstatus::WARNING;
3544  else if (status < dqm::qstatus::WARNING
3545  && mi->hasOtherReport())
3546  status = dqm::qstatus::OTHER;
3547  }
3548  return status;
3549 }
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 1763 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().

1764 {
1765  std::vector<std::string> result;
1766  auto e = dirs_.end();
1767  auto i = dirs_.find(pwd_);
1768 
1769  // If we didn't find current directory, the tree is empty, so quit.
1770  if (i == e)
1771  return result;
1772 
1773  // Skip the current directory and then start looking for immediate
1774  // subdirectories in the dirs_ list. Stop when we are no longer in
1775  // (direct or indirect) subdirectories of pwd_. Note that we don't
1776  // "know" which order the set will sort A/B, A/B/C and A/D.
1777  while (++i != e && isSubdirectory(pwd_, *i))
1778  if (i->find('/', pwd_.size()+1) == std::string::npos)
1779  result.push_back(*i);
1780 
1781  return result;
1782 }
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<ContentsWithinExpected>(qalgos_);
626  initQCriterion<CompareToMedian>(qalgos_);
627  initQCriterion<CompareLastFilledBin>(qalgos_);
628  initQCriterion<CheckVariance>(qalgos_);
629 
630  scaleFlag_ = pset.getUntrackedParameter<double>("ScalingFlag", 0.0);
631  if (verbose_ > 0)
632  std::cout << "DQMStore: Scaling Flag set to " << scaleFlag_ << std::endl;
633 }
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:3188
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:770
void reset()
Definition: DQMStore.cc:2109
bool enableMultiThread_
Definition: DQMStore.h:864
bool DQMStore::isCollate ( ) const

Definition at line 3604 of file DQMStore.cc.

References collateHistograms_.

Referenced by mtEnabled().

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

Definition at line 3613 of file DQMStore.cc.

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

Referenced by extract(), and mtEnabled().

3614 { 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 3161 of file DQMStore.cc.

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

Referenced by DQMFileReader::beginJob().

3164 {
3165  bool overwrite = true;
3166  if (collateHistograms_) overwrite = false;
3167  if (verbose_)
3168  {
3169  std::cout << "DQMStore::load: reading from file '" << filename << "'\n";
3170  if (collateHistograms_)
3171  std::cout << "DQMStore::load: in collate mode " << "\n";
3172  else
3173  std::cout << "DQMStore::load: in overwrite mode " << "\n";
3174  }
3175 
3176  if (!s_rxpbfile.match(filename, 0, 0))
3177  return readFile(filename, overwrite, "", "", stripdirs, fileMustExist);
3178  else
3179  return readFilePB(filename, overwrite, "", "", stripdirs, fileMustExist);
3180 }
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:3188
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:3272
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 770 of file DQMStore.cc.

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

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

771 {
772  std::string prev;
773  std::string subdir;
775  prev.reserve(path.size());
776  subdir.reserve(path.size());
777  name.reserve(path.size());
778  size_t prevname = 0;
779  size_t slash = 0;
780 
781  while (true)
782  {
783  // Create this subdirectory component.
784  subdir.clear();
785  subdir.append(path, 0, slash);
786  name.clear();
787  name.append(subdir, prevname, std::string::npos);
788  if (! prev.empty() && findObject(prev, name))
789  raiseDQMError("DQMStore", "Attempt to create subdirectory '%s'"
790  " which already exists as a monitor element",
791  subdir.c_str());
792 
793  if (! dirs_.count(subdir))
794  dirs_.insert(subdir);
795 
796  // Stop if we've reached the end (including possibly a trailing slash).
797  if (slash+1 >= path.size())
798  break;
799 
800  // Find the next slash, making sure we progress. If reach the end,
801  // process the last path component; the next loop round will terminate.
802  prevname = slash ? slash+1 : slash;
803  prev = subdir;
804  if ((slash = path.find('/', ++slash)) == std::string::npos)
805  slash = path.size();
806  }
807 }
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:1941
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 3146 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().

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

2159 {
2160  static const std::string null_str("");
2161 
2162  auto const& lumiblock = gc.luminosityBlockID();
2163  uint32_t run = lumiblock.run();
2164 
2165  // find the range of non-legacy global MEs for the current run:
2166  // run != 0, lumi == 0 (implicit), stream id == 0, module id == 0
2167  const MonitorElement begin(&null_str, null_str, run, 0, 0);
2168  const MonitorElement end(&null_str, null_str, run, 0, 1);
2169  auto i = data_.lower_bound(begin);
2170  const auto e = data_.lower_bound(end);
2171  while (i != e) {
2172  auto& me = const_cast<MonitorElement&>(*i++);
2173  // skip per-run MEs
2174  if (not LSbasedMode_ and not me.getLumiFlag())
2175  continue;
2176  me.Reset();
2177  me.resetUpdate();
2178  }
2179 }
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 645 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().

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

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

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

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

References pwd_.

Referenced by meGetter().

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

remove all monitoring elements from directory;

Definition at line 3373 of file DQMStore.cc.

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

3374 {
3375  MonitorElement proto(&dir, std::string());
3376  auto e = data_.end();
3377  auto i = data_.lower_bound(proto);
3378  while (i != e && isSubdirectory(dir, *i->data_.dirname))
3379  if (dir == *i->data_.dirname)
3380  data_.erase(i++);
3381  else
3382  ++i;
3383 }
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 3395 of file DQMStore.cc.

References pwd_.

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

3396 {
3398 }
void removeElement(const std::string &name)
Definition: DQMStore.cc:3395
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 3403 of file DQMStore.cc.

References gather_cfg::cout, and data_.

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

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

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

2110 {
2111  auto mi = data_.begin();
2112  auto me = data_.end();
2113  for ( ; mi != me; ++mi)
2114  {
2115  auto &me = const_cast<MonitorElement &>(*mi);
2116  if (mi->wasUpdated())
2117  {
2118  if (me.resetMe())
2119  me.Reset();
2120  me.resetUpdate();
2121  }
2122  }
2123 
2124  reset_ = true;
2125 }
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 3353 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().

3354 {
3356  const std::string *cleaned = nullptr;
3357  cleanTrailingSlashes(path, clean, cleaned);
3358  MonitorElement proto(cleaned, std::string());
3359 
3360  auto e = data_.end();
3361  auto i = data_.lower_bound(proto);
3362  while (i != e && isSubdirectory(*cleaned, *i->data_.dirname))
3363  data_.erase(i++);
3364 
3365  auto de = dirs_.end();
3366  auto di = dirs_.lower_bound(*cleaned);
3367  while (di != de && isSubdirectory(*cleaned, *di))
3368  dirs_.erase(di++);
3369 }
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 3505 of file DQMStore.cc.

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

Referenced by mtEnabled().

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

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

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

Referenced by savePB().

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

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

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

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

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

3622 {
3623  if (scaleFlag_ == 0.0) return;
3624  if (verbose_ > 0)
3625  std::cout << " =========== " << " ScaleFlag " << scaleFlag_ << std::endl;
3626  double factor = scaleFlag_;
3627  int events = 1;
3628  if (dirExists("Info/EventInfo")) {
3629  if ( scaleFlag_ == -1.0) {
3630  MonitorElement * scale_me = get("Info/EventInfo/ScaleFactor");
3631  if (scale_me && scale_me->kind()==MonitorElement::DQM_KIND_REAL) factor = scale_me->getFloatValue();
3632  }
3633  MonitorElement * event_me = get("Info/EventInfo/processedEvents");
3634  if (event_me && event_me->kind()==MonitorElement::DQM_KIND_INT) events = event_me->getIntValue();
3635  }
3636  factor = factor/(events*1.0);
3637 
3638  auto mi = data_.begin();
3639  auto me = data_.end();
3640  for ( ; mi != me; ++mi)
3641  {
3642  auto &me = const_cast<MonitorElement &>(*mi);
3643  switch (me.kind())
3644  {
3646  {
3647  me.getTH1F()->Scale(factor);
3648  break;
3649  }
3651  {
3652  me.getTH1S()->Scale(factor);
3653  break;
3654  }
3656  {
3657  me.getTH1D()->Scale(factor);
3658  break;
3659  }
3661  {
3662  me.getTH2F()->Scale(factor);
3663  break;
3664  }
3666  {
3667  me.getTH2S()->Scale(factor);
3668  break;
3669  }
3671  {
3672  me.getTH2D()->Scale(factor);
3673  break;
3674  }
3676  {
3677  me.getTH3F()->Scale(factor);
3678  break;
3679  }
3681  {
3682  me.getTProfile()->Scale(factor);
3683  break;
3684  }
3686  {
3687  me.getTProfile2D()->Scale(factor);
3688  break;
3689  }
3690  default:
3691  if (verbose_ > 0)
3692  std::cout << " The DQM object '" << me.getFullname() << "' is not scalable object " << std::endl;
3693  continue;
3694  }
3695  }
3696 }
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:811
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 3574 of file DQMStore.cc.

References MonitorElement::setAccumulate().

Referenced by mtEnabled().

3575 {
3576  if (me)
3577  me->setAccumulate(flag);
3578 }
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 746 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().

747 {
749  const std::string *cleaned = nullptr;
750  cleanTrailingSlashes(fullpath, clean, cleaned);
751  makeDirectory(*cleaned);
752  pwd_ = *cleaned;
753 }
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:770
void DQMStore::setVerbose ( unsigned  level)

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

Definition at line 710 of file DQMStore.cc.

References AlCaHLTBitMon_QueryRunRegistry::string.

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

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

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

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

References MonitorElement::softReset().

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

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

tag ME as <myTag> (myTag > 0)

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

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

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

1714 {
1715  std::string dir;
1716  std::string name;
1717  splitPath(dir, name, path);
1718 
1719  if (MonitorElement *me = findObject(dir, name))
1720  tag(me, myTag);
1721  else
1722  raiseDQMError("DQMStore", "Attempt to tag non-existent monitor element"
1723  " '%s' with tag %u", path.c_str(), myTag);
1724 
1725 }
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:1941
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:1698
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 1741 of file DQMStore.cc.

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

Referenced by meGetter().

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

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

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

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

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

Referenced by mtEnabled().

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

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