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