96 edm::LogError (
"endJob") <<
" Failed to access dqmStore --> histograms will NOT be plotted !!";
104 std::string numeratorHistogramName, numeratorHistogramDirectory;
110 TH1* histoNumerator = ( meNumerator !=
NULL ) ? meNumerator->
getTH1() :
NULL;
113 std::string denominatorHistogramName, denominatorHistogramDirectory;
119 TH1* histoDenominator = ( meDenominator !=
NULL ) ? meDenominator->
getTH1() :
NULL;
121 if ( histoNumerator !=
NULL && histoDenominator !=
NULL ) {
122 if ( !histoNumerator->GetSumw2N() ) histoNumerator->Sumw2();
125 if ( !histoDenominator->GetSumw2N() ) histoDenominator->Sumw2();
128 std::string effHistogramName, effHistogramDirectory, dummy;
131 if ( effHistogramDirectory !=
"" )
133 if(dqmStore.
dirExists(effHistogramDirectory))
136 std::cout<<
"TauDQMHistEffProducer:: Directory: "<<effHistogramDirectory<<
" does not exist!"<<std::endl;
140 histoNumerator->GetNbinsX(), histoNumerator->GetXaxis()->GetXmin(), histoNumerator->GetXaxis()->GetXmax());
142 histoEfficiency->
getTH1F()->Divide(histoNumerator, histoDenominator, 1., 1.,
"B");
153 edm::LogError(
"endRun") <<
" Failed to produce efficiency histogram = " <<
plot->efficiency_ <<
" !!";
154 if ( histoNumerator ==
NULL )
edm::LogError(
"endRun") <<
" numerator = " <<
plot->numerator_ <<
" does not exist.";
155 if ( histoDenominator ==
NULL )
edm::LogError(
"endRun") <<
" 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")
bool dirExists(const std::string &path) const
true if directory exists
TH1F * getTH1F(void) const
std::vector< MonitorElement * > histoEfficiencyVector_
const std::string dqmSeparator
void setCurrentFolder(const std::string &fullpath)