50 for (std::vector<std::string>::const_iterator
plotName = plotNames.begin();
plotName != plotNames.end(); ++
plotName) {
53 typedef std::vector<std::string>
vstring;
55 if (plotParameter.empty()) {
71 <<
" Failed to decode histogram names for plotName = " << (*plotName) <<
" --> skipping !!";
87 std::string numeratorHistogramName, numeratorHistogramDirectory;
94 TH1* histoNumerator = (meNumerator !=
nullptr) ? meNumerator->
getTH1() :
nullptr;
97 std::string denominatorHistogramName, denominatorHistogramDirectory;
104 TH1* histoDenominator = (meDenominator !=
nullptr) ? meDenominator->
getTH1() :
nullptr;
106 if (histoNumerator !=
nullptr && histoDenominator !=
nullptr) {
107 if (!histoNumerator->GetSumw2N())
108 histoNumerator->Sumw2();
111 if (!histoDenominator->GetSumw2N())
112 histoDenominator->Sumw2();
118 if (!effHistogramDirectory.empty()) {
119 if (iget.
dirExists(effHistogramDirectory))
122 std::cout <<
"TauDQMHistEffProducer:: Directory: " << effHistogramDirectory <<
" does not exist!" 128 histoNumerator->GetNbinsX(),
129 histoNumerator->GetXaxis()->GetXmin(),
130 histoNumerator->GetXaxis()->GetXmax());
132 histoEfficiency->
getTH1F()->Divide(histoNumerator, histoDenominator, 1., 1.,
"B");
143 edm::LogError(
"endRun") <<
" Failed to produce efficiency histogram = " <<
plot->efficiency_ <<
" !!";
144 if (histoNumerator ==
nullptr)
145 edm::LogError(
"endRun") <<
" numerator = " <<
plot->numerator_ <<
" does not exist.";
146 if (histoDenominator ==
nullptr)
147 edm::LogError(
"endRun") <<
" denominator = " <<
plot->denominator_ <<
" does not exist.";
T getParameter(std::string const &) const
virtual void setCurrentFolder(std::string const &fullpath)
virtual bool dirExists(std::string const &path) const
std::string replace_string(const std::string &src, const std::string &keyword, const std::string ¶meter, unsigned minReplacements, unsigned maxReplacements, int &errorFlag)
Log< level::Error, false > LogError
TauDQMHistEffProducer(const edm::ParameterSet &)
std::vector< cfgEntryPlot > cfgEntryPlot_
void separateHistogramFromDirectoryName(const std::string &histogramAndDirectoryName, std::string &histogramName, std::string &directoryName)
~TauDQMHistEffProducer() override
#define DEFINE_FWK_MODULE(type)
const std::string parKeyword
virtual TH1F * getTH1F() const
virtual MonitorElement * get(std::string const &fullpath) const
virtual TH1 * getTH1() const
std::vector< MonitorElement * > histoEfficiencyVector_
void dqmEndJob(DQMStore::IBooker &ibook, DQMStore::IGetter &iget) override
const std::string dqmSeparator
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
cfgEntryPlot(const edm::ParameterSet &)