Skip to content
Snippets Groups Projects
Commit b0db8053 authored by Danilo Piparo's avatar Danilo Piparo
Browse files

[DF][NFC] Add more comments to histo/profile models code and tests

parent 6f2686a3
No related branches found
No related tags found
No related merge requests found
......@@ -313,6 +313,11 @@ TProfile2DModel::TProfile2DModel(const char *name, const char *title, int nbinsx
std::shared_ptr<::TProfile2D> TProfile2DModel::GetProfile() const
{
// In this method we decide how to build the profile based on the input given in the constructor of the model.
// There are 4 cases:
// 1. No custom binning for both the x and y axes: we return a profile with equally spaced binning
// 2./3. Custom binning only for x(y): we return a profile with custom binning for x(y) and equally spaced for y(x).
// 4. No custom binning: we return a profile with equally spaced bins on both axes
auto xEdgesEmpty = fBinXEdges.empty();
auto yEdgesEmpty = fBinYEdges.empty();
std::shared_ptr<::TProfile2D> prof;
......
......@@ -18,6 +18,12 @@ void CheckBins(const TAxis *axis, const COLL &v)
EXPECT_DOUBLE_EQ(axis->GetBinUpEdge(nBinsm1), (double)v[nBinsm1]);
}
/*
These tests help us checking that the binning of the final histograms/profiles is correct.
We test construction of models with full blown histos/profiles and also using constructors
that mimick the ones of those very classes.
*/
TEST(RDataFrameHistoModels, Histo1D)
{
ROOT::RDataFrame tdf(10);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment