Dear all,
I created two loops of histos, HIS3[i] and H3[i], from different root files. then I tried to draw each one [i] in one pad by using the Draw option “same”. like:
TFile *f=new TFile("comparison.root","update");
sprintf(HFUNC2,"Avv","Zvv==%d");
printf("HFUNC2=%s\n",HFUNC2);
for (Int_t i=0;i<=30;i++){
sprintf(TITLE2,"A{Z=%d}",i);
sprintf(HNAME2,"mass%d",i);
sprintf(SELECT2,"Zvv==%d",i);
printf("SELECT2=%s\n",SELECT2);
sprintf(HNAME2,"mass%d",i);
HIS3[i] = new TH1F(HNAME2,TITLE2,60,0,60);
HIS3[i]->GetXaxis()->SetTitle("Avv");
h101->Project(HNAME2,HFUNC2,SELECT2);
HIS3->Draw();
HIS3->Write();
sprintf(HFUNC3,"A","Z==%d");
printf("HFUNC3=%s\n",HFUNC3);
sprintf(TITLE3,"A{Z=%d}",i);
sprintf(Hist3,"mass%d",i);
sprintf(SELECT3,"Z==%d",i);
printf("SELECT3=%s\n",SELECT3);
sprintf(Hist3,"mass%d",i);
H3[i] = new TH1F(Hist3,TITLE3,60,0,60);
H3[i]->GetXaxis()->SetTitle("A");
tree->Project(Hist3,HFUNC3,SELECT3);
H3->Draw("SAME");
H3->Write();
and it doesn’t work.
please any help,
Thank you…