34 : numerator_(numerator), denominator_(denominator), efficiency_(efficiency) {
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()) {
61 for (vstring::const_iterator parameter = plotParameter.begin(); parameter != plotParameter.end(); ++parameter) {
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();
115 std::string effHistogramName, effHistogramDirectory, dummy;
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.";
virtual void setCurrentFolder(std::string const &fullpath)
#define DEFINE_FWK_MODULE(type)
virtual TH1F * getTH1F() const
boost::dynamic_bitset append(const boost::dynamic_bitset<> &bs1, const boost::dynamic_bitset<> &bs2)
this method takes two bitsets bs1 and bs2 and returns result of bs2 appended to the end of bs1 ...
std::string replace_string(const std::string &src, const std::string &keyword, const std::string ¶meter, unsigned minReplacements, unsigned maxReplacements, int &errorFlag)
virtual bool dirExists(std::string const &path) const
Log< level::Error, false > LogError
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
TauDQMHistEffProducer(const edm::ParameterSet &)
std::vector< cfgEntryPlot > cfgEntryPlot_
virtual MonitorElement * get(std::string const &fullpath) const
void separateHistogramFromDirectoryName(const std::string &histogramAndDirectoryName, std::string &histogramName, std::string &directoryName)
~TauDQMHistEffProducer() override
const std::string parKeyword
T getParameter(std::string const &) 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 &)
virtual TH1 * getTH1() const