I’m trying to loop over a bunch of files in a directory and plots them in histograms but for some reason ROOT stops after one iteration. I’m using the following code:
thanks for your help! at first declaring the filename and the FILE as arrays seemed to work but then nothing happened - i mean ROOT seemed to be computing but there were no data produced so after a few hours i decided to kill the program. then when i tried to run it again there was a segmentation violation and the whole terminal crashed!
Ok, I kind of got it work… at least looping seems to be ok.
However I’m having another problem now: I wanna create a bunch of histograms but that’s apparently too much for ROOT, it crashes every time (some kind of memory issue?).
I’m trying to do the following:
TH1F *adc = new TH1F(“adc”,nbins,xmin,xmax);
FILE *inp = fopen("/data/Data\ Analysis/9023156.csv",“r”);
I assume that you want to see the result of drawing the histogram, so
you should create a canvas and draw the histogram in the canvas, tehn print the canvas as a png file, eg
TCancas c1;
adc->Draw(); //may be with some options
c1.Print("c1.png");
Rene