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, bool canSaveByLumi)
 
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 canSaveByLumi_ {false}
 
bool collateHistograms_ {false}
 
MEMap data_
 
std::set< std::string > dirs_
 
bool doSaveByLumi_ {false}
 
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 607 of file DQMStore.h.

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

Definition at line 609 of file DQMStore.h.

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

Definition at line 608 of file DQMStore.h.

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

Definition at line 605 of file DQMStore.h.

Definition at line 606 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 #if !WITHOUT_CMS_FRAMEWORK
380  forceResetOnBeginLumi_ = true;
382 #endif
383  }
385 }
void postGlobalBeginLumi(const edm::GlobalContext &)
Definition: DQMStore.cc:1886
void watchPostGlobalBeginLumi(PostGlobalBeginLumi::slot_type const &iSlot)
void forceReset()
Definition: DQMStore.cc:1864
Preallocate preallocateSignal_
signal is emitted before beginJob
unsigned int maxNumberOfStreams() const
Definition: SystemBounds.h:35
void watchPostSourceRun(PostSourceRun::slot_type const &iSlot)
void watchPreSourceLumi(PreSourceLumi::slot_type const &iSlot)
bool forceResetOnBeginLumi_
Definition: DQMStore.h:639
void connect(U iFunc)
Definition: Signal.h:62
bool enableMultiThread_
Definition: DQMStore.h:637
DQMStore::DQMStore ( edm::ParameterSet const &  pset)

Definition at line 387 of file DQMStore.cc.

References initializeFrom().

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

Definition at line 392 of file DQMStore.cc.

References qtests_, and qtestspecs_.

Referenced by meBookerGetter().

393 {
394  for (auto& qtest : qtests_)
395  delete qtest.second;
396 
397  for (auto& qtestspec : qtestspecs_)
398  delete qtestspec.first;
399 }
QCMap qtests_
Definition: DQMStore.h:653
QTestSpecs qtestspecs_
Definition: DQMStore.h:655
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 1130 of file DQMStore.cc.

References book1D_(), and pwd_.

1131 {
1132  return book1D_(pwd_, name, static_cast<TH1F*>(source->Clone(name)));
1133 }
MonitorElement * book1D_(std::string const &dir, std::string const &name, TH1F *h)
Book 1D histogram based on TH1F.
Definition: DQMStore.cc:1077
std::string pwd_
Definition: DQMStore.h:649
static std::string const source
Definition: EdmProvDump.cc:47
MonitorElement * DQMStore::book1D_ ( std::string const &  dir,
std::string const &  name,
TH1F *  h 
)
private

Book 1D histogram based on TH1F.

Definition at line 1077 of file DQMStore.cc.

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

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

1078 {
1079  return book_(dir, name, "book1D", MonitorElement::DQM_KIND_TH1F, h, collate1D);
1080 }
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:980
static void collate1D(MonitorElement *me, TH1F *h, unsigned verbose)
Definition: DQMStore.cc:1429
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 1114 of file DQMStore.cc.

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

Referenced by MEtoMEComparitor::book().

1116 {
1117  return book1DD_(pwd_, name, new TH1D(name, title, nchX, lowX, highX));
1118 }
MonitorElement * book1DD_(std::string const &dir, std::string const &name, TH1D *h)
Book 1D histogram based on TH1D.
Definition: DQMStore.cc:1091
std::string pwd_
Definition: DQMStore.h:649
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 1144 of file DQMStore.cc.

References book1DD_(), and pwd_.

1145 {
1146  return book1DD_(pwd_, name, static_cast<TH1D*>(source->Clone(name)));
1147 }
MonitorElement * book1DD_(std::string const &dir, std::string const &name, TH1D *h)
Book 1D histogram based on TH1D.
Definition: DQMStore.cc:1091
std::string pwd_
Definition: DQMStore.h:649
static std::string const source
Definition: EdmProvDump.cc:47
MonitorElement * DQMStore::book1DD_ ( std::string const &  dir,
std::string const &  name,
TH1D *  h 
)
private

Book 1D histogram based on TH1D.

Definition at line 1091 of file DQMStore.cc.

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

Referenced by book1DD(), and extract().

1092 {
1093  return book_(dir, name, "book1DD", MonitorElement::DQM_KIND_TH1D, h, collate1DD);
1094 }
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:980
static void collate1DD(MonitorElement *me, TH1D *h, unsigned verbose)
Definition: DQMStore.cc:1443
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 1106 of file DQMStore.cc.

References book1S_(), and pwd_.

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

1108 {
1109  return book1S_(pwd_, name, new TH1S(name, title, nchX, lowX, highX));
1110 }
std::string pwd_
Definition: DQMStore.h:649
MonitorElement * book1S_(std::string const &dir, std::string const &name, TH1S *h)
Book 1D histogram based on TH1S.
Definition: DQMStore.cc:1084
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 1137 of file DQMStore.cc.

References book1S_(), and pwd_.

1138 {
1139  return book1S_(pwd_, name, static_cast<TH1S*>(source->Clone(name)));
1140 }
std::string pwd_
Definition: DQMStore.h:649
MonitorElement * book1S_(std::string const &dir, std::string const &name, TH1S *h)
Book 1D histogram based on TH1S.
Definition: DQMStore.cc:1084
static std::string const source
Definition: EdmProvDump.cc:47
MonitorElement * DQMStore::book1S_ ( std::string const &  dir,
std::string const &  name,
TH1S *  h 
)
private

Book 1D histogram based on TH1S.

Definition at line 1084 of file DQMStore.cc.

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

Referenced by book1S(), and extract().

1085 {
1086  return book_(dir, name, "book1S", MonitorElement::DQM_KIND_TH1S, h, collate1S);
1087 }
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:980
static void collate1S(MonitorElement *me, TH1S *h, unsigned verbose)
Definition: DQMStore.cc:1436
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 1224 of file DQMStore.cc.

References book2D_(), and pwd_.

1225 {
1226  return book2D_(pwd_, name, static_cast<TH2F*>(source->Clone(name)));
1227 }
MonitorElement * book2D_(std::string const &dir, std::string const &name, TH2F *h)
Book 2D histogram based on TH2F.
Definition: DQMStore.cc:1152
std::string pwd_
Definition: DQMStore.h:649
static std::string const source
Definition: EdmProvDump.cc:47
MonitorElement * DQMStore::book2D_ ( std::string const &  dir,
std::string const &  name,
TH2F *  h 
)
private

Book 2D histogram based on TH2F.

Definition at line 1152 of file DQMStore.cc.

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

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

1153 {
1154  return book_(dir, name, "book2D", MonitorElement::DQM_KIND_TH2F, h, collate2D);
1155 }
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:980
dbl *** dir
Definition: mlp_gen.cc:35
static void collate2D(MonitorElement *me, TH2F *h, unsigned verbose)
Definition: DQMStore.cc:1450
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 1195 of file DQMStore.cc.

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

1198 {
1199  return book2DD_(pwd_, name, new TH2D(name, title,
1200  nchX, lowX, highX,
1201  nchY, lowY, highY));
1202 }
MonitorElement * book2DD_(std::string const &dir, std::string const &name, TH2D *h)
Book 2D histogram based on TH2D.
Definition: DQMStore.cc:1166
std::string pwd_
Definition: DQMStore.h:649
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 1238 of file DQMStore.cc.

References book2DD_(), and pwd_.

1239 {
1240  return book2DD_(pwd_, name, static_cast<TH2D*>(source->Clone(name)));
1241 }
MonitorElement * book2DD_(std::string const &dir, std::string const &name, TH2D *h)
Book 2D histogram based on TH2D.
Definition: DQMStore.cc:1166
std::string pwd_
Definition: DQMStore.h:649
static std::string const source
Definition: EdmProvDump.cc:47
MonitorElement * DQMStore::book2DD_ ( std::string const &  dir,
std::string const &  name,
TH2D *  h 
)
private

Book 2D histogram based on TH2D.

Definition at line 1166 of file DQMStore.cc.

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

Referenced by book2DD(), and extract().

1167 {
1168  return book_(dir, name, "book2DD", MonitorElement::DQM_KIND_TH2D, h, collate2DD);
1169 }
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:980
static void collate2DD(MonitorElement *me, TH2D *h, unsigned verbose)
Definition: DQMStore.cc:1464
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 1184 of file DQMStore.cc.

References book2S_(), and pwd_.

Referenced by book2DD(), and dqmRegisterHistogram().

1187 {
1188  return book2S_(pwd_, name, new TH2S(name, title,
1189  nchX, lowX, highX,
1190  nchY, lowY, highY));
1191 }
std::string pwd_
Definition: DQMStore.h:649
MonitorElement * book2S_(std::string const &dir, std::string const &name, TH2S *h)
Book 2D histogram based on TH2S.
Definition: DQMStore.cc:1159
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 1231 of file DQMStore.cc.

References book2S_(), and pwd_.

1232 {
1233  return book2S_(pwd_, name, static_cast<TH2S*>(source->Clone(name)));
1234 }
std::string pwd_
Definition: DQMStore.h:649
MonitorElement * book2S_(std::string const &dir, std::string const &name, TH2S *h)
Book 2D histogram based on TH2S.
Definition: DQMStore.cc:1159
static std::string const source
Definition: EdmProvDump.cc:47
MonitorElement * DQMStore::book2S_ ( std::string const &  dir,
std::string const &  name,
TH2S *  h 
)
private

Book 2D histogram based on TH2S.

Definition at line 1159 of file DQMStore.cc.

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

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

1160 {
1161  return book_(dir, name, "book2S", MonitorElement::DQM_KIND_TH2S, h, collate2S);
1162 }
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:980
dbl *** dir
Definition: mlp_gen.cc:35
static void collate2S(MonitorElement *me, TH2S *h, unsigned verbose)
Definition: DQMStore.cc:1457
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 1253 of file DQMStore.cc.

References book3D_(), and pwd_.

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

1257 {
1258  return book3D_(pwd_, name, new TH3F(name, title,
1259  nchX, lowX, highX,
1260  nchY, lowY, highY,
1261  nchZ, lowZ, highZ));
1262 }
MonitorElement * book3D_(std::string const &dir, std::string const &name, TH3F *h)
Book 3D histogram based on TH3F.
Definition: DQMStore.cc:1246
std::string pwd_
Definition: DQMStore.h:649
MonitorElement * DQMStore::book3D ( char_string const &  name,
TH3F *  h 
)

Book 3D histogram by cloning an existing histogram.

Definition at line 1266 of file DQMStore.cc.

References book3D_(), and pwd_.

1267 {
1268  return book3D_(pwd_, name, static_cast<TH3F*>(source->Clone(name)));
1269 }
MonitorElement * book3D_(std::string const &dir, std::string const &name, TH3F *h)
Book 3D histogram based on TH3F.
Definition: DQMStore.cc:1246
std::string pwd_
Definition: DQMStore.h:649
static std::string const source
Definition: EdmProvDump.cc:47
MonitorElement * DQMStore::book3D_ ( std::string const &  dir,
std::string const &  name,
TH3F *  h 
)
private

Book 3D histogram based on TH3F.

Definition at line 1246 of file DQMStore.cc.

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

Referenced by book3D(), and extract().

