Add cut test vs. TPC Ncls
[u/mrichter/AliRoot.git] / EVE / alice-macros / jetplane.C
CommitLineData
d810d0de 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 *
51346b82 7 * full copyright notice. *
d810d0de 8 **************************************************************************/
16718cdc 9
c7ee3856 10TEveViewer *gJPView = 0;
11TEveScene *gJPScene = 0;
12
13AliEveJetPlane* jetplane()
51346b82 14{
c7ee3856 15 if (gJPView == 0)
16 {
17 TEveWindowSlot *slot = 0;
18 TEveBrowser *browser = gEve->GetBrowser();
19
20 slot = TEveWindow::CreateWindowInTab(browser->GetTabRight());
21 slot->MakeCurrent();
22 gJPView = gEve->SpawnNewViewer("JetPlane", "");
23 gJPScene = gEve->SpawnNewScene("JetPlane", "Scene holding elements of the jet-plane view.");
24 gJPView->AddScene(gJPScene);
25 }
26
27 AliAODEvent* aod = AliEveEventManager::AssertAOD();
28
29
30 // We have event id everywhere now.
31 Int_t iev = AliEveEventManager::GetMaster()->GetEventId();
8c47e13d 32
d810d0de 33 AliEveJetPlane* jp = new AliEveJetPlane(iev);
8c47e13d 34
84aff7a4 35 // Read Jets in current event
8c47e13d 36
84aff7a4 37 TClonesArray* jets = aod->GetJets();
38 Int_t njets = jets->GetEntries();
16718cdc 39 printf("Event: %5d Number of jets: %5d \n", iev, njets);
8c47e13d 40
84aff7a4 41 for (Int_t ij = 0; ij < njets; ij++)
42 {
43 AliAODJet jet = (AliAODJet) jets->At(ij);
44 jp->AddJet(jet);
45 }
8c47e13d 46
84aff7a4 47 // Read tracks in current event
8c47e13d 48
84aff7a4 49 TClonesArray* tracks = aod->GetTracks();
50 Int_t ntracks = tracks->GetEntries();
16718cdc 51 printf("Event: %5d Number of tracks: %5d \n", iev, ntracks);
8c47e13d 52
84aff7a4 53 for (Int_t ij = 0; ij < ntracks; ij++)
54 {
55 AliAODTrack track = (AliAODTrack) tracks->At(ij);
56 jp->AddTrack(track);
57 }
8c47e13d 58
84aff7a4 59 // Render Jet Plane
60 gStyle->SetPalette(1, 0);
c7ee3856 61 // gEve->AddElement(jp);
62 gJPScene->AddElement(jp);
63
84aff7a4 64 gEve->Redraw3D();
8c47e13d 65
84aff7a4 66 return jp;
8c47e13d 67}