User Tools

Site Tools


root:showcuts

Show cut value as a line in a histogram

To create a line in a histogram for example to indicate a cut do the following in your python root macro and in the canvas where you have the histogram:

cutObj = TLine(XcutValue, hist.GetMinimum(), XcutValue, hist.GetMaximum())
cutObj.SetLineColor(kGreen+2)
cutObj.SetLineWidth(2)

cutObj.Draw("lsames")

Highlight an area in a histogram

cutObj2 = TBox(X1Value, hist.GetMinimum(), X2Value, hist.GetMaximum())
cutObj2.SetFillColor(kRed-4)
cutObj2.SetFillStyle(3003) #hatching
cutObj2.SetLineWidth(0)
cutObj2.Draw("lsames")
root/showcuts.txt · Last modified: 2010/01/12 11:26 by abuechle