1247 {
1248  return book_(dir, name, "book3D", MonitorElement::DQM_KIND_TH3F, h, collate3D);
1249 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
static void collate3D(MonitorElement *me, TH3F *h, unsigned verbose)
Definition: DQMStore.cc:1471
MonitorElement * book_(std::string const &dir, std::string const &name, char const *context)
Definition: DQMStore.cc:980
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 980 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_().

983 {
984  assert(name.find('/') == std::string::npos);
985  if (verbose_ > 3)
986  print_trace(dir, name);
987 
988  // Check if the request monitor element already exists.
989  if (MonitorElement* me = findObject(run_, 0, moduleId_, dir, name)) {
990  if (verbose_ > 1) {
992  mergePath(path, dir, name);
993 
994  std::cout << "DQMStore: "
995  << context << ": monitor element '"
996  << path << "' already exists, resetting" << std::endl;
997  }
998  me->Reset();
999  return me;
1000  }
1001  else {
1002  // Create it and return for initialisation.
1003  assert(dirs_.count(dir));
1004  MonitorElement proto(&*dirs_.find(dir), name, run_, moduleId_);
1005  // this is used only for Int/String/Float. We don't save these by lumi by
1006  // default, since we can't merge them properly.
1007  return &const_cast<MonitorElement&>(*data_.insert(std::move(proto)).first);
1008  }
1009 }
uint32_t moduleId_
Definition: DQMStore.h:642
void print_trace(std::string const &dir, std::string const &name)
Definition: DQMStore.cc:468
uint32_t run_
Definition: DQMStore.h:641
unsigned verbose_
Definition: DQMStore.h:632
MEMap data_
Definition: DQMStore.h:650
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:1739
std::set< std::string > dirs_
Definition: DQMStore.h:651
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 904 of file DQMStore.cc.

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

910 {
911  assert(name.find('/') == std::string::npos);
912  if (verbose_ > 3)
913  print_trace(dir, name);
915  mergePath(path, dir, name);
916 
917  // Put us in charge of h.
918  h->SetDirectory(nullptr);
919 
920  // Check if the request monitor element already exists.
922  if (me) {
923  if (collateHistograms_) {
924  collate(me, h, verbose_);
925  delete h;
926  return me;
927  }
928  else {
929  if (verbose_ > 1)
930  std::cout << "DQMStore: "
931  << context << ": monitor element '"
932  << path << "' already exists, collating" << std::endl;
933  me->Reset();
934  collate(me, h, verbose_);
935  delete h;
936  return me;
937  }
938  }
939  else {
940  // Create and initialise core object.
941  assert(dirs_.count(dir));
942  MonitorElement proto(&*dirs_.find(dir), name, run_, moduleId_);
943  if (doSaveByLumi_ && canSaveByLumi_) {
944  // for legacy (not DQMEDAnalyzer) this is not save.
945  proto.setLumiFlag(); // default to per-lumi mode for all non-legacy MEs.
946  }
947  me = const_cast<MonitorElement&>(*data_.insert(std::move(proto)).first)
949 
950  // Initialise quality test information.
951  for (auto const& q : qtestspecs_) {
952  if (q.first->match(path))
953  me->addQReport(q.second);
954  }
955 
956  // If we just booked a (plain) MonitorElement, and there is a reference
957  // MonitorElement with the same name, link the two together.
958  // The other direction is handled by the extract method.
959  std::string refdir;
960  refdir.reserve(s_referenceDirName.size() + dir.size() + 1);
961  refdir += s_referenceDirName;
962  refdir += '/';
963  refdir += dir;
964  MonitorElement* referenceME = findObject(0, 0, 0, refdir, name);
965  if (referenceME) {
966  // We have booked a new MonitorElement with a specific dir and name.
967  // Then, if we can find the corresponding MonitorElement in the reference
968  // dir we assign the object_ of the reference MonitorElement to the
969  // reference_ property of our new MonitorElement.
971  me->reference_ = referenceME->object_;
972  }
973 
974  // Return the monitor element.
975  return me;
976  }
977 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
uint32_t flags
Definition: DQMNet.h:99
uint32_t moduleId_
Definition: DQMStore.h:642
static const uint32_t DQM_PROP_HAS_REFERENCE
Definition: DQMNet.h:54
QTestSpecs qtestspecs_
Definition: DQMStore.h:655
void print_trace(std::string const &dir, std::string const &name)
Definition: DQMStore.cc:468
void setLumiFlag()
this ME is meant to be stored for each luminosity section
bool doSaveByLumi_
Definition: DQMStore.h:646
uint32_t run_
Definition: DQMStore.h:641
void Reset()
reset ME (ie. contents, errors, etc)
DQMNet::CoreObject data_
unsigned verbose_
Definition: DQMStore.h:632
MEMap data_
Definition: DQMStore.h:650
bool canSaveByLumi_
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:1739
MonitorElement * initialise(MonitorElement *me, std::string const &path)
std::set< std::string > dirs_
Definition: DQMStore.h:651
bool collateHistograms_
Definition: DQMStore.h:636
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 266 of file DQMStore.h.

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

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

Book float.

Definition at line 1035 of file DQMStore.cc.

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

Referenced by bookFloat(), and extract().

1036 {
1037  if (collateHistograms_) {
1038  if (MonitorElement* me = findObject(run_, 0, moduleId_, dir, name)) {
1039  me->Fill(0.);
1040  return me;
1041  }
1042  }
1043  return book_(dir, name, "bookFloat")->initialise(MonitorElement::DQM_KIND_REAL);
1044 }
MonitorElement * initialise(Kind kind)
MonitorElement * book_(std::string const &dir, std::string const &name, char const *context)
Definition: DQMStore.cc:980
uint32_t moduleId_
Definition: DQMStore.h:642
uint32_t run_
Definition: DQMStore.h:641
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:1739
bool collateHistograms_
Definition: DQMStore.h:636
MonitorElement * DQMStore::bookInt ( char_string const &  name)

Book int.

Definition at line 1027 of file DQMStore.cc.

References bookInt_(), and pwd_.

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

1028 {
1029  return bookInt_(pwd_, name);
1030 }
std::string pwd_
Definition: DQMStore.h:649
MonitorElement * bookInt_(std::string const &dir, std::string const &name)
Book int.
Definition: DQMStore.cc:1014
MonitorElement * DQMStore::bookInt_ ( std::string const &  dir,
std::string const &  name 
)
private

Book int.

Definition at line 1014 of file DQMStore.cc.

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

Referenced by bookInt(), and extract().

1015 {
1016  if (collateHistograms_) {
1017  if (MonitorElement* me = findObject(run_, 0, moduleId_, dir, name)) {
1018  me->Fill(0);
1019  return me;
1020  }
1021  }
1022  return book_(dir, name, "bookInt")->initialise(MonitorElement::DQM_KIND_INT);
1023 }
MonitorElement * initialise(Kind kind)
MonitorElement * book_(std::string const &dir, std::string const &name, char const *context)
Definition: DQMStore.cc:980
uint32_t moduleId_
Definition: DQMStore.h:642
uint32_t run_
Definition: DQMStore.h:641
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:1739
bool collateHistograms_
Definition: DQMStore.h:636
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 1285 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().

1289 {
1290  return bookProfile_(pwd_, name, new TProfile(name, title,
1291  nchX, lowX, highX,
1292  lowY, highY,
1293  option));
1294 }
MonitorElement * bookProfile_(std::string const &dir, std::string const &name, TProfile *h)
Book profile histogram based on TProfile.
Definition: DQMStore.cc:1274
std::string pwd_
Definition: DQMStore.h:649
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 1300 of file DQMStore.cc.

References bookProfile_(), and pwd_.

1304 {
1305  return bookProfile_(pwd_, name, new TProfile(name, title,
1306  nchX, lowX, highX,
1307  lowY, highY,
1308  option));
1309 }
MonitorElement * bookProfile_(std::string const &dir, std::string const &name, TProfile *h)
Book profile histogram based on TProfile.
Definition: DQMStore.cc:1274
std::string pwd_
Definition: DQMStore.h:649
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 1315 of file DQMStore.cc.

References bookProfile_(), and pwd_.

1319 {
1320  return bookProfile_(pwd_, name, new TProfile(name, title,
1321  nchX, xbinsize,
1322  lowY, highY,
1323  option));
1324 }
MonitorElement * bookProfile_(std::string const &dir, std::string const &name, TProfile *h)
Book profile histogram based on TProfile.
Definition: DQMStore.cc:1274
std::string pwd_
Definition: DQMStore.h:649
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 1330 of file DQMStore.cc.

References bookProfile_(), and pwd_.

1334 {
1335  return bookProfile_(pwd_, name, new TProfile(name, title,
1336  nchX, xbinsize,
1337  lowY, highY,
1338  option));
1339 }
MonitorElement * bookProfile_(std::string const &dir, std::string const &name, TProfile *h)
Book profile histogram based on TProfile.
Definition: DQMStore.cc:1274
std::string pwd_
Definition: DQMStore.h:649
MonitorElement * DQMStore::bookProfile ( char_string const &  name,
TProfile *  h 
)

Book TProfile by cloning an existing profile.

Definition at line 1343 of file DQMStore.cc.

References bookProfile_(), and pwd_.

1344 {
1345  return bookProfile_(pwd_, name, static_cast<TProfile*>(source->Clone(name)));
1346 }
MonitorElement * bookProfile_(std::string const &dir, std::string const &name, TProfile *h)
Book profile histogram based on TProfile.
Definition: DQMStore.cc:1274
std::string pwd_
Definition: DQMStore.h:649
static std::string const source
Definition: EdmProvDump.cc:47
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 1379 of file DQMStore.cc.

References bookProfile2D_(), and pwd_.

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

1384 {
1385  return bookProfile2D_(pwd_, name, new TProfile2D(name, title,
1386  nchX, lowX, highX,
1387  nchY, lowY, highY,
1388  lowZ, highZ,
1389  option));
1390 }
MonitorElement * bookProfile2D_(std::string const &dir, std::string const &name, TProfile2D *h)
Book 2D profile histogram based on TProfile2D.
Definition: DQMStore.cc:1351
std::string pwd_
Definition: DQMStore.h:649
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 1362 of file DQMStore.cc.

References bookProfile2D_(), and pwd_.

1367 {
1368  return bookProfile2D_(pwd_, name, new TProfile2D(name, title,
1369  nchX, lowX, highX,
1370  nchY, lowY, highY,
1371  lowZ, highZ,
1372  option));
1373 }
MonitorElement * bookProfile2D_(std::string const &dir, std::string const &name, TProfile2D *h)
Book 2D profile histogram based on TProfile2D.
Definition: DQMStore.cc:1351
std::string pwd_
Definition: DQMStore.h:649
MonitorElement * DQMStore::bookProfile2D ( char_string const &  name,
TProfile2D *  h 
)

Book TProfile2D by cloning an existing profile.

Definition at line 1394 of file DQMStore.cc.

References bookProfile2D_(), and pwd_.

1395 {
1396  return bookProfile2D_(pwd_, name, static_cast<TProfile2D*>(source->Clone(name)));
1397 }
MonitorElement * bookProfile2D_(std::string const &dir, std::string const &name, TProfile2D *h)
Book 2D profile histogram based on TProfile2D.
Definition: DQMStore.cc:1351
std::string pwd_
Definition: DQMStore.h:649
static std::string const source
Definition: EdmProvDump.cc:47
MonitorElement * DQMStore::bookProfile2D_ ( std::string const &  dir,
std::string const &  name,
TProfile2D *  h 
)
private

Book 2D profile histogram based on TProfile2D.

Definition at line 1351 of file DQMStore.cc.

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

Referenced by bookProfile2D(), and extract().

1352 {
1353  return book_(dir, name, "bookProfile2D",
1355  h, collateProfile2D);
1356 }
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:980
static void collateProfile2D(MonitorElement *me, TProfile2D *h, unsigned verbose)
Definition: DQMStore.cc:1487
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 1274 of file DQMStore.cc.

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

Referenced by bookProfile(), and extract().

1275 {
1276  return book_(dir, name, "bookProfile",
1278  h, collateProfile);
1279 }
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:980
static void collateProfile(MonitorElement *me, TProfile *h, unsigned verbose)
Definition: DQMStore.cc:1478
dbl *** dir
Definition: mlp_gen.cc:35
MonitorElement * DQMStore::bookString ( char_string const &  name,
char_string const &  value 
)

Book string.

Definition at line 1069 of file DQMStore.cc.

References bookString_(), and pwd_.

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

1070 {
1071  return bookString_(pwd_, name, value);
1072 }
MonitorElement * bookString_(std::string const &dir, std::string const &name, std::string const &value)
Book string.
Definition: DQMStore.cc:1056
Definition: value.py:1
std::string pwd_
Definition: DQMStore.h:649
MonitorElement * DQMStore::bookString_ ( std::string const &  dir,
std::string const &  name,
std::string const &  value 
)
private

Book string.

Definition at line 1056 of file DQMStore.cc.

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

Referenced by bookString(), and extract().

1059 {
1060  if (collateHistograms_) {
1061  if (MonitorElement* me = findObject(run_, 0, moduleId_, dir, name))
1062  return me;
1063  }
1064  return book_(dir, name, "bookString")->initialise(MonitorElement::DQM_KIND_STRING, value);
1065 }
MonitorElement * initialise(Kind kind)
MonitorElement * book_(std::string const &dir, std::string const &name, char const *context)
Definition: DQMStore.cc:980
uint32_t moduleId_
Definition: DQMStore.h:642
uint32_t run_
Definition: DQMStore.h:641
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:1739
bool collateHistograms_
Definition: DQMStore.h:636
template<typename iFunc >
void DQMStore::bookTransaction ( iFunc  f,
uint32_t  run,
uint32_t  moduleId,
bool  canSaveByLumi 
)
inline

Definition at line 243 of file DQMStore.h.

References book_mutex_, canSaveByLumi_, enableMultiThread_, f, moduleId_, writedatasetfile::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  canSaveByLumi_ = canSaveByLumi;
251  }
252  IBooker booker{this};
253  f(booker);
254 
255  /* Reset the run number and module id only if multithreading is enabled */
256  if (enableMultiThread_) {
257  run_ = 0;
258  moduleId_ = 0;
259  canSaveByLumi_ = false;
260  }
261  }
uint32_t moduleId_
Definition: DQMStore.h:642
std::mutex book_mutex_
Definition: DQMStore.h:657
double f[11][100]
uint32_t run_
Definition: DQMStore.h:641
bool canSaveByLumi_
Definition: DQMStore.h:644
bool enableMultiThread_
Definition: DQMStore.h:637
void DQMStore::cd ( )

go to top directory (ie. root)

Definition at line 546 of file DQMStore.cc.

References setCurrentFolder().

Referenced by SiStripDcsInfo::addBadModules(), DQMFileReader::beginJob(), SiStripCertificationInfo::bookSiStripCertificationMEs(), SiStripQualityChecker::bookStatus(), SiStripDcsInfo::bookStatus(), SiStripDaqInfo::bookStatus(), SiStripTrackerMapCreator::createForOffline(), SiStripTrackerMapCreator::createInfoFile(), SiStripSummaryCreator::createSummary(), SiStripActionExecutor::createSummary(), SiStripActionExecutor::createSummaryOffline(), APVValidationPlots::endJob(), StripValidationPlots::endJob(), 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(), SiStripActionExecutor::printFaultyModuleList(), readFilePB(), DQMFileSaver::saveForOffline(), DQMFileSaver::saveForOnline(), SiStripTrackerMapCreator::setTkMapFromHistogram(), and dqm_interfaces.DirWalkerFile::walk().

