Hi everyone,
I’m trying to do something that seems quite simple but I can’t find the right syntax anywhere and I’m not even sure it’s feasible.
I’m basically trying to pass a histogram in a function, has shown in the code below:
void test()
{
TH1F *h1 = new TH1F("h1","Histo from a Gaussian",100,-3,3);
h1->FillRandom("gaus",10000);
double mean_f = mean_function(h1);
}
double mean_function(TH1F** histo)
{
return histo->GetMean();
}
When running it, I get the following error:
Error: non class,struct,union object histo used with . or -> test.C:12:
So it seems that my function is not well defined. How should I write it then?
Thank you very much
ROOT Version: 5.34/36
Platform: Ubuntu 16.04
Compiler: C/C++ 5.18.00