00001
00002
00003
00004 {
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 gROOT->Reset();
00015
00016
00017 TFile f("Event.root");
00018
00019
00020 TTree *T = (TTree*)f.Get("T");
00021
00022
00023 TStopwatch timer;
00024 timer.Start();
00025
00026
00027 Event *event = new Event();
00028
00029 TBranch *bntrack = T->GetBranch("fNtrack");
00030 TBranch *branch = T->GetBranch("event");
00031 branch->SetAddress(&event);
00032 Int_t nevent = T->GetEntries();
00033 Int_t nselected = 0;
00034 Int_t nb = 0;
00035 for (Int_t i=0;i<nevent;i++) {
00036 if(i%50 == 0) printf("Event:%d\n",i);
00037 bntrack->GetEntry(i);
00038 if (event->GetNtrack() > 587)continue;
00039 nb += T->GetEntry(i);
00040 nselected++;
00041 if (nselected == 1) event->Dump();
00042 event->Clear();
00043 }
00044
00045
00046 timer.Stop();
00047 Float_t mbytes = T->GetTotBytes()*1.e-6;
00048 Double_t rtime = timer.RealTime();
00049 Double_t ctime = timer.CpuTime();
00050 printf("You have selected %d events out of %d\n",nselected,nevent);
00051 printf("RealTime=%f seconds, CpuTime=%f seconds\n",rtime,ctime);
00052 printf("You have scanned %f Mbytes/Realtime seconds\n",mbytes/rtime);
00053 printf("You have scanned %f Mbytes/Cputime seconds\n",mbytes/ctime);
00054
00055 f.Close();
00056 }