547 {
548  setCurrentFolder("");
549 }
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:571
void DQMStore::cd ( std::string const &  subdir)

cd to subdirectory (if there)

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

554 {
556  std::string const* cleaned = nullptr;
557  cleanTrailingSlashes(subdir, clean, cleaned);
558 
559  if (! dirExists(*cleaned))
560  raiseDQMError("DQMStore", "Cannot 'cd' into non-existent directory '%s'",
561  cleaned->c_str());
562 
563  setCurrentFolder(*cleaned);
564 }
bool dirExists(std::string const &path) const
true if directory exists
Definition: DQMStore.cc:635
std::vector< T * > clean
Definition: MVATrainer.cc:154
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:571
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 2314 of file DQMStore.cc.

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

Referenced by save().

2315 {
2316  assert(! path.empty());
2317 
2318  // Find the first path component.
2319  size_t start = 0;
2320  size_t end = path.find('/', start);
2321  if (end == std::string::npos)
2322  end = path.size();
2323 
2324  while (true) {
2325  // Check if this subdirectory component exists. If yes, make sure
2326  // it is actually a subdirectory. Otherwise create or cd into it.
2327  std::string part(path, start, end-start);
2328  TObject* o = gDirectory->Get(part.c_str());
2329  if (o && ! dynamic_cast<TDirectory*>(o))
2330  raiseDQMError("DQMStore", "Attempt to create directory '%s' in a file"
2331  " fails because the part '%s' already exists and is not"
2332  " directory", path.c_str(), part.c_str());
2333  else if (! o)
2334  gDirectory->mkdir(part.c_str());
2335 
2336  if (! gDirectory->cd(part.c_str()))
2337  raiseDQMError("DQMStore", "Attempt to create directory '%s' in a file"
2338  " fails because could not cd into subdirectory '%s'",
2339  path.c_str(), part.c_str());
2340 
2341  // Stop if we reached the end, ignoring any trailing '/'.
2342  if (end+1 >= path.size())
2343  break;
2344 
2345  // Find the next path component.
2346  start = end+1;
2347  end = path.find('/', start);
2348  if (end == std::string::npos)
2349  end = path.size();
2350  }
2351 
2352  return true;
2353 }
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 1403 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().

1404 {
1405  if (me->getTH1()->GetNbinsX() != h->GetNbinsX()
1406  || me->getTH1()->GetNbinsY() != h->GetNbinsY()
1407  || me->getTH1()->GetNbinsZ() != h->GetNbinsZ()
1408  || me->getTH1()->GetXaxis()->GetXmin() != h->GetXaxis()->GetXmin()
1409  || me->getTH1()->GetYaxis()->GetXmin() != h->GetYaxis()->GetXmin()
1410  || me->getTH1()->GetZaxis()->GetXmin() != h->GetZaxis()->GetXmin()
1411  || me->getTH1()->GetXaxis()->GetXmax() != h->GetXaxis()->GetXmax()
1412  || me->getTH1()->GetYaxis()->GetXmax() != h->GetYaxis()->GetXmax()
1413  || me->getTH1()->GetZaxis()->GetXmax() != h->GetZaxis()->GetXmax()
1414  || !MonitorElement::CheckBinLabels((TAxis*)me->getTH1()->GetXaxis(),(TAxis*)h->GetXaxis())
1415  || !MonitorElement::CheckBinLabels((TAxis*)me->getTH1()->GetYaxis(),(TAxis*)h->GetYaxis())
1416  || !MonitorElement::CheckBinLabels((TAxis*)me->getTH1()->GetZaxis(),(TAxis*)h->GetZaxis())) {
1417  if(verbose > 0)
1418  std::cout << "*** DQMStore: WARNING:"
1419  << "checkBinningMatches: different binning - cannot add object '"
1420  << h->GetName() << "' of type "
1421  << h->IsA()->GetName() << " to existing ME: '"
1422  << me->getFullname() << "'\n";
1423  return false;
1424  }
1425  return true;
1426 }
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 1920 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_.

1921 {
1922  if (verbose_ > 1) {
1923  std::cout << "DQMStore::cloneLumiHistograms - Preparing lumi histograms for run: "
1924  << run << ", lumi: " << lumi << ", module: " << moduleId << std::endl;
1925  }
1926 
1927  // acquire the global lock since this accesses the undelying data structure
1928  std::lock_guard<std::mutex> guard(book_mutex_);
1929 
1930  // MEs are sorted by (run, lumi, stream id, module id, directory, name)
1931  // lumi deafults to 0
1932  // stream id is always 0
1933  std::string null_str("");
1934  auto i = data_.lower_bound(MonitorElement(&null_str, null_str, run, moduleId));
1935  auto e = data_.lower_bound(MonitorElement(&null_str, null_str, run, moduleId + 1));
1936  // we will later modify data_, so better do two passes.
1937  auto tobehandled = std::vector<MonitorElement const*>();
1938  for (; i != e; ++i) {
1939  tobehandled.push_back(&*i);
1940  }
1941  for (auto i : tobehandled) {
1942  // handle only lumisection-based histograms
1943  if (not LSbasedMode_ and not i->getLumiFlag())
1944  continue;
1945 
1946  // clone the lumisection-based histograms
1948  clone.globalize();
1949  clone.setLumi(lumi);
1950  clone.markToDelete();
1951  data_.insert(std::move(clone));
1952 
1953  // reset the ME for the next lumisection
1954  const_cast<MonitorElement*>(&*i)->Reset();
1955  }
1956 }
std::mutex book_mutex_
Definition: DQMStore.h:657
unsigned verbose_
Definition: DQMStore.h:632
MEMap data_
Definition: DQMStore.h:650
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
void Reset(std::vector< TH2F > &depth)
bool LSbasedMode_
Definition: DQMStore.h:638
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 1962 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_.

1963 {
1964  if (verbose_ > 1) {
1965  std::cout << "DQMStore::cloneRunHistograms - Preparing run histograms for run: "
1966  << run << ", module: " << moduleId << std::endl;
1967  }
1968 
1969  // acquire the global lock since this accesses the undelying data structure
1970  std::lock_guard<std::mutex> guard(book_mutex_);
1971 
1972  // MEs are sorted by (run, lumi, stream id, module id, directory, name)
1973  // lumi deafults to 0
1974  // stream id is always 0
1975  std::string null_str("");
1976  auto i = data_.lower_bound(MonitorElement(&null_str, null_str, run, moduleId));
1977  auto e = data_.lower_bound(MonitorElement(&null_str, null_str, run, moduleId + 1));
1978  // we will later modify data_, so better do two passes.
1979  auto tobehandled = std::vector<MonitorElement const*>();
1980  for (; i != e; ++i) {
1981  tobehandled.push_back(&*i);
1982  }
1983  for (auto i : tobehandled) {
1984  // handle only non lumisection-based histograms
1985  if (LSbasedMode_ or i->getLumiFlag())
1986  continue;
1987 
1988  // clone the lumisection-based histograms
1990  clone.globalize();
1991  clone.markToDelete();
1992  data_.insert(std::move(clone));
1993 
1994  // reset the ME for the next lumisection
1995  const_cast<MonitorElement*>(&*i)->Reset();
1996  }
1997 }
std::mutex book_mutex_
Definition: DQMStore.h:657
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:632
MEMap data_
Definition: DQMStore.h:650
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
void Reset(std::vector< TH2F > &depth)
bool LSbasedMode_
Definition: DQMStore.h:638
def move(src, dest)
Definition: eostools.py:511
void DQMStore::collate1D ( MonitorElement me,
TH1F *  h,
unsigned  verbose 
)
staticprivate

Definition at line 1429 of file DQMStore.cc.

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

Referenced by book1D_(), and extract().

1430 {
1431  if (checkBinningMatches(me,h,verbose))
1432  me->getTH1F()->Add(h);
1433 }
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:1403
void DQMStore::collate1DD ( MonitorElement me,
TH1D *  h,
unsigned  verbose 
)
staticprivate

Definition at line 1443 of file DQMStore.cc.

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

Referenced by book1DD_(), and extract().

1444 {
1445  if (checkBinningMatches(me,h,verbose))
1446  me->getTH1D()->Add(h);
1447 }
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:1403
void DQMStore::collate1S ( MonitorElement me,
TH1S *  h,
unsigned  verbose 
)
staticprivate

Definition at line 1436 of file DQMStore.cc.

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

Referenced by book1S_(), and extract().

1437 {
1438  if (checkBinningMatches(me,h,verbose))
1439  me->getTH1S()->Add(h);
1440 }
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:1403
void DQMStore::collate2D ( MonitorElement me,
TH2F *  h,
unsigned  verbose 
)
staticprivate

Definition at line 1450 of file DQMStore.cc.

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

Referenced by book2D_(), and extract().

1451 {
1452  if (checkBinningMatches(me,h,verbose))
1453  me->getTH2F()->Add(h);
1454 }
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:1403
void DQMStore::collate2DD ( MonitorElement me,
TH2D *  h,
unsigned  verbose 
)
staticprivate

Definition at line 1464 of file DQMStore.cc.

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

Referenced by book2DD_(), and extract().

1465 {
1466  if (checkBinningMatches(me,h,verbose))
1467  me->getTH2D()->Add(h);
1468 }
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:1403
void DQMStore::collate2S ( MonitorElement me,
TH2S *  h,
unsigned  verbose 
)
staticprivate

Definition at line 1457 of file DQMStore.cc.

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

Referenced by book2S_(), and extract().

1458 {
1459  if (checkBinningMatches(me,h,verbose))
1460  me->getTH2S()->Add(h);
1461 }
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:1403
void DQMStore::collate3D ( MonitorElement me,
TH3F *  h,
unsigned  verbose 
)
staticprivate

Definition at line 1471 of file DQMStore.cc.

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

Referenced by book3D_(), and extract().

1472 {
1473  if (checkBinningMatches(me,h,verbose))
1474  me->getTH3F()->Add(h);
1475 }
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:1403
void DQMStore::collateProfile ( MonitorElement me,
TProfile *  h,
unsigned  verbose 
)
staticprivate

Definition at line 1478 of file DQMStore.cc.

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

Referenced by bookProfile_(), and extract().

1479 {
1480  if (checkBinningMatches(me,h,verbose)) {
1481  TProfile* meh = me->getTProfile();
1482  me->addProfiles(h, meh, meh, 1, 1);
1483  }
1484 }
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:1403
void DQMStore::collateProfile2D ( MonitorElement me,
TProfile2D *  h,
unsigned  verbose 
)
staticprivate

Definition at line 1487 of file DQMStore.cc.

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

Referenced by bookProfile2D_(), and extract().

1488 {
1489  if (checkBinningMatches(me,h,verbose)) {
1490  TProfile2D* meh = me->getTProfile2D();
1491  me->addProfiles(h, meh, meh, 1, 1);
1492  }
1493 }
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:1403
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 1603 of file DQMStore.cc.

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

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

1604 {
1605  MonitorElement proto(&path, std::string());
1606  auto e = data_.end();
1607  auto i = data_.lower_bound(proto);
1608  return (i != e && isSubdirectory(path, *i->data_.dirname));
1609 }
MEMap data_
Definition: DQMStore.h:650
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 3163 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().

3164 {
3165  if (qtests_.count(qtname))
3166  raiseDQMError("DQMStore", "Attempt to create duplicate quality test '%s'",
3167  qtname.c_str());
3168 
3169  auto i = qalgos_.find(algoname);
3170  if (i == qalgos_.end())
3171  raiseDQMError("DQMStore", "Cannot create a quality test using unknown"
3172  " algorithm '%s'", algoname.c_str());
3173 
3174  QCriterion* qc = i->second(qtname);
3175  qc->setVerbose(verboseQT_);
3176 
3177  qtests_[qtname] = qc;
3178  return qc;
3179 }
QCMap qtests_
Definition: DQMStore.h:653
unsigned verboseQT_
Definition: DQMStore.h:633
QAMap qalgos_
Definition: DQMStore.h:654
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 2005 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().

2006 {
2007  if (!enableMultiThread_)
2008  return;
2009 
2010  std::lock_guard<std::mutex> guard(book_mutex_);
2011 
2012  std::string null_str("");
2013  MonitorElement proto(&null_str, null_str, run, 0);
2014  proto.setLumi(lumi);
2015 
2016  auto e = data_.end();
2017  auto i = data_.lower_bound(proto);
2018 
2019  while (i != e) {
2020  if (i->data_.moduleId != 0)
2021  break;
2022  if (i->data_.lumi != lumi)
2023  break;
2024  if (i->data_.run != run)
2025  break;
2026  if (not i->markedToDelete()) {
2027  ++i;
2028  continue;
2029  }
2030 
2031  if (verbose_ > 1) {
2032  std::cout << "DQMStore::deleteUnusedLumiHistograms: deleted monitor element '"
2033  << *i->data_.dirname << "/" << i->data_.objname << "'"
2034  << "flags " << i->data_.flags << "\n";
2035  }
2036 
2037  i = data_.erase(i);
2038  }
2039 }
std::mutex book_mutex_
Definition: DQMStore.h:657
unsigned verbose_
Definition: DQMStore.h:632
MEMap data_
Definition: DQMStore.h:650
bool enableMultiThread_
Definition: DQMStore.h:637
bool DQMStore::dirExists ( std::string const &  path) const
void DQMStore::disableSoftReset ( MonitorElement me)

