1 #ifndef DQMServices_Core_DQMStore_h 2 #define DQMServices_Core_DQMStore_h 15 std::cout << "TRACE: " << __FILE__ << ":" << __LINE__ << "(" << __FUNCTION__ << ") " << msg << std::endl; 16 #define TRACE_ TRACE(""); 19 namespace implementation {
93 me->Fill(initial_value);
103 FUNC onbooking =
NOOP()) {
105 auto th1 =
new TH1F(
name,
title, nchX, lowX, highX);
112 TString
const&
name, TString
const&
title,
int nchX,
float const* xbinsize, FUNC onbooking =
NOOP()) {
114 auto th1 =
new TH1F(
name,
title, nchX, xbinsize);
125 auto th1 =
static_cast<TH1F*
>(
object->Clone(
name));
134 TString
const&
name, TString
const&
title,
int nchX,
double lowX,
double highX, FUNC onbooking =
NOOP()) {
136 auto th1 =
new TH1S(
name,
title, nchX, lowX, highX);
147 auto th1 =
static_cast<TH1S*
>(
object->Clone(
name));
156 TString
const&
name, TString
const&
title,
int nchX,
double lowX,
double highX, FUNC onbooking =
NOOP()) {
158 auto th1 =
new TH1D(
name,
title, nchX, lowX, highX);
169 auto th1 =
static_cast<TH1D*
>(
object->Clone(
name));
178 TString
const&
title,
182 FUNC onbooking =
NOOP()) {
184 auto th1 =
new TH1I(
name,
title, nchX, lowX, highX);
191 TString
const&
name, TString
const&
title,
int nchX,
float const* xbinsize, FUNC onbooking =
NOOP()) {
193 auto th1 =
new TH1I(
name,
title, nchX, xbinsize);
204 auto th1 =
static_cast<TH1I*
>(
object->Clone(
name));
213 TString
const&
title,
220 FUNC onbooking =
NOOP()) {
222 auto th2 =
new TH2F(
name,
title, nchX, lowX, highX, nchY, lowY, highY);
229 TString
const&
title,
231 float const* xbinsize,
233 float const* ybinsize,
234 FUNC onbooking =
NOOP()) {
236 auto th2 =
new TH2F(
name,
title, nchX, xbinsize, nchY, ybinsize);
247 auto th2 =
static_cast<TH2F*
>(
object->Clone(
name));
255 TString
const&
title,
262 FUNC onbooking =
NOOP()) {
264 auto th2 =
new TH2S(
name,
title, nchX, lowX, highX, nchY, lowY, highY);
271 TString
const&
title,
273 float const* xbinsize,
275 float const* ybinsize,
276 FUNC onbooking =
NOOP()) {
278 auto th2 =
new TH2S(
name,
title, nchX, xbinsize, nchY, ybinsize);
289 auto th2 =
static_cast<TH2S*
>(
object->Clone(
name));
297 TString
const&
title,
304 FUNC onbooking =
NOOP()) {
306 auto th2 =
new TH2I(
name,
title, nchX, lowX, highX, nchY, lowY, highY);
313 TString
const&
title,
315 float const* xbinsize,
317 float const* ybinsize,
318 FUNC onbooking =
NOOP()) {
320 auto th2 =
new TH2I(
name,
title, nchX, xbinsize, nchY, ybinsize);
331 auto th2 =
static_cast<TH2I*
>(
object->Clone(
name));
339 TString
const&
title,
346 FUNC onbooking =
NOOP()) {
348 auto th2 =
new TH2D(
name,
title, nchX, lowX, highX, nchY, lowY, highY);
359 auto th2 =
static_cast<TH2D*
>(
object->Clone(
name));
368 TString
const&
title,
378 FUNC onbooking =
NOOP()) {
380 auto th3 =
new TH3F(
name,
title, nchX, lowX, highX, nchY, lowY, highY, nchZ, lowZ, highZ);
391 auto th3 =
static_cast<TH3F*
>(
object->Clone(
name));
400 TString
const&
title,
408 FUNC onbooking =
NOOP()) {
410 auto tprofile =
new TProfile(
name,
title, nchX, lowX, highX, lowY, highY,
option);
417 TString
const&
title,
424 FUNC onbooking =
NOOP()) {
426 auto tprofile =
new TProfile(
name,
title, nchX, lowX, highX, lowY, highY,
option);
433 TString
const&
title,
435 double const* xbinsize,
440 FUNC onbooking =
NOOP()) {
442 auto tprofile =
new TProfile(
name,
title, nchX, xbinsize, lowY, highY,
option);
449 TString
const&
title,
451 double const* xbinsize,
455 FUNC onbooking =
NOOP()) {
457 auto tprofile =
new TProfile(
name,
title, nchX, xbinsize, lowY, highY,
option);
468 auto tprofile =
static_cast<TProfile*
>(
object->Clone(
name));
477 TString
const&
title,
487 FUNC onbooking =
NOOP()) {
489 auto tprofile =
new TProfile2D(
name,
title, nchX, lowX, highX, nchY, lowY, highY, lowZ, highZ,
option);
496 TString
const&
title,
507 FUNC onbooking =
NOOP()) {
509 auto tprofile =
new TProfile2D(
name,
title, nchX, lowX, highX, nchY, lowY, highY, lowZ, highZ,
option);
520 auto tprofile =
static_cast<TProfile2D*
>(
object->Clone(
name));
533 template <MonitorElementData::Scope SCOPE>
553 bool forceReplace =
false);
583 uint32_t
lumi)
const;
601 virtual std::vector<std::string>
getSubdirs()
const;
603 virtual std::vector<std::string>
getMEs()
const;
633 bool overwrite =
false,
637 bool fileMustExist =
true);
654 template <
typename iFunc>
674 struct ModuleIdScope {
685 oldscope_ = booker_.
setScope(newscope);
687 assert(newid != 0 || !
"moduleID must be set for normal booking transaction");
688 assert(oldid_ == 0 || !
"Nested booking transaction?");
697 ModuleIdScope booker(
701 canSaveByLumi && this->
doSaveByLumi_ ? MonitorElementData::Scope::LUMI : MonitorElementData::Scope::RUN,
708 template <
typename iFunc>
748 template <
typename MELIKE>
779 std::map<edm::LuminosityBlockID, std::set<MonitorElement*, MonitorElement::MEComparison>>
globalMEs_;
783 std::map<uint64_t, std::set<MonitorElement*, MonitorElement::MEComparison>>
localMEs_;
824 namespace harvesting {
DQMStore(edm::ParameterSet const &pset, edm::ActivityRegistry &)
MonitorElement * book2D(TString const &name, TString const &title, int nchX, float const *xbinsize, int nchY, float const *ybinsize, FUNC onbooking=NOOP())
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
MonitorElement * book2S(TString const &name, TString const &title, int nchX, float const *xbinsize, int nchY, float const *ybinsize, FUNC onbooking=NOOP())
MonitorElement * book2D(TString const &name, TH2F *object, FUNC onbooking=NOOP())
MonitorElement * book1D(TString const &name, TString const &title, int nchX, float const *xbinsize, FUNC onbooking=NOOP())
MonitorElement * bookProfile2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, double lowZ, double highZ, char const *option="s", FUNC onbooking=NOOP())
virtual DQM_DEPRECATED MonitorElement * getElement(std::string const &path) const
MonitorElement * book1I(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
MonitorElement * book2S(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
virtual void setCurrentFolder(std::string const &fullpath)
MonitorElement * book1D(TString const &name, TH1F *object, FUNC onbooking=NOOP())
MonitorElement * bookProfile(TString const &name, TProfile *object, FUNC onbooking=NOOP())
dqm::legacy::DQMStore DQMStore
const auto & getMEsToSave() const
virtual std::vector< std::string > getMEs() const
virtual std::string pwd()
virtual edm::LuminosityBlockID setRunLumi(edm::LuminosityBlockID runlumi)
void setCurrentFolder(std::string const &fullpath) override
virtual MonitorElementData::Scope setScope(MonitorElementData::Scope newscope)
virtual bool dirExists(std::string const &path) const
UseScope(IBooker &booker)
void printTrace(std::string const &message)
void bookTransaction(iFunc f, uint64_t moduleId, bool canSaveByLumi)
MonitorElement * book2DD(TString const &name, TH2D *object, FUNC onbooking=NOOP())
std::map< uint64_t, std::set< MonitorElement *, MonitorElement::MEComparison > > localMEs_
virtual MonitorElement * bookME(TString const &name, MonitorElementData::Kind kind, std::function< TH1 *()> makeobject, bool forceReplace=false)
void cd(std::string const &dir) override
std::string pwd() override
edm::LuminosityBlockID runlumi_
MonitorElementData::Scope scope_
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
unsigned int LuminosityBlockNumber_t
DQMStore & operator=(DQMStore const &)=delete
MonitorElement * book1S(TString const &name, TH1S *object, FUNC onbooking=NOOP())
MonitorElement * bookString(TString const &name, TString const &value, FUNC onbooking=NOOP())
MonitorElement * findOrRecycle(MonitorElementData::Key const &)
void leaveLumi(edm::RunNumber_t run, edm::LuminosityBlockNumber_t lumi, uint64_t moduleID)
MonitorElement * book1DD(TString const &name, TString const &title, int nchX, double lowX, double highX, FUNC onbooking=NOOP())
void initLumi(edm::RunNumber_t run, edm::LuminosityBlockNumber_t lumi)
void enterLumi(edm::RunNumber_t run, edm::LuminosityBlockNumber_t lumi, uint64_t moduleID)
std::recursive_mutex booking_mutex_
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
virtual std::vector< dqm::harvesting::MonitorElement * > getAllContents(std::string const &path) const
MonitorElement * book2I(TString const &name, TString const &title, int nchX, float const *xbinsize, int nchY, float const *ybinsize, FUNC onbooking=NOOP())
void meBookerGetter(iFunc f)
MonitorElement * book1S(TString const &name, TString const &title, int nchX, double lowX, double highX, FUNC onbooking=NOOP())
std::map< edm::LuminosityBlockID, std::set< MonitorElement *, MonitorElement::MEComparison > > globalMEs_
virtual uint64_t setModuleID(uint64_t moduleID)
MonitorElement * book1I(TString const &name, TString const &title, int nchX, float const *xbinsize, FUNC onbooking=NOOP())
MonitorElement * book1I(TString const &name, TH1I *object, FUNC onbooking=NOOP())
MonitorElementData::Scope oldscope
dqm::legacy::MonitorElement MonitorElement
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double const *xbinsize, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
MonitorElement * bookProfile2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int, double lowZ, double highZ, char const *option="s", FUNC onbooking=NOOP())
unsigned long long uint64_t
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
MonitorElement * findME(MELIKE const &path)
MonitorElement * bookInt(TString const &name, FUNC onbooking=NOOP())
MonitorElement * book2DD(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
std::vector< std::string > MEsToSave_
void operator()(TH1 *) const
MonitorElement * bookProfile2D(TString const &name, TProfile2D *object, FUNC onbooking=NOOP())
MonitorElement * putME(MonitorElement *me)
DQM_DEPRECATED void save(std::string const &filename, std::string const &path="")
MonitorElement * book2S(TString const &name, TH2S *object, FUNC onbooking=NOOP())
const bool & getMode() const
uint16_t *__restrict__ uint16_t const *__restrict__ uint32_t const *__restrict__ uint32_t *__restrict__ uint32_t const *__restrict__ moduleId
dqm::reco::DQMStore::IBooker IBooker
MonitorElement * book1DD(TString const &name, TH1D *object, FUNC onbooking=NOOP())
void cleanupLumi(edm::RunNumber_t run, edm::LuminosityBlockNumber_t lumi)
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double const *xbinsize, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
void debugTrackME(const char *message, MonitorElement *me_local, MonitorElement *me_global) const
MonitorElement * book2I(TString const &name, TH2I *object, FUNC onbooking=NOOP())
MonitorElement * book3D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ, FUNC onbooking=NOOP())
MonitorElement * book2I(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
DQM_DEPRECATED bool open(std::string const &filename, bool overwrite=false, std::string const &path="", std::string const &prepend="", OpenRunDirs stripdirs=KeepRunDirs, bool fileMustExist=true)
virtual std::vector< dqm::harvesting::MonitorElement * > getContents(std::string const &path) const
MonitorElement * book3D(TString const &name, TH3F *object, FUNC onbooking=NOOP())
virtual DQM_DEPRECATED std::vector< std::string > getSubdirs() const