In C++ in ROOT (the CERN language), I have declared a 2D array of histograms:
TH1F *hist[xlen][ylen];
where xlen
and ylen
are not variable-length; I assign them values in my code.
I would like to pass this 2D array into a function. I'm having trouble specifying the input parameter, however. Can someone help me out?
For an example, I can pass a 1D histogram (TH1F *hist[length];
) with a function like,
void func(TH1F** Hist) {
cout<<Hist[0]<<endl;
}
Please note that although my 2D histogram has a definite size (i.e. xlen
, ylen
), as defined in my code, I do not want the function to be limited to arrays of a single size.