Definition at line 3288 of file DQMStore.cc.

References MonitorElement::disableSoftReset().

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

3289 {
3290  if (me)
3291  me->disableSoftReset();
3292 }
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 2047 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, 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().

2051 {
2052  // NB: Profile histograms inherit from TH*D, checking order matters.
2053  MonitorElement *refcheck = nullptr;
2054  if (auto* h = dynamic_cast<TProfile*>(obj)) {
2055  MonitorElement* me = findObject(0, 0, 0, dir, h->GetName());
2056  if (! me)
2057  me = bookProfile_(dir, h->GetName(), (TProfile*) h->Clone());
2058  else if (overwrite)
2059  me->copyFrom(h);
2060  else if (isCollateME(me) || collateHistograms)
2061  collateProfile(me, h, verbose_);
2062  refcheck = me;
2063  }
2064  else if (auto* h = dynamic_cast<TProfile2D*>(obj)) {
2065  MonitorElement* me = findObject(0, 0, 0, dir, h->GetName());
2066  if (! me)
2067  me = bookProfile2D_(dir, h->GetName(), (TProfile2D*) h->Clone());
2068  else if (overwrite)
2069  me->copyFrom(h);
2070  else if (isCollateME(me) || collateHistograms)
2071  collateProfile2D(me, h, verbose_);
2072  refcheck = me;
2073  }
2074  else if (auto* h = dynamic_cast<TH1F*>(obj)) {
2075  MonitorElement* me = findObject(0, 0, 0, dir, h->GetName());
2076  if (! me)
2077  me = book1D_(dir, h->GetName(), (TH1F*) h->Clone());
2078  else if (overwrite)
2079  me->copyFrom(h);
2080  else if (isCollateME(me) || collateHistograms)
2081  collate1D(me, h, verbose_);
2082  refcheck = me;
2083  }
2084  else if (auto* h = dynamic_cast<TH1S*>(obj)) {
2085  MonitorElement* me = findObject(0, 0, 0, dir, h->GetName());
2086  if (! me)
2087  me = book1S_(dir, h->GetName(), (TH1S*) h->Clone());
2088  else if (overwrite)
2089  me->copyFrom(h);
2090  else if (isCollateME(me) || collateHistograms)
2091  collate1S(me, h, verbose_);
2092  refcheck = me;
2093  }
2094  else if (auto* h = dynamic_cast<TH1D*>(obj)) {
2095  MonitorElement* me = findObject(0, 0, 0, dir, h->GetName());
2096  if (! me)
2097  me = book1DD_(dir, h->GetName(), (TH1D*) h->Clone());
2098  else if (overwrite)
2099  me->copyFrom(h);
2100  else if (isCollateME(me) || collateHistograms)
2101  collate1DD(me, h, verbose_);
2102  refcheck = me;
2103  }
2104  else if (auto* h = dynamic_cast<TH2F*>(obj)) {
2105  MonitorElement* me = findObject(0, 0, 0, dir, h->GetName());
2106  if (! me)
2107  me = book2D_(dir, h->GetName(), (TH2F*) h->Clone());
2108  else if (overwrite)
2109  me->copyFrom(h);
2110  else if (isCollateME(me) || collateHistograms)
2111  collate2D(me, h, verbose_);
2112  refcheck = me;
2113  }
2114  else if (auto* h = dynamic_cast<TH2S*>(obj)) {
2115  MonitorElement* me = findObject(0, 0, 0, dir, h->GetName());
2116  if (! me)
2117  me = book2S_(dir, h->GetName(), (TH2S*) h->Clone());
2118  else if (overwrite)
2119  me->copyFrom(h);
2120  else if (isCollateME(me) || collateHistograms)
2121  collate2S(me, h, verbose_);
2122  refcheck = me;
2123  }
2124  else if (auto* h = dynamic_cast<TH2D*>(obj)) {
2125  MonitorElement* me = findObject(0, 0, 0, dir, h->GetName());
2126  if (! me)
2127  me = book2DD_(dir, h->GetName(), (TH2D*) h->Clone());
2128  else if (overwrite)
2129  me->copyFrom(h);
2130  else if (isCollateME(me) || collateHistograms)
2131  collate2DD(me, h, verbose_);
2132  refcheck = me;
2133  }
2134  else if (auto* h = dynamic_cast<TH3F*>(obj)) {
2135  MonitorElement* me = findObject(0, 0, 0, dir, h->GetName());
2136  if (! me)
2137  me = book3D_(dir, h->GetName(), (TH3F*) h->Clone());
2138  else if (overwrite)
2139  me->copyFrom(h);
2140  else if (isCollateME(me) || collateHistograms)
2141  collate3D(me, h, verbose_);
2142  refcheck = me;
2143  }
2144  else if (dynamic_cast<TObjString*>(obj)) {
2145  lat::RegexpMatch m;
2146  if (! s_rxmeval.match(obj->GetName(), 0, 0, &m)) {
2147  if (strstr(obj->GetName(), "CMSSW")) {
2148  if (verbose_)
2149  std::cout << "Input file version: " << obj->GetName() << std::endl;
2150  return true;
2151  }
2152  else if (strstr(obj->GetName(), "DQMPATCH")) {
2153  if (verbose_)
2154  std::cout << "DQM patch version: " << obj->GetName() << std::endl;
2155  return true;
2156  }
2157  else {
2158  std::cout << "*** DQMStore: WARNING: cannot extract object '"
2159  << obj->GetName() << "' of type '"
2160  << obj->IsA()->GetName() << "'\n";
2161  return false;
2162  }
2163  }
2164 
2165  std::string label = m.matchString(obj->GetName(), 1);
2166  std::string kind = m.matchString(obj->GetName(), 2);
2167  std::string value = m.matchString(obj->GetName(), 3);
2168 
2169  if (kind == "i") {
2170  MonitorElement* me = findObject(0, 0, 0, dir, label);
2171  if (! me || overwrite) {
2172  if (! me) me = bookInt_(dir, label);
2173  me->Fill(atoll(value.c_str()));
2174  }
2175  }
2176  else if (kind == "f") {
2177  MonitorElement* me = findObject(0, 0, 0, dir, label);
2178  if (! me || overwrite) {
2179  if (! me) me = bookFloat_(dir, label);
2180  me->Fill(atof(value.c_str()));
2181  }
2182  }
2183  else if (kind == "s") {
2184  MonitorElement* me = findObject(0, 0, 0, dir, label);
2185  if (! me)
2186  me = bookString_(dir, label, value);
2187  else if (overwrite)
2188  me->Fill(value);
2189  }
2190  else if (kind == "e") {
2191  MonitorElement* me = findObject(0, 0, 0, dir, label);
2192  if (! me) {
2193  std::cout << "*** DQMStore: WARNING: no monitor element '"
2194  << label << "' in directory '"
2195  << dir << "' to be marked as efficiency plot.\n";
2196  return false;
2197  }
2198  me->setEfficiencyFlag();
2199  }
2200  else if (kind == "t") {
2201  MonitorElement* me = findObject(0, 0, 0, dir, label);
2202  if (! me) {
2203  std::cout << "*** DQMStore: WARNING: no monitor element '"
2204  << label << "' in directory '"
2205  << dir << "' for a tag\n";
2206  return false;
2207  }
2208  errno = 0;
2209  char* endp = nullptr;
2210  unsigned long val = strtoul(value.c_str(), &endp, 10);
2211  if ((val == 0 && errno) || *endp || val > ~uint32_t(0)) {
2212  std::cout << "*** DQMStore: WARNING: cannot restore tag '"
2213  << value << "' for monitor element '"
2214  << label << "' in directory '"
2215  << dir << "' - invalid value\n";
2216  return false;
2217  }
2218  tag(me, val);
2219  }
2220  else if (kind == "qr") {
2221  // Handle qreports, but skip them while reading in references.
2222  if (! isSubdirectory(s_referenceDirName, dir)) {
2223  size_t dot = label.find('.');
2224  if (dot == std::string::npos) {
2225  std::cout << "*** DQMStore: WARNING: quality report label in '" << label
2226  << "' is missing a '.' and cannot be extracted\n";
2227  return false;
2228  }
2229 
2230  std::string mename (label, 0, dot);
2231  std::string qrname (label, dot+1, std::string::npos);
2232 
2233  m.reset();
2234  DQMNet::QValue qv;
2235  if (s_rxmeqr1.match(value, 0, 0, &m)) {
2236  qv.code = atoi(m.matchString(value, 1).c_str());
2237  qv.qtresult = strtod(m.matchString(value, 2).c_str(), nullptr);
2238  qv.message = m.matchString(value, 4);
2239  qv.qtname = qrname;
2240  qv.algorithm = m.matchString(value, 3);
2241  }
2242  else if (s_rxmeqr2.match(value, 0, 0, &m)) {
2243  qv.code = atoi(m.matchString(value, 1).c_str());
2244  qv.qtresult = 0; // unavailable in old format
2245  qv.message = m.matchString(value, 2);
2246  qv.qtname = qrname;
2247  // qv.algorithm unavailable in old format
2248  }
2249  else {
2250  std::cout << "*** DQMStore: WARNING: quality test value '"
2251  << value << "' is incorrectly formatted\n";
2252  return false;
2253  }
2254 
2255  MonitorElement* me = findObject(0, 0, 0, dir, mename);
2256  if (! me) {
2257  std::cout << "*** DQMStore: WARNING: no monitor element '"
2258  << mename << "' in directory '"
2259  << dir << "' for quality test '"
2260  << label << "'\n";
2261  return false;
2262  }
2263 
2264  me->addQReport(qv, /* FIXME: getQTest(qv.qtname)? */ nullptr);
2265  }
2266  }
2267  else {
2268  std::cout << "*** DQMStore: WARNING: cannot extract object '"
2269  << obj->GetName() << "' of type '"
2270  << obj->IsA()->GetName() << "'\n";
2271  return false;
2272  }
2273  }
2274  else if (auto* n = dynamic_cast<TNamed*>(obj)) {
2275  // For old DQM data.
2276  std::string s;
2277  s.reserve(6 + strlen(n->GetTitle()) + 2*strlen(n->GetName()));
2278  s += '<'; s += n->GetName(); s += '>';
2279  s += n->GetTitle();
2280  s += '<'; s += '/'; s += n->GetName(); s += '>';
2281  TObjString os(s.c_str());
2282  return extract(&os, dir, overwrite, collateHistograms_);
2283  }
2284  else {
2285  std::cout << "*** DQMStore: WARNING: cannot extract object '"
2286  << obj->GetName() << "' of type '" << obj->IsA()->GetName()
2287  << "' and with title '" << obj->GetTitle() << "'\n";
2288  return false;
2289  }
2290 
2291  // If we just read in a reference MonitorElement, and there is a
2292  // MonitorElement with the same name, link the two together.
2293  // The other direction is handled by the book() method.
2294  if (refcheck && isSubdirectory(s_referenceDirName, dir)) {
2295  std::string mdir(dir, s_referenceDirName.size()+1, std::string::npos);
2296  if (MonitorElement* master = findObject(0, 0, 0, mdir, obj->GetName())) {
2297  // We have extracted a MonitorElement, and it's located in the reference
2298  // dir. Then we find the corresponding MonitorElement in the
2299  // non-reference dir and assign the object_ of the reference
2300  // MonitorElement to the reference_ property of the corresponding
2301  // non-reference MonitorElement.
2302  master->data_.flags |= DQMNet::DQM_PROP_HAS_REFERENCE;
2303  master->reference_ = refcheck->object_;
2304  }
2305  }
2306 
2307  return true;
2308 }
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:1166
bool isCollateME(MonitorElement *me) const
Definition: DQMStore.cc:3336
MonitorElement * bookProfile2D_(std::string const &dir, std::string const &name, TProfile2D *h)
Book 2D profile histogram based on TProfile2D.
Definition: DQMStore.cc:1351
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:1471
MonitorElement * bookString_(std::string const &dir, std::string const &name, std::string const &value)
Book string.
Definition: DQMStore.cc:1056
static void collateProfile(MonitorElement *me, TProfile *h, unsigned verbose)
Definition: DQMStore.cc:1478
static void collate2DD(MonitorElement *me, TH2D *h, unsigned verbose)
Definition: DQMStore.cc:1464
MonitorElement * book1D_(std::string const &dir, std::string const &name, TH1F *h)
Book 1D histogram based on TH1F.
Definition: DQMStore.cc:1077
bool extract(TObject *obj, std::string const &dir, bool overwrite, bool collateHistograms)
Definition: DQMStore.cc:2047
MonitorElement * bookProfile_(std::string const &dir, std::string const &name, TProfile *h)
Book profile histogram based on TProfile.
Definition: DQMStore.cc:1274
void Fill(long long x)
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1500
char const * label
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:1152
MonitorElement * book1DD_(std::string const &dir, std::string const &name, TH1D *h)
Book 1D histogram based on TH1D.
Definition: DQMStore.cc:1091
static void collateProfile2D(MonitorElement *me, TProfile2D *h, unsigned verbose)
Definition: DQMStore.cc:1487
MonitorElement * book3D_(std::string const &dir, std::string const &name, TH3F *h)
Book 3D histogram based on TH3F.
Definition: DQMStore.cc:1246
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:1084
static void collate1DD(MonitorElement *me, TH1D *h, unsigned verbose)
Definition: DQMStore.cc:1443
unsigned verbose_
Definition: DQMStore.h:632
MonitorElement * book2S_(std::string const &dir, std::string const &name, TH2S *h)
Book 2D histogram based on TH2S.
Definition: DQMStore.cc:1159
static void collate1D(MonitorElement *me, TH1F *h, unsigned verbose)
Definition: DQMStore.cc:1429
MonitorElement * bookFloat_(std::string const &dir, std::string const &name)
Book float.
Definition: DQMStore.cc:1035
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:1014
static void collate1S(MonitorElement *me, TH1S *h, unsigned verbose)
Definition: DQMStore.cc:1436
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:1739
static void collate2D(MonitorElement *me, TH2F *h, unsigned verbose)
Definition: DQMStore.cc:1450
float qtresult
Definition: DQMNet.h:91
bool collateHistograms_
Definition: DQMStore.h:636
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:1457
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 2974 of file DQMStore.cc.

