2D histogram/graph between a tree member and integer loop

Hello all,
I have a tree which has time. Actually, I have more than 20 files. I loaded them using TChain. I am using TTreeReader in my script for the data manipulation and I would like to see the relation between time and the increasing event no (or loop lets say, I have defined it from Int_t j =0 to 2000000) to see the pattern of time increments. Is there is any way to solve this problem? Thank you!!

You can just use your loop variable j as if it was any other variable and fill it into a histogram.

// set up TChain mychain and TH2F h with reasonable binning

for (Long64_t j=0; j < mychain.GetEntries(); ++j) {
    h->Fill(j, mydatevariable);

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.