#if !defined( __CINT__) || defined(__MAKECINT__)
#include <Riostream.h>
- #include "TKey.h"
+ #include "TTree.h"
#include "TFile.h"
#include "TH1F.h"
#include "TCanvas.h"
//****** File with the ESD
TFile *ef=TFile::Open("AliESDcheck.root");
if (!ef || !ef->IsOpen()) {cerr<<"Can't AliESDs.root !\n"; return 1;}
+ AliESD* event = new AliESD;
+ TTree* tree = (TTree*) ef->Get("esdTree");
+ if (!tree) {cerr<<"no ESD tree found\n"; return 1;};
+ tree->SetBranchAddress("ESD", &event);
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 npmdcl=event->GetNumberOfPmdTracks();
cout<<"Number of PMD tracks : "<<npmdcl<<endl;