25void hist058_TExec_th2()
28 Error(
"hist058_TExec_th2",
"gPad is null, you are not supposed to run this macro");
32 int px =
gPad->GetEventX();
33 int py =
gPad->GetEventY();
34 float uxmin =
gPad->GetUxmin();
35 float uxmax =
gPad->GetUxmax();
36 int pxmin =
gPad->XtoAbsPixel(uxmin);
37 int pxmax =
gPad->XtoAbsPixel(uxmax);
43 int pyold =
gPad->GetUniqueID();
47 gVirtualX->DrawLine(pxmin, pyold, pxmax, pyold);
51 TH2 *
h =
dynamic_cast<TH2 *
>(select);
56 gVirtualX->DrawLine(pxmin, py, pxmax, py);
57 gPad->SetUniqueID(py);
65 delete c2->GetPrimitive(
"Projection");
67 c2 =
new TCanvas(
"c2",
"Projection Canvas", 710, 10, 700, 500);
72 Int_t biny =
h->GetYaxis()->FindBin(
y);
73 TH1D *hp =
h->ProjectionX(
"", biny, biny);
76 hp->
Fit(
"gaus",
"ql");
int Int_t
Signed integer 4 bytes (int).
float Float_t
Float 4 bytes (float).
Error("WriteTObject","The current directory (%s) is not associated with a file. The object (%s) has not been written.", GetName(), objname)
1-D histogram with a double per channel (see TH1 documentation)
void SetTitle(const char *title) override
Change/set the title.
virtual TFitResultPtr Fit(const char *formula, Option_t *option="", Option_t *goption="", Double_t xmin=0, Double_t xmax=0)
Fit histogram with function fname.
void SetName(const char *name) override
Change the name of this histogram.
Service class for 2-D histogram classes.
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.