52 for ( std::vector<std::string>::const_iterator plotName = plotNames.begin(); plotName != plotNames.end(); ++plotName ) {
55 typedef std::vector<std::string>
vstring;
56 vstring plotParameter = plotConfig.
getParameter<vstring>(
"parameter");
57 if ( plotParameter.empty() ) {
72 edm::LogError(
"TauDQMHistEffProducer") <<
" Failed to decode histogram names for plotName = " << (*plotName)
73 <<
" --> skipping !!";
91 std::string numeratorHistogramName, numeratorHistogramDirectory;
97 TH1* histoNumerator = ( meNumerator !=
nullptr ) ? meNumerator->
getTH1() :
nullptr;
100 std::string denominatorHistogramName, denominatorHistogramDirectory;
106 TH1* histoDenominator = ( meDenominator !=
nullptr ) ? meDenominator->
getTH1() :
nullptr;
108 if ( histoNumerator !=
nullptr && histoDenominator !=
nullptr ) {
109 if ( !histoNumerator->GetSumw2N() ) histoNumerator->Sumw2();
112 if ( !histoDenominator->GetSumw2N() ) histoDenominator->Sumw2();
118 if ( !effHistogramDirectory.empty() )
120 if(iget.
dirExists(effHistogramDirectory))
123 std::cout<<
"TauDQMHistEffProducer:: Directory: "<<effHistogramDirectory<<
" does not exist!"<<std::endl;
127 histoNumerator->GetNbinsX(), histoNumerator->GetXaxis()->GetXmin(), histoNumerator->GetXaxis()->GetXmax());
129 histoEfficiency->
getTH1F()->Divide(histoNumerator, histoDenominator, 1., 1.,
"B");
140 edm::LogError(
"endRun") <<
" Failed to produce efficiency histogram = " <<
plot->efficiency_ <<
" !!";
141 if ( histoNumerator ==
nullptr )
edm::LogError(
"endRun") <<
" numerator = " <<
plot->numerator_ <<
" does not exist.";
142 if ( histoDenominator ==
nullptr )
edm::LogError(
"endRun") <<
" denominator = " <<
plot->denominator_ <<
" does not exist.";
T getParameter(std::string const &) const
#define DEFINE_FWK_MODULE(type)
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 &)
void setCurrentFolder(std::string const &fullpath)
std::vector< cfgEntryPlot > cfgEntryPlot_
MonitorElement * book1D(Args &&...args)
void separateHistogramFromDirectoryName(const std::string &histogramAndDirectoryName, std::string &histogramName, std::string &directoryName)
~TauDQMHistEffProducer() override
const std::string parKeyword
MonitorElement * get(std::string const &path)
bool dirExists(std::string const &path)
std::vector< MonitorElement * > histoEfficiencyVector_
void dqmEndJob(DQMStore::IBooker &ibook, DQMStore::IGetter &iget) override
const std::string dqmSeparator
cfgEntryPlot(const edm::ParameterSet &)