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);
165 TString
const&
name, TString
const&
title,
int nchX,
float const* xbinsize, FUNC onbooking =
NOOP()) {
167 auto th1 =
new TH1D(
name,
title, nchX, xbinsize);
178 auto th1 =
static_cast<TH1D*
>(
object->Clone(
name));
187 TString
const&
title,
191 FUNC onbooking =
NOOP()) {
193 auto th1 =
new TH1I(
name,
title, nchX, lowX, highX);
200 TString
const&
name, TString
const&
title,
int nchX,
float const* xbinsize, FUNC onbooking =
NOOP()) {
202 auto th1 =
new TH1I(
name,
title, nchX, xbinsize);
213 auto th1 =
static_cast<TH1I*
>(
object->Clone(
name));
222 TString
const&
title,
229 FUNC onbooking =
NOOP()) {
231 auto th2 =
new TH2F(
name,
title, nchX, lowX, highX, nchY, lowY, highY);
238 TString
const&
title,
240 float const* xbinsize,
242 float const* ybinsize,
243 FUNC onbooking =
NOOP()) {
245 auto th2 =
new TH2F(
name,
title, nchX, xbinsize, nchY, ybinsize);
256 auto th2 =
static_cast<TH2F*
>(
object->Clone(
name));
264 TString
const&
title,
271 FUNC onbooking =
NOOP()) {
273 auto th2 =
new TH2S(
name,
title, nchX, lowX, highX, nchY, lowY, highY);
280 TString
const&
title,
282 float const* xbinsize,
284 float const* ybinsize,
285 FUNC onbooking =
NOOP()) {
287 auto th2 =
new TH2S(
name,
title, nchX, xbinsize, nchY, ybinsize);
298 auto th2 =
static_cast<TH2S*
>(
object->Clone(
name));
306 TString
const&
title,
313 FUNC onbooking =
NOOP()) {
315 auto th2 =
new TH2I(
name,
title, nchX, lowX, highX, nchY, lowY, highY);
322 TString
const&
title,
324 float const* xbinsize,
326 float const* ybinsize,
327 FUNC onbooking =
NOOP()) {
329 auto th2 =
new TH2I(
name,
title, nchX, xbinsize, nchY, ybinsize);
340 auto th2 =
static_cast<TH2I*
>(
object->Clone(
name));
348 TString
const&
title,
355 FUNC onbooking =
NOOP()) {
357 auto th2 =
new TH2D(
name,
title, nchX, lowX, highX, nchY, lowY, highY);
368 auto th2 =
static_cast<TH2D*
>(
object->Clone(
name));
377 TString
const&
title,
387 FUNC onbooking =
NOOP()) {
389 auto th3 =
new TH3F(
name,
title, nchX, lowX, highX, nchY, lowY, highY, nchZ, lowZ, highZ);
400 auto th3 =
static_cast<TH3F*
>(
object->Clone(
name));
409 TString
const&
title,
417 FUNC onbooking =
NOOP()) {
419 auto tprofile =
new TProfile(
name,
title, nchX, lowX, highX, lowY, highY,
option);
426 TString
const&
title,
433 FUNC onbooking =
NOOP()) {
435 auto tprofile =
new TProfile(
name,
title, nchX, lowX, highX, lowY, highY,
option);
442 TString
const&
title,
444 double const* xbinsize,
449 FUNC onbooking =
NOOP()) {
451 auto tprofile =
new TProfile(
name,
title, nchX, xbinsize, lowY, highY,
option);
458 TString
const&
title,
460 double const* xbinsize,
464 FUNC onbooking =
NOOP()) {
466 auto tprofile =
new TProfile(
name,
title, nchX, xbinsize, lowY, highY,
option);
477 auto tprofile =
static_cast<TProfile*
>(
object->Clone(
name));
486 TString
const&
title,
496 FUNC onbooking =
NOOP()) {
498 auto tprofile =
new TProfile2D(
name,
title, nchX, lowX, highX, nchY, lowY, highY, lowZ, highZ,
option);
505 TString
const&
title,
516 FUNC onbooking =
NOOP()) {
518 auto tprofile =
new TProfile2D(
name,
title, nchX, lowX, highX, nchY, lowY, highY, lowZ, highZ,
option);
529 auto tprofile =
static_cast<TProfile2D*
>(
object->Clone(
name));
542 template <MonitorElementData::Scope SCOPE>
562 bool forceReplace =
false);
593 uint32_t
lumi)
const;
611 virtual std::vector<std::string>
getSubdirs()
const;
613 virtual std::vector<std::string>
getMEs()
const;
643 bool overwrite =
false,
647 bool fileMustExist =
true);
664 template <
typename iFunc>
684 struct ModuleIdScope {
695 oldscope_ = booker_.
setScope(newscope);
707 ModuleIdScope booker(
711 canSaveByLumi && this->
doSaveByLumi_ ? MonitorElementData::Scope::LUMI : MonitorElementData::Scope::RUN,
718 template <
typename iFunc>
758 template <
typename MELIKE>
789 std::map<edm::LuminosityBlockID, std::set<MonitorElement*, MonitorElement::MEComparison>>
globalMEs_;
793 std::map<uint64_t, std::set<MonitorElement*, MonitorElement::MEComparison>>
localMEs_;
834 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())
key
prepare the HTCondor submission files and eventually submit them
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 * book1DD(TString const &name, TString const &title, int nchX, float const *xbinsize, FUNC onbooking=NOOP())
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())
static constexpr uint64_t kInvalidModuleID
virtual DQM_DEPRECATED std::vector< std::string > getSubdirs() const