]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/macros/alieve_online.C
c7024d68de8fa77ed24ccdbed0d8adbdbc339758
[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   TEveUtil::AssertMacro("VizDB_scan.C");
25
26   // Temp fix !!!
27   TGeoManager *man = gGeoManager;
28   gGeomGentle = geom_gentle();
29   // Temp fix !!!
30   gGeoManager = man;
31
32   gROOT->ProcessLine(".L SplitGLView.C++g"); // !!!! debug-mode
33   TEveBrowser* browser = gEve->GetBrowser();
34   browser->ExecPlugin("SplitGLView", 0, "new SplitGLView(gClient->GetRoot(), 600, 450, kTRUE)");
35
36   if (gRPhiMgr) {
37     TEveProjectionAxes* a = new TEveProjectionAxes(gRPhiMgr);
38     a->SetNumTickMarks(3);
39     a->SetText("R-Phi");
40     a->SetFontFile("comicbd");
41     a->SetFontSize(10);
42     gEve->GetScenes()->FindChild("R-Phi Projection")->AddElement(a);
43   }
44   if (gRhoZMgr) {
45     TEveProjectionAxes* a = new TEveProjectionAxes(gRhoZMgr);
46     a->SetNumTickMarks(3);
47     a->SetText("Rho-Z");
48     a->SetFontFile("comicbd");
49     a->SetFontSize(10);
50     gEve->GetScenes()->FindChild("Rho-Z Projection")->AddElement(a);
51   }
52
53   TEveBrowser* browser = gEve->GetBrowser();
54
55   browser->StartEmbedding(TRootBrowser::kBottom);
56   new AliEveEventManagerWindow(AliEveEventManager::GetMaster());
57   browser->StopEmbedding("EventCtrl");
58
59   gEve->Redraw3D(kTRUE);
60 }
61
62 void alieve_online_on_new_event()
63 {
64   its_raw();
65   its_clusters();
66
67   tpc_raw();
68   tpc_clusters();
69
70   acorde_raw();
71
72   primary_vertex();
73   esd_tracks();
74
75   AliESDEvent* esd = AliEveEventManager::AssertESD();
76   Double_t x[3];
77   esd->GetPrimaryVertex()->GetXYZ(x);
78
79   TEveElement* top = gEve->GetCurrentEvent();
80
81   if (gRPhiMgr && top) {
82     gRPhiMgr->DestroyElements();
83     gRPhiMgr->SetCenter(x[0], x[1], x[2]);
84     gRPhiMgr->ImportElements(gGeomGentle);
85     gRPhiMgr->ImportElements(top);
86   }
87   if (gRhoZMgr && top) {
88     gRhoZMgr->DestroyElements();
89     gRhoZMgr->SetCenter(x[0], x[1], x[2]);
90     gRhoZMgr->ImportElements(gGeomGentle);
91     gRhoZMgr->ImportElements(top);
92   }
93
94   gROOT->ProcessLine("SplitGLView::UpdateSummary()");
95 }