19 : bookPrefix_(
"ele"), bookIndex_(0), histoNamesReady(
false), finalDone_(
false) {
44 std::ostringstream oss;
54 typedef std::vector<std::string> HistoNames;
55 typedef HistoNames::iterator HistoNamesItr;
61 std::vector<HistoNamesItr>
res;
64 std::size_t nsize = name.size(), lsize = histoName->size();
65 if ((lsize >= nsize) && (histoName->find(name) == (lsize - nsize))) {
66 res.push_back(histoName);
70 std::ostringstream oss;
80 }
else if (res.size() > 1) {
81 std::ostringstream oss;
84 std::vector<HistoNamesItr>::iterator resItr;
85 for (resItr = res.begin(); resItr != res.end(); ++resItr) {
86 oss << sep <<
' ' << (**resItr);
105 edm::LogWarning(
"ElectronDqmHarvesterBase::endLuminosityBlock") <<
"finalize() already called";
115 edm::LogWarning(
"ElectronDqmHarvesterBase::dqmEndJob") <<
"finalize() already called";
146 return bookH1andDivide(iBooker, iGetter, name,
get(iGetter, num),
get(iGetter, denom), titleX, titleY, title);
157 return bookH2andDivide(iBooker, iGetter, name,
get(iGetter, num),
get(iGetter, denom), titleX, titleY, title);
165 return cloneH1(iBooker, iGetter, clone,
get(iGetter, original), title);
176 return profileX(iBooker, iGetter,
get(iGetter, me2d), title, titleX, titleY, minimum, maximum);
187 return profileY(iBooker, iGetter,
get(iGetter, me2d), title, titleX, titleY, minimum, maximum);
201 if (!titleX.empty()) {
204 if (!titleY.empty()) {
205 me->
getTH1F()->GetYaxis()->SetTitle(titleY.c_str());
207 if (TString(option) !=
"") {
211 me->
getTH1F()->StatOverflows(kTRUE);
228 if (!titleX.empty()) {
231 if (!titleY.empty()) {
232 me->
getTH1F()->GetYaxis()->SetTitle(titleY.c_str());
234 if (TString(option) !=
"") {
238 me->
getTH1F()->StatOverflows(kTRUE);
257 if (!titleX.empty()) {
260 if (!titleY.empty()) {
261 me->
getTH2F()->GetYaxis()->SetTitle(titleY.c_str());
263 if (TString(option) !=
"") {
267 me->
getTH1F()->StatOverflows(kTRUE);
287 if (!titleX.empty()) {
290 if (!titleY.empty()) {
291 me->
getTH2F()->GetYaxis()->SetTitle(titleY.c_str());
293 if (TString(option) !=
"") {
297 me->
getTH1F()->StatOverflows(kTRUE);
315 if (!titleX.empty()) {
316 me->
getTProfile()->GetXaxis()->SetTitle(titleX.c_str());
318 if (!titleY.empty()) {
319 me->
getTProfile()->GetYaxis()->SetTitle(titleY.c_str());
321 if (TString(option) !=
"") {
325 me->
getTH1F()->StatOverflows(kTRUE);
338 if ((!num) || (!denom))
342 TH1F *h_temp = (TH1F *)num->
getTH1F()->Clone(name2.c_str());
344 h_temp->Divide(num->
getTH1(), denom->
getTH1(), 1, 1,
"b");
345 h_temp->GetXaxis()->SetTitle(titleX.c_str());
346 h_temp->GetYaxis()->SetTitle(titleY.c_str());
347 if (!title.empty()) {
348 h_temp->SetTitle(title.c_str());
369 if ((!num) || (!denom))
373 TH2F *h_temp = (TH2F *)num->
getTH2F()->Clone(name2.c_str());
375 h_temp->Divide(num->
getTH1(), denom->
getTH1(), 1, 1,
"b");
376 h_temp->GetXaxis()->SetTitle(titleX.c_str());
377 h_temp->GetYaxis()->SetTitle(titleY.c_str());
378 if (!title.empty()) {
379 h_temp->SetTitle(title.c_str());
401 TH1F *h_temp = (TH1F *)original->
getTH1F()->Clone(name2.c_str());
403 if (!title.empty()) {
404 h_temp->SetTitle(title.c_str());
421 TProfile *p1_temp = me2d->
getTH2F()->ProfileX();
422 if (!title.empty()) {
423 p1_temp->SetTitle(title.c_str());
425 if (!titleX.empty()) {
426 p1_temp->GetXaxis()->SetTitle(titleX.c_str());
428 if (!titleY.empty()) {
429 p1_temp->GetYaxis()->SetTitle(titleY.c_str());
431 if (minimum != -1111) {
432 p1_temp->SetMinimum(minimum);
434 if (maximum != -1111) {
435 p1_temp->SetMaximum(maximum);
452 TProfile *p1_temp = me2d->
getTH2F()->ProfileY();
453 if (!title.empty()) {
454 p1_temp->SetTitle(title.c_str());
456 if (!titleX.empty()) {
457 p1_temp->GetXaxis()->SetTitle(titleX.c_str());
459 if (!titleY.empty()) {
460 p1_temp->GetYaxis()->SetTitle(titleY.c_str());
462 if (minimum != -1111) {
463 p1_temp->SetMinimum(minimum);
465 if (maximum != -1111) {
466 p1_temp->SetMaximum(maximum);
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
virtual TH2F * getTH2F() const
MonitorElement * profileX(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, MonitorElement *me2d, const std::string &title="", const std::string &titleX="", const std::string &titleY="", Double_t minimum=-1111, Double_t maximum=-1111)
void remove(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, const std::string &name)
MonitorElement * bookH1withSumw2(DQMStore::IBooker &, const std::string &name, const std::string &title, int nchX, double lowX, double highX, const std::string &titleX="", const std::string &titleY="Events", Option_t *option="E1 P")
MonitorElement * bookH2(DQMStore::IBooker &, const std::string &name, const std::string &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const std::string &titleX="", const std::string &titleY="", Option_t *option="COLZ")
const std::string * find(DQMStore::IGetter &iGetter, const std::string &name)
MonitorElement * bookH1(DQMStore::IBooker &, const std::string &name, const std::string &title, int nchX, double lowX, double highX, const std::string &titleX="", const std::string &titleY="Events", Option_t *option="E1 P")
virtual void setOption(const char *option)
void setCurrentFolder(std::string const &fullpath)
virtual TH1F * getTH1F() const
void setBookPrefix(const std::string &)
const std::string & getName() const
get name of ME
bool bookStatOverflowFlag_
MonitorElement * get(DQMStore::IGetter &iGetter, const std::string &name)
MonitorElement * bookH2andDivide(DQMStore::IBooker &iBooker, DQMStore::IGetter &, const std::string &name, MonitorElement *num, MonitorElement *denom, const std::string &titleX, const std::string &titleY, const std::string &title="")
MonitorElement * bookH1andDivide(DQMStore::IBooker &iBooker, DQMStore::IGetter &, const std::string &name, MonitorElement *num, MonitorElement *denom, const std::string &titleX, const std::string &titleY, const std::string &title="")
MonitorElement * profileY(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, MonitorElement *me2d, const std::string &title="", const std::string &titleX="", const std::string &titleY="", Double_t minimum=-1111, Double_t maximum=-1111)
MonitorElement * bookH2withSumw2(DQMStore::IBooker &, const std::string &name, const std::string &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const std::string &titleX="", const std::string &titleY="", Option_t *option="COLZ")
void setBookStatOverflowFlag(const bool &)
std::vector< std::string > getMEs()
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, char const *option="s")
std::string outputInternalPath_
void setBookEfficiencyFlag(const bool &)
MonitorElement * cloneH1(DQMStore::IBooker &iBooker, DQMStore::IGetter &, const std::string &name, MonitorElement *original, const std::string &title="")
virtual TProfile * getTProfile() const
std::string inputInternalPath_
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
~ElectronDqmHarvesterBase() override
std::vector< std::string > histoNames_
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
virtual void enableSumw2()
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
MonitorElement * bookP1(DQMStore::IBooker &, const std::string &name, const std::string &title, int nchX, double lowX, double highX, double lowY, double highY, const std::string &titleX="", const std::string &titleY="", Option_t *option="E1 P")
MonitorElement * get(std::string const &path)
std::string newName(const std::string &name)
virtual TH1 * getTH1() const
ElectronDqmHarvesterBase(const edm::ParameterSet &conf)
virtual void finalize(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter)
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)