I guess I am missing something, but I cannot draw a projection from a TH2F
using Draw, instead I need to use DrawCopy and then it works, is this expected
or am I doing something wrong?
I attach a root file and the macro projection.C to reproduce the problem.
TFile *file= new TFile("test1.root");
otherwise your objects are destroyed when the TFile object goes out of scope at the end of the function.
For more details read chapter about Object Ownership in the Users Guide