Referenced by get_info().

2975 {
2976  if (buf.Length() == buf.BufferSize())
2977  return nullptr;
2978  buf.InitMap();
2979  void* ptr = buf.ReadObjectAny(nullptr);
2980  return reinterpret_cast<TObject*>(ptr);
2981 }
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 1739 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(), writedatasetfile::run, and DQMNet::CoreObject::run.

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

1744 {
1745  if (dir.find_first_not_of(s_safe) != std::string::npos)
1746  raiseDQMError("DQMStore", "Monitor element path name '%s' uses"
1747  " unacceptable characters", dir.c_str());
1748  if (name.find_first_not_of(s_safe) != std::string::npos)
1749  raiseDQMError("DQMStore", "Monitor element path name '%s' uses"
1750  " unacceptable characters", name.c_str());
1751 
1752  MonitorElement proto;
1753  proto.data_.dirname = &dir;
1754  proto.data_.objname = name;
1755  proto.data_.run = run;
1756  proto.data_.lumi = lumi;
1757  proto.data_.moduleId = moduleId;
1758 
1759  auto mepos = data_.find(proto);
1760  return (mepos == data_.end() ? nullptr
1761  : const_cast<MonitorElement *>(&*mepos));
1762 }
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:650
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 1864 of file DQMStore.cc.

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

Referenced by DQMStore().

1865 {
1866  for (auto const& m : data_) {
1867  if (forceResetOnBeginLumi_ && (m.getLumiFlag() == false))
1868  continue;
1869  auto& me = const_cast<MonitorElement&>(m);
1870  me.Reset();
1871  me.resetUpdate();
1872  }
1873 
1874  reset_ = true;
1875 }
bool reset_
Definition: DQMStore.h:634
void Reset()
reset ME (ie. contents, errors, etc)
MEMap data_
Definition: DQMStore.h:650
bool forceResetOnBeginLumi_
Definition: DQMStore.h:639
MonitorElement * DQMStore::get ( std::string const &  path) const

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

Definition at line 1613 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(), 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(), L1ScalersClient::endLuminosityBlock(), HLTScalersClient::endLuminosityBlock(), TauDQMHistPlotter::endRun(), SiStripQualityChecker::fillDetectorStatusAtLumi(), SiStripQualityChecker::fillFaultyModuleStatus(), DQMFEDIntegrityClient::fillHistograms(), SiStripCertificationInfo::fillSiStripCertificationMEs(), SiStripCertificationInfo::fillSiStripCertificationMEsAtLumi(), PFDQMEventSelector::filter(), SiStripDaqInfo::findExcludedModule(), betterConfigParser.BetterConfigParser::getCompares(), SiStripTrackerMapCreator::getDetectorFlagAndComment(), EgHLTOfflineSummaryClient::getEgHLTSumHist_(), betterConfigParser.BetterConfigParser::getGeneral(), SiStripQualityChecker::getModuleStatus(), SiStripBadModuleFedErrESSource::getProcessedEvents(), betterConfigParser.BetterConfigParser::getResultingSection(), SiStripHistoPlotter::makePlot(), 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(), rrapi.RRApi::tags(), util.rrapi.RRApi::tags(), rrapi.RRApi::templates(), util.rrapi.RRApi::templates(), util.rrapi.RRApi::workspaces(), and rrapi.RRApi::workspaces().

1614 {
1615  std::string dir;
1616  std::string name;
1617  splitPath(dir, name, path);
1618  MonitorElement proto(&dir, name);
1619  auto mepos = data_.find(proto);
1620  return (mepos == data_.end() ? nullptr
1621  : const_cast<MonitorElement *>(&*mepos));
1622 }
MEMap data_
Definition: DQMStore.h:650
dbl *** dir
Definition: mlp_gen.cc:35
std::vector< MonitorElement * > DQMStore::get ( unsigned int  tag) const
void DQMStore::get_info ( dqmstorepb::ROOTFilePB_Histo const &  h,
std::string &  dirname,
std::string &  objname,
TObject **  obj 
)
private

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

