Changed the naming of some histograms and corrected a few axis names.
[u/mrichter/AliRoot.git] / EVE / macros / alieve_online.C
CommitLineData
319f3084 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
2a6fc1f9 7class TEveProjectionManager;
8class TEveGeoShape;
9class TEveUtil;
10
4d62585e 11TEveGeoShape *gGeomGentle = 0;
de33999e 12
2a6fc1f9 13TEveScene *gRPhiGeomScene = 0;
14TEveScene *gRhoZGeomScene = 0;
15TEveScene *gRPhiEventScene = 0;
16TEveScene *gRhoZEventScene = 0;
17
18TEveProjectionManager *gRPhiMgr = 0;
19TEveProjectionManager *gRhoZMgr = 0;
20
21TEveViewer *g3DView = 0;
22TEveViewer *gRPhiView = 0;
23TEveViewer *gRhoZView = 0;
24
25Bool_t gCenterProjectionsAtPrimaryVertex = kFALSE;
26
de33999e 27void alieve_online_init()
319f3084 28{
de33999e 29 gROOT->LoadMacro("geom_gentle.C");
30
31 gROOT->LoadMacro("primary_vertex.C");
32 gROOT->LoadMacro("esd_tracks.C");
44c97b40 33 // Disabled due to memory leaks
34 // gROOT->LoadMacro("trd_tracks.C++");
9fb2a3ed 35 gROOT->LoadMacro("trd_detectors.C++");
de33999e 36
dc9dec4d 37 gROOT->LoadMacro("its_clusters.C++");
38 gROOT->LoadMacro("tpc_clusters.C++");
95a0b764 39 gROOT->LoadMacro("tof_clusters.C++");
f1fa3b4b 40 gROOT->LoadMacro("hmpid_clusters.C++");
38aefcea 41 gROOT->LoadMacro("emcal_digits.C++");
de33999e 42
43 gROOT->LoadMacro("acorde_raw.C");
44 gROOT->LoadMacro("its_raw.C");
45 gROOT->LoadMacro("tpc_raw.C");
95a0b764 46 gROOT->LoadMacro("tof_raw.C");
0cf37c7b 47 gROOT->LoadMacro("vzero_raw.C");
de33999e 48
a9e18d1c 49 TEveUtil::AssertMacro("VizDB_scan.C");
50
2a6fc1f9 51 TEveBrowser *browser = gEve->GetBrowser();
52 browser->ShowCloseTab(kFALSE);
53
2a8440b7 54 // Temp fix !!!
55 TGeoManager *man = gGeoManager;
de33999e 56 gGeomGentle = geom_gentle();
2a6fc1f9 57 gGeomGentleRPhi = geom_gentle_rphi(); gGeomGentleRPhi->IncDenyDestroy();
58 gGeomGentleRhoZ = geom_gentle_rhoz(); gGeomGentleRhoZ->IncDenyDestroy();
2a8440b7 59 // Temp fix !!!
60 gGeoManager = man;
de33999e 61
2a6fc1f9 62 // Scenes
63 gRPhiGeomScene = gEve->SpawnNewScene("RPhi Geometry",
64 "Scene holding projected geometry for the RPhi view.");
65 gRhoZGeomScene = gEve->SpawnNewScene("RhoZ Geometry",
66 "Scene holding projected geometry for the RhoZ view.");
67 gRPhiEventScene = gEve->SpawnNewScene("RPhi Event Data",
68 "Scene holding projected geometry for the RPhi view.");
69 gRhoZEventScene = gEve->SpawnNewScene("RhoZ Event Data",
70 "Scene holding projected geometry for the RhoZ view.");
71
72 gRPhiMgr = new TEveProjectionManager();
73 gRPhiMgr->SetProjection(TEveProjection::kPT_RPhi);
74 gEve->AddToListTree(gRPhiMgr, kFALSE);
75 {
de33999e 76 TEveProjectionAxes* a = new TEveProjectionAxes(gRPhiMgr);
b631c5f2 77 a->SetMainColor(kWhite);
68ca2fe7 78 a->SetTitle("R-Phi");
b631c5f2 79 a->SetTitleSize(0.05);
2a6fc1f9 80 a->SetTitleFont(102);
b631c5f2 81 a->SetLabelSize(0.025);
2a6fc1f9 82 a->SetLabelFont(102);
83 gRPhiGeomScene->AddElement(a);
de33999e 84 }
2a6fc1f9 85 gRPhiMgr->SetCurrentDepth(-10);
86 gRPhiMgr->ImportElements(gGeomGentleRPhi, gRPhiGeomScene);
87 gRPhiMgr->SetCurrentDepth(0);
88
89 gRhoZMgr = new TEveProjectionManager();
90 gRhoZMgr->SetProjection(TEveProjection::kPT_RhoZ);
91 gEve->AddToListTree(gRhoZMgr, kFALSE);
92 {
de33999e 93 TEveProjectionAxes* a = new TEveProjectionAxes(gRhoZMgr);
b631c5f2 94 a->SetMainColor(kWhite);
2a6fc1f9 95 a->SetTitle("Rho-Z");
b631c5f2 96 a->SetTitleSize(0.05);
2a6fc1f9 97 a->SetTitleFont(102);
b631c5f2 98 a->SetLabelSize(0.025);
2a6fc1f9 99 a->SetLabelFont(102);
100 gRhoZGeomScene->AddElement(a);
de33999e 101 }
2a6fc1f9 102 gRhoZMgr->SetCurrentDepth(-10);
103 gRhoZMgr->ImportElements(gGeomGentleRhoZ, gRhoZGeomScene);
104 gRhoZMgr->SetCurrentDepth(0);
105
106 // Viewers
107 TEveWindowSlot *slot = 0;
108 TEveWindowPack *pack = 0;
109
110 slot = TEveWindow::CreateWindowInTab(browser->GetTabRight());
111 pack = slot->MakePack();
112 pack->SetElementName("Multi View");
113 pack->SetHorizontal();
114 pack->SetShowTitleBar(kFALSE);
115 pack->NewSlot()->MakeCurrent();
116 g3DView = gEve->SpawnNewViewer("3D View", "");
117 g3DView->AddScene(gEve->GetGlobalScene());
118 g3DView->AddScene(gEve->GetEventScene());
119
120 pack = pack->NewSlot()->MakePack();
121 pack->SetShowTitleBar(kFALSE);
122 pack->NewSlot()->MakeCurrent();
123 gRPhiView = gEve->SpawnNewViewer("RPhi View", "");
124 gRPhiView->GetGLViewer()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
125 gRPhiView->AddScene(gRPhiGeomScene);
126 gRPhiView->AddScene(gRPhiEventScene);
127
128 pack->NewSlot()->MakeCurrent();
129 gRhoZView = gEve->SpawnNewViewer("RhoZ View", "");
130 gRhoZView->GetGLViewer()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
131 gRhoZView->AddScene(gRhoZGeomScene);
132 gRhoZView->AddScene(gRhoZEventScene);
133
14a4b686 134 browser->GetTabRight()->SetTab(1);
de33999e 135
47aab29b 136 browser->StartEmbedding(TRootBrowser::kBottom);
4d62585e 137 new AliEveEventManagerWindow(AliEveEventManager::GetMaster());
47aab29b 138 browser->StopEmbedding("EventCtrl");
139
de33999e 140 gEve->Redraw3D(kTRUE);
141}
142
143void alieve_online_on_new_event()
144{
effa8d5d 145 if (AliEveEventManager::HasRawReader())
146 its_raw();
de33999e 147 its_clusters();
148
effa8d5d 149 if (AliEveEventManager::HasRawReader())
150 tpc_raw();
de33999e 151 tpc_clusters();
152
95a0b764 153 if (AliEveEventManager::HasRawReader())
154 tof_raw();
155 tof_clusters();
156
f1fa3b4b 157 hmpid_clusters();
158
effa8d5d 159 if (AliEveEventManager::HasRawReader())
160 acorde_raw();
de33999e 161
0cf37c7b 162 if (AliEveEventManager::HasRawReader())
163 vzero_raw();
164
38aefcea 165 emcal_digits();
166
de33999e 167 primary_vertex();
168 esd_tracks();
169
44c97b40 170 // Disabled due to memory leaks
171 // if (AliEveEventManager::HasESDfriend()) trd_tracks();
172 // AliSysInfo::AddStamp("EveTRDTr");
9fb2a3ed 173 trd_detectors();
174
de33999e 175 AliESDEvent* esd = AliEveEventManager::AssertESD();
176 Double_t x[3];
177 esd->GetPrimaryVertex()->GetXYZ(x);
178
179 TEveElement* top = gEve->GetCurrentEvent();
180
2a6fc1f9 181 if (gRPhiMgr && top)
182 {
183 gRPhiEventScene->DestroyElements();
184 if (gCenterProjectionsAtPrimaryVertex)
185 gRPhiMgr->SetCenter(x[0], x[1], x[2]);
186 gRPhiMgr->ImportElements(top, gRPhiEventScene);
de33999e 187 }
2a6fc1f9 188 if (gRhoZMgr && top)
189 {
190 gRhoZEventScene->DestroyElements();
191 if (gCenterProjectionsAtPrimaryVertex)
192 gRhoZMgr->SetCenter(x[0], x[1], x[2]);
193 gRhoZMgr->ImportElements(top, gRhoZEventScene);
de33999e 194 }
319f3084 195}