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,
185 FUNC onbooking =
NOOP()) {
187 auto th2 =
new TH2F(name, title, nchX, lowX, highX, nchY, lowY, highY);
194 TString
const& title,
196 float const* xbinsize,
198 float const* ybinsize,
199 FUNC onbooking =
NOOP()) {
201 auto th2 =
new TH2F(name, title, nchX, xbinsize, nchY, ybinsize);
212 auto th2 =
static_cast<TH2F*
>(
object->Clone(name));
220 TString
const& title,
227 FUNC onbooking =
NOOP()) {
229 auto th2 =
new TH2S(name, title, nchX, lowX, highX, nchY, lowY, highY);
236 TString
const& title,
238 float const* xbinsize,
240 float const* ybinsize,
241 FUNC onbooking =
NOOP()) {
243 auto th2 =
new TH2S(name, title, nchX, xbinsize, nchY, ybinsize);
254 auto th2 =
static_cast<TH2S*
>(
object->Clone(name));
262 TString
const& title,
269 FUNC onbooking =
NOOP()) {
271 auto th2 =
new TH2D(name, title, nchX, lowX, highX, nchY, lowY, highY);
282 auto th2 =
static_cast<TH2D*
>(
object->Clone(name));
291 TString
const& title,
301 FUNC onbooking =
NOOP()) {
303 auto th3 =
new TH3F(name, title, nchX, lowX, highX, nchY, lowY, highY, nchZ, lowZ, highZ);
314 auto th3 =
static_cast<TH3F*
>(
object->Clone(name));
323 TString
const& title,
330 char const* option =
"s",
331 FUNC onbooking =
NOOP()) {
333 auto tprofile =
new TProfile(name, title, nchX, lowX, highX, lowY, highY, option);
340 TString
const& title,
346 char const* option =
"s",
347 FUNC onbooking =
NOOP()) {
349 auto tprofile =
new TProfile(name, title, nchX, lowX, highX, lowY, highY, option);
356 TString
const& title,
358 double const* xbinsize,
362 char const* option =
"s",
363 FUNC onbooking =
NOOP()) {
365 auto tprofile =
new TProfile(name, title, nchX, xbinsize, lowY, highY, option);
372 TString
const& title,
374 double const* xbinsize,
377 char const* option =
"s",
378 FUNC onbooking =
NOOP()) {
380 auto tprofile =
new TProfile(name, title, nchX, xbinsize, lowY, highY, option);
391 auto tprofile =
static_cast<TProfile*
>(
object->Clone(name));
400 TString
const& title,
409 char const* option =
"s",
410 FUNC onbooking =
NOOP()) {
412 auto tprofile =
new TProfile2D(name, title, nchX, lowX, highX, nchY, lowY, highY, lowZ, highZ, option);
419 TString
const& title,
429 char const* option =
"s",
430 FUNC onbooking =
NOOP()) {
432 auto tprofile =
new TProfile2D(name, title, nchX, lowX, highX, nchY, lowY, highY, lowZ, highZ, option);
443 auto tprofile =
static_cast<TProfile2D*
>(
object->Clone(name));
456 template <MonitorElementData::Scope SCOPE>
476 bool forceReplace =
false);
506 uint32_t
lumi)
const;
524 virtual std::vector<std::string>
getSubdirs()
const;
526 virtual std::vector<std::string>
getMEs()
const;
556 bool overwrite =
false,
560 bool fileMustExist =
true);
577 template <
typename iFunc>
597 struct ModuleIdScope {
607 oldid_ = booker_.setModuleID(newid);
608 oldscope_ = booker_.setScope(newscope);
609 oldrunlumi_ = booker_.setRunLumi(newrunlumi);
610 assert(newid != 0 || !
"moduleID must be set for normal booking transaction");
611 assert(oldid_ == 0 || !
"Nested booking transaction?");
614 booker_.setModuleID(oldid_);
615 booker_.setScope(oldscope_);
616 booker_.setRunLumi(oldrunlumi_);
620 ModuleIdScope booker(
624 canSaveByLumi && this->
doSaveByLumi_ ? MonitorElementData::Scope::LUMI : MonitorElementData::Scope::RUN,
631 template <
typename iFunc>
671 template <
typename MELIKE>
698 std::map<edm::LuminosityBlockID, std::set<MonitorElement*, MonitorElement::MEComparison>>
globalMEs_;
702 std::map<uint64_t, std::set<MonitorElement*, MonitorElement::MEComparison>>
localMEs_;
739 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())
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())
virtual DQM_DEPRECATED std::vector< std::string > getSubdirs() const
virtual DQM_DEPRECATED MonitorElement * getElement(std::string const &path) const
void debugTrackME(const char *message, MonitorElement *me_local, MonitorElement *me_global) const
virtual std::vector< dqm::harvesting::MonitorElement * > getContents(std::string const &path) 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)
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
virtual bool dirExists(std::string const &path) const
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
virtual std::vector< dqm::harvesting::MonitorElement * > getAllContents(std::string const &path) const
MonitorElement * book1S(TString const &name, TH1S *object, FUNC onbooking=NOOP())
MonitorElement * bookString(TString const &name, TString const &value, FUNC onbooking=NOOP())
dqm::reco::DQMStore DQMStore
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 operator()(TH1 *) const
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())
tuple key
prepare the HTCondor submission files and eventually submit them
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)
uint16_t *__restrict__ uint16_t const *__restrict__ uint32_t const *__restrict__ uint32_t *__restrict__ uint32_t const *__restrict__ moduleId
MonitorElementData::Scope oldscope
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
dqm::legacy::MonitorElement MonitorElement
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_
MonitorElement * bookProfile2D(TString const &name, TProfile2D *object, FUNC onbooking=NOOP())
MonitorElement * putME(MonitorElement *me)
virtual std::vector< std::string > getMEs() const
DQM_DEPRECATED void save(std::string const &filename, std::string const &path="")
MonitorElement * book2S(TString const &name, TH2S *object, FUNC onbooking=NOOP())
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())
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())
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)
MonitorElement * book3D(TString const &name, TH3F *object, FUNC onbooking=NOOP())