2987 {
2988  size_t slash = h.full_pathname().rfind('/');
2989  size_t dirpos = (slash == std::string::npos ? 0 : slash);
2990  size_t namepos = (slash == std::string::npos ? 0 : slash+1);
2991  dirname.assign(h.full_pathname(), 0, dirpos);
2992  objname.assign(h.full_pathname(), namepos, std::string::npos);
2993  TBufferFile buf(TBufferFile::kRead, h.size(),
2994  (void*)h.streamed_histo().data(),
2995  kFALSE);
2996  buf.Reset();
2997  *obj = extractNextObject(buf);
2998  if (!*obj) {
2999  raiseDQMError("DQMStore", "Error reading element:'%s'" , h.full_pathname().c_str());
3000  }
3001 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
TObject * extractNextObject(TBufferFile &) const
Definition: DQMStore.cc:2974
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 1767 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().

1770 {
1772  std::string const* cleaned = nullptr;
1773  cleanTrailingSlashes(path, clean, cleaned);
1774  MonitorElement proto(cleaned, std::string(), run, 0);
1775  proto.setLumi(lumi);
1776 
1777  std::vector<MonitorElement*> result;
1778  auto e = data_.end();
1779  auto i = data_.lower_bound(proto);
1780  for ( ; i != e && isSubdirectory(*cleaned, *i->data_.dirname); ++i) {
1781  if (run != 0) {
1782  if (i->data_.run > run // TODO[rovere]: pleonastic? first we encounter local ME of the same run ...
1783  || i->data_.moduleId != 0)
1784  break;
1785  }
1786  if (lumi != 0) {
1787  if (i->data_.lumi > lumi
1788  || i->data_.moduleId != 0)
1789  break;
1790  }
1791  if (run != 0 or lumi !=0) {
1792  assert(i->data_.moduleId == 0);
1793  }
1794  result.push_back(const_cast<MonitorElement*>(&*i));
1795  }
1796 
1797  if (enableMultiThread_) {
1798  //save legacy modules when running MT
1799  i = data_.begin();
1800  for ( ; i != e && isSubdirectory(*cleaned, *i->data_.dirname); ++i) {
1801  if (i->data_.run != 0 or i->data_.moduleId != 0)
1802  break;
1803  result.push_back(const_cast<MonitorElement*>(&*i));
1804  }
1805  }
1806 
1807  return result;
1808 }
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:154
MEMap data_
Definition: DQMStore.h:650
bool enableMultiThread_
Definition: DQMStore.h:637
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 1640 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(), SiStripActionExecutor::printFaultyModuleList(), SiStripTrackerMapCreator::setTkMapFromHistogram(), and showDirStructure().

1641 {
1643  std::string const* cleaned = nullptr;
1644  cleanTrailingSlashes(path, clean, cleaned);
1645  MonitorElement proto(cleaned, std::string());
1646 
1647  std::vector<MonitorElement*> result;
1648  auto e = data_.end();
1649  auto i = data_.lower_bound(proto);
1650  for ( ; i != e && isSubdirectory(*cleaned, *i->data_.dirname); ++i)
1651  if (*cleaned == *i->data_.dirname)
1652  result.push_back(const_cast<MonitorElement *>(&*i));
1653 
1654  return result;
1655 }
std::vector< T * > clean
Definition: MVATrainer.cc:154
MEMap data_
Definition: DQMStore.h:650
std::vector< MonitorElement * > DQMStore::getContents ( std::string const &  path,
unsigned int  tag 
) const

same as above for tagged MonitorElements

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

1660 {
1662  std::string const* cleaned = nullptr;
1663  cleanTrailingSlashes(path, clean, cleaned);
1664  MonitorElement proto(cleaned, std::string());
1665 
1666  std::vector<MonitorElement*> result;
1667  auto e = data_.end();
1668  auto i = data_.lower_bound(proto);
1669  for ( ; i != e && isSubdirectory(*cleaned, *i->data_.dirname); ++i)
1670  if (*cleaned == *i->data_.dirname
1671  && (i->data_.flags & DQMNet::DQM_PROP_TAGGED)
1672  && i->data_.tag == tag)
1673  result.push_back(const_cast<MonitorElement *>(&*i));
1674 
1675  return result;
1676 }
static const uint32_t DQM_PROP_TAGGED
Definition: DQMNet.h:55
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1500
std::vector< T * > clean
Definition: MVATrainer.cc:154
MEMap data_
Definition: DQMStore.h:650
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 1683 of file DQMStore.cc.

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

1684 {
1685  into.clear();
1686  into.reserve(dirs_.size());
1687 
1688  auto me = data_.end();
1689  for (auto const& dir : dirs_)
1690  {
1691  MonitorElement proto(&dir, std::string());
1692  auto mi = data_.lower_bound(proto);
1693  auto m = mi;
1694  size_t sz = dir.size() + 2;
1695  size_t nfound = 0;
1696  for ( ; m != me && isSubdirectory(dir, *m->data_.dirname); ++m)
1697  if (dir == *m->data_.dirname)
1698  {
1699  sz += m->data_.objname.size() + 1;
1700  ++nfound;
1701  }
1702 
1703  if (! nfound)
1704  continue;
1705 
1706  auto istr
1707  = into.insert(into.end(), std::string());
1708 
1709  if (showContents)
1710  {
1711  istr->reserve(sz);
1712 
1713  *istr += dir;
1714  *istr += ':';
1715  for (sz = 0; mi != m; ++mi)
1716  {
1717  if (dir != *mi->data_.dirname)
1718  continue;
1719 
1720  if (sz > 0)
1721  *istr += ',';
1722 
1723  *istr += mi->data_.objname;
1724  ++sz;
1725  }
1726  }
1727  else
1728  {
1729  istr->reserve(dir.size() + 2);
1730  *istr += dir;
1731  *istr += ':';
1732  }
1733  }
1734 }
MEMap data_
Definition: DQMStore.h:650
dbl *** dir
Definition: mlp_gen.cc:35
std::set< std::string > dirs_
Definition: DQMStore.h:651
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 1813 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().

1814 {
1815  lat::Regexp rx;
1816  try {
1817  rx = lat::Regexp(pattern, 0, syntaxType);
1818  rx.study();
1819  }
1820  catch (lat::Error& e) {
1821  raiseDQMError("DQMStore", "Invalid regular expression '%s': %s",
1822  pattern.c_str(), e.explain().c_str());
1823  }
1824 
1825  std::string path;
1826  std::vector<MonitorElement *> result;
1827  for (auto const& me : data_) {
1828  path.clear();
1829  mergePath(path, *me.data_.dirname, me.data_.objname);
1830  if (rx.match(path))
1831  result.push_back(const_cast<MonitorElement*>(&me));
1832  }
1833 
1834  return result;
1835 }
edm::ErrorSummaryEntry Error
MEMap data_
Definition: DQMStore.h:650
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 1587 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().

1588 {
1589  MonitorElement proto(&pwd_, std::string());
1590  std::vector<std::string> result;
1591  auto e = data_.end();
1592  auto i = data_.lower_bound(proto);
1593  for ( ; i != e && isSubdirectory(pwd_, *i->data_.dirname); ++i)
1594  if (pwd_ == *i->data_.dirname)
1595  result.push_back(i->getName());
1596 
1597  return result;
1598 }
std::string pwd_
Definition: DQMStore.h:649
MEMap data_
Definition: DQMStore.h:650
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 3252 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().

3253 {
3255  std::string const* cleaned = nullptr;
3256  cleanTrailingSlashes(path, clean, cleaned);
3257 
3259  for (auto const& me : data_) {
3260  if (! cleaned->empty() && ! isSubdirectory(*cleaned, *me.data_.dirname))
3261  continue;
3262 
3263  if (me.hasError())
3264  return dqm::qstatus::ERROR;
3265  else if (me.hasWarning())
3266  status = dqm::qstatus::WARNING;
3267  else if (status < dqm::qstatus::WARNING
3268  && me.hasOtherReport())
3269  status = dqm::qstatus::OTHER;
3270  }
3271  return status;
3272 }
static const int OTHER
static const int WARNING
std::vector< T * > clean
Definition: MVATrainer.cc:154
MEMap data_
Definition: DQMStore.h:650
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 1564 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(), DQMStore::IGetter::removeElement(), DQMFileSaver::saveForOffline(), DQMFileSaver::saveForOnline(), and SiStripTrackerMapCreator::setTkMapFromHistogram().

1565 {
1566  std::vector<std::string> result;
1567  auto e = dirs_.end();
1568  auto i = dirs_.find(pwd_);
1569 
1570  // If we didn't find current directory, the tree is empty, so quit.
1571  if (i == e)
1572  return result;
1573 
1574  // Skip the current directory and then start looking for immediate
1575  // subdirectories in the dirs_ list. Stop when we are no longer in
1576  // (direct or indirect) subdirectories of pwd_. Note that we don't
1577  // "know" which order the set will sort A/B, A/B/C and A/D.
1578  while (++i != e && isSubdirectory(pwd_, *i))
1579  if (i->find('/', pwd_.size()+1) == std::string::npos)
1580  result.push_back(*i);
1581 
1582  return result;
1583 }
std::string pwd_
Definition: DQMStore.h:649
std::set< std::string > dirs_
Definition: DQMStore.h:651
void DQMStore::goUp ( )

equivalent to "cd .."

Definition at line 582 of file DQMStore.cc.

References pwd_, and setCurrentFolder().

Referenced by SiStripSummaryCreator::createSummary(), SiStripSummaryCreator::fillGrandSummaryHistos(), SiStripSummaryCreator::fillSummaryHistos(), SiStripUtility::getModuleFolderList(), SiStripSummaryCreator::getSummaryME(), SiStripUtility::goToDir(), and meBookerGetter().

583 {
584  size_t pos = pwd_.rfind('/');
585  if (pos == std::string::npos)
586  setCurrentFolder("");
587  else
588  setCurrentFolder(pwd_.substr(0, pos));
589 }
std::string pwd_
Definition: DQMStore.h:649
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:571
MonitorElement* DQMStore::initialise ( MonitorElement me,
std::string const &  path 
)
private

Referenced by book_().

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

Definition at line 402 of file DQMStore.cc.

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

Referenced by DQMStore().

403 {
404  makeDirectory("");
405  reset();
406 
407  // set steerable parameters
408  verbose_ = pset.getUntrackedParameter<int>("verbose", 0);
409  if (verbose_ > 0)
410  std::cout << "DQMStore: verbosity set to " << verbose_ << std::endl;
411 
412  verboseQT_ = pset.getUntrackedParameter<int>("verboseQT", 0);
413  if (verbose_ > 0)
414  std::cout << "DQMStore: QTest verbosity set to " << verboseQT_ << std::endl;
415 
416  collateHistograms_ = pset.getUntrackedParameter<bool>("collateHistograms", false);
417  if (collateHistograms_)
418  std::cout << "DQMStore: histogram collation is enabled\n";
419 
420  enableMultiThread_ = pset.getUntrackedParameter<bool>("enableMultiThread", false);
421  if (enableMultiThread_)
422  std::cout << "DQMStore: MultiThread option is enabled\n";
423 
424  LSbasedMode_ = pset.getUntrackedParameter<bool>("LSbasedMode", false);
425  if (LSbasedMode_)
426  std::cout << "DQMStore: LSbasedMode option is enabled\n";
427 
428  doSaveByLumi_ = pset.getUntrackedParameter<bool>("saveByLumi", false);
429  if (doSaveByLumi_)
430  std::cout << "DQMStore: saveByLumi option is enabled\n";
431 
432  std::string ref = pset.getUntrackedParameter<std::string>("referenceFileName", "");
433  if (! ref.empty()) {
434  std::cout << "DQMStore: using reference file '" << ref << "'\n";
435  readFile(ref, true, "", s_referenceDirName, StripRunDirs, false);
436  }
437 
438  initQCriterion<Comp2RefChi2>(qalgos_);
439  initQCriterion<Comp2Ref2DChi2>(qalgos_);
440  initQCriterion<Comp2RefKolmogorov>(qalgos_);
441  initQCriterion<ContentsXRange>(qalgos_);
442  initQCriterion<ContentsYRange>(qalgos_);
443  initQCriterion<MeanWithinExpected>(qalgos_);
444  initQCriterion<Comp2RefEqualH>(qalgos_);
445  initQCriterion<DeadChannel>(qalgos_);
446  initQCriterion<NoisyChannel>(qalgos_);
447  initQCriterion<ContentSigma>(qalgos_);
448  initQCriterion<ContentsWithinExpected>(qalgos_);
449  initQCriterion<CompareToMedian>(qalgos_);
450  initQCriterion<CompareLastFilledBin>(qalgos_);
451  initQCriterion<CheckVariance>(qalgos_);
452 
453  scaleFlag_ = pset.getUntrackedParameter<double>("ScalingFlag", 0.0);
454  if (verbose_ > 0)
455  std::cout << "DQMStore: Scaling Flag set to " << scaleFlag_ << std::endl;
456 }
void makeDirectory(std::string const &path)
Definition: DQMStore.cc:595
unsigned verboseQT_
Definition: DQMStore.h:633
double scaleFlag_
Definition: DQMStore.h:635
bool doSaveByLumi_
Definition: DQMStore.h:646
QAMap qalgos_
Definition: DQMStore.h:654
unsigned verbose_
Definition: DQMStore.h:632
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:2925
bool collateHistograms_
Definition: DQMStore.h:636
bool LSbasedMode_
Definition: DQMStore.h:638
void reset()
Definition: DQMStore.cc:1844
bool enableMultiThread_
Definition: DQMStore.h:637
bool DQMStore::isCollate ( ) const

Definition at line 3327 of file DQMStore.cc.

References collateHistograms_.

3328 {
3329  return collateHistograms_;
3330 }
bool collateHistograms_
Definition: DQMStore.h:636
bool DQMStore::isCollateME ( MonitorElement me) const
private

Definition at line 3336 of file DQMStore.cc.

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

Referenced by extract().

3337 {
3338  return me && isSubdirectory(s_collateDirName, *me->data_.dirname);
3339 }
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 2898 of file DQMStore.cc.

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

Referenced by DQMFileReader::beginJob().

2901 {
2902  bool overwrite = true;
2903  if (collateHistograms_) overwrite = false;
2904  if (verbose_)
2905  {
2906  std::cout << "DQMStore::load: reading from file '" << filename << "'\n";
2907  if (collateHistograms_)
2908  std::cout << "DQMStore::load: in collate mode " << "\n";
2909  else
2910  std::cout << "DQMStore::load: in overwrite mode " << "\n";
2911  }
2912 
2913  if (!s_rxpbfile.match(filename, 0, 0))
2914  return readFile(filename, overwrite, "", "", stripdirs, fileMustExist);
2915  else
2916  return readFilePB(filename, overwrite, "", "", stripdirs, fileMustExist);
2917 }
unsigned verbose_
Definition: DQMStore.h:632
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:3004
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:2925
bool collateHistograms_
Definition: DQMStore.h:636
void DQMStore::makeDirectory ( std::string const &  path)
private

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

Definition at line 595 of file DQMStore.cc.

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

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

596 {
597  std::string prev;
598  std::string subdir;
600  prev.reserve(path.size());
601  subdir.reserve(path.size());
602  name.reserve(path.size());
603  size_t prevname = 0;
604  size_t slash = 0;
605 
606  while (true) {
607  // Create this subdirectory component.
608  subdir.clear();
609  subdir.append(path, 0, slash);
610  name.clear();
611  name.append(subdir, prevname, std::string::npos);
612  if (! prev.empty() && findObject(0, 0, 0, prev, name))
613  raiseDQMError("DQMStore", "Attempt to create subdirectory '%s'"
614  " which already exists as a monitor element",
615  subdir.c_str());
616 
617  if (! dirs_.count(subdir))
618  dirs_.insert(subdir);
619 
620  // Stop if we've reached the end (including possibly a trailing slash).
621  if (slash+1 >= path.size())
622  break;
623 
624  // Find the next slash, making sure we progress. If reach the end,
625  // process the last path component; the next loop round will terminate.
626  prevname = slash ? slash+1 : slash;
627  prev = subdir;
628  if ((slash = path.find('/', ++slash)) == std::string::npos)
629  slash = path.size();
630  }
631 }
MonitorElement * findObject(uint32_t run, uint32_t lumi, uint32_t moduleId, std::string const &dir, std::string const &name) const
Definition: DQMStore.cc:1739
std::set< std::string > dirs_
Definition: DQMStore.h:651
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 2883 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().

2889 {
2890  return readFile(filename,overwrite,onlypath,prepend,stripdirs,fileMustExist);
2891 }
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:2925
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 1886 of file DQMStore.cc.

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

Referenced by DQMStore().

1887 {
1888  static const std::string null_str("");
1889 
1890  auto const& lumiblock = gc.luminosityBlockID();
1891  uint32_t run = lumiblock.run();
1892 
1893  // find the range of non-legacy global MEs for the current run:
1894  // run != 0, lumi == 0 (implicit), stream id == 0, module id == 0
1895  const MonitorElement begin(&null_str, null_str, run, 0);
1896  const MonitorElement end(&null_str, null_str, run, 1);
1897  auto i = data_.lower_bound(begin);
1898  const auto e = data_.lower_bound(end);
1899  while (i != e) {
1900  auto& me = const_cast<MonitorElement&>(*i++);
1901  // skip per-run MEs
1902  if (not LSbasedMode_ and not me.getLumiFlag())
1903  continue;
1904  me.Reset();
1905  me.resetUpdate();
1906  }
1907 }
#define end
Definition: vmac.h:39
void Reset()
reset ME (ie. contents, errors, etc)
MEMap data_
Definition: DQMStore.h:650
#define begin
Definition: vmac.h:32
bool LSbasedMode_
Definition: DQMStore.h:638
void DQMStore::print_trace ( std::string const &  dir,
std::string const &  name 
)
private

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

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

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

Referenced by readFile().

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

2931 {
2932 
2933  if (verbose_)
2934  std::cout << "DQMStore::readFile: reading from file '" << filename << "'\n";
2935 
2936  std::unique_ptr<TFile> f;
2937 
2938  try {
2939  f.reset(TFile::Open(filename.c_str()));
2940  if (! f.get() || f->IsZombie())
2941  raiseDQMError("DQMStore", "Failed to open file '%s'", filename.c_str());
2942  }
2943  catch (std::exception &) {
2944  if (fileMustExist)
2945  throw;
2946  else {
2947  if (verbose_)
2948  std::cout << "DQMStore::readFile: file '" << filename << "' does not exist, continuing\n";
2949  return false;
2950  }
2951  }
2952 
2953  unsigned n = readDirectory(f.get(), overwrite, onlypath, prepend, "", stripdirs);
2954  f->Close();
2955 
2956  for (auto const& me : data_)
2957  const_cast<MonitorElement &>(me).updateQReportStats();
2958 
2959  if (verbose_) {
2960  std::cout << "DQMStore::open: successfully read " << n
2961  << " objects from file '" << filename << "'";
2962  if (! onlypath.empty())
2963  std::cout << " from directory '" << onlypath << "'";
2964  if (! prepend.empty())
2965  std::cout << " into directory '" << prepend << "'";
2966  std::cout << std::endl;
2967  }
2968  return true;
2969 }
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:2737
unsigned verbose_
Definition: DQMStore.h:632
MEMap data_
Definition: DQMStore.h:650
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 3004 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, hgcalPlots::obj, open(), callgraph::path, raiseDQMError(), setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, and verbose_.

Referenced by load().

3010 {
3011  using google::protobuf::io::FileInputStream;
3012  using google::protobuf::io::FileOutputStream;
3013  using google::protobuf::io::GzipInputStream;
3014  using google::protobuf::io::GzipOutputStream;
3015  using google::protobuf::io::CodedInputStream;
3016  using google::protobuf::io::ArrayInputStream;
3017 
3018  if (verbose_)
3019  std::cout << "DQMStore::readFile: reading from file '" << filename << "'\n";
3020 
3021  int filedescriptor;
3022  if ((filedescriptor = ::open(filename.c_str(), O_RDONLY)) == -1) {
3023  if (fileMustExist)
3024  raiseDQMError("DQMStore", "Failed to open file '%s'", filename.c_str());
3025  else
3026  if (verbose_)
3027  std::cout << "DQMStore::readFile: file '" << filename << "' does not exist, continuing\n";
3028  return false;
3029  }
3030 
3031  dqmstorepb::ROOTFilePB dqmstore_message;
3032  FileInputStream fin(filedescriptor);
3033  GzipInputStream input(&fin);
3034  CodedInputStream input_coded(&input);
3035  input_coded.SetTotalBytesLimit(1024*1024*1024, -1);
3036  if (!dqmstore_message.ParseFromCodedStream(&input_coded)) {
3037  raiseDQMError("DQMStore", "Fatal parsing file '%s'", filename.c_str());
3038  return false;
3039  }
3040  ::close(filedescriptor);
3041 
3042  for (int i = 0; i < dqmstore_message.histo_size(); ++i) {
3043  std::string path;
3044  std::string objname;
3045 
3046  TObject* obj = nullptr;
3047  dqmstorepb::ROOTFilePB::Histo const& h = dqmstore_message.histo(i);
3048  get_info(h, path, objname, &obj);
3049 
3050  setCurrentFolder(path);
3051  if (obj) {
3052  /* Before calling the extract() check if histogram exists:
3053  * if it does - flags for the given monitor are already set (and merged)
3054  * else - set the flags after the histogram is created.
3055  */
3056  MonitorElement* me = findObject(0, 0, 0, path, objname);
3057 
3058  /* Run histograms should be collated and not overwritten,
3059  * Lumi histograms should be overwritten (and collate flag is not checked)
3060  */
3061  bool overwrite = h.flags() & DQMNet::DQM_PROP_LUMI;
3062  bool collate = !(h.flags() & DQMNet::DQM_PROP_LUMI);
3063  extract(static_cast<TObject*>(obj), path, overwrite, collate);
3064 
3065  if (me == nullptr) {
3066  me = findObject(0, 0, 0, path, objname);
3067  me->data_.flags = h.flags();
3068  }
3069 
3070  delete obj;
3071  }
3072  }
3073 
3074  cd();
3075  return true;
3076 }
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:2047
void get_info(dqmstorepb::ROOTFilePB_Histo const &, std::string &dirname, std::string &objname, TObject **obj)
Definition: DQMStore.cc:2983
static std::string const input
Definition: EdmProvDump.cc:48
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:2883
DQMNet::CoreObject data_
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:571
void cd()
go to top directory (ie. root)
Definition: DQMStore.cc:546
const ::dqmstorepb::ROOTFilePB_Histo & histo(int index) const
unsigned verbose_
Definition: DQMStore.h:632
::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:1739
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 3118 of file DQMStore.cc.

References pwd_.

3119 {
3121 }
std::string pwd_
Definition: DQMStore.h:649
void removeContents()
erase all monitoring elements in current directory (not including subfolders);
Definition: DQMStore.cc:3118
void DQMStore::removeContents ( std::string const &  dir)

remove all monitoring elements from directory;

Definition at line 3104 of file DQMStore.cc.

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

3105 {
3106  MonitorElement proto(&dir, std::string());
3107  auto e = data_.end();
3108  auto i = data_.lower_bound(proto);
3109  while (i != e && isSubdirectory(dir, *i->data_.dirname))
3110  if (dir == *i->data_.dirname)
3111  data_.erase(i++);
3112  else
3113  ++i;
3114 }
MEMap data_
Definition: DQMStore.h:650
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 3126 of file DQMStore.cc.

References pwd_.

Referenced by MonitorElementsDb::endJob(), and TrackerOfflineValidationSummary::fillTree().

3127 {
3129 }
void removeElement(std::string const &name)
Definition: DQMStore.cc:3126
std::string pwd_
Definition: DQMStore.h:649
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 3134 of file DQMStore.cc.

References gather_cfg::cout, and data_.

3135 {
3136  MonitorElement proto(&dir, name);
3137  auto pos = data_.find(proto);
3138  if (pos != data_.end())
3139  data_.erase(pos);
3140  else if (warning) {
3141  std::cout << "DQMStore: WARNING: attempt to remove non-existent"
3142  << " monitor element '" << name << "' in '" << dir << "'\n";
3143  }
3144 }
MEMap data_
Definition: DQMStore.h:650
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 1844 of file DQMStore.cc.

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

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

1845 {
1846  for (auto const& m : data_) {
1847  auto& me = const_cast<MonitorElement&>(m);
1848  if (me.wasUpdated()) {
1849  if (me.resetMe())
1850  me.Reset();
1851  me.resetUpdate();
1852  }
1853  }
1854 
1855  reset_ = true;
1856 }
bool reset_
Definition: DQMStore.h:634
void Reset()
reset ME (ie. contents, errors, etc)
MEMap data_
Definition: DQMStore.h:650
void DQMStore::rmdir ( std::string const &  path)

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

Definition at line 3084 of file DQMStore.cc.

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

Referenced by dqmCopyRecursively().

3085 {
3087  std::string const* cleaned = nullptr;
3088  cleanTrailingSlashes(path, clean, cleaned);
3089  MonitorElement proto(cleaned, std::string());
3090 
3091  auto e = data_.end();
3092  auto i = data_.lower_bound(proto);
3093  while (i != e && isSubdirectory(*cleaned, *i->data_.dirname))
3094  data_.erase(i++);
3095 
3096  auto de = dirs_.end();
3097  auto di = dirs_.lower_bound(*cleaned);
3098  while (di != de && isSubdirectory(*cleaned, *di))
3099  dirs_.erase(di++);
3100 }
std::vector< T * > clean
Definition: MVATrainer.cc:154
MEMap data_
Definition: DQMStore.h:650
std::set< std::string > dirs_
Definition: DQMStore.h:651
void DQMStore::runQTests ( )

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

Definition at line 3233 of file DQMStore.cc.

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

3234 {
3235 
3236  if (verbose_ > 0)
3237  std::cout << "DQMStore: running runQTests() with reset = "
3238  << ( reset_ ? "true" : "false" ) << std::endl;
3239 
3240  // Apply quality tests to each monitor element, skipping references.
3241  for (auto const& me : data_)
3242  if (! isSubdirectory(s_referenceDirName, *me.data_.dirname))
3243  const_cast<MonitorElement &>(me).runQTests();
3244 
3245  reset_ = false;
3246 }
bool reset_
Definition: DQMStore.h:634
unsigned verbose_
Definition: DQMStore.h:632
MEMap data_
Definition: DQMStore.h:650
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 2465 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(), SiStripDigiValid::endJob(), TrackingTruthValid::endJob(), SiPixelDigiValid::endJob(), LaserDQM::endJob(), TrackerHitAnalyzer::endJob(), SiStripLAProfileBooker::endJob(), dEdxAnalyzer::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().

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

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

Referenced by savePB().

2610 {
2611  for (auto const& me: boost::make_iterator_range(begin, end)) {
2612  if (not isSubdirectory(dir, *me.data_.dirname))
2613  break;
2614 
2615  if (verbose_ > 1)
2616  std::cout << "DQMStore::savePB:"
2617  << " run: " << me.run()
2618  << " lumi: " << me.lumi()
2619  << " lumiFlag: " << me.getLumiFlag()
2620  << " moduleId: " << me.moduleId()
2621  << " fullpathname: " << me.getFullname()
2622  << " flags: " << std::hex << me.data_.flags
2623  << std::endl;
2624 
2625  // Skip MonitorElements in a subdirectory of the current one.
2626  if (dir != *me.data_.dirname) {
2627  if (verbose_ > 1) {
2628  std::cout << "DQMStore::savePB: skipping monitor element in a subfolder of " << dir << "/" << std::endl;
2629  }
2630  continue;
2631  }
2632 
2633  // Handle reference histograms, with three distinct cases:
2634  // XXX not supported by protobuf files.
2635 
2636  if (verbose_ > 1) {
2637  std::cout << "DQMStore::savePB: saving monitor element" << std::endl;
2638  }
2639 
2640  saveMonitorElementToPB(me, file);
2641 
2642  // Count saved histograms
2643  ++counter;
2644  }
2645 }
#define end
Definition: vmac.h:39
void saveMonitorElementToPB(MonitorElement const &me, dqmstorepb::ROOTFilePB &file)
Definition: DQMStore.cc:2576
unsigned verbose_
Definition: DQMStore.h:632
#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 2385 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().

2394 {
2395  for (auto const& me: boost::make_iterator_range(begin, end)) {
2396  if (not isSubdirectory(dir, *me.data_.dirname))
2397  break;
2398 
2399  if (verbose_ > 1)
2400  std::cout << "DQMStore::save:"
2401  << " run: " << me.run()
2402  << " lumi: " << me.lumi()
2403  << " lumiFlag: " << me.getLumiFlag()
2404  << " moduleId: " << me.moduleId()
2405  << " fullpathname: " << me.getFullname()
2406  << " flags: " << std::hex << me.data_.flags
2407  << std::endl;
2408 
2409  // Skip MonitorElements in a subdirectory of the current one.
2410  if (dir != *me.data_.dirname) {
2411  if (verbose_ > 1) {
2412  std::cout << "DQMStore::save: skipping monitor element in a subfolder of " << dir << "/" << std::endl;
2413  }
2414  continue;
2415  }
2416 
2417  // Handle reference histograms, with three distinct cases:
2418  // 1) Skip all references entirely on saving.
2419  // 2) Blanket saving of all references.
2420  // 3) Save only references for monitor elements with qtests.
2421  // The latter two are affected by "path" sub-tree selection,
2422  // i.e. references are saved only in the selected tree part.
2423  if (isSubdirectory(refpath, *me.data_.dirname)) {
2424  if (ref == SaveWithoutReference)
2425  // Skip the reference entirely.
2426  continue;
2427  else if (ref == SaveWithReference)
2428  // Save all references regardless of qtests.
2429  ;
2430  else if (ref == SaveWithReferenceForQTest) {
2431  // Save only references for monitor elements with qtests
2432  // with an optional cut on minimum quality test result.
2433  int status = -1;
2434  std::string mname(me.getFullname(), s_referenceDirName.size()+1, std::string::npos);
2435  MonitorElement* master = get(mname);
2436  if (master)
2437  for (auto const& qreport : master->data_.qreports)
2438  status = std::max(status, qreport.code);
2439 
2440  if (not master or status < minStatus) {
2441  if (verbose_ > 1)
2442  std::cout << "DQMStore::save: skipping monitor element '"
2443  << me.data_.objname << "' while saving, status is "
2444  << status << ", required minimum status is "
2445  << minStatus << std::endl;
2446  continue;
2447  }
2448  }
2449  }
2450 
2451  if (verbose_ > 1) {
2452  std::cout << "DQMStore::save: saving monitor element" << std::endl;
2453  }
2454 
2456 
2457  // Count saved histograms
2458  ++counter;
2459  }
2460 }
Master< F > master(const F &f)
Definition: FunctClone.h:68
void saveMonitorElementToROOT(MonitorElement const &me, TFile &file)
Definition: DQMStore.cc:2356
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:632
#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 2576 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().

2578 {
2579  // Save the object.
2580  TBufferFile buffer(TBufferFile::kWrite);
2581  if (me.kind() < MonitorElement::DQM_KIND_TH1F) {
2582  TObjString object(me.tagString().c_str());
2583  buffer.WriteObject(&object);
2584  } else {
2585  buffer.WriteObject(me.object_);
2586  }
2588  histo.set_full_pathname(*me.data_.dirname + '/' + me.data_.objname);
2589  histo.set_flags(me.data_.flags);
2590  histo.set_size(buffer.Length());
2591  histo.set_streamed_histo((void const*)buffer.Buffer(), buffer.Length());
2592 
2593  // Save quality reports if this is not in reference section.
2594  // XXX not supported by protobuf files.
2595 
2596  // Save efficiency tag, if any.
2597  // XXX not supported by protobuf files.
2598 
2599  // Save tag if any.
2600  // XXX not supported by protobuf files.
2601 }
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 2356 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().

2358 {
2359  // Save the object.
2360  if (me.kind() < MonitorElement::DQM_KIND_TH1F) {
2361  TObjString(me.tagString().c_str()).Write();
2362  } else {
2363  me.object_->Write();
2364  }
2365 
2366  // Save quality reports if this is not in reference section.
2367  if (not isSubdirectory(s_referenceDirName, *me.data_.dirname)) {
2368  for (auto const& report: me.data_.qreports) {
2369  TObjString(me.qualityTagString(report).c_str()).Write();
2370  }
2371  }
2372 
2373  // Save efficiency tag, if any.
2374  if (me.data_.flags & DQMNet::DQM_PROP_EFFICIENCY_PLOT) {
2375  TObjString(me.effLabelString().c_str()).Write();
2376  }
2377 
2378  // Save tag if any.
2379  if (me.data_.flags & DQMNet::DQM_PROP_TAGGED) {
2380  TObjString(me.tagLabelString().c_str()).Write();
2381  }
2382 }
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 2650 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().

2654 {
2655  using google::protobuf::io::FileOutputStream;
2656  using google::protobuf::io::GzipOutputStream;
2657  using google::protobuf::io::StringOutputStream;
2658 
2659  std::lock_guard<std::mutex> guard(book_mutex_);
2660 
2661  unsigned int nme = 0;
2662 
2663  if (verbose_) {
2664  std::cout << "DQMStore::savePB: Opening PBFile '" << filename << "'"
2665  << std::endl;
2666  }
2667  dqmstorepb::ROOTFilePB dqmstore_message;
2668 
2669  // Loop over the directory structure.
2670  for (auto const& dir: dirs_) {
2671  // Check if we should process this directory. We process the
2672  // requested part of the object tree, including references.
2673  if (not path.empty()
2674  and not isSubdirectory(path, dir))
2675  continue;
2676 
2677  if (verbose_ > 1) {
2678  std::cout << "DQMStore::savePB: DQM folder " << dir << "/" << std::endl;
2679  }
2680 
2681  // Loop over monitor elements in this directory.
2682  if (not enableMultiThread_) {
2683  MonitorElement proto(&dir, std::string(), run, 0);
2684  auto begin = data_.lower_bound(proto);
2685  auto end = data_.end();
2686  saveMonitorElementRangeToPB(dir, run, begin, end, dqmstore_message, nme);
2687  } else {
2688  // Restrict the loop to the monitor elements for the current lumisection
2689  MonitorElement proto(&dir, std::string(), run, 0);
2690  proto.setLumi(lumi);
2691  auto begin = data_.lower_bound(proto);
2692  proto.setLumi(lumi+1);
2693  auto end = data_.lower_bound(proto);
2694  saveMonitorElementRangeToPB(dir, run, begin, end, dqmstore_message, nme);
2695  }
2696 
2697  // In LSbasedMode, loop also over the (run, 0) global histograms;
2698  // these could be the merged global histrograms of their per-stream
2699  // counterparts after the streamEndRun transition - but they are not
2700  // produced in LSbasedMode.
2701  if (enableMultiThread_ and LSbasedMode_ and lumi != 0) {
2702  auto begin = data_.lower_bound(MonitorElement(&dir, std::string(), run, 0));
2703  auto end = data_.lower_bound(MonitorElement(&dir, std::string(), run, 1));
2704  saveMonitorElementRangeToPB(dir, run, begin, end, dqmstore_message, nme);
2705  }
2706  }
2707 
2708  int filedescriptor = ::open(filename.c_str(),
2709  O_WRONLY | O_CREAT | O_TRUNC,
2710  S_IRUSR | S_IWUSR |
2711  S_IRGRP | S_IWGRP |
2712  S_IROTH);
2713  FileOutputStream file_stream(filedescriptor);
2715  options.format = GzipOutputStream::GZIP;
2716  options.compression_level = 1;
2717  GzipOutputStream gzip_stream(&file_stream, options);
2718  dqmstore_message.SerializeToZeroCopyStream(&gzip_stream);
2719 
2720  // Flush the internal streams before closing the fd.
2721  gzip_stream.Close();
2722  file_stream.Close();
2723  ::close(filedescriptor);
2724 
2725  // Maybe make some noise.
2726  if (verbose_) {
2727  std::cout << "DQMStore::savePB: successfully wrote " << nme
2728  << " objects from path '" << path << "/"
2729  << "' into DQM file '" << filename << "'\n";
2730  }
2731 }
std::mutex book_mutex_
Definition: DQMStore.h:657
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:2604
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:2883
#define end
Definition: vmac.h:39
unsigned verbose_
Definition: DQMStore.h:632
MEMap data_
Definition: DQMStore.h:650
#define begin
Definition: vmac.h:32
dbl *** dir
Definition: mlp_gen.cc:35
std::set< std::string > dirs_
Definition: DQMStore.h:651
bool LSbasedMode_
Definition: DQMStore.h:638
bool enableMultiThread_
Definition: DQMStore.h:637
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 3347 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_.

3348 {
3349  if (scaleFlag_ == 0.0) return;
3350  if (verbose_ > 0)
3351  std::cout << " =========== " << " ScaleFlag " << scaleFlag_ << std::endl;
3352  double factor = scaleFlag_;
3353  int events = 1;
3354  if (dirExists("Info/EventInfo")) {
3355  if ( scaleFlag_ == -1.0) {
3356  MonitorElement* scale_me = get("Info/EventInfo/ScaleFactor");
3357  if (scale_me && scale_me->kind()==MonitorElement::DQM_KIND_REAL) factor = scale_me->getFloatValue();
3358  }
3359  MonitorElement* event_me = get("Info/EventInfo/processedEvents");
3360  if (event_me && event_me->kind()==MonitorElement::DQM_KIND_INT) events = event_me->getIntValue();
3361  }
3362  factor = factor/(events*1.0);
3363 
3364  for (auto const& m : data_) {
3365  auto& me = const_cast<MonitorElement&>(m);
3366  switch (me.kind()) {
3368  {
3369  me.getTH1F()->Scale(factor);
3370  break;
3371  }
3373  {
3374  me.getTH1S()->Scale(factor);
3375  break;
3376  }
3378  {
3379  me.getTH1D()->Scale(factor);
3380  break;
3381  }
3383  {
3384  me.getTH2F()->Scale(factor);
3385  break;
3386  }
3388  {
3389  me.getTH2S()->Scale(factor);
3390  break;
3391  }
3393  {
3394  me.getTH2D()->Scale(factor);
3395  break;
3396  }
3398  {
3399  me.getTH3F()->Scale(factor);
3400  break;
3401  }
3403  {
3404  me.getTProfile()->Scale(factor);
3405  break;
3406  }
3408  {
3409  me.getTProfile2D()->Scale(factor);
3410  break;
3411  }
3412  default:
3413  if (verbose_ > 0)
3414  std::cout << " The DQM object '" << me.getFullname() << "' is not scalable object " << std::endl;
3415  continue;
3416  }
3417  }
3418 }
int64_t getIntValue() const
double getFloatValue() const
double scaleFlag_
Definition: DQMStore.h:635
bool dirExists(std::string const &path) const
true if directory exists
Definition: DQMStore.cc:635
unsigned verbose_
Definition: DQMStore.h:632
MEMap data_
Definition: DQMStore.h:650
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 3297 of file DQMStore.cc.

References MonitorElement::setAccumulate().

3298 {
3299  if (me)
3300  me->setAccumulate(flag);
3301 }
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 571 of file DQMStore.cc.

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

Referenced by SiStripDcsInfo::addBadModules(), DQMFileReader::beginJob(), L1ScalersClient::beginJob(), DQMFEDIntegrityClient::beginJob(), ConverterTester::beginJob(), APVValidationPlots::beginJob(), StripValidationPlots::beginJob(), DQMDaqInfo::beginJob(), MuonAlignment::beginJob(), HLTScalersClient::beginJob(), LatencyTask::book(), FineDelayTask::book(), CalibrationScanTask::book(), CalibrationTask::book(), MEtoMEComparitor::book(), TrackerOfflineValidationSummary::bookHarvestingHists(), PixelVTXMonitor::bookHistograms(), DQMLumiMonitor::bookHistograms(), SiStripCertificationInfo::bookSiStripCertificationMEs(), SiStripQualityChecker::bookStatus(), SiStripDcsInfo::bookStatus(), SiStripDaqInfo::bookStatus(), cd(), dqmCopyRecursively(), HarvestingAnalyzer::endJob(), HLTScalersClient::endLuminosityBlock(), 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().

572 {
574  std::string const* cleaned = nullptr;
575  cleanTrailingSlashes(fullpath, clean, cleaned);
576  makeDirectory(*cleaned);
577  pwd_ = *cleaned;
578 }
void makeDirectory(std::string const &path)
Definition: DQMStore.cc:595
std::string pwd_
Definition: DQMStore.h:649
std::vector< T * > clean
Definition: MVATrainer.cc:154
void DQMStore::setVerbose ( unsigned  level)
void DQMStore::showDirStructure ( ) const

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

3308 {
3309  std::vector<std::string> contents;
3310  getContents(contents);
3311 
3312  std::cout << " ------------------------------------------------------------\n"
3313  << " Directory structure: \n"
3314  << " ------------------------------------------------------------\n";
3315 
3316  std::copy(contents.begin(), contents.end(),
3317  std::ostream_iterator<std::string>(std::cout, "\n"));
3318 
3319  std::cout << " ------------------------------------------------------------\n";
3320 }
std::vector< MonitorElement * > getContents(std::string const &path) const
Definition: DQMStore.cc:1640
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 3280 of file DQMStore.cc.

References MonitorElement::softReset().

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

3281 {
3282  if (me)
3283  me->softReset();
3284 }
void DQMStore::tag ( MonitorElement me,
unsigned int  myTag 
)

tag ME as <myTag> (myTag > 0)

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

1501 {
1502  if (! myTag)
1503  raiseDQMError("DQMStore", "Attempt to tag monitor element '%s'"
1504  " with a zero tag", me->getFullname().c_str());
1505  if ((me->data_.flags & DQMNet::DQM_PROP_TAGGED) && myTag != me->data_.tag)
1506  raiseDQMError("DQMStore", "Attempt to tag monitor element '%s'"
1507  " twice with multiple tags", me->getFullname().c_str());
1508 
1509  me->data_.tag = myTag;
1511 }
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 1515 of file DQMStore.cc.

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

1516 {
1517  std::string dir;
1518  std::string name;
1519  splitPath(dir, name, path);
1520 
1521  if (MonitorElement* me = findObject(0, 0, 0, dir, name))
1522  tag(me, myTag);
1523  else
1524  raiseDQMError("DQMStore", "Attempt to tag non-existent monitor element"
1525  " '%s' with tag %u", path.c_str(), myTag);
1526 
1527 }
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1500
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:1739
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 1543 of file DQMStore.cc.

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

1544 {
1546  std::string const* cleaned = nullptr;
1547  cleanTrailingSlashes(path, clean, cleaned);
1548  MonitorElement proto(cleaned, std::string());
1549 
1550  // FIXME: WILDCARDS? Old one supported them, but nobody seemed to use them.
1551  auto e = data_.end();
1552  auto i = data_.lower_bound(proto);
1553  while (i != e && isSubdirectory(*cleaned, *i->data_.dirname)) {
1554  tag(const_cast<MonitorElement*>(&*i), myTag);
1555  ++i;
1556  }
1557 }
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1500
std::vector< T * > clean
Definition: MVATrainer.cc:154
MEMap data_
Definition: DQMStore.h:650
void DQMStore::tagContents ( std::string const &  path,
unsigned int  myTag 
)

tag all children of folder (does NOT include subfolders)

Definition at line 1531 of file DQMStore.cc.

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

1532 {
1533  MonitorElement proto(&path, std::string());
1534  auto e = data_.end();
1535  auto i = data_.lower_bound(proto);
1536  for ( ; i != e && path == *i->data_.dirname; ++i)
1537  tag(const_cast<MonitorElement *>(&*i), myTag);
1538 }
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1500
MEMap data_
Definition: DQMStore.h:650
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 3184 of file DQMStore.cc.

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

3185 {
3186  // Clean the path
3188  std::string const* cleaned = nullptr;
3189  cleanTrailingSlashes(dir, clean, cleaned);
3190 
3191  // Validate the path.
3192  if (cleaned->find_first_not_of(s_safe) != std::string::npos)
3193  raiseDQMError("DQMStore", "Monitor element path name '%s'"
3194  " uses unacceptable characters", cleaned->c_str());
3195 
3196  // Redirect to the pattern match version.
3197  useQTestByMatch(*cleaned + "/*", qtname);
3198 }
std::vector< T * > clean
Definition: MVATrainer.cc:154
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:3202
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 3202 of file DQMStore.cc.

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

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

3203 {
3204  QCriterion* qc = getQCriterion(qtname);
3205  if (! qc)
3206  raiseDQMError("DQMStore", "Cannot apply non-existent quality test '%s'",
3207  qtname.c_str());
3208 
3209  auto* fm = new fastmatch(pattern);
3210 
3211  // Record the test for future reference.
3212  QTestSpec qts(fm, qc);
3213  qtestspecs_.push_back(qts);
3214 
3215  // Apply the quality test.
3216  std::string path;
3217  int cases = 0;
3218  for (auto const& me : data_) {
3219  path.clear();
3220  mergePath(path, *me.data_.dirname, me.data_.objname);
3221  if (fm->match(path)) {
3222  ++cases;
3223  const_cast<MonitorElement &>(me).addQReport(qts.second);
3224  }
3225  }
3226 
3227  //return the number of matched cases
3228  return cases;
3229 }
std::pair< fastmatch *, QCriterion * > QTestSpec
Definition: DQMStore.h:605
QTestSpecs qtestspecs_
Definition: DQMStore.h:655
QCriterion * getQCriterion(std::string const &qtname) const
Definition: DQMStore.cc:3152
MEMap data_
Definition: DQMStore.h:650
void raiseDQMError(const char *context, const char *fmt,...)
Definition: DQMError.cc:11

Friends And Related Function Documentation

friend class DQMArchiver
friend

Definition at line 662 of file DQMStore.h.

friend class DQMFileSaver
friend

Definition at line 666 of file DQMStore.h.

friend class DQMNet
friend

Definition at line 661 of file DQMStore.h.

friend class DQMRootOutputModule
friend

Definition at line 664 of file DQMStore.h.

friend class DQMRootSource
friend

Definition at line 665 of file DQMStore.h.

friend class DQMService
friend

Definition at line 660 of file DQMStore.h.

friend class DQMStoreExample
friend

Definition at line 663 of file DQMStore.h.

friend class edm::DQMHttpSource
friend

Definition at line 659 of file DQMStore.h.

friend class MEtoEDMConverter
friend

Definition at line 667 of file DQMStore.h.

Member Data Documentation

std::mutex DQMStore::book_mutex_
private
bool DQMStore::canSaveByLumi_ {false}
private

Definition at line 644 of file DQMStore.h.

Referenced by book_(), and bookTransaction().

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

Definition at line 651 of file DQMStore.h.

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

bool DQMStore::doSaveByLumi_ {false}
private

Definition at line 646 of file DQMStore.h.

Referenced by book_(), and initializeFrom().

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

Definition at line 639 of file DQMStore.h.

Referenced by DQMStore(), and forceReset().

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

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

Referenced by createQTest(), and initializeFrom().

DQMStore::qtests_
private

All the quality tests.

Definition at line 653 of file DQMStore.h.

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

QTestSpecs DQMStore::qtestspecs_
private

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

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

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

Definition at line 635 of file DQMStore.h.

Referenced by initializeFrom(), and scaleElements().

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

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

Referenced by createQTest(), and initializeFrom().