gROOT->cd(); // newly created histograms should go here TH1F *histM0 = new TH1F(...); TH1F *histM1 = new TH1F(...);