#if !defined( __CINT__) || defined(__MAKECINT__)
#include <Riostream.h>
- #include "TKey.h"
+ #include <TTree.h>
#include "TFile.h"
#include "TH1F.h"
#include "TCanvas.h"
#include "TStyle.h"
#include "TStopwatch.h"
- #include "AliESD.h"
+ #include "AliESDEvent.h"
#endif
extern TStyle *gStyle;
//****** File with the ESD
TFile *ef=TFile::Open("AliESDs.root");
if (!ef || !ef->IsOpen()) {cerr<<"Can't AliESDs.root !\n"; return 1;}
+ AliESDEvent* event = new AliESDEvent();
+ TTree* tree = (TTree*) ef->Get("esdTree");
+ if (!tree) {cerr<<"no ESD tree found\n"; return 1;};
+ event->ReadFromTree(tree);
Int_t n=0;
- TKey *key=0;
- TIter next(ef->GetListOfKeys());
//******* The loop over events
- while ((key=(TKey*)next())!=0) {
+ while (tree->GetEvent(n)) {
cout<<endl<<"Processing event number : "<<n++<<endl;
- AliESD *event=(AliESD*)key->ReadObj();
-
Int_t ntrk=event->GetNumberOfTracks();
cout<<"Number of ESD tracks : "<<ntrk<<endl;
Int_t nv0=event->GetNumberOfV0s();
}
+ delete event;
+ ef->Close();
+
timer.Stop(); timer.Print();
TCanvas *c1=new TCanvas("c1","",0,0,600,1200);