Here is your modified source file: calo2.cpp (15.6 KB)
Sorry, I forgot one line. Here is the correct one: calo2.cpp (15.6 KB)
Hi bellenot, than you! Your macro works! now I’ve to modify it to add the case in which I don’t have the target (I think you modified the macro of saturday). But it’s just a copy and past of some pieces of the script, so I think that I will not have problems (I hope it). Anyway, I will inform you about it!
A question please, why did you comment this line?
leg->AddEntry(gaus, "Fit", "l");
Can’t I add the fit in the legend?
Check the latest version ![]()
In the last version, it’s commented too…Anyway, don’t worry! I deleted the comment!
Nope, please use:
leg->AddEntry(htemp->GetFunction("gaus"), "Fit", "l");
Here is the correct one, this time (hopefully): calo2.cpp (15.6 KB)
Hi bellenot, don’t worry…I wrote it!
Anyway, I also added the piece of script for the case without the target, and it looks like working!
Thank you! And thanks to couet too!