]>
Commit | Line | Data |
---|---|---|
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 | #if !defined(__CINT__) || defined(__MAKECINT__) | |
11 | #include <TClonesArray.h> | |
12 | #include <TGLViewer.h> | |
13 | #include <TStyle.h> | |
14 | #include <TEveBrowser.h> | |
15 | #include <TEveManager.h> | |
16 | #include <TEveViewer.h> | |
17 | #include <TEveWindow.h> | |
18 | #include <TEveScene.h> | |
19 | #include <TEveTreeTools.h> | |
20 | ||
21 | #include <AliRunLoader.h> | |
22 | #include <AliAODEvent.h> | |
23 | #include <AliAODTrack.h> | |
24 | #include <AliEveEventManager.h> | |
25 | #include <AliEveJetPlane.h> | |
26 | #endif | |
27 | ||
28 | TEveViewer *gJPView = 0; | |
29 | TEveScene *gJPScene = 0; | |
30 | ||
31 | AliEveJetPlane* jetplane() | |
32 | { | |
33 | if (gJPView == 0) | |
34 | { | |
35 | TEveWindowSlot *slot = 0; | |
36 | TEveBrowser *browser = gEve->GetBrowser(); | |
37 | ||
38 | slot = TEveWindow::CreateWindowInTab(browser->GetTabRight()); | |
39 | slot->MakeCurrent(); | |
40 | gJPView = gEve->SpawnNewViewer("JetPlane", ""); | |
41 | gJPScene = gEve->SpawnNewScene("JetPlane", "Scene holding elements of the jet-plane view."); | |
42 | gJPView->AddScene(gJPScene); | |
43 | ||
44 | gJPView->GetGLViewer()->SetCurrentCamera(TGLViewer::kCameraPerspXOY); | |
45 | } | |
46 | ||
47 | AliAODEvent* aod = AliEveEventManager::AssertAOD(); | |
48 | ||
49 | // We have event id everywhere now. | |
50 | Int_t iev = AliEveEventManager::GetMaster()->GetEventId(); | |
51 | ||
52 | gStyle->SetPalette(1, 0); | |
53 | ||
54 | AliEveJetPlane* jp = new AliEveJetPlane(iev); | |
55 | jp->SetPickable(kTRUE); | |
56 | ||
57 | // Read Jets in current event | |
58 | ||
59 | TClonesArray* jets = aod->GetJets(); | |
60 | Int_t njets = jets->GetEntries(); | |
61 | Info("jetplane", "Event: %5d Number of jets: %5d \n", iev, njets); | |
62 | ||
63 | for (Int_t ij = 0; ij < njets; ij++) | |
64 | { | |
65 | AliAODJet *jet = (AliAODJet*) jets->At(ij); | |
66 | jp->AddJet(jet); | |
67 | } | |
68 | ||
69 | // Read tracks in current event | |
70 | ||
71 | TClonesArray* tracks = aod->GetTracks(); | |
72 | Int_t ntracks = tracks->GetEntries(); | |
73 | Info("jetplane", "Event: %5d Number of tracks: %5d \n", iev, ntracks); | |
74 | ||
75 | for (Int_t ij = 0; ij < ntracks; ij++) | |
76 | { | |
77 | AliAODTrack* track = (AliAODTrack*) tracks->At(ij); | |
78 | jp->AddTrack(track); | |
79 | } | |
80 | ||
81 | jp->CreateArrows(); | |
82 | ||
83 | // Render Jet Plane | |
84 | gJPScene->AddElement(jp); | |
85 | AliEveEventManager::RegisterTransient(jp); | |
86 | ||
87 | gEve->Redraw3D(); | |
88 | ||
89 | return jp; | |
90 | } |