34 : numerator_(numerator), denominator_(denominator), efficiency_(efficiency)
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.size() == 0 ) {
60 std::string numerator = plotConfig.
getParameter<std::string>(
"numerator");
72 edm::LogError(
"TauDQMHistEffProducer") <<
" Failed to decode histogram names for plotName = " << (*plotName)
73 <<
" --> skipping !!";
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.";
T getParameter(std::string const &) const
virtual ~TauDQMHistEffProducer()
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
#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 &)
virtual void analyze(const edm::Event &, const edm::EventSetup &)
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")
const std::string parKeyword
bool dirExists(const std::string &path) const
true if directory exists
TH1F * getTH1F(void) const
virtual void endRun(const edm::Run &r, const edm::EventSetup &c)
std::vector< std::string > vstring
std::vector< MonitorElement * > histoEfficiencyVector_
const std::string dqmSeparator
cfgEntryPlot(const edm::ParameterSet &)
void setCurrentFolder(const std::string &fullpath)