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"
31 Bool_t kPrintCaloCells = kTRUE;
32 Bool_t kPrintCaloClusters = kTRUE;
37 TFile* f = new TFile("AliAOD.root");
38 TTree* aodTree = (TTree*)f->Get("aodTree");
40 AliAODEvent* aod = new AliAODEvent();
41 aod->ReadFromTree(aodTree);
43 Int_t nEvt = aodTree->GetEntries();
45 for(Int_t iev = 0; iev < nEvt; iev++) {
46 cout << "Event: " << iev+1 << "/" << nEvt << endl;
47 aodTree->GetEvent(iev);
49 //get reconstructed vertex position
50 Double_t vertex_position[3] = { aod->GetPrimaryVertex()->GetX(),
51 aod->GetPrimaryVertex()->GetY(),
52 aod->GetPrimaryVertex()->GetZ()};
54 //------------------------------------------------------
56 //------------------------------------------------------
57 if(kPrintCaloClusters)
59 TRefArray* caloClusters = new TRefArray();
60 aod->GetEMCALClusters(caloClusters);
62 Int_t nclus = caloClusters->GetEntries();
63 for (Int_t icl = 0; icl < nclus; icl++)
66 AliAODCaloCluster* clus = (AliAODCaloCluster*)caloClusters->At(icl);
67 Float_t energy = clus->E();
68 Float_t time = clus->GetTOF()*1.e9;
70 clus->GetMomentum(p,vertex_position);
71 Int_t nMatched = clus->GetNTracksMatched();
73 cout << "Cluster: " << icl+1 << "/" << nclus << " - Energy: " << energy << "; Time "<<time
74 <<"; Phi: " << p.Phi() << "; Eta: " << p.Eta() << "; #Matches: " << nMatched << endl;
79 //------------------------------------------------------
81 //------------------------------------------------------
85 AliVCaloCells &cells= *(aod->GetEMCALCells());
87 Int_t nTotalCells = cells.GetNumberOfCells() ;
88 //Int_t type = cells.GetType();
89 for (Int_t icell= 0; icell < nTotalCells; icell++) {
90 cout<<"Cell : "<<icell<<"/"<<nTotalCells<<" - ID: "<<cells.GetCellNumber(icell)<<"; Amplitude: "<<cells.GetAmplitude(icell)<<"; Time: "<<cells.GetTime(icell)*1e9;
91 cout << "; MC label "<<cells.GetMCLabel(icell)<<"; Embeded E fraction "<<cells.GetEFraction(icell);