Hi,
I am very new to root and C++.
Compiling my script, I get the error above. I basically have the problem, that the Rebin-function does not work as I want it to. I want to write new histograms with rebinned versions of the old histograms.
Here is the code, shortened:
#include <vector>
#include <map>
#include <iostream>
#include <string>
#include <stdlib.h>
#include <stdio.h>
#include <sstream>
#include <fstream>
#include "TH1.h"
double getMeanMinimum(TH1D *histo, int binning){
double meanMin=0;
TH1D *historebin = histo->Rebin(binning,"historebin"); /* This line and the next are where the error occurs! */
meanMin = historebin->GetMinimum();
return meanMin;
}
void root_test(){
int totalHistoNumber=10;
int meanBinning=5;
TH1D* histo1[totalHistoNumber];
double meanMin[totalHistoNumber];
/* All meanMin[totalHistoNumber] entries are filled by another function here, and this works fine, so I don't write the function or the filling down.
*/
for(int i=1; i <= totalHistoNumber; i++){
meanMin[i] = getMeanMinimum(histo1[i], meanBinning); /* I am not sure wether I give histo1[i] to the function getMeanMinimum in the correct way
*/
cout << "gemitteltes Minimum: " << meanMin[i]<< endl;
}
}
Any ideas what I did wrong here? Thank you in advance!
Cheers, Aiedala