Re: [ROOT] how to look histos in a loop

From: Edward Chen (edward@SLAC.stanford.edu)
Date: Thu Aug 28 2003 - 10:23:59 MEST


Hi - you want:

> {
>     Double_t ave;
>     Int_t i;
>
>      TFile f("mpeak.root");
>      TH1F *h2= new TH1F("h2","",50,0.,1000);
>
>      for( i=6480; i<6500; i++){

	char myCut[255];
 	sprintf(myCut,"btub==55611&&ctub==%d",i);
	ntuple->Draw("bpul>>h2",myCut)
>      ave = h2->GetMean();
>      cout<<" average : "<<ave<<endl;
>       }
> }
>
> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
> http://sitebuilder.yahoo.com
>



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:15 MET