Hi, I am running a code where I produce multiple histograms in loop, for different cuts of the same branch. However, only the last histogram gets displayed in TCanvas. How can I display and save all the histograms that I produce (preferably a single histogram in a single canvas)?
Here’s how my code looks like-
hist = new TH1D ("hist1","Plot", numBins,lowLim,highLim);
t = new TChain ("...");
branch = ("lifetimeformula>>hist1").c_str();
if (cut1) {
t->Draw(branch, cutsfor1)
}
if (cut2) {
t->Draw(branch, cutsfor2)
}
and so on.
ROOT Version: 6.24/02