]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/alice-macros/jetplane.C
From Alexandru: new/improved TRD macros.
[u/mrichter/AliRoot.git] / EVE / alice-macros / jetplane.C
1 // $Id$
2 // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3
4 /**************************************************************************
5  * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6  * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
7  * full copyright notice.                                                 *
8  **************************************************************************/
9
10 AliEveJetPlane* jetplane(Int_t iev)
11 {
12   TFile* f       = new TFile("aod.root");
13   TTree* treeAOD = (TTree*) f->Get("AOD");
14   AliAODEvent* aod = new AliAODEvent();
15   aod->ReadFromTree(treeAOD);
16   treeAOD->GetEntry(iev);
17
18   AliEveJetPlane* jp = new AliEveJetPlane(iev);
19
20   // Read Jets in current event
21
22   TClonesArray* jets = aod->GetJets();
23   Int_t njets = jets->GetEntries();
24   printf("Event: %5d Number of jets: %5d \n", iev, njets);
25
26   for (Int_t ij = 0; ij < njets; ij++)
27   {
28     AliAODJet jet = (AliAODJet) jets->At(ij);
29     jp->AddJet(jet);
30   }
31
32   // Read tracks in current event
33
34   TClonesArray* tracks = aod->GetTracks();
35   Int_t ntracks = tracks->GetEntries();
36   printf("Event: %5d Number of tracks: %5d \n", iev, ntracks);
37
38   for (Int_t ij = 0; ij < ntracks; ij++)
39   {
40     AliAODTrack track = (AliAODTrack) tracks->At(ij);
41     jp->AddTrack(track);
42   }
43
44   // Render Jet Plane
45   gStyle->SetPalette(1, 0);
46   gEve->AddElement(jp);
47   gEve->Redraw3D();
48
49   return jp;
50 }