1 #if !defined(__CINT__) || defined(__MAKECINT__)
10 #include <TObjArray.h>
15 #include <TParticle.h>
16 #include <TRefArray.h>
19 //AliRoot include files
20 #include "AliRunLoader.h"
22 #include "AliAODEvent.h"
23 #include "AliAODVertex.h"
24 #include "AliAODCaloCluster.h"
25 #include "AliAODCaloCells.h"
33 TFile* f = new TFile("aod.root");
34 TTree* aodTree = (TTree*)f->Get("aodTree");
36 AliAODEvent* aod = new AliAODEvent();
37 aod->ReadFromTree(aodTree);
39 Int_t nEvt = aodTree->GetEntries();
41 for(Int_t iev = 0; iev < nEvt; iev++) {
42 cout << "Event: " << iev+1 << "/" << nEvt << endl;
43 aodTree->GetEvent(iev);
45 TRefArray* caloClusters = new TRefArray();
46 aod->GetEMCALClusters(caloClusters);
48 //get reconstructed vertex position
49 Double_t vertex_position[3] = { aod->GetPrimaryVertex()->GetX(),
50 aod->GetPrimaryVertex()->GetY(),
51 aod->GetPrimaryVertex()->GetZ()};
53 Int_t nclus = caloClusters->GetEntries();
54 for (Int_t icl = 0; icl < nclus; icl++) {
56 AliAODCaloCluster* clus = (AliAODCaloCluster*)caloClusters->At(icl);
57 Float_t energy = clus->E();
59 clus->GetMomentum(p,vertex_position);
60 Int_t nMatched = clus->GetNTracksMatched();
62 cout << "Cluster: " << icl+1 << "/" << nclus << " Energy: " << energy << " Phi: " << p.Phi() << " Eta: " << p.Eta() << " #Matches: " << nMatched << endl;