I have in the same tree two branches, one silicon detector data “Si1” and the time in “t1”. When I draw the data from Si1 it plots directly by channel or energy if I apply the calibration. The issue is that for the sake of my project I need to analyze the data of Si1 respect to the time t1, but I’m not able to do it.
I’ve tried doing something like:
TH2F *h = new TH2F(“h”,“histogram_time”,100,0,3,800,0,70000);
but the result is nothing like I was expecting (first of all, it plots a scatter plot and not a histogram). I would like to have the counts in the YAxis respect to the time in the XAxis.
It looks better for sure, but I was expecting something in the shape of a “normal” histogram, with solid lines. Also, I’m not entirely sure what the YAxis represents in this plot, because when I plot “SI1” I don’t get so many counts per channel.
Sorry, perhaps that’s the problem. I tried 2D histo because I had two variables, but yes, my intention would be to get a 1D histogram of Si1 but in the XAxis instead of having the channels I would like to have the time in t1.
It looks better, but it is still plotting points instead of the solid histogram, and very weirdly is taking the counts as negative (the shape makes sense, but it should be flipped to positive). This is what I wrote
root  TH1F *h = new TH1F(“h”,“hist_time”,100,0,3);
root  DataTree->Draw(“t1>>h”,“Si1”);