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