This tutorial demonstrates how to use the highlight mode on graph.
{
return;
if (!histo)
return;
}
bh->SetX1(histo->GetBinLowEdge(
hbin));
bh->SetY1(histo->GetMinimum());
bh->SetX2(histo->GetBinWidth(
hbin) + histo->GetBinLowEdge(
hbin));
bh->SetY2(histo->GetBinContent(
hbin));
if (!th) {
th->SetName("TText");
th->SetTextColor(
bh->GetFillColor());
}
th->SetText(histo->GetXaxis()->GetXmax() * 0.75, histo->GetMaximum() * 0.5,
TString::Format(
"id = %d", (
Int_t)i));
delete th;
}
return;
th->Draw();
}
{
auto dir =
gROOT->GetTutorialDir();
dir.Append("/hsimple.C");
dir.ReplaceAll("/./", "/");
auto file = (
TFile *)
gROOT->ProcessLineFast(
"hsimple(1)");
if (!file)
return;
file->GetObject(
"ntuple",
ntuple);
return;
Canvas1->HighlightConnect(
"HighlightBinId(TVirtualPad*,TObject*,Int_t,Int_t)");
const char *cut = "pz > 3.0";
auto info =
new TText(0.0, 4.5,
"please move the mouse over the graph");
ntuple->Draw(
"TMath::Sqrt(px*px + py*py + pz*pz)>>histo(100, 0, 15)", cut);
ntuple->Draw(
"px:py:pz:i", cut,
"goff");
}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
winID h TVirtualViewer3D TVirtualGLPainter p
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
A TGraph is an object made of two arrays X and Y with npoints each.
1-D histogram with a float per channel (see TH1 documentation)
A simple TTree restricted to a list of float variables only.
Mother of all ROOT objects.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Base class for several text objects.
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Double_t Sqrt(Double_t x)
Returns the square root of x.