50 for (std::vector<std::string>::const_iterator
plotName = plotNames.begin();
plotName != plotNames.end(); ++
plotName) {
53 typedef std::vector<std::string>
vstring;
54 vstring plotParameter = plotConfig.
getParameter<vstring>(
"parameter");
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.";
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX)
T getParameter(std::string const &) const
void setCurrentFolder(std::string const &fullpath)
virtual TH1F * getTH1F() const
std::string replace_string(const std::string &src, const std::string &keyword, const std::string ¶meter, unsigned minReplacements, unsigned maxReplacements, int &errorFlag)
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
TauDQMHistEffProducer(const edm::ParameterSet &)
bool dirExists(std::string const &path)
#define DEFINE_FWK_MODULE(type)
std::vector< cfgEntryPlot > cfgEntryPlot_
void separateHistogramFromDirectoryName(const std::string &histogramAndDirectoryName, std::string &histogramName, std::string &directoryName)
~TauDQMHistEffProducer() override
const std::string parKeyword
std::vector< MonitorElement * > histoEfficiencyVector_
void dqmEndJob(DQMStore::IBooker &ibook, DQMStore::IGetter &iget) override
const std::string dqmSeparator
MonitorElement * get(std::string const &path)
cfgEntryPlot(const edm::ParameterSet &)
virtual TH1 * getTH1() const