Dear rooters,
I guess my question is not connected to ROOT or to histograms specifically, but…
I am trying to generate a few histograms, then loop over my events, fill the histograms in, then, outside the loop, save them in a file. This works fine, but now, I want to place my histogram initialisation in a function in another file, the filling of the histograms in a second, and the saving in a third, so my main macro looks like this:
#include "InitHistos.h"
#include "FillHistos.h"
#include "SaveHistos.h"
void func(){
initialiseHistos();
for(int i{0};i<ev_number;++i){
.....
fillHistos(....);
}
saveHistos();
}
I am not sure how to make fillHistos “see” the histograms that I have without initialising them as global variables.
Thank you,
Vangi
ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided