How to fill the histograms with data from chain?

Hi ,
i wrote this and i want to fill these histograms with data from chain with function lets say (a+b)
any suggestion ?

TH1F *TDC[200];
for (Int_t i=25;i<=72,i++){
Int_t ii=i+100;
TDC[i]=new TH1F(Form(“s%d”,i),Form(“s%d”,i),512,0.,100.);
TDC[ii]=new TH1F(Form(“s%d”,ii),Form(“s%d”,ii),512,0.,100.);
}

thank you.

See http://root.cern.ch/root/html/TTree.html#TTree:Project
Search for “>>” in http://root.cern.ch/root/html/TTree.html#TTree:Draw@2 and in http://root.cern.ch/download/doc/ROOTUsersGuideHTML/ch12s20.html

i tried so many times but no results ,
all the canvases are empty .
any help Plz?

HI,

Did you try this way?
I tried this simple macro and it worked.

{
  TChain *ch1 = new TChain("ch1", "");
  ch1->Add("dvcs_sim_kine1_*.root/tr1");
  TH1D *h1 = new TH1D("h1", "", 1000, -40, 40);

  ch1->Draw("xc+yc>>h1");
}

Rafayel