95 edm::LogError (
"endJob") <<
" Failed to access dqmStore --> histograms will NOT be plotted !!";
103 std::string numeratorHistogramName, numeratorHistogramDirectory;
109 TH1* histoNumerator = ( meNumerator !=
NULL ) ? meNumerator->
getTH1() :
NULL;
112 std::string denominatorHistogramName, denominatorHistogramDirectory;
118 TH1* histoDenominator = ( meDenominator !=
NULL ) ? meDenominator->
getTH1() :
NULL;
120 if ( histoNumerator !=
NULL && histoDenominator !=
NULL ) {
121 if ( !histoNumerator->GetSumw2N() ) histoNumerator->Sumw2();
124 if ( !histoDenominator->GetSumw2N() ) histoDenominator->Sumw2();
127 std::string effHistogramName, effHistogramDirectory, dummy;
130 if ( effHistogramDirectory !=
"" ) dqmStore.
setCurrentFolder(effHistogramDirectory);
133 histoNumerator->GetNbinsX(), histoNumerator->GetXaxis()->GetXmin(), histoNumerator->GetXaxis()->GetXmax());
135 histoEfficiency->
getTH1F()->Divide(histoNumerator, histoDenominator, 1., 1.,
"B");
137 edm::LogError(
"endJob") <<
" Failed to produce efficiency histogram = " <<
plot->efficiency_ <<
" !!";
138 if ( histoNumerator ==
NULL )
edm::LogError(
"endJob") <<
" numerator = " <<
plot->numerator_ <<
" does not exist.";
139 if ( histoDenominator ==
NULL )
edm::LogError(
"endJob") <<
" denominator = " <<
plot->denominator_ <<
" does not exist.";
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
std::vector< cfgEntryPlot > cfgEntryPlot_
void separateHistogramFromDirectoryName(const std::string &histogramAndDirectoryName, std::string &histogramName, std::string &directoryName)
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
TH1F * getTH1F(void) const
const std::string dqmSeparator
void setCurrentFolder(const std::string &fullpath)