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  char_string
 
class  ConcurrentBooker
 
class  IBooker
 
class  IGetter
 

Public Types

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

Public Member Functions

MonitorElementbook1D (char_string const &name, char_string const &title, int const nchX, double const lowX, double const highX)
 Book 1D histogram. More...
 
MonitorElementbook1D (char_string const &name, char_string const &title, int nchX, float const *xbinsize)
 
MonitorElementbook1D (char_string const &name, TH1F *h)
 Book 1D histogram by cloning an existing histogram. More...
 
MonitorElementbook1DD (char_string const &name, char_string const &title, int nchX, double lowX, double highX)
 Book 1S histogram. More...
 
MonitorElementbook1DD (char_string const &name, char_string const &title, int nchX, float const *xbinsize)
 
MonitorElementbook1DD (char_string const &name, TH1D *h)
 Book 1D double histogram by cloning an existing histogram. More...
 
MonitorElementbook1S (char_string const &name, char_string const &title, int nchX, double lowX, double highX)
 Book 1S histogram. More...
 
MonitorElementbook1S (char_string const &name, char_string const &title, int nchX, float const *xbinsize)
 
MonitorElementbook1S (char_string const &name, TH1S *h)
 Book 1S histogram by cloning an existing histogram. More...
 
MonitorElementbook2D (char_string const &name, char_string const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
 Book 2D histogram. More...
 
MonitorElementbook2D (char_string const &name, char_string const &title, int nchX, float const *xbinsize, int nchY, float const *ybinsize)
 
MonitorElementbook2D (char_string const &name, TH2F *h)
 Book 2D histogram by cloning an existing histogram. More...
 
MonitorElementbook2DD (char_string const &name, char_string const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
 Book 2D histogram. More...
 
MonitorElementbook2DD (char_string const &name, char_string const &title, int nchX, float const *xbinsize, int nchY, float const *ybinsize)
 
MonitorElementbook2DD (char_string const &name, TH2D *h)
 Book 2DS histogram by cloning an existing histogram. More...
 
MonitorElementbook2S (char_string const &name, char_string const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
 Book 2S histogram. More...
 
MonitorElementbook2S (char_string const &name, char_string const &title, int nchX, float const *xbinsize, int nchY, float const *ybinsize)
 
MonitorElementbook2S (char_string const &name, TH2S *h)
 Book 2DS histogram by cloning an existing histogram. More...
 
MonitorElementbook3D (char_string const &name, char_string const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ)
 Book 3D histogram. More...
 
MonitorElementbook3D (char_string const &name, TH3F *h)
 Book 3D histogram by cloning an existing histogram. More...
 
template<typename iFunc >
void bookConcurrentTransaction (iFunc f, uint32_t run)
 
MonitorElementbookFloat (char_string const &name)
 Book float. More...
 
MonitorElementbookInt (char_string const &name)
 Book int. More...
 
MonitorElementbookProfile (char_string const &name, char_string const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, char const *option="s")
 
MonitorElementbookProfile (char_string const &name, char_string const &title, int nchX, double lowX, double highX, double lowY, double highY, char const *option="s")
 
MonitorElementbookProfile (char_string const &name, char_string const &title, int nchX, double const *xbinsize, int nchY, double lowY, double highY, char const *option="s")
 
MonitorElementbookProfile (char_string const &name, char_string const &title, int nchX, double const *xbinsize, double lowY, double highY, char const *option="s")
 
MonitorElementbookProfile (char_string const &name, TProfile *h)
 Book TProfile by cloning an existing profile. More...
 
MonitorElementbookProfile2D (char_string const &name, char_string const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, double lowZ, double highZ, char const *option="s")
 
MonitorElementbookProfile2D (char_string const &name, char_string const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ, char const *option="s")
 
MonitorElementbookProfile2D (char_string const &name, TProfile2D *h)
 Book TProfile2D by cloning an existing profile. More...
 
MonitorElementbookString (char_string const &name, char_string const &value)
 Book string. More...
 
template<typename iFunc >
void bookTransaction (iFunc f, uint32_t run, uint32_t moduleId)
 
void cd ()
 go to top directory (ie. root) More...
 
void cd (std::string const &subdir)
 cd to subdirectory (if there) More...
 
void cloneLumiHistograms (uint32_t run, uint32_t lumi, uint32_t moduleId)
 
void cloneRunHistograms (uint32_t run, uint32_t moduleId)
 
bool containsAnyMonitorable (std::string const &path) const
 
QCriterioncreateQTest (std::string const &algoname, std::string const &qtname)
 
void deleteUnusedLumiHistograms (uint32_t run, uint32_t lumi)
 
bool dirExists (std::string const &path) const
 true if directory exists More...
 
void disableSoftReset (MonitorElement *me)
 
 DQMStore (edm::ParameterSet const &pset, edm::ActivityRegistry &)
 
 DQMStore (edm::ParameterSet const &pset)
 
 DQMStore (DQMStore const &)=delete
 
MonitorElementget (std::string const &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 (std::string const &path, uint32_t runNumber=0, uint32_t lumi=0) const
 
std::vector< MonitorElement * > getContents (std::string const &path) const
 
std::vector< MonitorElement * > getContents (std::string const &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 (std::string const &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 (std::string const &qtname) const
 
int getStatus (std::string const &path="") const
 
std::vector< std::string > getSubdirs () const
 
void goUp ()
 equivalent to "cd .." More...
 
bool isCollate () const
 
bool load (std::string const &filename, OpenRunDirs stripdirs=StripRunDirs, bool fileMustExist=true)
 
template<typename iFunc >
void meBookerGetter (iFunc f)
 
bool mtEnabled ()
 
bool open (std::string const &filename, bool overwrite=false, std::string const &path="", std::string const &prepend="", OpenRunDirs stripdirs=KeepRunDirs, bool fileMustExist=true)
 
DQMStoreoperator= (DQMStore const &)=delete
 
std::string const & pwd () const
 
void removeContents ()
 erase all monitoring elements in current directory (not including subfolders); More...
 
void removeContents (std::string const &dir)
 remove all monitoring elements from directory; More...
 
void removeElement (std::string const &name)
 
void removeElement (std::string const &dir, std::string const &name, bool warning=true)
 
void rmdir (std::string const &fullpath)
 
void runQTests ()
 
void save (std::string const &filename, std::string const &path="", std::string const &pattern="", std::string const &rewrite="", uint32_t run=0, uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, std::string const &fileupdate="RECREATE")
 
void savePB (std::string const &filename, std::string const &path="", uint32_t run=0, uint32_t lumi=0)
 
void scaleElements ()
 
void setCurrentFolder (std::string const &fullpath)
 
void setVerbose (unsigned level)
 
void showDirStructure () const
 
void softReset (MonitorElement *me)
 
void tag (MonitorElement *me, unsigned int myTag)
 
void tag (std::string const &path, unsigned int myTag)
 tag ME specified by full pathname (e.g. "my/long/dir/my_histo") More...
 
void tagAllContents (std::string const &path, unsigned int myTag)
 
void tagContents (std::string const &path, unsigned int myTag)
 tag all children of folder (does NOT include subfolders) More...
 
void useQTest (std::string const &dir, std::string const &qtname)
 
int useQTestByMatch (std::string const &pattern, std::string const &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 *(*)(std::string const &)>
 
using QCMap = std::map< std::string, QCriterion * >
 
using QTestSpec = std::pair< fastmatch *, QCriterion * >
 
using QTestSpecs = std::list< QTestSpec >
 

Private Member Functions

MonitorElementbook1D_ (std::string const &dir, std::string const &name, TH1F *h)
 Book 1D histogram based on TH1F. More...
 
MonitorElementbook1DD_ (std::string const &dir, std::string const &name, TH1D *h)
 Book 1D histogram based on TH1D. More...
 
MonitorElementbook1S_ (std::string const &dir, std::string const &name, TH1S *h)
 Book 1D histogram based on TH1S. More...
 
MonitorElementbook2D_ (std::string const &dir, std::string const &name, TH2F *h)
 Book 2D histogram based on TH2F. More...
 
MonitorElementbook2DD_ (std::string const &dir, std::string const &name, TH2D *h)
 Book 2D histogram based on TH2D. More...
 
MonitorElementbook2S_ (std::string const &dir, std::string const &name, TH2S *h)
 Book 2D histogram based on TH2S. More...
 
MonitorElementbook3D_ (std::string const &dir, std::string const &name, TH3F *h)
 Book 3D histogram based on TH3F. More...
 
MonitorElementbook_ (std::string const &dir, std::string const &name, char const *context)
 
template<class HISTO , class COLLATE >
MonitorElementbook_ (std::string const &dir, std::string const &name, char const *context, int kind, HISTO *h, COLLATE collate)
 
MonitorElementbookFloat_ (std::string const &dir, std::string const &name)
 Book float. More...
 
MonitorElementbookInt_ (std::string const &dir, std::string const &name)
 Book int. More...
 
MonitorElementbookProfile2D_ (std::string const &dir, std::string const &name, TProfile2D *h)
 Book 2D profile histogram based on TProfile2D. More...
 
MonitorElementbookProfile_ (std::string const &dir, std::string const &name, TProfile *h)
 Book profile histogram based on TProfile. More...
 
MonitorElementbookString_ (std::string const &dir, std::string const &name, std::string const &value)
 Book string. More...
 
bool cdInto (std::string const &path) const
 
bool extract (TObject *obj, std::string const &dir, bool overwrite, bool collateHistograms)
 
TObject * extractNextObject (TBufferFile &) const
 
MonitorElementfindObject (uint32_t run, uint32_t lumi, uint32_t moduleId, std::string const &dir, std::string const &name) const
 
void forceReset ()
 
void get_info (dqmstorepb::ROOTFilePB_Histo const &, std::string &dirname, std::string &objname, TObject **obj)
 
MonitorElementinitialise (MonitorElement *me, std::string const &path)
 
void initializeFrom (const edm::ParameterSet &)
 
bool isCollateME (MonitorElement *me) const
 
void makeDirectory (std::string const &path)
 
void postGlobalBeginLumi (const edm::GlobalContext &)
 
void print_trace (std::string const &dir, std::string const &name)
 
unsigned int readDirectory (TFile *file, bool overwrite, std::string const &path, std::string const &prepend, std::string const &curdir, OpenRunDirs stripdirs)
 
bool readFile (std::string const &filename, bool overwrite=false, std::string const &path="", std::string const &prepend="", OpenRunDirs stripdirs=StripRunDirs, bool fileMustExist=true)
 
bool readFilePB (std::string const &filename, bool overwrite=false, std::string const &path="", std::string const &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_ {false}
 
MEMap data_
 
std::set< std::string > dirs_
 
bool enableMultiThread_ {false}
 
bool forceResetOnBeginLumi_ {false}
 
bool LSbasedMode_
 
uint32_t moduleId_ {}
 
std::string pwd_ {}
 
QAMap qalgos_
 
QCMap qtests_
 
QTestSpecs qtestspecs_
 
std::string readSelectedDirectory_ {}
 
bool reset_ {false}
 
uint32_t run_ {}
 
double scaleFlag_
 
std::unique_ptr< std::ostream > stream_ {nullptr}
 
unsigned verbose_ {1}
 
unsigned verboseQT_ {1}
 

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 76 of file DQMStore.h.

Member Typedef Documentation

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

Definition at line 605 of file DQMStore.h.

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

Definition at line 607 of file DQMStore.h.

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

Definition at line 606 of file DQMStore.h.

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

Definition at line 603 of file DQMStore.h.

Definition at line 604 of file DQMStore.h.

Member Enumeration Documentation

Enumerator
KeepRunDirs 
StripRunDirs 

Definition at line 83 of file DQMStore.h.

Enumerator
SaveWithoutReference 
SaveWithReference 
SaveWithReferenceForQTest 

Definition at line 78 of file DQMStore.h.

Constructor & Destructor Documentation

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

Definition at line 367 of file DQMStore.cc.

References enableMultiThread_, forceReset(), forceResetOnBeginLumi_, edm::service::SystemBounds::maxNumberOfStreams(), postGlobalBeginLumi(), and muonDTDigis_cfi::pset.

368  : DQMStore{pset}
369 {
370  ar.preallocateSignal_.connect([this](edm::service::SystemBounds const& iBounds) {
371  if(iBounds.maxNumberOfStreams() > 1 ) {
372  enableMultiThread_ = true;
373  }
374  });
375  if(pset.getUntrackedParameter<bool>("forceResetOnBeginRun",false)) {
376  ar.watchPostSourceRun([this](edm::RunIndex){ forceReset(); });
377  }
378  if(pset.getUntrackedParameter<bool>("forceResetOnBeginLumi",false) && enableMultiThread_ == false) {
379  forceResetOnBeginLumi_ = true;
381  }
383 }
void postGlobalBeginLumi(const edm::GlobalContext &)
Definition: DQMStore.cc:1874
void watchPostGlobalBeginLumi(PostGlobalBeginLumi::slot_type const &iSlot)
void forceReset()
Definition: DQMStore.cc:1852
Preallocate preallocateSignal_
signal is emitted before beginJob
unsigned int maxNumberOfStreams() const
Definition: SystemBounds.h:43
void watchPostSourceRun(PostSourceRun::slot_type const &iSlot)
void watchPostSourceLumi(PostSourceLumi::slot_type const &iSlot)
bool forceResetOnBeginLumi_
Definition: DQMStore.h:637
void connect(U iFunc)
Definition: Signal.h:64
bool enableMultiThread_
Definition: DQMStore.h:635
DQMStore::DQMStore ( edm::ParameterSet const &  pset)

Definition at line 385 of file DQMStore.cc.

References initializeFrom().

386 {
388 }
void initializeFrom(const edm::ParameterSet &)
Definition: DQMStore.cc:400
DQMStore::~DQMStore ( )

Definition at line 390 of file DQMStore.cc.

References qtests_, and qtestspecs_.

Referenced by meBookerGetter().

391 {
392  for (auto& qtest : qtests_)
393  delete qtest.second;
394 
395  for (auto& qtestspec : qtestspecs_)
396  delete qtestspec.first;
397 }
QCMap qtests_
Definition: DQMStore.h:647
QTestSpecs qtestspecs_
Definition: DQMStore.h:649
DQMStore::DQMStore ( DQMStore const &  )
delete

Member Function Documentation

MonitorElement * DQMStore::book1D ( char_string const &  name,
char_string const &  title,
int const  nchX,
double const  lowX,
double const  highX 
)
MonitorElement* DQMStore::book1D ( char_string const &  name,
char_string const &  title,
int  nchX,
float const *  xbinsize 
)
MonitorElement * DQMStore::book1D ( char_string const &  name,
TH1F *  h 
)

Book 1D histogram by cloning an existing histogram.

Definition at line 1118 of file DQMStore.cc.

References book1D_(), and pwd_.

1119 {
1120  return book1D_(pwd_, name, static_cast<TH1F*>(source->Clone(name)));
1121 }
MonitorElement * book1D_(std::string const &dir, std::string const &name, TH1F *h)
Book 1D histogram based on TH1F.
Definition: DQMStore.cc:1065
std::string pwd_
Definition: DQMStore.h:643
static std::string const source
Definition: EdmProvDump.cc:44
MonitorElement * DQMStore::book1D_ ( std::string const &  dir,
std::string const &  name,
TH1F *  h 
)
private

Book 1D histogram based on TH1F.

Definition at line 1065 of file DQMStore.cc.

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

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

1066 {
1067  return book_(dir, name, "book1D", MonitorElement::DQM_KIND_TH1F, h, collate1D);
1068 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
MonitorElement * book_(std::string const &dir, std::string const &name, char const *context)
Definition: DQMStore.cc:970
static void collate1D(MonitorElement *me, TH1F *h, unsigned verbose)
Definition: DQMStore.cc:1417
dbl *** dir
Definition: mlp_gen.cc:35
MonitorElement * DQMStore::book1DD ( char_string const &  name,
char_string const &  title,
int  nchX,
double  lowX,
double  highX 
)

Book 1S histogram.

Definition at line 1102 of file DQMStore.cc.

References book1D(), book1D_(), book1DD_(), pwd_, and fftjetcommon_cfi::title.

Referenced by MEtoMEComparitor::book().

1104 {
1105  return book1DD_(pwd_, name, new TH1D(name, title, nchX, lowX, highX));
1106 }
MonitorElement * book1DD_(std::string const &dir, std::string const &name, TH1D *h)
Book 1D histogram based on TH1D.
Definition: DQMStore.cc:1079
std::string pwd_
Definition: DQMStore.h:643
MonitorElement* DQMStore::book1DD ( char_string const &  name,
char_string const &  title,
int  nchX,
float const *  xbinsize 
)
MonitorElement * DQMStore::book1DD ( char_string const &  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 }
MonitorElement * book1DD_(std::string const &dir, std::string const &name, TH1D *h)
Book 1D histogram based on TH1D.
Definition: DQMStore.cc:1079
std::string pwd_
Definition: DQMStore.h:643
static std::string const source
Definition: EdmProvDump.cc:44
MonitorElement * DQMStore::book1DD_ ( std::string const &  dir,
std::string const &  name,
TH1D *  h 
)
private

Book 1D histogram based on TH1D.

Definition at line 1079 of file DQMStore.cc.

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

Referenced by book1DD(), and extract().

1080 {
1081  return book_(dir, name, "book1DD", MonitorElement::DQM_KIND_TH1D, h, collate1DD);
1082 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
MonitorElement * book_(std::string const &dir, std::string const &name, char const *context)
Definition: DQMStore.cc:970
static void collate1DD(MonitorElement *me, TH1D *h, unsigned verbose)
Definition: DQMStore.cc:1431
dbl *** dir
Definition: mlp_gen.cc:35
MonitorElement * DQMStore::book1S ( char_string const &  name,
char_string const &  title,
int  nchX,
double  lowX,
double  highX 
)

Book 1S histogram.

Definition at line 1094 of file DQMStore.cc.

References book1S_(), and pwd_.

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

1096 {
1097  return book1S_(pwd_, name, new TH1S(name, title, nchX, lowX, highX));
1098 }
std::string pwd_
Definition: DQMStore.h:643
MonitorElement * book1S_(std::string const &dir, std::string const &name, TH1S *h)
Book 1D histogram based on TH1S.
Definition: DQMStore.cc:1072
MonitorElement* DQMStore::book1S ( char_string const &  name,
char_string const &  title,
int  nchX,
float const *  xbinsize 
)
MonitorElement * DQMStore::book1S ( char_string const &  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)));
1128 }
std::string pwd_
Definition: DQMStore.h:643
MonitorElement * book1S_(std::string const &dir, std::string const &name, TH1S *h)
Book 1D histogram based on TH1S.
Definition: DQMStore.cc:1072
static std::string const source
Definition: EdmProvDump.cc:44
MonitorElement * DQMStore::book1S_ ( std::string const &  dir,
std::string const &  name,
TH1S *  h 
)
private

Book 1D histogram based on TH1S.

Definition at line 1072 of file DQMStore.cc.

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

Referenced by book1S(), and extract().

1073 {
1074  return book_(dir, name, "book1S", MonitorElement::DQM_KIND_TH1S, h, collate1S);
1075 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
MonitorElement * book_(std::string const &dir, std::string const &name, char const *context)
Definition: DQMStore.cc:970
static void collate1S(MonitorElement *me, TH1S *h, unsigned verbose)
Definition: DQMStore.cc:1424
dbl *** dir
Definition: mlp_gen.cc:35
MonitorElement * DQMStore::book2D ( char_string const &  name,
char_string const &  title,
int  nchX,
double  lowX,
double  highX,
int  nchY,
double  lowY,
double  highY 
)
MonitorElement* DQMStore::book2D ( char_string const &  name,
char_string const &  title,
int  nchX,
float const *  xbinsize,
int  nchY,
float const *  ybinsize 
)
MonitorElement * DQMStore::book2D ( char_string const &  name,
TH2F *  h 
)

Book 2D histogram by cloning an existing histogram.

Definition at line 1212 of file DQMStore.cc.

References book2D_(), and pwd_.

1213 {
1214  return book2D_(pwd_, name, static_cast<TH2F*>(source->Clone(name)));
1215 }
MonitorElement * book2D_(std::string const &dir, std::string const &name, TH2F *h)
Book 2D histogram based on TH2F.
Definition: DQMStore.cc:1140
std::string pwd_
Definition: DQMStore.h:643
static std::string const source
Definition: EdmProvDump.cc:44
MonitorElement * DQMStore::book2D_ ( std::string const &  dir,
std::string const &  name,
TH2F *  h 
)
private

Book 2D histogram based on TH2F.

Definition at line 1140 of file DQMStore.cc.

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

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

1141 {
1142  return book_(dir, name, "book2D", MonitorElement::DQM_KIND_TH2F, h, collate2D);
1143 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
MonitorElement * book_(std::string const &dir, std::string const &name, char const *context)
Definition: DQMStore.cc:970
dbl *** dir
Definition: mlp_gen.cc:35
static void collate2D(MonitorElement *me, TH2F *h, unsigned verbose)
Definition: DQMStore.cc:1438
MonitorElement * DQMStore::book2DD ( char_string const &  name,
char_string const &  title,
int  nchX,
double  lowX,
double  highX,
int  nchY,
double  lowY,
double  highY 
)

Book 2D histogram.

Definition at line 1183 of file DQMStore.cc.

References book2D(), book2D_(), book2DD_(), book2S(), book2S_(), and pwd_.

1186 {
1187  return book2DD_(pwd_, name, new TH2D(name, title,
1188  nchX, lowX, highX,
1189  nchY, lowY, highY));
1190 }
MonitorElement * book2DD_(std::string const &dir, std::string const &name, TH2D *h)
Book 2D histogram based on TH2D.
Definition: DQMStore.cc:1154
std::string pwd_
Definition: DQMStore.h:643
MonitorElement* DQMStore::book2DD ( char_string const &  name,
char_string const &  title,
int  nchX,
float const *  xbinsize,
int  nchY,
float const *  ybinsize 
)
MonitorElement * DQMStore::book2DD ( char_string const &  name,
TH2D *  h 
)

Book 2DS histogram by cloning an existing histogram.

Definition at line 1226 of file DQMStore.cc.

References book2DD_(), and pwd_.

1227 {
1228  return book2DD_(pwd_, name, static_cast<TH2D*>(source->Clone(name)));
1229 }
MonitorElement * book2DD_(std::string const &dir, std::string const &name, TH2D *h)
Book 2D histogram based on TH2D.
Definition: DQMStore.cc:1154
std::string pwd_
Definition: DQMStore.h:643
static std::string const source
Definition: EdmProvDump.cc:44
MonitorElement * DQMStore::book2DD_ ( std::string const &  dir,
std::string const &  name,
TH2D *  h 
)
private

Book 2D histogram based on TH2D.

Definition at line 1154 of file DQMStore.cc.

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

Referenced by book2DD(), and extract().

1155 {
1156  return book_(dir, name, "book2DD", MonitorElement::DQM_KIND_TH2D, h, collate2DD);
1157 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
MonitorElement * book_(std::string const &dir, std::string const &name, char const *context)
Definition: DQMStore.cc:970
static void collate2DD(MonitorElement *me, TH2D *h, unsigned verbose)
Definition: DQMStore.cc:1452
dbl *** dir
Definition: mlp_gen.cc:35
MonitorElement * DQMStore::book2S ( char_string const &  name,
char_string const &  title,
int  nchX,
double  lowX,
double  highX,
int  nchY,
double  lowY,
double  highY 
)

Book 2S histogram.

Definition at line 1172 of file DQMStore.cc.

References book2S_(), and pwd_.

Referenced by book2DD(), and dqmRegisterHistogram().

1175 {
1176  return book2S_(pwd_, name, new TH2S(name, title,
1177  nchX, lowX, highX,
1178  nchY, lowY, highY));
1179 }
std::string pwd_
Definition: DQMStore.h:643
MonitorElement * book2S_(std::string const &dir, std::string const &name, TH2S *h)
Book 2D histogram based on TH2S.
Definition: DQMStore.cc:1147
MonitorElement* DQMStore::book2S ( char_string const &  name,
char_string const &  title,
int  nchX,
float const *  xbinsize,
int  nchY,
float const *  ybinsize 
)
MonitorElement * DQMStore::book2S ( char_string const &  name,
TH2S *  h 
)

Book 2DS histogram by cloning an existing histogram.

Definition at line 1219 of file DQMStore.cc.

References book2S_(), and pwd_.

1220 {
1221  return book2S_(pwd_, name, static_cast<TH2S*>(source->Clone(name)));
1222 }
std::string pwd_
Definition: DQMStore.h:643
MonitorElement * book2S_(std::string const &dir, std::string const &name, TH2S *h)
Book 2D histogram based on TH2S.
Definition: DQMStore.cc:1147
static std::string const source
Definition: EdmProvDump.cc:44
MonitorElement * DQMStore::book2S_ ( std::string const &  dir,
std::string const &  name,
TH2S *  h 
)
private

Book 2D histogram based on TH2S.

Definition at line 1147 of file DQMStore.cc.

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

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

1148 {
1149  return book_(dir, name, "book2S", MonitorElement::DQM_KIND_TH2S, h, collate2S);
1150 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
MonitorElement * book_(std::string const &dir, std::string const &name, char const *context)
Definition: DQMStore.cc:970
dbl *** dir
Definition: mlp_gen.cc:35
static void collate2S(MonitorElement *me, TH2S *h, unsigned verbose)
Definition: DQMStore.cc:1445
MonitorElement * DQMStore::book3D ( char_string const &  name,
char_string const &  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 1241 of file DQMStore.cc.

References book3D_(), and pwd_.

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

1245 {
1246  return book3D_(pwd_, name, new TH3F(name, title,
1247  nchX, lowX, highX,
1248  nchY, lowY, highY,
1249  nchZ, lowZ, highZ));
1250 }
MonitorElement * book3D_(std::string const &dir, std::string const &name, TH3F *h)
Book 3D histogram based on TH3F.
Definition: DQMStore.cc:1234
std::string pwd_
Definition: DQMStore.h:643
MonitorElement * DQMStore::book3D ( char_string const &  name,
TH3F *  h 
)

Book 3D histogram by cloning an existing histogram.

Definition at line 1254 of file DQMStore.cc.

References book3D_(), and pwd_.

1255 {
1256  return book3D_(pwd_, name, static_cast<TH3F*>(source->Clone(name)));
1257 }
MonitorElement * book3D_(std::string const &dir, std::string const &name, TH3F *h)
Book 3D histogram based on TH3F.
Definition: DQMStore.cc:1234
std::string pwd_
Definition: DQMStore.h:643
static std::string const source
Definition: EdmProvDump.cc:44
MonitorElement * DQMStore::book3D_ ( std::string const &  dir,
std::string const &  name,
TH3F *  h 
)
private

Book 3D histogram based on TH3F.

Definition at line 1234 of file DQMStore.cc.

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

Referenced by book3D(), and extract().

1235 {
1236  return book_(dir, name, "book3D", MonitorElement::DQM_KIND_TH3F, h, collate3D);
1237 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
static void collate3D(MonitorElement *me, TH3F *h, unsigned verbose)
Definition: DQMStore.cc:1459
MonitorElement * book_(std::string const &dir, std::string const &name, char const *context)
Definition: DQMStore.cc:970
dbl *** dir
Definition: mlp_gen.cc:35
MonitorElement * DQMStore::book_ ( std::string const &  dir,
std::string const &  name,
char const *  context 
)
private

Definition at line 970 of file DQMStore.cc.

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

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

973 {
974  assert(name.find('/') == std::string::npos);
975  if (verbose_ > 3)
976  print_trace(dir, name);
977 
978  // Check if the request monitor element already exists.
979  if (MonitorElement* me = findObject(run_, 0, moduleId_, dir, name)) {
980  if (verbose_ > 1) {
982  mergePath(path, dir, name);
983 
984  std::cout << "DQMStore: "
985  << context << ": monitor element '"
986  << path << "' already exists, resetting" << std::endl;
987  }
988  me->Reset();
989  return me;
990  }
991  else {
992  // Create it and return for initialisation.
993  assert(dirs_.count(dir));
994  MonitorElement proto(&*dirs_.find(dir), name, run_, moduleId_);
995  return &const_cast<MonitorElement&>(*data_.insert(std::move(proto)).first);
996  }
997 }
uint32_t moduleId_
Definition: DQMStore.h:640
void print_trace(std::string const &dir, std::string const &name)
Definition: DQMStore.cc:462
uint32_t run_
Definition: DQMStore.h:639
unsigned verbose_
Definition: DQMStore.h:630
MEMap data_
Definition: DQMStore.h:644
dbl *** dir
Definition: mlp_gen.cc:35
MonitorElement * findObject(uint32_t run, uint32_t lumi, uint32_t moduleId, std::string const &dir, std::string const &name) const
Definition: DQMStore.cc:1727
std::set< std::string > dirs_
Definition: DQMStore.h:645
def move(src, dest)
Definition: eostools.py:511
template<class HISTO , class COLLATE >
MonitorElement * DQMStore::book_ ( std::string const &  dir,
std::string const &  name,
char const *  context,
int  kind,
HISTO *  h,
COLLATE  collate 
)
private

Definition at line 898 of file DQMStore.cc.

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

904 {
905  assert(name.find('/') == std::string::npos);
906  if (verbose_ > 3)
907  print_trace(dir, name);
909  mergePath(path, dir, name);
910 
911  // Put us in charge of h.
912  h->SetDirectory(nullptr);
913 
914  // Check if the request monitor element already exists.
916  if (me) {
917  if (collateHistograms_) {
918  collate(me, h, verbose_);
919  delete h;
920  return me;
921  }
922  else {
923  if (verbose_ > 1)
924  std::cout << "DQMStore: "
925  << context << ": monitor element '"
926  << path << "' already exists, collating" << std::endl;
927  me->Reset();
928  collate(me, h, verbose_);
929  delete h;
930  return me;
931  }
932  }
933  else {
934  // Create and initialise core object.
935  assert(dirs_.count(dir));
936  MonitorElement proto(&*dirs_.find(dir), name, run_, moduleId_);
937  me = const_cast<MonitorElement&>(*data_.insert(std::move(proto)).first)
939 
940  // Initialise quality test information.
941  for (auto const& q : qtestspecs_) {
942  if (q.first->match(path))
943  me->addQReport(q.second);
944  }
945 
946  // If we just booked a (plain) MonitorElement, and there is a reference
947  // MonitorElement with the same name, link the two together.
948  // The other direction is handled by the extract method.
949  std::string refdir;
950  refdir.reserve(s_referenceDirName.size() + dir.size() + 1);
951  refdir += s_referenceDirName;
952  refdir += '/';
953  refdir += dir;
954  MonitorElement* referenceME = findObject(0, 0, 0, refdir, name);
955  if (referenceME) {
956  // We have booked a new MonitorElement with a specific dir and name.
957  // Then, if we can find the corresponding MonitorElement in the reference
958  // dir we assign the object_ of the reference MonitorElement to the
959  // reference_ property of our new MonitorElement.
960  me->data_.flags |= DQMNet::DQM_PROP_HAS_REFERENCE;
961  me->reference_ = referenceME->object_;
962  }
963 
964  // Return the monitor element.
965  return me;
966  }
967 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
uint32_t moduleId_
Definition: DQMStore.h:640
static const uint32_t DQM_PROP_HAS_REFERENCE
Definition: DQMNet.h:54
QTestSpecs qtestspecs_
Definition: DQMStore.h:649
void print_trace(std::string const &dir, std::string const &name)
Definition: DQMStore.cc:462
uint32_t run_
Definition: DQMStore.h:639
void Reset()
reset ME (ie. contents, errors, etc)
unsigned verbose_
Definition: DQMStore.h:630
MEMap data_
Definition: DQMStore.h:644
dbl *** dir
Definition: mlp_gen.cc:35
MonitorElement * findObject(uint32_t run, uint32_t lumi, uint32_t moduleId, std::string const &dir, std::string const &name) const
Definition: DQMStore.cc:1727
MonitorElement * initialise(MonitorElement *me, std::string const &path)
std::set< std::string > dirs_
Definition: DQMStore.h:645
bool collateHistograms_
Definition: DQMStore.h:634
void addQReport(const DQMNet::QValue &desc, QCriterion *qc)
Add quality report, from DQMStore.
def move(src, dest)
Definition: eostools.py:511
template<typename iFunc >
void DQMStore::bookConcurrentTransaction ( iFunc  f,
uint32_t  run 
)
inline

Definition at line 264 of file DQMStore.h.

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

265  {
266  std::lock_guard<std::mutex> guard(book_mutex_);
267  /* Set the run_ member only if enableMultiThread is enabled */
268  if (enableMultiThread_) {
269  run_ = run;
270  }
271  ConcurrentBooker booker(this);
272  f(booker);
273 
274  /* Reset the run_ member only if enableMultiThread is enabled */
275  if (enableMultiThread_) {
276  run_ = 0;
277  }
278  }
std::mutex book_mutex_
Definition: DQMStore.h:651
double f[11][100]
uint32_t run_
Definition: DQMStore.h:639
bool enableMultiThread_
Definition: DQMStore.h:635
MonitorElement * DQMStore::bookFloat ( char_string const &  name)
MonitorElement * DQMStore::bookFloat_ ( std::string const &  dir,
std::string const &  name 
)
private

Book float.

Definition at line 1023 of file DQMStore.cc.

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

Referenced by bookFloat(), and extract().

1024 {
1025  if (collateHistograms_) {
1026  if (MonitorElement* me = findObject(run_, 0, moduleId_, dir, name)) {
1027  me->Fill(0.);
1028  return me;
1029  }
1030  }
1031  return book_(dir, name, "bookFloat")->initialise(MonitorElement::DQM_KIND_REAL);
1032 }
MonitorElement * initialise(Kind kind)
MonitorElement * book_(std::string const &dir, std::string const &name, char const *context)
Definition: DQMStore.cc:970
uint32_t moduleId_
Definition: DQMStore.h:640
uint32_t run_
Definition: DQMStore.h:639
dbl *** dir
Definition: mlp_gen.cc:35
MonitorElement * findObject(uint32_t run, uint32_t lumi, uint32_t moduleId, std::string const &dir, std::string const &name) const
Definition: DQMStore.cc:1727
bool collateHistograms_
Definition: DQMStore.h:634
MonitorElement * DQMStore::bookInt ( char_string const &  name)

Book int.

Definition at line 1015 of file DQMStore.cc.

References bookInt_(), and pwd_.

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

1016 {
1017  return bookInt_(pwd_, name);
1018 }
std::string pwd_
Definition: DQMStore.h:643
MonitorElement * bookInt_(std::string const &dir, std::string const &name)
Book int.
Definition: DQMStore.cc:1002
MonitorElement * DQMStore::bookInt_ ( std::string const &  dir,
std::string const &  name 
)
private

Book int.

Definition at line 1002 of file DQMStore.cc.

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

Referenced by bookInt(), and extract().

1003 {
1004  if (collateHistograms_) {
1005  if (MonitorElement* me = findObject(run_, 0, moduleId_, dir, name)) {
1006  me->Fill(0);
1007  return me;
1008  }
1009  }
1010  return book_(dir, name, "bookInt")->initialise(MonitorElement::DQM_KIND_INT);
1011 }
MonitorElement * initialise(Kind kind)
MonitorElement * book_(std::string const &dir, std::string const &name, char const *context)
Definition: DQMStore.cc:970
uint32_t moduleId_
Definition: DQMStore.h:640
uint32_t run_
Definition: DQMStore.h:639
dbl *** dir
Definition: mlp_gen.cc:35
MonitorElement * findObject(uint32_t run, uint32_t lumi, uint32_t moduleId, std::string const &dir, std::string const &name) const
Definition: DQMStore.cc:1727
bool collateHistograms_
Definition: DQMStore.h:634
MonitorElement * DQMStore::bookProfile ( char_string const &  name,
char_string const &  title,
int  nchX,
double  lowX,
double  highX,
int  nchY,
double  lowY,
double  highY,
char const *  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 1273 of file DQMStore.cc.

References bookProfile_(), and pwd_.

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

1277 {
1278  return bookProfile_(pwd_, name, new TProfile(name, title,
1279  nchX, lowX, highX,
1280  lowY, highY,
1281  option));
1282 }
MonitorElement * bookProfile_(std::string const &dir, std::string const &name, TProfile *h)
Book profile histogram based on TProfile.
Definition: DQMStore.cc:1262
std::string pwd_
Definition: DQMStore.h:643
MonitorElement * DQMStore::bookProfile ( char_string const &  name,
char_string const &  title,
int  nchX,
double  lowX,
double  highX,
double  lowY,
double  highY,
char const *  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 1288 of file DQMStore.cc.

References bookProfile_(), and pwd_.

1292 {
1293  return bookProfile_(pwd_, name, new TProfile(name, title,
1294  nchX, lowX, highX,
1295  lowY, highY,
1296  option));
1297 }
MonitorElement * bookProfile_(std::string const &dir, std::string const &name, TProfile *h)
Book profile histogram based on TProfile.
Definition: DQMStore.cc:1262
std::string pwd_
Definition: DQMStore.h:643
MonitorElement * DQMStore::bookProfile ( char_string const &  name,
char_string const &  title,
int  nchX,
double const *  xbinsize,
int  nchY,
double  lowY,
double  highY,
char const *  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 1303 of file DQMStore.cc.

References bookProfile_(), and pwd_.

1307 {
1308  return bookProfile_(pwd_, name, new TProfile(name, title,
1309  nchX, xbinsize,
1310  lowY, highY,
1311  option));
1312 }
MonitorElement * bookProfile_(std::string const &dir, std::string const &name, TProfile *h)
Book profile histogram based on TProfile.
Definition: DQMStore.cc:1262
std::string pwd_
Definition: DQMStore.h:643
MonitorElement * DQMStore::bookProfile ( char_string const &  name,
char_string const &  title,
int  nchX,
double const *  xbinsize,
double  lowY,
double  highY,
char const *  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 1318 of file DQMStore.cc.

References bookProfile_(), and pwd_.

1322 {
1323  return bookProfile_(pwd_, name, new TProfile(name, title,
1324  nchX, xbinsize,
1325  lowY, highY,
1326  option));
1327 }
MonitorElement * bookProfile_(std::string const &dir, std::string const &name, TProfile *h)
Book profile histogram based on TProfile.
Definition: DQMStore.cc:1262
std::string pwd_
Definition: DQMStore.h:643
MonitorElement * DQMStore::bookProfile ( char_string const &  name,
TProfile *  h 
)

Book TProfile by cloning an existing profile.

Definition at line 1331 of file DQMStore.cc.

References bookProfile_(), and pwd_.

1332 {
1333  return bookProfile_(pwd_, name, static_cast<TProfile*>(source->Clone(name)));
1334 }
MonitorElement * bookProfile_(std::string const &dir, std::string const &name, TProfile *h)
Book profile histogram based on TProfile.
Definition: DQMStore.cc:1262
std::string pwd_
Definition: DQMStore.h:643
static std::string const source
Definition: EdmProvDump.cc:44
MonitorElement * DQMStore::bookProfile2D ( char_string const &  name,
char_string const &  title,
int  nchX,
double  lowX,
double  highX,
int  nchY,
double  lowY,
double  highY,
double  lowZ,
double  highZ,
char const *  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 1367 of file DQMStore.cc.

References bookProfile2D_(), and pwd_.

Referenced by ConverterTester::beginJob(), DQMLumiMonitor::bookHistograms(), dqmRegisterHistogram(), and MonitorElementsDb::MonitorElementsDb().

1372 {
1373  return bookProfile2D_(pwd_, name, new TProfile2D(name, title,
1374  nchX, lowX, highX,
1375  nchY, lowY, highY,
1376  lowZ, highZ,
1377  option));
1378 }
MonitorElement * bookProfile2D_(std::string const &dir, std::string const &name, TProfile2D *h)
Book 2D profile histogram based on TProfile2D.
Definition: DQMStore.cc:1339
std::string pwd_
Definition: DQMStore.h:643
MonitorElement * DQMStore::bookProfile2D ( char_string const &  name,
char_string const &  title,
int  nchX,
double  lowX,
double  highX,
int  nchY,
double  lowY,
double  highY,
int  nchZ,
double  lowZ,
double  highZ,
char const *  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 1350 of file DQMStore.cc.

References bookProfile2D_(), and pwd_.

1355 {
1356  return bookProfile2D_(pwd_, name, new TProfile2D(name, title,
1357  nchX, lowX, highX,
1358  nchY, lowY, highY,
1359  lowZ, highZ,
1360  option));
1361 }
MonitorElement * bookProfile2D_(std::string const &dir, std::string const &name, TProfile2D *h)
Book 2D profile histogram based on TProfile2D.
Definition: DQMStore.cc:1339
std::string pwd_
Definition: DQMStore.h:643
MonitorElement * DQMStore::bookProfile2D ( char_string const &  name,
TProfile2D *  h 
)

Book TProfile2D by cloning an existing profile.

Definition at line 1382 of file DQMStore.cc.

References bookProfile2D_(), and pwd_.

1383 {
1384  return bookProfile2D_(pwd_, name, static_cast<TProfile2D*>(source->Clone(name)));
1385 }
MonitorElement * bookProfile2D_(std::string const &dir, std::string const &name, TProfile2D *h)
Book 2D profile histogram based on TProfile2D.
Definition: DQMStore.cc:1339
std::string pwd_
Definition: DQMStore.h:643
static std::string const source
Definition: EdmProvDump.cc:44
MonitorElement * DQMStore::bookProfile2D_ ( std::string const &  dir,
std::string const &  name,
TProfile2D *  h 
)
private

Book 2D profile histogram based on TProfile2D.

Definition at line 1339 of file DQMStore.cc.

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

Referenced by bookProfile2D(), and extract().

1340 {
1341  return book_(dir, name, "bookProfile2D",
1343  h, collateProfile2D);
1344 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
MonitorElement * book_(std::string const &dir, std::string const &name, char const *context)
Definition: DQMStore.cc:970
static void collateProfile2D(MonitorElement *me, TProfile2D *h, unsigned verbose)
Definition: DQMStore.cc:1475
dbl *** dir
Definition: mlp_gen.cc:35
MonitorElement * DQMStore::bookProfile_ ( std::string const &  dir,
std::string const &  name,
TProfile *  h 
)
private

Book profile histogram based on TProfile.

Definition at line 1262 of file DQMStore.cc.

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

Referenced by bookProfile(), and extract().

1263 {
1264  return book_(dir, name, "bookProfile",
1266  h, collateProfile);
1267 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
MonitorElement * book_(std::string const &dir, std::string const &name, char const *context)
Definition: DQMStore.cc:970
static void collateProfile(MonitorElement *me, TProfile *h, unsigned verbose)
Definition: DQMStore.cc:1466
dbl *** dir
Definition: mlp_gen.cc:35
MonitorElement * DQMStore::bookString ( char_string const &  name,
char_string const &  value 
)

Book string.

Definition at line 1057 of file DQMStore.cc.

References bookString_(), and pwd_.

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

1058 {
1059  return bookString_(pwd_, name, value);
1060 }
MonitorElement * bookString_(std::string const &dir, std::string const &name, std::string const &value)
Book string.
Definition: DQMStore.cc:1044
Definition: value.py:1
std::string pwd_
Definition: DQMStore.h:643
MonitorElement * DQMStore::bookString_ ( std::string const &  dir,
std::string const &  name,
std::string const &  value 
)
private

Book string.

Definition at line 1044 of file DQMStore.cc.

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

Referenced by bookString(), and extract().

1047 {
1048  if (collateHistograms_) {
1049  if (MonitorElement* me = findObject(run_, 0, moduleId_, dir, name))
1050  return me;
1051  }
1052  return book_(dir, name, "bookString")->initialise(MonitorElement::DQM_KIND_STRING, value);
1053 }
MonitorElement * initialise(Kind kind)
MonitorElement * book_(std::string const &dir, std::string const &name, char const *context)
Definition: DQMStore.cc:970
uint32_t moduleId_
Definition: DQMStore.h:640
uint32_t run_
Definition: DQMStore.h:639
Definition: value.py:1
dbl *** dir
Definition: mlp_gen.cc:35
MonitorElement * findObject(uint32_t run, uint32_t lumi, uint32_t moduleId, std::string const &dir, std::string const &name) const
Definition: DQMStore.cc:1727
bool collateHistograms_
Definition: DQMStore.h:634
template<typename iFunc >
void DQMStore::bookTransaction ( iFunc  f,
uint32_t  run,
uint32_t  moduleId 
)
inline

Definition at line 243 of file DQMStore.h.

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

244  {
245  std::lock_guard<std::mutex> guard(book_mutex_);
246  /* Set the run number and module id only if multithreading is enabled */
247  if (enableMultiThread_) {
248  run_ = run;
249  moduleId_ = moduleId;
250  }
251  IBooker booker{this};
252  f(booker);
253 
254  /* Reset the run number and module id only if multithreading is enabled */
255  if (enableMultiThread_) {
256  run_ = 0;
257  moduleId_ = 0;
258  }
259  }
uint32_t moduleId_
Definition: DQMStore.h:640
std::mutex book_mutex_
Definition: DQMStore.h:651
double f[11][100]
uint32_t run_
Definition: DQMStore.h:639
bool enableMultiThread_
Definition: DQMStore.h:635
void DQMStore::cd ( )

go to top directory (ie. root)

Definition at line 540 of file DQMStore.cc.

References setCurrentFolder().

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

541 {
542  setCurrentFolder("");
543 }
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:565
void DQMStore::cd ( std::string const &  subdir)

cd to subdirectory (if there)

Definition at line 547 of file DQMStore.cc.

References clean, 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().

548 {
550  std::string const* cleaned = nullptr;
551  cleanTrailingSlashes(subdir, clean, cleaned);
552 
553  if (! dirExists(*cleaned))
554  raiseDQMError("DQMStore", "Cannot 'cd' into non-existent directory '%s'",
555  cleaned->c_str());
556 
557  setCurrentFolder(*cleaned);
558 }
bool dirExists(std::string const &path) const
true if directory exists
Definition: DQMStore.cc:629
std::vector< T * > clean
Definition: MVATrainer.cc:156
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:565
void raiseDQMError(const char *context, const char *fmt,...)
Definition: DQMError.cc:11
bool DQMStore::cdInto ( std::string const &  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 2292 of file DQMStore.cc.

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

Referenced by save().

2293 {
2294  assert(! path.empty());
2295 
2296  // Find the first path component.
2297  size_t start = 0;
2298  size_t end = path.find('/', start);
2299  if (end == std::string::npos)
2300  end = path.size();
2301 
2302  while (true) {
2303  // Check if this subdirectory component exists. If yes, make sure
2304  // it is actually a subdirectory. Otherwise create or cd into it.
2305  std::string part(path, start, end-start);
2306  TObject* o = gDirectory->Get(part.c_str());
2307  if (o && ! dynamic_cast<TDirectory*>(o))
2308  raiseDQMError("DQMStore", "Attempt to create directory '%s' in a file"
2309  " fails because the part '%s' already exists and is not"
2310  " directory", path.c_str(), part.c_str());
2311  else if (! o)
2312  gDirectory->mkdir(part.c_str());
2313 
2314  if (! gDirectory->cd(part.c_str()))
2315  raiseDQMError("DQMStore", "Attempt to create directory '%s' in a file"
2316  " fails because could not cd into subdirectory '%s'",
2317  path.c_str(), part.c_str());
2318 
2319  // Stop if we reached the end, ignoring any trailing '/'.
2320  if (end+1 >= path.size())
2321  break;
2322 
2323  // Find the next path component.
2324  start = end+1;
2325  end = path.find('/', start);
2326  if (end == std::string::npos)
2327  end = path.size();
2328  }
2329 
2330  return true;
2331 }
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 1391 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(), and utils.BinToBin1percent::do_test().

1392 {
1393  if (me->getTH1()->GetNbinsX() != h->GetNbinsX()
1394  || me->getTH1()->GetNbinsY() != h->GetNbinsY()
1395  || me->getTH1()->GetNbinsZ() != h->GetNbinsZ()
1396  || me->getTH1()->GetXaxis()->GetXmin() != h->GetXaxis()->GetXmin()
1397  || me->getTH1()->GetYaxis()->GetXmin() != h->GetYaxis()->GetXmin()
1398  || me->getTH1()->GetZaxis()->GetXmin() != h->GetZaxis()->GetXmin()
1399  || me->getTH1()->GetXaxis()->GetXmax() != h->GetXaxis()->GetXmax()
1400  || me->getTH1()->GetYaxis()->GetXmax() != h->GetYaxis()->GetXmax()
1401  || me->getTH1()->GetZaxis()->GetXmax() != h->GetZaxis()->GetXmax()
1402  || !MonitorElement::CheckBinLabels((TAxis*)me->getTH1()->GetXaxis(),(TAxis*)h->GetXaxis())
1403  || !MonitorElement::CheckBinLabels((TAxis*)me->getTH1()->GetYaxis(),(TAxis*)h->GetYaxis())
1404  || !MonitorElement::CheckBinLabels((TAxis*)me->getTH1()->GetZaxis(),(TAxis*)h->GetZaxis())) {
1405  if(verbose > 0)
1406  std::cout << "*** DQMStore: WARNING:"
1407  << "checkBinningMatches: different binning - cannot add object '"
1408  << h->GetName() << "' of type "
1409  << h->IsA()->GetName() << " to existing ME: '"
1410  << me->getFullname() << "'\n";
1411  return false;
1412  }
1413  return true;
1414 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
TH1 * getTH1() const
const std::string getFullname() const
get full name of ME including Pathname
static bool CheckBinLabels(const TAxis *a1, const TAxis *a2)
Check the consistency of the axis labels.
void DQMStore::cloneLumiHistograms ( uint32_t  run,
uint32_t  lumi,
uint32_t  moduleId 
)

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

Definition at line 1908 of file DQMStore.cc.

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

1909 {
1910  if (verbose_ > 1) {
1911  std::cout << "DQMStore::cloneLumiHistograms - Preparing lumi histograms for run: "
1912  << run << ", lumi: " << lumi << ", module: " << moduleId << std::endl;
1913  }
1914 
1915  // acquire the global lock since this accesses the undelying data structure
1916  std::lock_guard<std::mutex> guard(book_mutex_);
1917 
1918  // MEs are sorted by (run, lumi, stream id, module id, directory, name)
1919  // lumi deafults to 0
1920  // stream id is always 0
1921  std::string null_str("");
1922  auto i = data_.lower_bound(MonitorElement(&null_str, null_str, run, moduleId));
1923  auto e = data_.lower_bound(MonitorElement(&null_str, null_str, run, moduleId + 1));
1924  for (; i != e; ++i) {
1925  // handle only lumisection-based histograms
1926  if (not LSbasedMode_ and not i->getLumiFlag())
1927  continue;
1928 
1929  // clone the lumisection-based histograms
1931  clone.globalize();
1932  clone.setLumi(lumi);
1933  clone.markToDelete();
1934  data_.insert(std::move(clone));
1935 
1936  // reset the ME for the next lumisection
1937  const_cast<MonitorElement*>(&*i)->Reset();
1938  }
1939 }
std::mutex book_mutex_
Definition: DQMStore.h:651
unsigned verbose_
Definition: DQMStore.h:630
MEMap data_
Definition: DQMStore.h:644
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
void Reset(std::vector< TH2F > &depth)
bool LSbasedMode_
Definition: DQMStore.h:636
def move(src, dest)
Definition: eostools.py:511
void DQMStore::cloneRunHistograms ( uint32_t  run,
uint32_t  moduleId 
)

Same as above, but for run histograms.

Definition at line 1945 of file DQMStore.cc.

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

1946 {
1947  if (verbose_ > 1) {
1948  std::cout << "DQMStore::cloneRunHistograms - Preparing run histograms for run: "
1949  << run << ", module: " << moduleId << std::endl;
1950  }
1951 
1952  // acquire the global lock since this accesses the undelying data structure
1953  std::lock_guard<std::mutex> guard(book_mutex_);
1954 
1955  // MEs are sorted by (run, lumi, stream id, module id, directory, name)
1956  // lumi deafults to 0
1957  // stream id is always 0
1958  std::string null_str("");
1959  auto i = data_.lower_bound(MonitorElement(&null_str, null_str, run, moduleId));
1960  auto e = data_.lower_bound(MonitorElement(&null_str, null_str, run, moduleId + 1));
1961  for (; i != e; ++i) {
1962  // handle only non lumisection-based histograms
1963  if (LSbasedMode_ or i->getLumiFlag())
1964  continue;
1965 
1966  // clone the lumisection-based histograms
1968  clone.globalize();
1969  clone.markToDelete();
1970  data_.insert(std::move(clone));
1971 
1972  // reset the ME for the next lumisection
1973  const_cast<MonitorElement*>(&*i)->Reset();
1974  }
1975 }
std::mutex book_mutex_
Definition: DQMStore.h:651
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
unsigned verbose_
Definition: DQMStore.h:630
MEMap data_
Definition: DQMStore.h:644
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
void Reset(std::vector< TH2F > &depth)
bool LSbasedMode_
Definition: DQMStore.h:636
def move(src, dest)
Definition: eostools.py:511
void DQMStore::collate1D ( MonitorElement me,
TH1F *  h,
unsigned  verbose 
)
staticprivate

Definition at line 1417 of file DQMStore.cc.

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

Referenced by book1D_(), and extract().

1418 {
1419  if (checkBinningMatches(me,h,verbose))
1420  me->getTH1F()->Add(h);
1421 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
TH1F * getTH1F() const
static bool checkBinningMatches(MonitorElement *me, TH1 *h, unsigned verbose)
Definition: DQMStore.cc:1391
void DQMStore::collate1DD ( MonitorElement me,
TH1D *  h,
unsigned  verbose 
)
staticprivate

Definition at line 1431 of file DQMStore.cc.

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

Referenced by book1DD_(), and extract().

1432 {
1433  if (checkBinningMatches(me,h,verbose))
1434  me->getTH1D()->Add(h);
1435 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
TH1D * getTH1D() const
static bool checkBinningMatches(MonitorElement *me, TH1 *h, unsigned verbose)
Definition: DQMStore.cc:1391
void DQMStore::collate1S ( MonitorElement me,
TH1S *  h,
unsigned  verbose 
)
staticprivate

Definition at line 1424 of file DQMStore.cc.

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

Referenced by book1S_(), and extract().

1425 {
1426  if (checkBinningMatches(me,h,verbose))
1427  me->getTH1S()->Add(h);
1428 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
TH1S * getTH1S() const
static bool checkBinningMatches(MonitorElement *me, TH1 *h, unsigned verbose)
Definition: DQMStore.cc:1391
void DQMStore::collate2D ( MonitorElement me,
TH2F *  h,
unsigned  verbose 
)
staticprivate

Definition at line 1438 of file DQMStore.cc.

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

Referenced by book2D_(), and extract().

1439 {
1440  if (checkBinningMatches(me,h,verbose))
1441  me->getTH2F()->Add(h);
1442 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
TH2F * getTH2F() const
static bool checkBinningMatches(MonitorElement *me, TH1 *h, unsigned verbose)
Definition: DQMStore.cc:1391
void DQMStore::collate2DD ( MonitorElement me,
TH2D *  h,
unsigned  verbose 
)
staticprivate

Definition at line 1452 of file DQMStore.cc.

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

Referenced by book2DD_(), and extract().

1453 {
1454  if (checkBinningMatches(me,h,verbose))
1455  me->getTH2D()->Add(h);
1456 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
TH2D * getTH2D() const
static bool checkBinningMatches(MonitorElement *me, TH1 *h, unsigned verbose)
Definition: DQMStore.cc:1391
void DQMStore::collate2S ( MonitorElement me,
TH2S *  h,
unsigned  verbose 
)
staticprivate

Definition at line 1445 of file DQMStore.cc.

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

Referenced by book2S_(), and extract().

1446 {
1447  if (checkBinningMatches(me,h,verbose))
1448  me->getTH2S()->Add(h);
1449 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
TH2S * getTH2S() const
static bool checkBinningMatches(MonitorElement *me, TH1 *h, unsigned verbose)
Definition: DQMStore.cc:1391
void DQMStore::collate3D ( MonitorElement me,
TH3F *  h,
unsigned  verbose 
)
staticprivate

Definition at line 1459 of file DQMStore.cc.

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

Referenced by book3D_(), and extract().

1460 {
1461  if (checkBinningMatches(me,h,verbose))
1462  me->getTH3F()->Add(h);
1463 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
TH3F * getTH3F() const
static bool checkBinningMatches(MonitorElement *me, TH1 *h, unsigned verbose)
Definition: DQMStore.cc:1391
void DQMStore::collateProfile ( MonitorElement me,
TProfile *  h,
unsigned  verbose 
)
staticprivate

Definition at line 1466 of file DQMStore.cc.

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

Referenced by bookProfile_(), and extract().

1467 {
1468  if (checkBinningMatches(me,h,verbose)) {
1469  TProfile* meh = me->getTProfile();
1470  me->addProfiles(h, meh, meh, 1, 1);
1471  }
1472 }
TProfile * getTProfile() const
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
void addProfiles(TProfile *h1, TProfile *h2, TProfile *sum, float c1, float c2)
static bool checkBinningMatches(MonitorElement *me, TH1 *h, unsigned verbose)
Definition: DQMStore.cc:1391
void DQMStore::collateProfile2D ( MonitorElement me,
TProfile2D *  h,
unsigned  verbose 
)
staticprivate

Definition at line 1475 of file DQMStore.cc.

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

Referenced by bookProfile2D_(), and extract().

1476 {
1477  if (checkBinningMatches(me,h,verbose)) {
1478  TProfile2D* meh = me->getTProfile2D();
1479  me->addProfiles(h, meh, meh, 1, 1);
1480  }
1481 }
TProfile2D * getTProfile2D() const
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
void addProfiles(TProfile *h1, TProfile *h2, TProfile *sum, float c1, float c2)
static bool checkBinningMatches(MonitorElement *me, TH1 *h, unsigned verbose)
Definition: DQMStore.cc:1391
bool DQMStore::containsAnyMonitorable ( std::string const &  path) const

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

Definition at line 1591 of file DQMStore.cc.

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

Referenced by DQMStore::IGetter::removeElement().

1592 {
1593  MonitorElement proto(&path, std::string());
1594  auto e = data_.end();
1595  auto i = data_.lower_bound(proto);
1596  return (i != e && isSubdirectory(path, *i->data_.dirname));
1597 }
MEMap data_
Definition: DQMStore.h:644
QCriterion * DQMStore::createQTest ( std::string const &  algoname,
std::string const &  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 3141 of file DQMStore.cc.

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

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

3142 {
3143  if (qtests_.count(qtname))
3144  raiseDQMError("DQMStore", "Attempt to create duplicate quality test '%s'",
3145  qtname.c_str());
3146 
3147  auto i = qalgos_.find(algoname);
3148  if (i == qalgos_.end())
3149  raiseDQMError("DQMStore", "Cannot create a quality test using unknown"
3150  " algorithm '%s'", algoname.c_str());
3151 
3152  QCriterion* qc = i->second(qtname);
3153  qc->setVerbose(verboseQT_);
3154 
3155  qtests_[qtname] = qc;
3156  return qc;
3157 }
QCMap qtests_
Definition: DQMStore.h:647
unsigned verboseQT_
Definition: DQMStore.h:631
QAMap qalgos_
Definition: DQMStore.h:648
void setVerbose(int verbose)
probability limits for warnings, errors
Definition: QTest.h:119
void raiseDQMError(const char *context, const char *fmt,...)
Definition: DQMError.cc:11
void DQMStore::deleteUnusedLumiHistograms ( uint32_t  run,
uint32_t  lumi 
)

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

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

1984 {
1985  if (!enableMultiThread_)
1986  return;
1987 
1988  std::lock_guard<std::mutex> guard(book_mutex_);
1989 
1990  std::string null_str("");
1991  MonitorElement proto(&null_str, null_str, run, 0);
1992  proto.setLumi(lumi);
1993 
1994  auto e = data_.end();
1995  auto i = data_.lower_bound(proto);
1996 
1997  while (i != e) {
1998  if (i->data_.moduleId != 0)
1999  break;
2000  if (i->data_.lumi != lumi)
2001  break;
2002  if (i->data_.run != run)
2003  break;
2004  if (not i->markedToDelete()) {
2005  ++i;
2006  continue;
2007  }
2008 
2009  if (verbose_ > 1) {
2010  std::cout << "DQMStore::deleteUnusedLumiHistograms: deleted monitor element '"
2011  << *i->data_.dirname << "/" << i->data_.objname << "'"
2012  << "flags " << i->data_.flags << "\n";
2013  }
2014 
2015  i = data_.erase(i);
2016  }
2017 }
std::mutex book_mutex_
Definition: DQMStore.h:651
unsigned verbose_
Definition: DQMStore.h:630
MEMap data_
Definition: DQMStore.h:644
bool enableMultiThread_
Definition: DQMStore.h:635
bool DQMStore::dirExists ( std::string const &  path) const
void DQMStore::disableSoftReset ( MonitorElement me)

Definition at line 3266 of file DQMStore.cc.

References MonitorElement::disableSoftReset().

Referenced by ecaldqm::MESet::recoverStats().

3267 {
3268  if (me)
3269  me->disableSoftReset();
3270 }
void disableSoftReset()
reverts action of softReset
bool DQMStore::extract ( TObject *  obj,
std::string const &  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 2025 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(), h, isCollateME(), callgraph::kind, diffTwoXMLs::label, funct::m, funct::master(), DQMNet::QValue::message, gen::n, MonitorElement::object_, DQMNet::QValue::qtname, DQMNet::QValue::qtresult, alignCSCRings::s, s_rxmeval(), MonitorElement::setEfficiencyFlag(), AlCaHLTBitMon_QueryRunRegistry::string, tag(), heppy_batch::val, and verbose_.

Referenced by readDirectory(), and readFilePB().

2029 {
2030  // NB: Profile histograms inherit from TH*D, checking order matters.
2031  MonitorElement *refcheck = nullptr;
2032  if (auto* h = dynamic_cast<TProfile*>(obj)) {
2033  MonitorElement* me = findObject(0, 0, 0, dir, h->GetName());
2034  if (! me)
2035  me = bookProfile_(dir, h->GetName(), (TProfile*) h->Clone());
2036  else if (overwrite)
2037  me->copyFrom(h);
2038  else if (isCollateME(me) || collateHistograms)
2039  collateProfile(me, h, verbose_);
2040  refcheck = me;
2041  }
2042  else if (auto* h = dynamic_cast<TProfile2D*>(obj)) {
2043  MonitorElement* me = findObject(0, 0, 0, dir, h->GetName());
2044  if (! me)
2045  me = bookProfile2D_(dir, h->GetName(), (TProfile2D*) h->Clone());
2046  else if (overwrite)
2047  me->copyFrom(h);
2048  else if (isCollateME(me) || collateHistograms)
2049  collateProfile2D(me, h, verbose_);
2050  refcheck = me;
2051  }
2052  else if (auto* h = dynamic_cast<TH1F*>(obj)) {
2053  MonitorElement* me = findObject(0, 0, 0, dir, h->GetName());
2054  if (! me)
2055  me = book1D_(dir, h->GetName(), (TH1F*) h->Clone());
2056  else if (overwrite)
2057  me->copyFrom(h);
2058  else if (isCollateME(me) || collateHistograms)
2059  collate1D(me, h, verbose_);
2060  refcheck = me;
2061  }
2062  else if (auto* h = dynamic_cast<TH1S*>(obj)) {
2063  MonitorElement* me = findObject(0, 0, 0, dir, h->GetName());
2064  if (! me)
2065  me = book1S_(dir, h->GetName(), (TH1S*) h->Clone());
2066  else if (overwrite)
2067  me->copyFrom(h);
2068  else if (isCollateME(me) || collateHistograms)
2069  collate1S(me, h, verbose_);
2070  refcheck = me;
2071  }
2072  else if (auto* h = dynamic_cast<TH1D*>(obj)) {
2073  MonitorElement* me = findObject(0, 0, 0, dir, h->GetName());
2074  if (! me)
2075  me = book1DD_(dir, h->GetName(), (TH1D*) h->Clone());
2076  else if (overwrite)
2077  me->copyFrom(h);
2078  else if (isCollateME(me) || collateHistograms)
2079  collate1DD(me, h, verbose_);
2080  refcheck = me;
2081  }
2082  else if (auto* h = dynamic_cast<TH2F*>(obj)) {
2083  MonitorElement* me = findObject(0, 0, 0, dir, h->GetName());
2084  if (! me)
2085  me = book2D_(dir, h->GetName(), (TH2F*) h->Clone());
2086  else if (overwrite)
2087  me->copyFrom(h);
2088  else if (isCollateME(me) || collateHistograms)
2089  collate2D(me, h, verbose_);
2090  refcheck = me;
2091  }
2092  else if (auto* h = dynamic_cast<TH2S*>(obj)) {
2093  MonitorElement* me = findObject(0, 0, 0, dir, h->GetName());
2094  if (! me)
2095  me = book2S_(dir, h->GetName(), (TH2S*) h->Clone());
2096  else if (overwrite)
2097  me->copyFrom(h);
2098  else if (isCollateME(me) || collateHistograms)
2099  collate2S(me, h, verbose_);
2100  refcheck = me;
2101  }
2102  else if (auto* h = dynamic_cast<TH2D*>(obj)) {
2103  MonitorElement* me = findObject(0, 0, 0, dir, h->GetName());
2104  if (! me)
2105  me = book2DD_(dir, h->GetName(), (TH2D*) h->Clone());
2106  else if (overwrite)
2107  me->copyFrom(h);
2108  else if (isCollateME(me) || collateHistograms)
2109  collate2DD(me, h, verbose_);
2110  refcheck = me;
2111  }
2112  else if (auto* h = dynamic_cast<TH3F*>(obj)) {
2113  MonitorElement* me = findObject(0, 0, 0, dir, h->GetName());
2114  if (! me)
2115  me = book3D_(dir, h->GetName(), (TH3F*) h->Clone());
2116  else if (overwrite)
2117  me->copyFrom(h);
2118  else if (isCollateME(me) || collateHistograms)
2119  collate3D(me, h, verbose_);
2120  refcheck = me;
2121  }
2122  else if (dynamic_cast<TObjString*>(obj)) {
2123  lat::RegexpMatch m;
2124  if (! s_rxmeval.match(obj->GetName(), 0, 0, &m)) {
2125  if (strstr(obj->GetName(), "CMSSW")) {
2126  if (verbose_)
2127  std::cout << "Input file version: " << obj->GetName() << std::endl;
2128  return true;
2129  }
2130  else if (strstr(obj->GetName(), "DQMPATCH")) {
2131  if (verbose_)
2132  std::cout << "DQM patch version: " << obj->GetName() << std::endl;
2133  return true;
2134  }
2135  else {
2136  std::cout << "*** DQMStore: WARNING: cannot extract object '"
2137  << obj->GetName() << "' of type '"
2138  << obj->IsA()->GetName() << "'\n";
2139  return false;
2140  }
2141  }
2142 
2143  std::string label = m.matchString(obj->GetName(), 1);
2144  std::string kind = m.matchString(obj->GetName(), 2);
2145  std::string value = m.matchString(obj->GetName(), 3);
2146 
2147  if (kind == "i") {
2148  MonitorElement* me = findObject(0, 0, 0, dir, label);
2149  if (! me || overwrite) {
2150  if (! me) me = bookInt_(dir, label);
2151  me->Fill(atoll(value.c_str()));
2152  }
2153  }
2154  else if (kind == "f") {
2155  MonitorElement* me = findObject(0, 0, 0, dir, label);
2156  if (! me || overwrite) {
2157  if (! me) me = bookFloat_(dir, label);
2158  me->Fill(atof(value.c_str()));
2159  }
2160  }
2161  else if (kind == "s") {
2162  MonitorElement* me = findObject(0, 0, 0, dir, label);
2163  if (! me)
2164  me = bookString_(dir, label, value);
2165  else if (overwrite)
2166  me->Fill(value);
2167  }
2168  else if (kind == "e") {
2169  MonitorElement* me = findObject(0, 0, 0, dir, label);
2170  if (! me) {
2171  std::cout << "*** DQMStore: WARNING: no monitor element '"
2172  << label << "' in directory '"
2173  << dir << "' to be marked as efficiency plot.\n";
2174  return false;
2175  }
2176  me->setEfficiencyFlag();
2177  }
2178  else if (kind == "t") {
2179  MonitorElement* me = findObject(0, 0, 0, dir, label);
2180  if (! me) {
2181  std::cout << "*** DQMStore: WARNING: no monitor element '"
2182  << label << "' in directory '"
2183  << dir << "' for a tag\n";
2184  return false;
2185  }
2186  errno = 0;
2187  char* endp = nullptr;
2188  unsigned long val = strtoul(value.c_str(), &endp, 10);
2189  if ((val == 0 && errno) || *endp || val > ~uint32_t(0)) {
2190  std::cout << "*** DQMStore: WARNING: cannot restore tag '"
2191  << value << "' for monitor element '"
2192  << label << "' in directory '"
2193  << dir << "' - invalid value\n";
2194  return false;
2195  }
2196  tag(me, val);
2197  }
2198  else if (kind == "qr") {
2199  // Handle qreports, but skip them while reading in references.
2200  if (! isSubdirectory(s_referenceDirName, dir)) {
2201  size_t dot = label.find('.');
2202  if (dot == std::string::npos) {
2203  std::cout << "*** DQMStore: WARNING: quality report label in '" << label
2204  << "' is missing a '.' and cannot be extracted\n";
2205  return false;
2206  }
2207 
2208  std::string mename (label, 0, dot);
2209  std::string qrname (label, dot+1, std::string::npos);
2210 
2211  m.reset();
2212  DQMNet::QValue qv;
2213  if (s_rxmeqr1.match(value, 0, 0, &m)) {
2214  qv.code = atoi(m.matchString(value, 1).c_str());
2215  qv.qtresult = strtod(m.matchString(value, 2).c_str(), nullptr);
2216  qv.message = m.matchString(value, 4);
2217  qv.qtname = qrname;
2218  qv.algorithm = m.matchString(value, 3);
2219  }
2220  else if (s_rxmeqr2.match(value, 0, 0, &m)) {
2221  qv.code = atoi(m.matchString(value, 1).c_str());
2222  qv.qtresult = 0; // unavailable in old format
2223  qv.message = m.matchString(value, 2);
2224  qv.qtname = qrname;
2225  // qv.algorithm unavailable in old format
2226  }
2227  else {
2228  std::cout << "*** DQMStore: WARNING: quality test value '"
2229  << value << "' is incorrectly formatted\n";
2230  return false;
2231  }
2232 
2233  MonitorElement* me = findObject(0, 0, 0, dir, mename);
2234  if (! me) {
2235  std::cout << "*** DQMStore: WARNING: no monitor element '"
2236  << mename << "' in directory '"
2237  << dir << "' for quality test '"
2238  << label << "'\n";
2239  return false;
2240  }
2241 
2242  me->addQReport(qv, /* FIXME: getQTest(qv.qtname)? */ nullptr);
2243  }
2244  }
2245  else {
2246  std::cout << "*** DQMStore: WARNING: cannot extract object '"
2247  << obj->GetName() << "' of type '"
2248  << obj->IsA()->GetName() << "'\n";
2249  return false;
2250  }
2251  }
2252  else if (auto* n = dynamic_cast<TNamed*>(obj)) {
2253  // For old DQM data.
2254  std::string s;
2255  s.reserve(6 + strlen(n->GetTitle()) + 2*strlen(n->GetName()));
2256  s += '<'; s += n->GetName(); s += '>';
2257  s += n->GetTitle();
2258  s += '<'; s += '/'; s += n->GetName(); s += '>';
2259  TObjString os(s.c_str());
2260  return extract(&os, dir, overwrite, collateHistograms_);
2261  }
2262  else {
2263  std::cout << "*** DQMStore: WARNING: cannot extract object '"
2264  << obj->GetName() << "' of type '" << obj->IsA()->GetName()
2265  << "' and with title '" << obj->GetTitle() << "'\n";
2266  return false;
2267  }
2268 
2269  // If we just read in a reference MonitorElement, and there is a
2270  // MonitorElement with the same name, link the two together.
2271  // The other direction is handled by the book() method.
2272  if (refcheck && isSubdirectory(s_referenceDirName, dir)) {
2273  std::string mdir(dir, s_referenceDirName.size()+1, std::string::npos);
2274  if (MonitorElement* master = findObject(0, 0, 0, mdir, obj->GetName())) {
2275  // We have extracted a MonitorElement, and it's located in the reference
2276  // dir. Then we find the corresponding MonitorElement in the
2277  // non-reference dir and assign the object_ of the reference
2278  // MonitorElement to the reference_ property of the corresponding
2279  // non-reference MonitorElement.
2280  master->data_.flags |= DQMNet::DQM_PROP_HAS_REFERENCE;
2281  master->reference_ = refcheck->object_;
2282  }
2283  }
2284 
2285  return true;
2286 }
Master< F > master(const F &f)
Definition: FunctClone.h:68
MonitorElement * book2DD_(std::string const &dir, std::string const &name, TH2D *h)
Book 2D histogram based on TH2D.
Definition: DQMStore.cc:1154
bool isCollateME(MonitorElement *me) const
Definition: DQMStore.cc:3314
MonitorElement * bookProfile2D_(std::string const &dir, std::string const &name, TProfile2D *h)
Book 2D profile histogram based on TProfile2D.
Definition: DQMStore.cc:1339
void copyFrom(TH1 *from)
std::string algorithm
Definition: DQMNet.h:94
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
static void collate3D(MonitorElement *me, TH3F *h, unsigned verbose)
Definition: DQMStore.cc:1459
MonitorElement * bookString_(std::string const &dir, std::string const &name, std::string const &value)
Book string.
Definition: DQMStore.cc:1044
static void collateProfile(MonitorElement *me, TProfile *h, unsigned verbose)
Definition: DQMStore.cc:1466
static void collate2DD(MonitorElement *me, TH2D *h, unsigned verbose)
Definition: DQMStore.cc:1452
MonitorElement * book1D_(std::string const &dir, std::string const &name, TH1F *h)
Book 1D histogram based on TH1F.
Definition: DQMStore.cc:1065
bool extract(TObject *obj, std::string const &dir, bool overwrite, bool collateHistograms)
Definition: DQMStore.cc:2025
MonitorElement * bookProfile_(std::string const &dir, std::string const &name, TProfile *h)
Book profile histogram based on TProfile.
Definition: DQMStore.cc:1262
void Fill(long long x)
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1488
void setEfficiencyFlag()
static const uint32_t DQM_PROP_HAS_REFERENCE
Definition: DQMNet.h:54
MonitorElement * book2D_(std::string const &dir, std::string const &name, TH2F *h)
Book 2D histogram based on TH2F.
Definition: DQMStore.cc:1140
MonitorElement * book1DD_(std::string const &dir, std::string const &name, TH1D *h)
Book 1D histogram based on TH1D.
Definition: DQMStore.cc:1079
static void collateProfile2D(MonitorElement *me, TProfile2D *h, unsigned verbose)
Definition: DQMStore.cc:1475
MonitorElement * book3D_(std::string const &dir, std::string const &name, TH3F *h)
Book 3D histogram based on TH3F.
Definition: DQMStore.cc:1234
Definition: value.py:1
std::string qtname
Definition: DQMNet.h:93
MonitorElement * book1S_(std::string const &dir, std::string const &name, TH1S *h)
Book 1D histogram based on TH1S.
Definition: DQMStore.cc:1072
static void collate1DD(MonitorElement *me, TH1D *h, unsigned verbose)
Definition: DQMStore.cc:1431
unsigned verbose_
Definition: DQMStore.h:630
MonitorElement * book2S_(std::string const &dir, std::string const &name, TH2S *h)
Book 2D histogram based on TH2S.
Definition: DQMStore.cc:1147
static void collate1D(MonitorElement *me, TH1F *h, unsigned verbose)
Definition: DQMStore.cc:1417
MonitorElement * bookFloat_(std::string const &dir, std::string const &name)
Book float.
Definition: DQMStore.cc:1023
static const Regexp s_rxmeval("<(.*)>(i|f|s|qr)=(.*)</\\1>")
T dot(const Basic3DVector &v) const
Scalar product, or "dot" product, with a vector of same type.
std::string message
Definition: DQMNet.h:92
MonitorElement * bookInt_(std::string const &dir, std::string const &name)
Book int.
Definition: DQMStore.cc:1002
static void collate1S(MonitorElement *me, TH1S *h, unsigned verbose)
Definition: DQMStore.cc:1424
dbl *** dir
Definition: mlp_gen.cc:35
MonitorElement * findObject(uint32_t run, uint32_t lumi, uint32_t moduleId, std::string const &dir, std::string const &name) const
Definition: DQMStore.cc:1727
static void collate2D(MonitorElement *me, TH2F *h, unsigned verbose)
Definition: DQMStore.cc:1438
float qtresult
Definition: DQMNet.h:91
bool collateHistograms_
Definition: DQMStore.h:634
void addQReport(const DQMNet::QValue &desc, QCriterion *qc)
Add quality report, from DQMStore.
static void collate2S(MonitorElement *me, TH2S *h, unsigned verbose)
Definition: DQMStore.cc:1445
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 2952 of file DQMStore.cc.

Referenced by get_info().

2953 {
2954  if (buf.Length() == buf.BufferSize())
2955  return nullptr;
2956  buf.InitMap();
2957  void* ptr = buf.ReadObjectAny(nullptr);
2958  return reinterpret_cast<TObject*>(ptr);
2959 }
MonitorElement * DQMStore::findObject ( uint32_t  run,
uint32_t  lumi,
uint32_t  moduleId,
std::string const &  dir,
std::string const &  name 
) const
private

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

Definition at line 1727 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, and findQualityFiles::run.

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

1732 {
1733  if (dir.find_first_not_of(s_safe) != std::string::npos)
1734  raiseDQMError("DQMStore", "Monitor element path name '%s' uses"
1735  " unacceptable characters", dir.c_str());
1736  if (name.find_first_not_of(s_safe) != std::string::npos)
1737  raiseDQMError("DQMStore", "Monitor element path name '%s' uses"
1738  " unacceptable characters", name.c_str());
1739 
1740  MonitorElement proto;
1741  proto.data_.dirname = &dir;
1742  proto.data_.objname = name;
1743  proto.data_.run = run;
1744  proto.data_.lumi = lumi;
1745  proto.data_.moduleId = moduleId;
1746 
1747  auto mepos = data_.find(proto);
1748  return (mepos == data_.end() ? nullptr
1749  : const_cast<MonitorElement *>(&*mepos));
1750 }
uint32_t moduleId
Definition: DQMNet.h:105
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:644
dbl *** dir
Definition: mlp_gen.cc:35
void raiseDQMError(const char *context, const char *fmt,...)
Definition: DQMError.cc:11
void DQMStore::forceReset ( )
private

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

Definition at line 1852 of file DQMStore.cc.

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

Referenced by DQMStore().

1853 {
1854  for (auto const& m : data_) {
1855  if (forceResetOnBeginLumi_ && (m.getLumiFlag() == false))
1856  continue;
1857  auto& me = const_cast<MonitorElement&>(m);
1858  me.Reset();
1859  me.resetUpdate();
1860  }
1861 
1862  reset_ = true;
1863 }
bool reset_
Definition: DQMStore.h:632
void Reset()
reset ME (ie. contents, errors, etc)
MEMap data_
Definition: DQMStore.h:644
bool forceResetOnBeginLumi_
Definition: DQMStore.h:637
MonitorElement * DQMStore::get ( std::string const &  path) const

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

Definition at line 1601 of file DQMStore.cc.

References data_, dir, dataset::name, and AlCaHLTBitMon_QueryRunRegistry::string.

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

1602 {
1603  std::string dir;
1604  std::string name;
1605  splitPath(dir, name, path);
1606  MonitorElement proto(&dir, name);
1607  auto mepos = data_.find(proto);
1608  return (mepos == data_.end() ? nullptr
1609  : const_cast<MonitorElement *>(&*mepos));
1610 }
MEMap data_
Definition: DQMStore.h:644
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 1614 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(), rrapi.RRApi::count(), util.rrapi.RRApi::count(), rrapi.RRApi::data(), util.rrapi.RRApi::data(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getResultingSection(), rrapi.RRApi::report(), util.rrapi.RRApi::report(), rrapi.RRApi::reports(), util.rrapi.RRApi::reports(), rrapi.RRApi::tables(), util.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().

1615 {
1616  // FIXME: Use reverse map [tag -> path] / [tag -> dir]?
1617  std::vector<MonitorElement*> result;
1618  for (auto const& me : data_) {
1619  if ((me.data_.flags & DQMNet::DQM_PROP_TAGGED) && me.data_.tag == tag)
1620  result.push_back(const_cast<MonitorElement*>(&me));
1621  }
1622  return result;
1623 }
static const uint32_t DQM_PROP_TAGGED
Definition: DQMNet.h:55
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1488
MEMap data_
Definition: DQMStore.h:644
void DQMStore::get_info ( dqmstorepb::ROOTFilePB_Histo const &  h,
std::string &  dirname,
std::string &  objname,
TObject **  obj 
)
private

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

2965 {
2966  size_t slash = h.full_pathname().rfind('/');
2967  size_t dirpos = (slash == std::string::npos ? 0 : slash);
2968  size_t namepos = (slash == std::string::npos ? 0 : slash+1);
2969  dirname.assign(h.full_pathname(), 0, dirpos);
2970  objname.assign(h.full_pathname(), namepos, std::string::npos);
2971  TBufferFile buf(TBufferFile::kRead, h.size(),
2972  (void*)h.streamed_histo().data(),
2973  kFALSE);
2974  buf.Reset();
2975  *obj = extractNextObject(buf);
2976  if (!*obj) {
2977  raiseDQMError("DQMStore", "Error reading element:'%s'" , h.full_pathname().c_str());
2978  }
2979 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
TObject * extractNextObject(TBufferFile &) const
Definition: DQMStore.cc:2952
void raiseDQMError(const char *context, const char *fmt,...)
Definition: DQMError.cc:11
std::vector< MonitorElement * > DQMStore::getAllContents ( std::string const &  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 1755 of file DQMStore.cc.

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

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

1758 {
1760  std::string const* cleaned = nullptr;
1761  cleanTrailingSlashes(path, clean, cleaned);
1762  MonitorElement proto(cleaned, std::string(), run, 0);
1763  proto.setLumi(lumi);
1764 
1765  std::vector<MonitorElement*> result;
1766  auto e = data_.end();
1767  auto i = data_.lower_bound(proto);
1768  for ( ; i != e && isSubdirectory(*cleaned, *i->data_.dirname); ++i) {
1769  if (run != 0) {
1770  if (i->data_.run > run // TODO[rovere]: pleonastic? first we encounter local ME of the same run ...
1771  || i->data_.moduleId != 0)
1772  break;
1773  }
1774  if (lumi != 0) {
1775  if (i->data_.lumi > lumi
1776  || i->data_.moduleId != 0)
1777  break;
1778  }
1779  if (run != 0 or lumi !=0) {
1780  assert(i->data_.moduleId == 0);
1781  }
1782  result.push_back(const_cast<MonitorElement*>(&*i));
1783  }
1784 
1785  if (enableMultiThread_) {
1786  //save legacy modules when running MT
1787  i = data_.begin();
1788  for ( ; i != e && isSubdirectory(*cleaned, *i->data_.dirname); ++i) {
1789  if (i->data_.run != 0 or i->data_.moduleId != 0)
1790  break;
1791  result.push_back(const_cast<MonitorElement*>(&*i));
1792  }
1793  }
1794 
1795  return result;
1796 }
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:644
bool enableMultiThread_
Definition: DQMStore.h:635
std::vector< MonitorElement * > DQMStore::getContents ( std::string const &  path) const

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

Definition at line 1628 of file DQMStore.cc.

References clean, data_, MillePedeFileConverter_cfg::e, mps_fire::i, mps_fire::result, and AlCaHLTBitMon_QueryRunRegistry::string.

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

1629 {
1631  std::string const* cleaned = nullptr;
1632  cleanTrailingSlashes(path, clean, cleaned);
1633  MonitorElement proto(cleaned, std::string());
1634 
1635  std::vector<MonitorElement*> result;
1636  auto e = data_.end();
1637  auto i = data_.lower_bound(proto);
1638  for ( ; i != e && isSubdirectory(*cleaned, *i->data_.dirname); ++i)
1639  if (*cleaned == *i->data_.dirname)
1640  result.push_back(const_cast<MonitorElement *>(&*i));
1641 
1642  return result;
1643 }
std::vector< T * > clean
Definition: MVATrainer.cc:156
MEMap data_
Definition: DQMStore.h:644
std::vector< MonitorElement * > DQMStore::getContents ( std::string const &  path,
unsigned int  tag 
) const

same as above for tagged MonitorElements

Definition at line 1647 of file DQMStore.cc.

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

1648 {
1650  std::string const* cleaned = nullptr;
1651  cleanTrailingSlashes(path, clean, cleaned);
1652  MonitorElement proto(cleaned, std::string());
1653 
1654  std::vector<MonitorElement*> result;
1655  auto e = data_.end();
1656  auto i = data_.lower_bound(proto);
1657  for ( ; i != e && isSubdirectory(*cleaned, *i->data_.dirname); ++i)
1658  if (*cleaned == *i->data_.dirname
1659  && (i->data_.flags & DQMNet::DQM_PROP_TAGGED)
1660  && i->data_.tag == tag)
1661  result.push_back(const_cast<MonitorElement *>(&*i));
1662 
1663  return result;
1664 }
static const uint32_t DQM_PROP_TAGGED
Definition: DQMNet.h:55
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1488
std::vector< T * > clean
Definition: MVATrainer.cc:156
MEMap data_
Definition: DQMStore.h:644
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 1671 of file DQMStore.cc.

References data_, dir, dirs_, funct::m, and AlCaHLTBitMon_QueryRunRegistry::string.

1672 {
1673  into.clear();
1674  into.reserve(dirs_.size());
1675 
1676  auto me = data_.end();
1677  for (auto const& dir : dirs_)
1678  {
1679  MonitorElement proto(&dir, std::string());
1680  auto mi = data_.lower_bound(proto);
1681  auto m = mi;
1682  size_t sz = dir.size() + 2;
1683  size_t nfound = 0;
1684  for ( ; m != me && isSubdirectory(dir, *m->data_.dirname); ++m)
1685  if (dir == *m->data_.dirname)
1686  {
1687  sz += m->data_.objname.size() + 1;
1688  ++nfound;
1689  }
1690 
1691  if (! nfound)
1692  continue;
1693 
1694  auto istr
1695  = into.insert(into.end(), std::string());
1696 
1697  if (showContents)
1698  {
1699  istr->reserve(sz);
1700 
1701  *istr += dir;
1702  *istr += ':';
1703  for (sz = 0; mi != m; ++mi)
1704  {
1705  if (dir != *mi->data_.dirname)
1706  continue;
1707 
1708  if (sz > 0)
1709  *istr += ',';
1710 
1711  *istr += mi->data_.objname;
1712  ++sz;
1713  }
1714  }
1715  else
1716  {
1717  istr->reserve(dir.size() + 2);
1718  *istr += dir;
1719  *istr += ':';
1720  }
1721  }
1722 }
MEMap data_
Definition: DQMStore.h:644
dbl *** dir
Definition: mlp_gen.cc:35
std::set< std::string > dirs_
Definition: DQMStore.h:645
std::vector< MonitorElement * > DQMStore::getMatchingContents ( std::string const &  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 1801 of file DQMStore.cc.

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

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

1802 {
1803  lat::Regexp rx;
1804  try {
1805  rx = lat::Regexp(pattern, 0, syntaxType);
1806  rx.study();
1807  }
1808  catch (lat::Error& e) {
1809  raiseDQMError("DQMStore", "Invalid regular expression '%s': %s",
1810  pattern.c_str(), e.explain().c_str());
1811  }
1812 
1813  std::string path;
1814  std::vector<MonitorElement *> result;
1815  for (auto const& me : data_) {
1816  path.clear();
1817  mergePath(path, *me.data_.dirname, me.data_.objname);
1818  if (rx.match(path))
1819  result.push_back(const_cast<MonitorElement*>(&me));
1820  }
1821 
1822  return result;
1823 }
edm::ErrorSummaryEntry Error
MEMap data_
Definition: DQMStore.h:644
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 1575 of file DQMStore.cc.

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

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

1576 {
1577  MonitorElement proto(&pwd_, std::string());
1578  std::vector<std::string> result;
1579  auto e = data_.end();
1580  auto i = data_.lower_bound(proto);
1581  for ( ; i != e && isSubdirectory(pwd_, *i->data_.dirname); ++i)
1582  if (pwd_ == *i->data_.dirname)
1583  result.push_back(i->getName());
1584 
1585  return result;
1586 }
std::string pwd_
Definition: DQMStore.h:643
MEMap data_
Definition: DQMStore.h:644
QCriterion * DQMStore::getQCriterion ( std::string const &  qtname) const
int DQMStore::getStatus ( std::string const &  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 3230 of file DQMStore.cc.

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

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

3231 {
3233  std::string const* cleaned = nullptr;
3234  cleanTrailingSlashes(path, clean, cleaned);
3235 
3237  for (auto const& me : data_) {
3238  if (! cleaned->empty() && ! isSubdirectory(*cleaned, *me.data_.dirname))
3239  continue;
3240 
3241  if (me.hasError())
3242  return dqm::qstatus::ERROR;
3243  else if (me.hasWarning())
3244  status = dqm::qstatus::WARNING;
3245  else if (status < dqm::qstatus::WARNING
3246  && me.hasOtherReport())
3247  status = dqm::qstatus::OTHER;
3248  }
3249  return status;
3250 }
static const int OTHER
static const int WARNING
std::vector< T * > clean
Definition: MVATrainer.cc:156
MEMap data_
Definition: DQMStore.h:644
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 1552 of file DQMStore.cc.

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

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

1553 {
1554  std::vector<std::string> result;
1555  auto e = dirs_.end();
1556  auto i = dirs_.find(pwd_);
1557 
1558  // If we didn't find current directory, the tree is empty, so quit.
1559  if (i == e)
1560  return result;
1561 
1562  // Skip the current directory and then start looking for immediate
1563  // subdirectories in the dirs_ list. Stop when we are no longer in
1564  // (direct or indirect) subdirectories of pwd_. Note that we don't
1565  // "know" which order the set will sort A/B, A/B/C and A/D.
1566  while (++i != e && isSubdirectory(pwd_, *i))
1567  if (i->find('/', pwd_.size()+1) == std::string::npos)
1568  result.push_back(*i);
1569 
1570  return result;
1571 }
std::string pwd_
Definition: DQMStore.h:643
std::set< std::string > dirs_
Definition: DQMStore.h:645
void DQMStore::goUp ( )
MonitorElement* DQMStore::initialise ( MonitorElement me,
std::string const &  path 
)
private

Referenced by book_().

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

Definition at line 400 of file DQMStore.cc.

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

Referenced by DQMStore().

401 {
402  makeDirectory("");
403  reset();
404 
405  // set steerable parameters
406  verbose_ = pset.getUntrackedParameter<int>("verbose", 0);
407  if (verbose_ > 0)
408  std::cout << "DQMStore: verbosity set to " << verbose_ << std::endl;
409 
410  verboseQT_ = pset.getUntrackedParameter<int>("verboseQT", 0);
411  if (verbose_ > 0)
412  std::cout << "DQMStore: QTest verbosity set to " << verboseQT_ << std::endl;
413 
414  collateHistograms_ = pset.getUntrackedParameter<bool>("collateHistograms", false);
415  if (collateHistograms_)
416  std::cout << "DQMStore: histogram collation is enabled\n";
417 
418  enableMultiThread_ = pset.getUntrackedParameter<bool>("enableMultiThread", false);
419  if (enableMultiThread_)
420  std::cout << "DQMStore: MultiThread option is enabled\n";
421 
422  LSbasedMode_ = pset.getUntrackedParameter<bool>("LSbasedMode", false);
423  if (LSbasedMode_)
424  std::cout << "DQMStore: LSbasedMode option is enabled\n";
425 
426  std::string ref = pset.getUntrackedParameter<std::string>("referenceFileName", "");
427  if (! ref.empty()) {
428  std::cout << "DQMStore: using reference file '" << ref << "'\n";
429  readFile(ref, true, "", s_referenceDirName, StripRunDirs, false);
430  }
431 
432  initQCriterion<Comp2RefChi2>(qalgos_);
433  initQCriterion<Comp2Ref2DChi2>(qalgos_);
434  initQCriterion<Comp2RefKolmogorov>(qalgos_);
435  initQCriterion<ContentsXRange>(qalgos_);
436  initQCriterion<ContentsYRange>(qalgos_);
437  initQCriterion<MeanWithinExpected>(qalgos_);
438  initQCriterion<Comp2RefEqualH>(qalgos_);
439  initQCriterion<DeadChannel>(qalgos_);
440  initQCriterion<NoisyChannel>(qalgos_);
441  initQCriterion<ContentSigma>(qalgos_);
442  initQCriterion<ContentsWithinExpected>(qalgos_);
443  initQCriterion<CompareToMedian>(qalgos_);
444  initQCriterion<CompareLastFilledBin>(qalgos_);
445  initQCriterion<CheckVariance>(qalgos_);
446 
447  scaleFlag_ = pset.getUntrackedParameter<double>("ScalingFlag", 0.0);
448  if (verbose_ > 0)
449  std::cout << "DQMStore: Scaling Flag set to " << scaleFlag_ << std::endl;
450 }
void makeDirectory(std::string const &path)
Definition: DQMStore.cc:589
unsigned verboseQT_
Definition: DQMStore.h:631
double scaleFlag_
Definition: DQMStore.h:633
QAMap qalgos_
Definition: DQMStore.h:648
unsigned verbose_
Definition: DQMStore.h:630
bool readFile(std::string const &filename, bool overwrite=false, std::string const &path="", std::string const &prepend="", OpenRunDirs stripdirs=StripRunDirs, bool fileMustExist=true)
Definition: DQMStore.cc:2903
bool collateHistograms_
Definition: DQMStore.h:634
bool LSbasedMode_
Definition: DQMStore.h:636
void reset()
Definition: DQMStore.cc:1832
bool enableMultiThread_
Definition: DQMStore.h:635
bool DQMStore::isCollate ( ) const

Definition at line 3305 of file DQMStore.cc.

References collateHistograms_.

3306 {
3307  return collateHistograms_;
3308 }
bool collateHistograms_
Definition: DQMStore.h:634
bool DQMStore::isCollateME ( MonitorElement me) const
private

Definition at line 3314 of file DQMStore.cc.

References MonitorElement::data_, and DQMNet::CoreObject::dirname.

Referenced by extract().

3315 {
3316  return me && isSubdirectory(s_collateDirName, *me->data_.dirname);
3317 }
const std::string * dirname
Definition: DQMNet.h:106
DQMNet::CoreObject data_
bool DQMStore::load ( std::string const &  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 2876 of file DQMStore.cc.

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

Referenced by DQMFileReader::beginJob().

2879 {
2880  bool overwrite = true;
2881  if (collateHistograms_) overwrite = false;
2882  if (verbose_)
2883  {
2884  std::cout << "DQMStore::load: reading from file '" << filename << "'\n";
2885  if (collateHistograms_)
2886  std::cout << "DQMStore::load: in collate mode " << "\n";
2887  else
2888  std::cout << "DQMStore::load: in overwrite mode " << "\n";
2889  }
2890 
2891  if (!s_rxpbfile.match(filename, 0, 0))
2892  return readFile(filename, overwrite, "", "", stripdirs, fileMustExist);
2893  else
2894  return readFilePB(filename, overwrite, "", "", stripdirs, fileMustExist);
2895 }
unsigned verbose_
Definition: DQMStore.h:630
bool readFilePB(std::string const &filename, bool overwrite=false, std::string const &path="", std::string const &prepend="", OpenRunDirs stripdirs=StripRunDirs, bool fileMustExist=true)
Definition: DQMStore.cc:2982
bool readFile(std::string const &filename, bool overwrite=false, std::string const &path="", std::string const &prepend="", OpenRunDirs stripdirs=StripRunDirs, bool fileMustExist=true)
Definition: DQMStore.cc:2903
bool collateHistograms_
Definition: DQMStore.h:634
void DQMStore::makeDirectory ( std::string const &  path)
private

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

Definition at line 589 of file DQMStore.cc.

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

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

590 {
591  std::string prev;
592  std::string subdir;
594  prev.reserve(path.size());
595  subdir.reserve(path.size());
596  name.reserve(path.size());
597  size_t prevname = 0;
598  size_t slash = 0;
599 
600  while (true) {
601  // Create this subdirectory component.
602  subdir.clear();
603  subdir.append(path, 0, slash);
604  name.clear();
605  name.append(subdir, prevname, std::string::npos);
606  if (! prev.empty() && findObject(0, 0, 0, prev, name))
607  raiseDQMError("DQMStore", "Attempt to create subdirectory '%s'"
608  " which already exists as a monitor element",
609  subdir.c_str());
610 
611  if (! dirs_.count(subdir))
612  dirs_.insert(subdir);
613 
614  // Stop if we've reached the end (including possibly a trailing slash).
615  if (slash+1 >= path.size())
616  break;
617 
618  // Find the next slash, making sure we progress. If reach the end,
619  // process the last path component; the next loop round will terminate.
620  prevname = slash ? slash+1 : slash;
621  prev = subdir;
622  if ((slash = path.find('/', ++slash)) == std::string::npos)
623  slash = path.size();
624  }
625 }
MonitorElement * findObject(uint32_t run, uint32_t lumi, uint32_t moduleId, std::string const &dir, std::string const &name) const
Definition: DQMStore.cc:1727
std::set< std::string > dirs_
Definition: DQMStore.h:645
void raiseDQMError(const char *context, const char *fmt,...)
Definition: DQMError.cc:11
template<typename iFunc >
void DQMStore::meBookerGetter ( iFunc  f)
inline
bool DQMStore::mtEnabled ( )
inline
bool DQMStore::open ( std::string const &  filename,
bool  overwrite = false,
std::string const &  onlypath = "",
std::string const &  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 2861 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(), PFDQMEventSelector::openInputFile(), SiStripOfflineDQM::openInputFile(), BuildTrackerMapPlugin::read(), readFilePB(), savePB(), SiStripQualityHotStripIdentifierRoot::SiStripQualityHotStripIdentifierRoot(), and StatisticsFilter::StatisticsFilter().

2867 {
2868  return readFile(filename,overwrite,onlypath,prepend,stripdirs,fileMustExist);
2869 }
bool readFile(std::string const &filename, bool overwrite=false, std::string const &path="", std::string const &prepend="", OpenRunDirs stripdirs=StripRunDirs, bool fileMustExist=true)
Definition: DQMStore.cc:2903
DQMStore& DQMStore::operator= ( DQMStore const &  )
delete
void DQMStore::postGlobalBeginLumi ( const edm::GlobalContext )
private

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

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

1875 {
1876  static const std::string null_str("");
1877 
1878  auto const& lumiblock = gc.luminosityBlockID();
1879  uint32_t run = lumiblock.run();
1880 
1881  // find the range of non-legacy global MEs for the current run:
1882  // run != 0, lumi == 0 (implicit), stream id == 0, module id == 0
1883  const MonitorElement begin(&null_str, null_str, run, 0);
1884  const MonitorElement end(&null_str, null_str, run, 1);
1885  auto i = data_.lower_bound(begin);
1886  const auto e = data_.lower_bound(end);
1887  while (i != e) {
1888  auto& me = const_cast<MonitorElement&>(*i++);
1889  // skip per-run MEs
1890  if (not LSbasedMode_ and not me.getLumiFlag())
1891  continue;
1892  me.Reset();
1893  me.resetUpdate();
1894  }
1895 }
#define end
Definition: vmac.h:39
void Reset()
reset ME (ie. contents, errors, etc)
MEMap data_
Definition: DQMStore.h:644
#define begin
Definition: vmac.h:32
bool LSbasedMode_
Definition: DQMStore.h:636
void DQMStore::print_trace ( std::string const &  dir,
std::string const &  name 
)
private

Definition at line 462 of file DQMStore.cc.

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

Referenced by book_().

463 {
464  // the access to the member stream_ is implicitely protected against
465  // concurrency problems because the print_trace method is always called behind
466  // a lock (see bookTransaction).
467  if (!stream_)
468  stream_ = std::make_unique<std::ofstream>("histogramBookingBT.log");
469 
470  void* array[10];
471  size_t size;
472  char** strings;
473  int r = 0;
474  lat::RegexpMatch m;
475  m.reset();
476 
477  size = backtrace(array, 10);
478  strings = backtrace_symbols(array, size);
479 
480  size_t level = 1;
481  char* demangled = nullptr;
482  for (; level < size; ++level) {
483  if (!s_rxtrace.match(strings[level], 0, 0, &m)) continue;
484  demangled = abi::__cxa_demangle(m.matchString(strings[level], 2).c_str(), nullptr, nullptr, &r);
485  if (!demangled) continue;
486  if (!s_rxself.match(demangled, 0, 0)) break;
487  free(demangled);
488  demangled = nullptr;
489  }
490 
491  if (demangled != nullptr) {
492  *stream_ << "\"" << dir << "/"
493  << name << "\" "
494  << (r ? m.matchString(strings[level], 2) : demangled) << " "
495  << m.matchString(strings[level], 1) << "\n";
496  free(demangled);
497  } else {
498  *stream_ << "Skipping "<< dir << "/" << name
499  << " with stack size " << size << "\n";
500  }
501 
502  /* In this case print the full stack trace, up to main or to the
503  * maximum stack size, i.e. 10. */
504  if (verbose_ > 4 || demangled == nullptr) {
505  size_t i;
506  m.reset();
507 
508  for (i = 0; i < size; ++i)
509  if (s_rxtrace.match(strings[i], 0, 0, &m)) {
510  char* demangled = abi::__cxa_demangle(m.matchString(strings[i], 2).c_str(), nullptr, nullptr, &r);
511  *stream_ << "\t\t" << i << "/" << size << " "
512  << (r ? m.matchString(strings[i], 2) : demangled) << " "
513  << m.matchString(strings[i], 1) << std::endl;
514  free (demangled);
515  }
516  }
517  free (strings);
518 }
size
Write out results.
demangled
Definition: symbols.py:62
unsigned verbose_
Definition: DQMStore.h:630
std::unique_ptr< std::ostream > stream_
Definition: DQMStore.h:641
dbl *** dir
Definition: mlp_gen.cc:35
std::string const & DQMStore::pwd ( ) const
unsigned int DQMStore::readDirectory ( TFile *  file,
bool  overwrite,
std::string const &  onlypath,
std::string const &  prepend,
std::string const &  curdir,
OpenRunDirs  stripdirs 
)
private

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

Definition at line 2715 of file DQMStore.cc.

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

Referenced by readFile().

2721 {
2722  unsigned int ntot = 0;
2723  unsigned int count = 0;
2724 
2725  if (! file->cd(curdir.c_str()))
2726  raiseDQMError("DQMStore", "Failed to process directory '%s' while"
2727  " reading file '%s'", curdir.c_str(), file->GetName());
2728 
2729  // Figure out current directory name, but strip out the top
2730  // directory into which we dump everything.
2731  std::string dirpart = curdir;
2732  if (dirpart.compare(0, s_monitorDirName.size(), s_monitorDirName) == 0) {
2733  if (dirpart.size() == s_monitorDirName.size())
2734  dirpart.clear();
2735  else if (dirpart[s_monitorDirName.size()] == '/')
2736  dirpart.erase(0, s_monitorDirName.size()+1);
2737  }
2738 
2739  // See if we are going to skip this directory.
2740  bool skip = (! onlypath.empty() && ! isSubdirectory(onlypath, dirpart));
2741 
2742  if (prepend == s_collateDirName ||
2743  prepend == s_referenceDirName ||
2744  stripdirs == StripRunDirs ) {
2745  // Remove Run # and RunSummary dirs
2746  // first look for Run summary,
2747  // if that is found and erased, also erase Run dir
2748  size_t slash = dirpart.find('/');
2749  size_t pos = dirpart.find("/Run summary");
2750  if (slash != std::string::npos && pos !=std::string::npos) {
2751  dirpart.erase(pos,12);
2752 
2753  pos = dirpart.find("Run ");
2754  size_t length = dirpart.find('/',pos+1)-pos+1;
2755  if (pos !=std::string::npos)
2756  dirpart.erase(pos,length);
2757  }
2758  }
2759 
2760  // If we are prepending, add it to the directory name,
2761  // and suppress reading of already existing reference histograms
2762  if (prepend == s_collateDirName ||
2763  prepend == s_referenceDirName) {
2764  size_t slash = dirpart.find('/');
2765  // If we are reading reference, skip previous reference.
2766  if (slash == std::string::npos // skip if Reference is toplevel folder, i.e. no slash
2767  && slash+1+s_referenceDirName.size() == dirpart.size()
2768  && dirpart.compare(slash+1, s_referenceDirName.size(), s_referenceDirName) == 0)
2769  return 0;
2770 
2771  slash = dirpart.find('/');
2772  // Skip reading of EventInfo subdirectory.
2773  if (slash != std::string::npos
2774  && slash + 10 == dirpart.size()
2775  && dirpart.compare( slash+1 , 9 , "EventInfo") == 0) {
2776  if (verbose_)
2777  std::cout << "DQMStore::readDirectory: skipping '" << dirpart << "'\n";
2778  return 0;
2779  }
2780 
2781  // Add prefix.
2782  if (dirpart.empty())
2783  dirpart = prepend;
2784  else
2785  dirpart = prepend + '/' + dirpart;
2786  }
2787  else if (! prepend.empty()) {
2788  if (dirpart.empty())
2789  dirpart = prepend;
2790  else
2791  dirpart = prepend + '/' + dirpart;
2792  }
2793 
2794  // Loop over the contents of this directory in the file.
2795  // Post-pone string object handling to happen after other
2796  // objects have been read in so we are guaranteed to have
2797  // histograms by the time we read in quality tests and tags.
2798  TKey* key;
2799  TIter next (gDirectory->GetListOfKeys());
2800  std::list<TObject*> delayed;
2801  while ((key = (TKey*) next()))
2802  {
2803  std::unique_ptr<TObject> obj(key->ReadObj());
2804  if (dynamic_cast<TDirectory*>(obj.get())) {
2805  std::string subdir;
2806  subdir.reserve(curdir.size() + strlen(obj->GetName()) + 2);
2807  subdir += curdir;
2808  if (! curdir.empty())
2809  subdir += '/';
2810  subdir += obj->GetName();
2811 
2812  ntot += readDirectory(file, overwrite, onlypath, prepend, subdir, stripdirs);
2813  }
2814  else if (skip)
2815  ;
2816  else if (dynamic_cast<TObjString*>(obj.get())) {
2817  delayed.push_back(obj.release());
2818  }
2819  else {
2820  if (verbose_ > 2)
2821  std::cout << "DQMStore: reading object '" << obj->GetName()
2822  << "' of type '" << obj->IsA()->GetName()
2823  << "' from '" << file->GetName()
2824  << "' into '" << dirpart << "'\n";
2825 
2826  makeDirectory(dirpart);
2827  if (extract(obj.get(), dirpart, overwrite, collateHistograms_))
2828  ++count;
2829  }
2830  }
2831 
2832  while (! delayed.empty()) {
2833  if (verbose_ > 2)
2834  std::cout << "DQMStore: reading object '" << delayed.front()->GetName()
2835  << "' of type '" << delayed.front()->IsA()->GetName()
2836  << "' from '" << file->GetName()
2837  << "' into '" << dirpart << "'\n";
2838 
2839  makeDirectory(dirpart);
2840  if (extract(delayed.front(), dirpart, overwrite, collateHistograms_))
2841  ++count;
2842 
2843  delete delayed.front();
2844  delayed.pop_front();
2845  }
2846 
2847  if (verbose_ > 1)
2848  std::cout << "DQMStore: read " << count << '/' << ntot
2849  << " objects from directory '" << dirpart << "'\n";
2850 
2851  return ntot + count;
2852 }
void makeDirectory(std::string const &path)
Definition: DQMStore.cc:589
bool extract(TObject *obj, std::string const &dir, bool overwrite, bool collateHistograms)
Definition: DQMStore.cc:2025
unsigned int readDirectory(TFile *file, bool overwrite, std::string const &path, std::string const &prepend, std::string const &curdir, OpenRunDirs stripdirs)
Definition: DQMStore.cc:2715
unsigned verbose_
Definition: DQMStore.h:630
bool collateHistograms_
Definition: DQMStore.h:634
void raiseDQMError(const char *context, const char *fmt,...)
Definition: DQMError.cc:11
bool DQMStore::readFile ( std::string const &  filename,
bool  overwrite = false,
std::string const &  onlypath = "",
std::string const &  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 2903 of file DQMStore.cc.

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

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

2909 {
2910 
2911  if (verbose_)
2912  std::cout << "DQMStore::readFile: reading from file '" << filename << "'\n";
2913 
2914  std::unique_ptr<TFile> f;
2915 
2916  try {
2917  f.reset(TFile::Open(filename.c_str()));
2918  if (! f.get() || f->IsZombie())
2919  raiseDQMError("DQMStore", "Failed to open file '%s'", filename.c_str());
2920  }
2921  catch (std::exception &) {
2922  if (fileMustExist)
2923  throw;
2924  else {
2925  if (verbose_)
2926  std::cout << "DQMStore::readFile: file '" << filename << "' does not exist, continuing\n";
2927  return false;
2928  }
2929  }
2930 
2931  unsigned n = readDirectory(f.get(), overwrite, onlypath, prepend, "", stripdirs);
2932  f->Close();
2933 
2934  for (auto const& me : data_)
2935  const_cast<MonitorElement &>(me).updateQReportStats();
2936 
2937  if (verbose_) {
2938  std::cout << "DQMStore::open: successfully read " << n
2939  << " objects from file '" << filename << "'";
2940  if (! onlypath.empty())
2941  std::cout << " from directory '" << onlypath << "'";
2942  if (! prepend.empty())
2943  std::cout << " into directory '" << prepend << "'";
2944  std::cout << std::endl;
2945  }
2946  return true;
2947 }
double f[11][100]
unsigned int readDirectory(TFile *file, bool overwrite, std::string const &path, std::string const &prepend, std::string const &curdir, OpenRunDirs stripdirs)
Definition: DQMStore.cc:2715
unsigned verbose_
Definition: DQMStore.h:630
MEMap data_
Definition: DQMStore.h:644
void raiseDQMError(const char *context, const char *fmt,...)
Definition: DQMError.cc:11
bool DQMStore::readFilePB ( std::string const &  filename,
bool  overwrite = false,
std::string const &  path = "",
std::string const &  prepend = "",
OpenRunDirs  stripdirs = StripRunDirs,
bool  fileMustExist = true 
)
private

Definition at line 2982 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(), h, 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().

2988 {
2989  using google::protobuf::io::FileInputStream;
2990  using google::protobuf::io::FileOutputStream;
2991  using google::protobuf::io::GzipInputStream;
2992  using google::protobuf::io::GzipOutputStream;
2993  using google::protobuf::io::CodedInputStream;
2994  using google::protobuf::io::ArrayInputStream;
2995 
2996  if (verbose_)
2997  std::cout << "DQMStore::readFile: reading from file '" << filename << "'\n";
2998 
2999  int filedescriptor;
3000  if ((filedescriptor = ::open(filename.c_str(), O_RDONLY)) == -1) {
3001  if (fileMustExist)
3002  raiseDQMError("DQMStore", "Failed to open file '%s'", filename.c_str());
3003  else
3004  if (verbose_)
3005  std::cout << "DQMStore::readFile: file '" << filename << "' does not exist, continuing\n";
3006  return false;
3007  }
3008 
3009  dqmstorepb::ROOTFilePB dqmstore_message;
3010  FileInputStream fin(filedescriptor);
3011  GzipInputStream input(&fin);
3012  CodedInputStream input_coded(&input);
3013  input_coded.SetTotalBytesLimit(1024*1024*1024, -1);
3014  if (!dqmstore_message.ParseFromCodedStream(&input_coded)) {
3015  raiseDQMError("DQMStore", "Fatal parsing file '%s'", filename.c_str());
3016  return false;
3017  }
3018  ::close(filedescriptor);
3019 
3020  for (int i = 0; i < dqmstore_message.histo_size(); ++i) {
3021  std::string path;
3022  std::string objname;
3023 
3024  TObject* obj = nullptr;
3025  dqmstorepb::ROOTFilePB::Histo const& h = dqmstore_message.histo(i);
3026  get_info(h, path, objname, &obj);
3027 
3028  setCurrentFolder(path);
3029  if (obj) {
3030  /* Before calling the extract() check if histogram exists:
3031  * if it does - flags for the given monitor are already set (and merged)
3032  * else - set the flags after the histogram is created.
3033  */
3034  MonitorElement* me = findObject(0, 0, 0, path, objname);
3035 
3036  /* Run histograms should be collated and not overwritten,
3037  * Lumi histograms should be overwritten (and collate flag is not checked)
3038  */
3039  bool overwrite = h.flags() & DQMNet::DQM_PROP_LUMI;
3040  bool collate = !(h.flags() & DQMNet::DQM_PROP_LUMI);
3041  extract(static_cast<TObject*>(obj), path, overwrite, collate);
3042 
3043  if (me == nullptr) {
3044  me = findObject(0, 0, 0, path, objname);
3045  me->data_.flags = h.flags();
3046  }
3047 
3048  delete obj;
3049  }
3050  }
3051 
3052  cd();
3053  return true;
3054 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
uint32_t flags
Definition: DQMNet.h:99
bool extract(TObject *obj, std::string const &dir, bool overwrite, bool collateHistograms)
Definition: DQMStore.cc:2025
void get_info(dqmstorepb::ROOTFilePB_Histo const &, std::string &dirname, std::string &objname, TObject **obj)
Definition: DQMStore.cc:2961
static std::string const input
Definition: EdmProvDump.cc:45
bool open(std::string const &filename, bool overwrite=false, std::string const &path="", std::string const &prepend="", OpenRunDirs stripdirs=KeepRunDirs, bool fileMustExist=true)
Definition: DQMStore.cc:2861
DQMNet::CoreObject data_
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:565
void cd()
go to top directory (ie. root)
Definition: DQMStore.cc:540
const ::dqmstorepb::ROOTFilePB_Histo & histo(int index) const
unsigned verbose_
Definition: DQMStore.h:630
::google::protobuf::uint32 flags() const
MonitorElement * findObject(uint32_t run, uint32_t lumi, uint32_t moduleId, std::string const &dir, std::string const &name) const
Definition: DQMStore.cc:1727
static const uint32_t DQM_PROP_LUMI
Definition: DQMNet.h:61
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 3096 of file DQMStore.cc.

References pwd_.

3097 {
3099 }
std::string pwd_
Definition: DQMStore.h:643
void removeContents()
erase all monitoring elements in current directory (not including subfolders);
Definition: DQMStore.cc:3096
void DQMStore::removeContents ( std::string const &  dir)

remove all monitoring elements from directory;

Definition at line 3082 of file DQMStore.cc.

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

3083 {
3084  MonitorElement proto(&dir, std::string());
3085  auto e = data_.end();
3086  auto i = data_.lower_bound(proto);
3087  while (i != e && isSubdirectory(dir, *i->data_.dirname))
3088  if (dir == *i->data_.dirname)
3089  data_.erase(i++);
3090  else
3091  ++i;
3092 }
MEMap data_
Definition: DQMStore.h:644
dbl *** dir
Definition: mlp_gen.cc:35
void DQMStore::removeElement ( std::string const &  name)

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

Definition at line 3104 of file DQMStore.cc.

References pwd_.

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

3105 {
3107 }
void removeElement(std::string const &name)
Definition: DQMStore.cc:3104
std::string pwd_
Definition: DQMStore.h:643
void DQMStore::removeElement ( std::string const &  dir,
std::string const &  name,
bool  warning = true 
)

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

Definition at line 3112 of file DQMStore.cc.

References gather_cfg::cout, and data_.

3113 {
3114  MonitorElement proto(&dir, name);
3115  auto pos = data_.find(proto);
3116  if (pos != data_.end())
3117  data_.erase(pos);
3118  else if (warning) {
3119  std::cout << "DQMStore: WARNING: attempt to remove non-existent"
3120  << " monitor element '" << name << "' in '" << dir << "'\n";
3121  }
3122 }
MEMap data_
Definition: DQMStore.h:644
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 1832 of file DQMStore.cc.

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

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

1833 {
1834  for (auto const& m : data_) {
1835  auto& me = const_cast<MonitorElement&>(m);
1836  if (me.wasUpdated()) {
1837  if (me.resetMe())
1838  me.Reset();
1839  me.resetUpdate();
1840  }
1841  }
1842 
1843  reset_ = true;
1844 }
bool reset_
Definition: DQMStore.h:632
void Reset()
reset ME (ie. contents, errors, etc)
MEMap data_
Definition: DQMStore.h:644
void DQMStore::rmdir ( std::string const &  path)

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

Definition at line 3062 of file DQMStore.cc.

References clean, data_, dirs_, MillePedeFileConverter_cfg::e, mps_fire::i, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by dqmCopyRecursively().

3063 {
3065  std::string const* cleaned = nullptr;
3066  cleanTrailingSlashes(path, clean, cleaned);
3067  MonitorElement proto(cleaned, std::string());
3068 
3069  auto e = data_.end();
3070  auto i = data_.lower_bound(proto);
3071  while (i != e && isSubdirectory(*cleaned, *i->data_.dirname))
3072  data_.erase(i++);
3073 
3074  auto de = dirs_.end();
3075  auto di = dirs_.lower_bound(*cleaned);
3076  while (di != de && isSubdirectory(*cleaned, *di))
3077  dirs_.erase(di++);
3078 }
std::vector< T * > clean
Definition: MVATrainer.cc:156
MEMap data_
Definition: DQMStore.h:644
std::set< std::string > dirs_
Definition: DQMStore.h:645
void DQMStore::runQTests ( )

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

Definition at line 3211 of file DQMStore.cc.

References gather_cfg::cout, data_, reset_, and verbose_.

3212 {
3213 
3214  if (verbose_ > 0)
3215  std::cout << "DQMStore: running runQTests() with reset = "
3216  << ( reset_ ? "true" : "false" ) << std::endl;
3217 
3218  // Apply quality tests to each monitor element, skipping references.
3219  for (auto const& me : data_)
3220  if (! isSubdirectory(s_referenceDirName, *me.data_.dirname))
3221  const_cast<MonitorElement &>(me).runQTests();
3222 
3223  reset_ = false;
3224 }
bool reset_
Definition: DQMStore.h:632
unsigned verbose_
Definition: DQMStore.h:630
MEMap data_
Definition: DQMStore.h:644
void DQMStore::save ( std::string const &  filename,
std::string const &  path = "",
std::string const &  pattern = "",
std::string const &  rewrite = "",
uint32_t  run = 0,
uint32_t  lumi = 0,
SaveReferenceTag  ref = SaveWithReference,
int  minStatus = dqm::qstatus::STATUS_OK,
std::string const &  fileupdate = "RECREATE" 
)

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

Definition at line 2443 of file DQMStore.cc.

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

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

2452 {
2453  // TFile flushes to disk with fsync() on every TDirectory written to
2454  // the file. This makes DQM file saving painfully slow, and
2455  // ironically makes it _more_ likely the file saving gets
2456  // interrupted and corrupts the file. The utility class below
2457  // simply ignores the flush synchronisation.
2458  class TFileNoSync : public TFile {
2459  public:
2460  TFileNoSync(char const* file, char const* opt) : TFile{file, opt} {}
2461  Int_t SysSync(Int_t) override { return 0; }
2462  };
2463 
2464  std::lock_guard<std::mutex> guard(book_mutex_);
2465 
2466  unsigned int nme = 0;
2467 
2468  // open output file, on 1st save recreate, later update
2469  if (verbose_) {
2470  std::cout << "DQMStore::save: Opening TFile '" << filename
2471  << "' with option '" << fileupdate << "'"
2472  << std::endl;
2473  }
2474 
2475  TFileNoSync f(filename.c_str(), fileupdate.c_str()); // open file
2476  if(f.IsZombie())
2477  raiseDQMError("DQMStore", "Failed to create/update file '%s'", filename.c_str());
2478  f.cd();
2479 
2480  // Construct a regular expression from the pattern string.
2481  std::unique_ptr<lat::Regexp> rxpat;
2482  if (not pattern.empty())
2483  rxpat = std::make_unique<lat::Regexp>(pattern);
2484 
2485  // Prepare a path for the reference object selection.
2486  std::string refpath;
2487  refpath.reserve(s_referenceDirName.size() + path.size() + 2);
2488  refpath += s_referenceDirName;
2489  if (not path.empty()) {
2490  refpath += '/';
2491  refpath += path;
2492  }
2493 
2494  // Loop over the directory structure.
2495  for (auto const& dir: dirs_) {
2496  // Check if we should process this directory. We process the
2497  // requested part of the object tree, including references.
2498  if (not path.empty()
2499  and not isSubdirectory(refpath, dir)
2500  and not isSubdirectory(path, dir))
2501  continue;
2502 
2503  if (verbose_ > 1) {
2504  std::cout << "DQMStore::save: DQM folder " << dir << "/" << std::endl;
2505  }
2506 
2507  // Create the directory.
2508  gDirectory->cd("/");
2509  if (dir.empty())
2510  cdInto(s_monitorDirName);
2511  else if (rxpat.get())
2512  cdInto(s_monitorDirName + '/' + lat::StringOps::replace(dir, *rxpat, rewrite));
2513  else
2514  cdInto(s_monitorDirName + '/' + dir);
2515 
2516  // Loop over monitor elements in this directory.
2517  if (not enableMultiThread_) {
2518  MonitorElement proto(&dir, std::string(), run, 0);
2519  auto begin = data_.lower_bound(proto);
2520  auto end = data_.end();
2521  saveMonitorElementRangeToROOT(dir, refpath, ref, minStatus, run, begin, end, f, nme);
2522  } else {
2523  // Restrict the loop to the monitor elements for the current lumisection
2524  MonitorElement proto(&dir, std::string(), run, 0);
2525  proto.setLumi(lumi);
2526  auto begin = data_.lower_bound(proto);
2527  proto.setLumi(lumi+1);
2528  auto end = data_.lower_bound(proto);
2529  saveMonitorElementRangeToROOT(dir, refpath, ref, minStatus, run, begin, end, f, nme);
2530  }
2531 
2532  // In LSbasedMode, loop also over the (run, 0) global histograms;
2533  // these could be the merged global histrograms of their per-stream
2534  // counterparts after the streamEndRun transition - but they are not
2535  // produced in LSbasedMode.
2536  if (enableMultiThread_ and LSbasedMode_ and lumi != 0) {
2537  auto begin = data_.lower_bound(MonitorElement(&dir, std::string(), run, 0));
2538  auto end = data_.lower_bound(MonitorElement(&dir, std::string(), run, 1));
2539  saveMonitorElementRangeToROOT(dir, refpath, ref, minStatus, run, begin, end, f, nme);
2540  }
2541  }
2542 
2543  f.Close();
2544 
2545  // Maybe make some noise.
2546  if (verbose_) {
2547  std::cout << "DQMStore::save: successfully wrote " << nme
2548  << " objects from path '" << path << "/"
2549  << "' into DQM file '" << filename << "'\n";
2550  }
2551 }
def replace(string, replacements)
bool cdInto(std::string const &path) const
Definition: DQMStore.cc:2292
std::mutex book_mutex_
Definition: DQMStore.h:651
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:2363
double f[11][100]
#define end
Definition: vmac.h:39
unsigned verbose_
Definition: DQMStore.h:630
MEMap data_
Definition: DQMStore.h:644
#define begin
Definition: vmac.h:32
dbl *** dir
Definition: mlp_gen.cc:35
std::set< std::string > dirs_
Definition: DQMStore.h:645
bool LSbasedMode_
Definition: DQMStore.h:636
bool enableMultiThread_
Definition: DQMStore.h:635
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 2582 of file DQMStore.cc.

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

Referenced by savePB().

2588 {
2589  for (auto const& me: boost::make_iterator_range(begin, end)) {
2590  if (not isSubdirectory(dir, *me.data_.dirname))
2591  break;
2592 
2593  if (verbose_ > 1)
2594  std::cout << "DQMStore::savePB:"
2595  << " run: " << me.run()
2596  << " lumi: " << me.lumi()
2597  << " lumiFlag: " << me.getLumiFlag()
2598  << " moduleId: " << me.moduleId()
2599  << " fullpathname: " << me.getFullname()
2600  << " flags: " << std::hex << me.data_.flags
2601  << std::endl;
2602 
2603  // Skip MonitorElements in a subdirectory of the current one.
2604  if (dir != *me.data_.dirname) {
2605  if (verbose_ > 1) {
2606  std::cout << "DQMStore::savePB: skipping monitor element in a subfolder of " << dir << "/" << std::endl;
2607  }
2608  continue;
2609  }
2610 
2611  // Handle reference histograms, with three distinct cases:
2612  // XXX not supported by protobuf files.
2613 
2614  if (verbose_ > 1) {
2615  std::cout << "DQMStore::savePB: saving monitor element" << std::endl;
2616  }
2617 
2618  saveMonitorElementToPB(me, file);
2619 
2620  // Count saved histograms
2621  ++counter;
2622  }
2623 }
#define end
Definition: vmac.h:39
void saveMonitorElementToPB(MonitorElement const &me, dqmstorepb::ROOTFilePB &file)
Definition: DQMStore.cc:2554
unsigned verbose_
Definition: DQMStore.h:630
#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 2363 of file DQMStore.cc.

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

Referenced by save().

2372 {
2373  for (auto const& me: boost::make_iterator_range(begin, end)) {
2374  if (not isSubdirectory(dir, *me.data_.dirname))
2375  break;
2376 
2377  if (verbose_ > 1)
2378  std::cout << "DQMStore::save:"
2379  << " run: " << me.run()
2380  << " lumi: " << me.lumi()
2381  << " lumiFlag: " << me.getLumiFlag()
2382  << " moduleId: " << me.moduleId()
2383  << " fullpathname: " << me.getFullname()
2384  << " flags: " << std::hex << me.data_.flags
2385  << std::endl;
2386 
2387  // Skip MonitorElements in a subdirectory of the current one.
2388  if (dir != *me.data_.dirname) {
2389  if (verbose_ > 1) {
2390  std::cout << "DQMStore::save: skipping monitor element in a subfolder of " << dir << "/" << std::endl;
2391  }
2392  continue;
2393  }
2394 
2395  // Handle reference histograms, with three distinct cases:
2396  // 1) Skip all references entirely on saving.
2397  // 2) Blanket saving of all references.
2398  // 3) Save only references for monitor elements with qtests.
2399  // The latter two are affected by "path" sub-tree selection,
2400  // i.e. references are saved only in the selected tree part.
2401  if (isSubdirectory(refpath, *me.data_.dirname)) {
2402  if (ref == SaveWithoutReference)
2403  // Skip the reference entirely.
2404  continue;
2405  else if (ref == SaveWithReference)
2406  // Save all references regardless of qtests.
2407  ;
2408  else if (ref == SaveWithReferenceForQTest) {
2409  // Save only references for monitor elements with qtests
2410  // with an optional cut on minimum quality test result.
2411  int status = -1;
2412  std::string mname(me.getFullname(), s_referenceDirName.size()+1, std::string::npos);
2413  MonitorElement* master = get(mname);
2414  if (master)
2415  for (auto const& qreport : master->data_.qreports)
2416  status = std::max(status, qreport.code);
2417 
2418  if (not master or status < minStatus) {
2419  if (verbose_ > 1)
2420  std::cout << "DQMStore::save: skipping monitor element '"
2421  << me.data_.objname << "' while saving, status is "
2422  << status << ", required minimum status is "
2423  << minStatus << std::endl;
2424  continue;
2425  }
2426  }
2427  }
2428 
2429  if (verbose_ > 1) {
2430  std::cout << "DQMStore::save: saving monitor element" << std::endl;
2431  }
2432 
2434 
2435  // Count saved histograms
2436  ++counter;
2437  }
2438 }
Master< F > master(const F &f)
Definition: FunctClone.h:68
void saveMonitorElementToROOT(MonitorElement const &me, TFile &file)
Definition: DQMStore.cc:2334
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:630
#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 2554 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().

2556 {
2557  // Save the object.
2558  TBufferFile buffer(TBufferFile::kWrite);
2559  if (me.kind() < MonitorElement::DQM_KIND_TH1F) {
2560  TObjString object(me.tagString().c_str());
2561  buffer.WriteObject(&object);
2562  } else {
2563  buffer.WriteObject(me.object_);
2564  }
2566  histo.set_full_pathname(*me.data_.dirname + '/' + me.data_.objname);
2567  histo.set_flags(me.data_.flags);
2568  histo.set_size(buffer.Length());
2569  histo.set_streamed_histo((void const*)buffer.Buffer(), buffer.Length());
2570 
2571  // Save quality reports if this is not in reference section.
2572  // XXX not supported by protobuf files.
2573 
2574  // Save efficiency tag, if any.
2575  // XXX not supported by protobuf files.
2576 
2577  // Save tag if any.
2578  // XXX not supported by protobuf files.
2579 }
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 2334 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, MonitorElement::kind(), MonitorElement::object_, DQMNet::CoreObject::qreports, MonitorElement::qualityTagString(), edmIntegrityCheck::report, MonitorElement::tagLabelString(), and MonitorElement::tagString().

Referenced by saveMonitorElementRangeToROOT().

2336 {
2337  // Save the object.
2338  if (me.kind() < MonitorElement::DQM_KIND_TH1F) {
2339  TObjString(me.tagString().c_str()).Write();
2340  } else {
2341  me.object_->Write();
2342  }
2343 
2344  // Save quality reports if this is not in reference section.
2345  if (not isSubdirectory(s_referenceDirName, *me.data_.dirname)) {
2346  for (auto const& report: me.data_.qreports) {
2347  TObjString(me.qualityTagString(report).c_str()).Write();
2348  }
2349  }
2350 
2351  // Save efficiency tag, if any.
2352  if (me.data_.flags & DQMNet::DQM_PROP_EFFICIENCY_PLOT) {
2353  TObjString(me.effLabelString().c_str()).Write();
2354  }
2355 
2356  // Save tag if any.
2357  if (me.data_.flags & DQMNet::DQM_PROP_TAGGED) {
2358  TObjString(me.tagLabelString().c_str()).Write();
2359  }
2360 }
static const uint32_t DQM_PROP_TAGGED
Definition: DQMNet.h:55
static const uint32_t DQM_PROP_EFFICIENCY_PLOT
Definition: DQMNet.h:64
void DQMStore::savePB ( std::string const &  filename,
std::string const &  path = "",
uint32_t  run = 0,
uint32_t  lumi = 0 
)

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

Definition at line 2628 of file DQMStore.cc.

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

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

2632 {
2633  using google::protobuf::io::FileOutputStream;
2634  using google::protobuf::io::GzipOutputStream;
2635  using google::protobuf::io::StringOutputStream;
2636 
2637  std::lock_guard<std::mutex> guard(book_mutex_);
2638 
2639  unsigned int nme = 0;
2640 
2641  if (verbose_) {
2642  std::cout << "DQMStore::savePB: Opening PBFile '" << filename << "'"
2643  << std::endl;
2644  }
2645  dqmstorepb::ROOTFilePB dqmstore_message;
2646 
2647  // Loop over the directory structure.
2648  for (auto const& dir: dirs_) {
2649  // Check if we should process this directory. We process the
2650  // requested part of the object tree, including references.
2651  if (not path.empty()
2652  and not isSubdirectory(path, dir))
2653  continue;
2654 
2655  if (verbose_ > 1) {
2656  std::cout << "DQMStore::savePB: DQM folder " << dir << "/" << std::endl;
2657  }
2658 
2659  // Loop over monitor elements in this directory.
2660  if (not enableMultiThread_) {
2661  MonitorElement proto(&dir, std::string(), run, 0);
2662  auto begin = data_.lower_bound(proto);
2663  auto end = data_.end();
2664  saveMonitorElementRangeToPB(dir, run, begin, end, dqmstore_message, nme);
2665  } else {
2666  // Restrict the loop to the monitor elements for the current lumisection
2667  MonitorElement proto(&dir, std::string(), run, 0);
2668  proto.setLumi(lumi);
2669  auto begin = data_.lower_bound(proto);
2670  proto.setLumi(lumi+1);
2671  auto end = data_.lower_bound(proto);
2672  saveMonitorElementRangeToPB(dir, run, begin, end, dqmstore_message, nme);
2673  }
2674 
2675  // In LSbasedMode, loop also over the (run, 0) global histograms;
2676  // these could be the merged global histrograms of their per-stream
2677  // counterparts after the streamEndRun transition - but they are not
2678  // produced in LSbasedMode.
2679  if (enableMultiThread_ and LSbasedMode_ and lumi != 0) {
2680  auto begin = data_.lower_bound(MonitorElement(&dir, std::string(), run, 0));
2681  auto end = data_.lower_bound(MonitorElement(&dir, std::string(), run, 1));
2682  saveMonitorElementRangeToPB(dir, run, begin, end, dqmstore_message, nme);
2683  }
2684  }
2685 
2686  int filedescriptor = ::open(filename.c_str(),
2687  O_WRONLY | O_CREAT | O_TRUNC,
2688  S_IRUSR | S_IWUSR |
2689  S_IRGRP | S_IWGRP |
2690  S_IROTH);
2691  FileOutputStream file_stream(filedescriptor);
2693  options.format = GzipOutputStream::GZIP;
2694  options.compression_level = 1;
2695  GzipOutputStream gzip_stream(&file_stream, options);
2696  dqmstore_message.SerializeToZeroCopyStream(&gzip_stream);
2697 
2698  // Flush the internal streams before closing the fd.
2699  gzip_stream.Close();
2700  file_stream.Close();
2701  ::close(filedescriptor);
2702 
2703  // Maybe make some noise.
2704  if (verbose_) {
2705  std::cout << "DQMStore::savePB: successfully wrote " << nme
2706  << " objects from path '" << path << "/"
2707  << "' into DQM file '" << filename << "'\n";
2708  }
2709 }
std::mutex book_mutex_
Definition: DQMStore.h:651
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:2582
bool open(std::string const &filename, bool overwrite=false, std::string const &path="", std::string const &prepend="", OpenRunDirs stripdirs=KeepRunDirs, bool fileMustExist=true)
Definition: DQMStore.cc:2861
#define end
Definition: vmac.h:39
unsigned verbose_
Definition: DQMStore.h:630
MEMap data_
Definition: DQMStore.h:644
#define begin
Definition: vmac.h:32
dbl *** dir
Definition: mlp_gen.cc:35
std::set< std::string > dirs_
Definition: DQMStore.h:645
bool LSbasedMode_
Definition: DQMStore.h:636
bool enableMultiThread_
Definition: DQMStore.h:635
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 3325 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(), funct::m, scaleFlag_, and verbose_.

3326 {
3327  if (scaleFlag_ == 0.0) return;
3328  if (verbose_ > 0)
3329  std::cout << " =========== " << " ScaleFlag " << scaleFlag_ << std::endl;
3330  double factor = scaleFlag_;
3331  int events = 1;
3332  if (dirExists("Info/EventInfo")) {
3333  if ( scaleFlag_ == -1.0) {
3334  MonitorElement* scale_me = get("Info/EventInfo/ScaleFactor");
3335  if (scale_me && scale_me->kind()==MonitorElement::DQM_KIND_REAL) factor = scale_me->getFloatValue();
3336  }
3337  MonitorElement* event_me = get("Info/EventInfo/processedEvents");
3338  if (event_me && event_me->kind()==MonitorElement::DQM_KIND_INT) events = event_me->getIntValue();
3339  }
3340  factor = factor/(events*1.0);
3341 
3342  for (auto const& m : data_) {
3343  auto& me = const_cast<MonitorElement&>(m);
3344  switch (me.kind()) {
3346  {
3347  me.getTH1F()->Scale(factor);
3348  break;
3349  }
3351  {
3352  me.getTH1S()->Scale(factor);
3353  break;
3354  }
3356  {
3357  me.getTH1D()->Scale(factor);
3358  break;
3359  }
3361  {
3362  me.getTH2F()->Scale(factor);
3363  break;
3364  }
3366  {
3367  me.getTH2S()->Scale(factor);
3368  break;
3369  }
3371  {
3372  me.getTH2D()->Scale(factor);
3373  break;
3374  }
3376  {
3377  me.getTH3F()->Scale(factor);
3378  break;
3379  }
3381  {
3382  me.getTProfile()->Scale(factor);
3383  break;
3384  }
3386  {
3387  me.getTProfile2D()->Scale(factor);
3388  break;
3389  }
3390  default:
3391  if (verbose_ > 0)
3392  std::cout << " The DQM object '" << me.getFullname() << "' is not scalable object " << std::endl;
3393  continue;
3394  }
3395  }
3396 }
int64_t getIntValue() const
double getFloatValue() const
double scaleFlag_
Definition: DQMStore.h:633
bool dirExists(std::string const &path) const
true if directory exists
Definition: DQMStore.cc:629
unsigned verbose_
Definition: DQMStore.h:630
MEMap data_
Definition: DQMStore.h:644
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 3275 of file DQMStore.cc.

References MonitorElement::setAccumulate().

3276 {
3277  if (me)
3278  me->setAccumulate(flag);
3279 }
void setAccumulate(bool)
void DQMStore::setCurrentFolder ( std::string const &  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 565 of file DQMStore.cc.

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

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

566 {
568  std::string const* cleaned = nullptr;
569  cleanTrailingSlashes(fullpath, clean, cleaned);
570  makeDirectory(*cleaned);
571  pwd_ = *cleaned;
572 }
void makeDirectory(std::string const &path)
Definition: DQMStore.cc:589
std::string pwd_
Definition: DQMStore.h:643
std::vector< T * > clean
Definition: MVATrainer.cc:156
void DQMStore::setVerbose ( unsigned  level)
void DQMStore::showDirStructure ( ) const

Definition at line 3285 of file DQMStore.cc.

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

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

3286 {
3287  std::vector<std::string> contents;
3288  getContents(contents);
3289 
3290  std::cout << " ------------------------------------------------------------\n"
3291  << " Directory structure: \n"
3292  << " ------------------------------------------------------------\n";
3293 
3294  std::copy(contents.begin(), contents.end(),
3295  std::ostream_iterator<std::string>(std::cout, "\n"));
3296 
3297  std::cout << " ------------------------------------------------------------\n";
3298 }
std::vector< MonitorElement * > getContents(std::string const &path) const
Definition: DQMStore.cc:1628
def copy(args, dbName)
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 3258 of file DQMStore.cc.

References MonitorElement::softReset().

Referenced by ecaldqm::MESet::softReset().

3259 {
3260  if (me)
3261  me->softReset();
3262 }
void DQMStore::tag ( MonitorElement me,
unsigned int  myTag 
)

tag ME as <myTag> (myTag > 0)

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

1489 {
1490  if (! myTag)
1491  raiseDQMError("DQMStore", "Attempt to tag monitor element '%s'"
1492  " with a zero tag", me->getFullname().c_str());
1493  if ((me->data_.flags & DQMNet::DQM_PROP_TAGGED) && myTag != me->data_.tag)
1494  raiseDQMError("DQMStore", "Attempt to tag monitor element '%s'"
1495  " twice with multiple tags", me->getFullname().c_str());
1496 
1497  me->data_.tag = myTag;
1499 }
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 ( std::string const &  path,
unsigned int  myTag 
)

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

Definition at line 1503 of file DQMStore.cc.

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

1504 {
1505  std::string dir;
1506  std::string name;
1507  splitPath(dir, name, path);
1508 
1509  if (MonitorElement* me = findObject(0, 0, 0, dir, name))
1510  tag(me, myTag);
1511  else
1512  raiseDQMError("DQMStore", "Attempt to tag non-existent monitor element"
1513  " '%s' with tag %u", path.c_str(), myTag);
1514 
1515 }
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1488
dbl *** dir
Definition: mlp_gen.cc:35
MonitorElement * findObject(uint32_t run, uint32_t lumi, uint32_t moduleId, std::string const &dir, std::string const &name) const
Definition: DQMStore.cc:1727
void raiseDQMError(const char *context, const char *fmt,...)
Definition: DQMError.cc:11
void DQMStore::tagAllContents ( std::string const &  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 1531 of file DQMStore.cc.

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

1532 {
1534  std::string const* cleaned = nullptr;
1535  cleanTrailingSlashes(path, clean, cleaned);
1536  MonitorElement proto(cleaned, std::string());
1537 
1538  // FIXME: WILDCARDS? Old one supported them, but nobody seemed to use them.
1539  auto e = data_.end();
1540  auto i = data_.lower_bound(proto);
1541  while (i != e && isSubdirectory(*cleaned, *i->data_.dirname)) {
1542  tag(const_cast<MonitorElement*>(&*i), myTag);
1543  ++i;
1544  }
1545 }
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1488
std::vector< T * > clean
Definition: MVATrainer.cc:156
MEMap data_
Definition: DQMStore.h:644
void DQMStore::tagContents ( std::string const &  path,
unsigned int  myTag 
)

tag all children of folder (does NOT include subfolders)

Definition at line 1519 of file DQMStore.cc.

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

1520 {
1521  MonitorElement proto(&path, std::string());
1522  auto e = data_.end();
1523  auto i = data_.lower_bound(proto);
1524  for ( ; i != e && path == *i->data_.dirname; ++i)
1525  tag(const_cast<MonitorElement *>(&*i), myTag);
1526 }
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1488
MEMap data_
Definition: DQMStore.h:644
void DQMStore::useQTest ( std::string const &  dir,
std::string const &  qtname 
)

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

Definition at line 3162 of file DQMStore.cc.

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

3163 {
3164  // Clean the path
3166  std::string const* cleaned = nullptr;
3167  cleanTrailingSlashes(dir, clean, cleaned);
3168 
3169  // Validate the path.
3170  if (cleaned->find_first_not_of(s_safe) != std::string::npos)
3171  raiseDQMError("DQMStore", "Monitor element path name '%s'"
3172  " uses unacceptable characters", cleaned->c_str());
3173 
3174  // Redirect to the pattern match version.
3175  useQTestByMatch(*cleaned + "/*", qtname);
3176 }
std::vector< T * > clean
Definition: MVATrainer.cc:156
dbl *** dir
Definition: mlp_gen.cc:35
int useQTestByMatch(std::string const &pattern, std::string const &qtname)
attach quality test <qc> to monitor elements matching <pattern>.
Definition: DQMStore.cc:3180
void raiseDQMError(const char *context, const char *fmt,...)
Definition: DQMError.cc:11
int DQMStore::useQTestByMatch ( std::string const &  pattern,
std::string const &  qtname 
)

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

Definition at line 3180 of file DQMStore.cc.

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

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

3181 {
3182  QCriterion* qc = getQCriterion(qtname);
3183  if (! qc)
3184  raiseDQMError("DQMStore", "Cannot apply non-existent quality test '%s'",
3185  qtname.c_str());
3186 
3187  auto* fm = new fastmatch(pattern);
3188 
3189  // Record the test for future reference.
3190  QTestSpec qts(fm, qc);
3191  qtestspecs_.push_back(qts);
3192 
3193  // Apply the quality test.
3194  std::string path;
3195  int cases = 0;
3196  for (auto const& me : data_) {
3197  path.clear();
3198  mergePath(path, *me.data_.dirname, me.data_.objname);
3199  if (fm->match(path)) {
3200  ++cases;
3201  const_cast<MonitorElement &>(me).addQReport(qts.second);
3202  }
3203  }
3204 
3205  //return the number of matched cases
3206  return cases;
3207 }
std::pair< fastmatch *, QCriterion * > QTestSpec
Definition: DQMStore.h:603
QTestSpecs qtestspecs_
Definition: DQMStore.h:649
QCriterion * getQCriterion(std::string const &qtname) const
Definition: DQMStore.cc:3130
MEMap data_
Definition: DQMStore.h:644
void raiseDQMError(const char *context, const char *fmt,...)
Definition: DQMError.cc:11

Friends And Related Function Documentation

friend class DQMArchiver
friend

Definition at line 656 of file DQMStore.h.

friend class DQMFileSaver
friend

Definition at line 660 of file DQMStore.h.

friend class DQMNet
friend

Definition at line 655 of file DQMStore.h.

friend class DQMRootOutputModule
friend

Definition at line 658 of file DQMStore.h.

friend class DQMRootSource
friend

Definition at line 659 of file DQMStore.h.

friend class DQMService
friend

Definition at line 654 of file DQMStore.h.

friend class DQMStoreExample
friend

Definition at line 657 of file DQMStore.h.

friend class edm::DQMHttpSource
friend

Definition at line 653 of file DQMStore.h.

friend class MEtoEDMConverter
friend

Definition at line 661 of file DQMStore.h.

Member Data Documentation

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

Definition at line 645 of file DQMStore.h.

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

bool DQMStore::enableMultiThread_ {false}
private
bool DQMStore::forceResetOnBeginLumi_ {false}
private

Definition at line 637 of file DQMStore.h.

Referenced by DQMStore(), and forceReset().

bool DQMStore::LSbasedMode_
private
uint32_t DQMStore::moduleId_ {}
private

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

Referenced by createQTest(), and initializeFrom().

DQMStore::qtests_
private

All the quality tests.

Definition at line 647 of file DQMStore.h.

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

QTestSpecs DQMStore::qtestspecs_
private

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

DQMStore::reset_ {false}
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 632 of file DQMStore.h.

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

uint32_t DQMStore::run_ {}
private
double DQMStore::scaleFlag_
private

Definition at line 633 of file DQMStore.h.

Referenced by initializeFrom(), and scaleElements().

std::unique_ptr<std::ostream> DQMStore::stream_ {nullptr}
private

Definition at line 641 of file DQMStore.h.

Referenced by print_trace().

DQMStore::verbose_ {1}
private
DQMStore::verboseQT_ {1}
private

Verbose flag for xml-based QTests.

Definition at line 631 of file DQMStore.h.

Referenced by createQTest(), and initializeFrom().