#include <TText.h>
#include <TBenchmark.h>
#include <TStyle.h>
- #include <TKey.h>
+ #include <TFile.h>
#include <TROOT.h>
#include "AliStack.h"
#include "AliTrackReference.h"
#include "AliRunLoader.h"
#include "AliRun.h"
- #include "AliESD.h"
+ #include "AliESDEvent.h"
+ #include "AliESDtrack.h"
#include "AliSimDigits.h"
#include "AliTPC.h"
return 5;
}
}
- TKey *key=0;
- TIter next(ef->GetListOfKeys());
+ AliESDEvent* event = new AliESDEvent();
+ TTree* esdTree = (TTree*) ef->Get("esdTree");
+ if (!esdTree) {
+ ::Error("AliTPCComparison.C", "no ESD tree found");
+ return 6;
+ }
+ event->ReadFromTree(esdTree);
//******* Loop over events *********
Int_t e=0;
- while ((key=(TKey*)next())!=0) {
+ while (esdTree->GetEvent(e)) {
cout<<endl<<endl<<"********* Processing event number: "<<e<<"*******\n";
- AliESD *event=(AliESD*)key->ReadObj();
-
Int_t nentr=event->GetNumberOfTracks();
allfound+=nentr;
cout<<"Number of \"good\" tracks ="<<ngood<<endl;
refs->Clear();
- delete event;
}// ***** End of the loop over events
+ delete event;
+ delete esdTree;
ef->Close();
delete tpcTree;
//**** check if there is also information at the entrance of the TPC
TTree *TR=rl->TreeTR();
- TBranch *branch=TR->GetBranch("TPC");
+ TBranch *branch=TR->GetBranch("TrackReferences");
if (branch==0) {
::Error("GoodTracksTPC","No track references !");
delete rl;
for (Int_t r=0; r<nr; r++) {
//cerr<<r<<' '<<nr<<'\r';
TR->GetEvent(r);
- if (tpcRefs->GetEntriesFast()==0) continue;
- AliTrackReference *tpcRef=(AliTrackReference*)tpcRefs->UncheckedAt(0);
+
+ Int_t nref = tpcRefs->GetEntriesFast();
+ if (!nref) continue;
+ AliTrackReference *tpcRef= 0x0;
+ for (Int_t iref=0; iref<nref; ++iref) {
+ tpcRef = (AliTrackReference*)tpcRefs->UncheckedAt(iref);
+ if (tpcRef->DetectorId() == AliTrackReference::kTPC) break;
+ tpcRef = 0x0;
+ }
+
+ if (!tpcRef) continue;
+
Int_t j;
AliTrackReference *ref=0;
for (j=0; j<nt; j++) {