Spread Option, "s", in TProfile

Hello everyone,

I am trying to use the spread option of the TProfile function. Here is what I am doing:

        TProfile* histo2ProfY2 = Histogram2->ProfileY("histo2ProfY2", 0, -1, "s [cut1]");
        histo2ProfY2->SetLineWidth(2);
        histo2ProfY2->SetLineColor(kBlue);
        histo2ProfY2->SetTitle("RMS (Spread) ProfileY of tot vs. nSigmaTof(#pi)");
        histo2ProfY2->Draw("Hist");

However, the above code does not produce a different outcome than when I use the default option with no “s”:

        TProfile* histo2ProfY1 = Histogram2->ProfileY("histo2ProfY1", 0, -1, "[cut1]");
        histo2ProfY1->SetLineWidth(2);
        histo2ProfY1->SetLineColor(kBlue);
        histo2ProfY1->SetTitle("ProfileY of tot vs. nSigmaTof(#pi)");
        histo2ProfY1->Draw("Hist");

I also attached an image of the output of both pieces of codes at the end of this thread. The comparison between the default plot and the plot where the option “s” is specified tells me that turning on option “s” is really not doing anything. Any thoughts on how to turn on the spread option “s” properly?

Thank you very much and I really appreciate the help!

SampleOutput.pdf (55.1 KB)


Please read tips for efficient and successful posting and posting code

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided


Maybe @moneta or @couet can take a look once back from vacation

Look at the doc. The spread option is related to errors. You plot the histogram with the option hist… which removes the errors … so …

Thank you very much for the helpful answer! This was exactly the issue!