I want to plot the mean of each fit using h2_0 but the error I get is that the histogram h2_0 is undeclared. I thought from the example that h2_0 gets automatically declared when you do fitslices. Any ideas?
Ellie
The name of the generated histograms are “name of the 2d histogram_0”,etc. If your histogram pointed by Miss_had_perp has the same name, ie “Miss_had_perp”, I suggest changing your code like below
[quote]and the code is crashing on the last line. Any ideas? [/quote]Is Miss_had_perp_1 a TH1F or TH2F … it is probably a TH2F and you should cast it as such (instead of TH1F).
No, read the mail, it is a TH2F and the projection is a TH1.
What probably happens is that teh name of the 2-D histogram is not
what the user thinks , ie “Miss_had_perp”, and as a result, teh result
of h2_1=(TH1F*)gDirectory->Get(“Miss_had_perp_1”); is h2_1=0.