Thank you @Wile_E_Coyote it woks but looking th two graphs I notice that one of them (the first one) has a noticeble difference between MC and data…I would check if it depends on the binning.
For the MC data are stored in a TTree then I can set the binning
The easiest solution would be to first get the old “GePD” histogram and then use its “nbins”, “xmin”, and “xmax” to create the new “htemp0” histogram, e.g.:
gROOT->cd(); // newly created histograms should go here
TH1F *hExp0 = (TH1F*)g->Get("GePD");
TH1F *hSim0 = (TH1F*)hExp0->Clone("htemp0"); hSim0->Reset("M");
TString hString0 = TString::Format("Edep[0] >> htemp0"); t0->Draw(hString0);
Thank you @Wile_E_Coyote
I tried your code, but there is still that difference in one of the detectors…
maybe there is really this difference and we have to check the reason