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

feat: Add getters to Histo #251

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

bastienvoirin
Copy link

Context:

void Histo::Write_RootFormat(std::pair<TH1F*,TH1F*>& histo)
{
// Creating ROOT histograms
histo.first -> SetBins(nbins_,xmin_,xmax_);
histo.second -> SetBins(nbins_,xmin_,xmax_);
// Filling histos
for (unsigned int i=0;i<histo_.size();i++)
{
histo.first -> SetBinContent(i+1,histo_[i].first);
histo.second -> SetBinContent(i+1,histo_[i].second);
}
histo.first -> SetBinContent(0,underflow_.first);
histo.second -> SetBinContent(0,underflow_.second);
histo.first -> SetBinContent(histo_.size()+1,overflow_.first);
histo.second -> SetBinContent(histo_.size()+1,overflow_.second);
// Filling statistics for histo with positive weight
histo.first -> SetEntries(nentries_.first);
Double_t stats[4];
stats[0]=sum_w_.first;
stats[1]=sum_ww_.first;
stats[2]=sum_xw_.first;
stats[3]=sum_xxw_.first;
histo.first -> PutStats(stats);
histo.second -> SetEntries(nentries_.second);
stats[0]=sum_w_.second;
stats[1]=sum_ww_.second;
stats[2]=sum_xw_.second;
stats[3]=sum_xxw_.second;
histo.second -> PutStats(stats);
}
was removed by 7db20d3 (v1.4?), so no way to manipulate and save the histograms other than using their SAF representation is provided AFAIK.

Description of the Change:

Make protected members of Histo readable through getters.

Benefits:

This change allows to manipulate and save histograms in a user-defined way.

Possible Drawbacks:

Related GitHub Issues:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant