I am trying to read histogram from a root file. Here is my attempt:
const Char_t *directory="/home/haha/data.root"; TFile *f1=TFile::Open(directory1,"READ"); //TH1D *num11=(TH1D*)f1->Get(TString::Format("NumQinV;%d",i1));num11->Sumw2(); //int =13; //char temp; //sprintf(temp,"Num;%d",13); //string a="Num;13"; TString b; b.Format("Num;%d",13); TH1D *num11=(TH1D*)f1->Get(b); num11->Sumw2();
But this gives a weird graph. I have also tried using the sprintf method to format string then put in as the argument of Get. But that does not work neither. Could anyone explain what happen?