Hi, I wrote the macro in the attachment, it must draw a plot and fit the histograms using the NKG distribution
where r0=100 is the moliere radius; it compiles, but the fits aren’t good, because I’ve
but I must have something like this
Hi pepe…I know that usually the lateral distribution of an EAS is described by the NKG function, so I tried to fit the data using this function (but the supervisor is on holiday, so I didn’t ask him if it is correct)…
I runned your macro and this is the result:
it looks like better than other macros…
what do you think about?
I will try the macro for other set of data too (I’ve 10 CORSIKA file, 5 files are EAS induced by photons and 5 files by protons)
Maybe your “analytical function” is not really describing your “experimental data” well (you would need to ask corsikans what function they are actually using).
Try also: {
TFile *f = TFile::Open("cors_plot-gamma1.root");
TH1F *hgamlat = (TH1F *)f->Get("hgamlat");
TH1F *helelat = (TH1F *)f->Get("helelat");
TH1F *hmuolat = (TH1F *)f->Get("hmuolat");
TH1F *hhadlat = (TH1F *)f->Get("hhadlat");
TCanvas *c = new TCanvas("c", "c");
c->Divide(2, 2);
c->cd(1); gPad->SetLogx(); hgamlat->Draw("E1");
c->cd(2); gPad->SetLogx(); helelat->Draw("E1");
c->cd(3); hmuolat->Draw("E1");
c->cd(4); hhadlat->Draw("E1");
c->cd(0);
} Note that, for all your histograms, “bin_error” is something like 100 to 100000 times bigger than “bin_content” (I would expect the ratio “bin_error / bin_content < 1”).
Is it possible that these histograms were scaled, but Sumw2 was not called before making this operation?
Actually, I started to think that the main problem may be related to “bin errors” of all your histograms (which I pointed out in my previous post). Then the chi^2 is ridiculously small, which may fool the minimizer.
BTW. The current macro uses the same (fixed) “r_mol” parameter for all types of particles and I guess it’s not really completely right (but it depends on what was used by the one who produced this simulation). One could also try to fit “r_mol” (one simply needs to comment out the “FixParameter” line in the macro).