Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve RMS error calculation. #48

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Validation/RecoParticleFlow/plugins/PFJetAnalyzerDQM.cc
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ void PFJetAnalyzerDQM::prepareJetResponsePlots(const std::vector<edm::ParameterS
ptbin_low, ptbin_high,
etabin_low, etabin_high
));

}
if (jetResponsePlots.size() > 200) {
throw std::runtime_error("Requested too many jet response plots, aborting as this seems unusual.");
Expand Down
17 changes: 10 additions & 7 deletions Validation/RecoParticleFlow/plugins/PFJetDQMPostProcessor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -140,18 +140,22 @@ PFJetDQMPostProcessor::dqmEndJob(DQMStore::IBooker& ibook_, DQMStore::IGetter& i
// RMS-based
double std = h_resp->GetStdDev();
double std_error = h_resp->GetStdDevError();

// Scale each bin with mean response
double mean = 1.0;
double mean_error = 0.0;
double err = 0.0;
if (h_resp->GetMean()>0){

mean = h_resp->GetMean();
mean_error = h_resp->GetMeanError();
if (std > 0.0 && mean > 0.0)
err = std/mean * sqrt(pow(std_error,2) / pow(std,2) + pow(mean_error,2) / pow(mean,2));
if (mean > 0.0)
std /= mean;

// Scale resolution by response. Avoid division by zero.
std /= mean;
std_error /= mean;

err = getRespUnc(std,std_error,mean,mean_error);

}

h_preso_rms->SetBinContent(ipt+1,std);
Expand Down Expand Up @@ -237,8 +241,7 @@ PFJetDQMPostProcessor::fitResponse(TH1F* hreso, TH1F* h_genjet_pt, int ptbinlow,

fg2->SetRange(fitlow,fithigh);

if (doPlots) hreso->Fit("fg2","RQ");
else hreso->Fit("fg2","RQN");
hreso->Fit("fg2","RQ");

fg->SetRange(0,3);
fg2->SetRange(0,3);
Expand Down