]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/macros/alieve_online.C
064471afe21642e3681b9b0f1d00fbdf91ebd706
[u/mrichter/AliRoot.git] / EVE / macros / alieve_online.C
1 /**************************************************************************
2  * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
3  * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
4  * full copyright notice.                                                 *
5  **************************************************************************/
6
7 TEveGeoShape *gGeomGentle    = 0;
8
9 void alieve_online_init()
10 {
11   gROOT->LoadMacro("geom_gentle.C");
12
13   gROOT->LoadMacro("primary_vertex.C");
14   gROOT->LoadMacro("esd_tracks.C");
15
16   gROOT->LoadMacro("its_clusters.C++");
17   gROOT->LoadMacro("tpc_clusters.C++");
18   gROOT->LoadMacro("trd_clusters.C++");
19
20   gROOT->LoadMacro("acorde_raw.C");
21   gROOT->LoadMacro("its_raw.C");
22   gROOT->LoadMacro("tpc_raw.C");
23
24   gGeomGentle = geom_gentle();
25
26   gROOT->ProcessLine(".L SplitGLView.C++g"); // !!!! debug-mode
27   TEveBrowser* browser = gEve->GetBrowser();
28   browser->ExecPlugin("SplitGLView", 0, "new SplitGLView(gClient->GetRoot(), 600, 450, kTRUE)");
29
30   if (gRPhiMgr) {
31     TEveProjectionAxes* a = new TEveProjectionAxes(gRPhiMgr);
32     a->SetNumTickMarks(3);
33     a->SetText("R-Phi");
34     a->SetFontFile("comicbd");
35     a->SetFontSize(10);
36     gEve->GetScenes()->FindChild("R-Phi Projection")->AddElement(a);
37   }
38   if (gRhoZMgr) {
39     TEveProjectionAxes* a = new TEveProjectionAxes(gRhoZMgr);
40     a->SetNumTickMarks(3);
41     a->SetText("Rho-Z");
42     a->SetFontFile("comicbd");
43     a->SetFontSize(10);
44     gEve->GetScenes()->FindChild("Rho-Z Projection")->AddElement(a);
45   }
46
47   gEve->Redraw3D(kTRUE);
48 }
49
50 void alieve_online_on_new_event()
51 {
52
53   its_raw();
54   its_clusters();
55
56   tpc_raw();
57   tpc_clusters();
58
59   acorde_raw();
60
61   primary_vertex();
62   esd_tracks();
63
64   AliESDEvent* esd = AliEveEventManager::AssertESD();
65   Double_t x[3];
66   esd->GetPrimaryVertex()->GetXYZ(x);
67
68   TEveElement* top = gEve->GetCurrentEvent();
69
70   if (gRPhiMgr && top) {
71     gRPhiMgr->DestroyElements();
72     gRPhiMgr->SetCenter(x[0], x[1], x[2]);
73     gRPhiMgr->ImportElements(gGeomGentle);
74     gRPhiMgr->ImportElements(top);
75   }
76   if (gRhoZMgr && top) {
77     gRhoZMgr->DestroyElements();
78     gRhoZMgr->SetCenter(x[0], x[1], x[2]);
79     gRhoZMgr->ImportElements(gGeomGentle);
80     gRhoZMgr->ImportElements(top);
81   }
82
83   gROOT->ProcessLine("SplitGLView::UpdateSummary()");
84 }