From Cesar: Macro to visualize jets.
[u/mrichter/AliRoot.git] / EVE / alice-macros / jetplane.C
1 Alieve::JetPlane* jetplane(Int_t iev)
2
3 {       
4         TFile* f       = new TFile("aod.root");
5         TTree* treeAOD = (TTree*) f->Get("AOD");
6         AliAODEvent* aod = new AliAODEvent();
7   aod->ReadFromTree(treeAOD);
8   treeAOD->GetEntry(iev);
9
10         using namespace Alieve;
11         JetPlane* jp = new JetPlane(iev);
12
13         // Read Jets in current event
14
15         TClonesArray* jets = aod->GetJets();
16         Int_t njets = jets->GetEntries();
17         printf("Event: %5d Number of jets: %5d \n", iev, njets);
18
19         for (Int_t ij = 0; ij < njets; ij++)
20         {
21                 AliAODJet jet = (AliAODJet) jets->At(ij);
22                 jp->AddJet(jet);
23         }
24
25 // Read tracks in current event
26
27         TClonesArray* tracks = aod->GetTracks();
28         Int_t ntracks = tracks->GetEntries();
29         printf("Event: %5d Number of tracks: %5d \n", iev, ntracks);
30
31         for (Int_t ij = 0; ij < ntracks; ij++)
32         {
33                 AliAODTrack track = (AliAODTrack) tracks->At(ij);
34                 jp->AddTrack(track);
35         }
36
37 // Render Jet Plane
38         gStyle->SetPalette(1, 0);
39         gReve->AddRenderElement(jp);
40         gReve->Redraw3D();
41
42         return jp;
43 }