Dear @couet, @Wile_E_Coyote,
Is there any way to draw SetShowProjectionX() in same canvas? It is always creating a default TCanvas with name C1_n2
Dear @couet, @Wile_E_Coyote,
Is there any way to draw SetShowProjectionX() in same canvas? It is always creating a default TCanvas with name C1_n2
Then any way to draw projection of a 2D fit on the same canvas?
You mean I can Draw ProjectionX of a TF2 fit, right? I mean ProjectionX works with TH2D. Does it work with TF2?
Which function do you intend to do the projection ? Do you have a piece of code ?
Suppose,
TF2 *f = new TF2("f", "[0] * TMath::Gaus(x, [1], [2]) * TMath::Gaus(y, [3], [4])", -10., 10., -20., 20.);
f->SetParameters(10., 2., 3., 4., 5.);
f->Draw("Surf");
{
TF2 *f = new TF2("f", "[0] * TMath::Gaus(x, [1], [2]) * TMath::Gaus(y, [3], [4])", -10., 10., -20., 20.);
f->SetParameters(10., 2., 3., 4., 5.);
auto h2 = (TH2D*)f->GetHistogram();
auto h1 = h2->ProjectionX();
h1->Draw();
}
The counts the projection is having, are those true yield or it should be normalized by integral?
up to you …
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.