9e78371d |
1 | //-*- Mode: C++ -*- |
2 | |
3 | // ** USED macros : |
4 | // *************************************************** |
5 | // - hlt_alieve_init.C |
6 | // - VizDB_scan.C |
7 | // - geom_gentle_hlt.C |
8 | // - geom_gentle_muon.C |
9 | // *************************************************** |
10 | |
f1fefc07 |
11 | #ifndef __CINT__ |
9e78371d |
12 | #include "unistd.h" |
13 | #include <TEvePointSet.h> |
14 | #include "EveBase/AliEveEventManager.h" |
15 | #include <AliCluster.h> |
16 | #include <TPC/AliTPCClustersRow.h> |
f1fefc07 |
17 | #include <EveHLT/AliEveHOMERManager.h> |
18 | #include <TTimer.h> |
19 | #endif |
9e78371d |
20 | |
f1fefc07 |
21 | class TEveTrackList; |
9e78371d |
22 | class TEveProjectionManager; |
23 | class TEveGeoShape; |
24 | class TEveUtil; |
25 | class AliEveMacroExecutor; |
26 | class TEveScene; |
27 | class TEveElement; |
28 | class TEveText; |
29 | class AliHLTTriggerDecision; |
30 | class TEvePointSet; |
f1fefc07 |
31 | class AliHLTHOMERBlockDesc; |
9e78371d |
32 | |
f1fefc07 |
33 | class TEveViewer; |
9e78371d |
34 | // ----------------------------------------------------------------- |
35 | // -- Geometry / Scenes -- |
36 | // ----------------------------------------------------------------- |
37 | |
f1fefc07 |
38 | TEveGeoShape *gGeomGentle = 0; |
39 | TEveGeoShape *gGeomGentleRPhi = 0; |
40 | TEveGeoShape *gGeomGentleRhoZ = 0; |
41 | TEveGeoShape *gGeomGentleTRD = 0; |
42 | TEveGeoShape *gGeomGentleMUON = 0; |
43 | |
44 | TEveScene *gRPhiGeomScene = 0; |
45 | TEveScene *gRhoZGeomScene = 0; |
46 | TEveScene *gRPhiEventScene = 0; |
47 | TEveScene *gRhoZEventScene = 0; |
48 | |
9e78371d |
49 | TEveProjectionManager *gRPhiMgr = 0; |
50 | TEveProjectionManager *gRhoZMgr = 0; |
51 | |
f1fefc07 |
52 | TEveViewer *g3DView = 0; |
53 | TEveViewer *gRPhiView = 0; |
54 | TEveViewer *gRhoZView = 0; |
55 | |
9e78371d |
56 | // ----------------------------------------------------------------- |
57 | // -- Geometry / Scenes Parameters -- |
58 | // ----------------------------------------------------------------- |
59 | |
60 | // -- Parameters to show different geometries |
61 | Bool_t gShowMUON = kTRUE; |
62 | Bool_t gShowMUONRPhi = kFALSE; |
63 | Bool_t gShowMUONRhoZ = kTRUE; |
f1fefc07 |
64 | Bool_t gShowTRD = kFALSE; |
65 | |
66 | Bool_t gCenterProjectionsAtPrimaryVertex = kFALSE; |
9e78371d |
67 | |
68 | // ----------------------------------------------------------------- |
69 | // -- Members -- |
70 | // ----------------------------------------------------------------- |
71 | |
72 | // -- Timer for automatic event loop |
73 | TTimer eventTimer; |
74 | |
75 | // -- HOMERManager |
76 | AliEveHOMERManager* gHomerManager = 0; |
77 | |
78 | // -- Cluster members |
79 | TEvePointSet* gPHOSClusters = 0; |
80 | TEvePointSet* gTPCClusters = 0; |
81 | TEvePointSet* gSPDClusters = 0; |
82 | |
f1fefc07 |
83 | // -- Text output members |
84 | TEveText* gHLTText = 0; |
85 | |
9e78371d |
86 | // -- Tracks members |
87 | TEveTrackList* gTPCTrack = 0; |
88 | |
f1fefc07 |
89 | // -- Canvas for histos |
90 | TCanvas* gCanvas = 0; |
91 | |
9e78371d |
92 | // ----------------------------------------------------------------- |
93 | // -- Methods -- |
94 | // ----------------------------------------------------------------- |
95 | |
96 | Int_t initializeEveViewer( Bool_t showExtraGeo ); |
97 | |
5de5a293 |
98 | Int_t nextEvent(); |
99 | |
ea9a0e13 |
100 | Int_t processEvent(); |
9e78371d |
101 | |
f1fefc07 |
102 | //Int_t processPHOSClusters( AliHLTHOMERBlockDesc* block); |
9e78371d |
103 | |
104 | Int_t processEsdTracks( AliHLTHOMERBlockDesc* block, TEveTrackList* cont ); |
105 | |
106 | Int_t processHLTRDLST( AliHLTHOMERBlockDesc* block ); |
107 | |
108 | Int_t processROOTTOBJ( AliHLTHOMERBlockDesc* block ); |
109 | |
110 | Int_t processTPCClusters (AliHLTHOMERBlockDesc * block, TEvePointSet cont ); |
111 | |
112 | // ################################################################# |
113 | // ################################################################# |
114 | // ################################################################# |
115 | |
116 | // ----------------------------------------------------------------- |
117 | void onlineDisplay(Bool_t showMuonGeo=kFALSE) { |
f1fefc07 |
118 | |
9e78371d |
119 | // -- Loading Geometry |
120 | // --------------------- |
121 | Int_t run = 67179; |
122 | AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB"); |
123 | AliCDBManager::Instance()->SetRun(run); |
124 | AliGeomManager::LoadGeometry(); |
125 | |
126 | // -- Create new hM object |
127 | // ------------------------- |
128 | gHomerManager = new AliEveHOMERManager(); |
129 | gHomerManager->SetRetryCount(50,5); |
130 | |
131 | Int_t iResult = gHomerManager->Initialize(); |
132 | if (iResult) { |
133 | printf("Error Initializing AliHLTHOMERManager, quitting"); |
134 | return; |
135 | } |
136 | |
137 | // -- Add hM to EveTree |
138 | // ---------------------- |
139 | gEve->AddToListTree(gHomerManager, kTRUE); |
140 | |
141 | // -- Create SourceList |
142 | // ---------------------- |
143 | iResult = gHomerManager->CreateEveSourcesListLoop(); |
144 | if (iResult) { |
145 | printf ("Couldn't find active services. returning\n"); |
146 | return; |
147 | } |
148 | |
149 | // -- Initialize pointsets and add macros |
150 | // ---------------------------------------- |
151 | TEveUtil::LoadMacro("hlt_alieve_init.C"); |
152 | hlt_alieve_init(".", -1); |
153 | |
154 | // -- Initialize Eve |
155 | // ------------------- |
156 | initializeEveViewer( showMuonGeo ); |
157 | |
158 | // -- Finalize Eve |
159 | // ----------------- |
160 | gSystem->ProcessEvents(); |
161 | gEve->Redraw3D(kTRUE); |
f1fefc07 |
162 | |
163 | gHomerManager->ConnectEVEtoHOMER("TPC" ); |
9e78371d |
164 | } |
165 | |
166 | // ----------------------------------------------------------------- |
167 | Int_t initializeEveViewer( Bool_t showMuonGeo ) { |
168 | |
169 | //============================================================================== |
170 | // Geometry, scenes, projections and viewers |
171 | //============================================================================== |
172 | |
f1fefc07 |
173 | TEveBrowser *browser = gEve->GetBrowser(); |
174 | browser->ShowCloseTab(kFALSE); |
175 | |
9e78371d |
176 | // -- Disable extra geometry |
177 | // --------------------------- |
178 | if ( ! showMuonGeo ) { |
179 | gShowMUON = gShowMUONRPhi = gShowMUONRhoZ = kFALSE; |
180 | } |
181 | |
182 | // -- Load Geometry |
183 | // ------------------ |
184 | TEveUtil::LoadMacro("geom_gentle_hlt.C"); |
f1fefc07 |
185 | gGeomGentle = geom_gentle_hlt(); |
186 | gGeomGentleRPhi = geom_gentle_rphi(); gGeomGentleRPhi->IncDenyDestroy(); |
187 | gGeomGentleRhoZ = geom_gentle_rhoz(); gGeomGentleRhoZ->IncDenyDestroy(); |
188 | gGeomGentleTRD = geom_gentle_trd(); |
189 | |
9e78371d |
190 | if (gShowMUON) { |
191 | TEveUtil::LoadMacro("geom_gentle_muon.C"); |
f1fefc07 |
192 | gGeomGentleMUON = geom_gentle_muon(kFALSE); |
9e78371d |
193 | } |
194 | |
5de5a293 |
195 | // -- Scenes |
196 | // ----------- |
f1fefc07 |
197 | |
198 | gRPhiGeomScene = gEve->SpawnNewScene("RPhi Geometry", |
199 | "Scene holding projected geometry for the RPhi view."); |
200 | gRhoZGeomScene = gEve->SpawnNewScene("RhoZ Geometry", |
201 | "Scene holding projected geometry for the RhoZ view."); |
202 | gRPhiEventScene = gEve->SpawnNewScene("RPhi Event Data", |
203 | "Scene holding projected geometry for the RPhi view."); |
204 | gRhoZEventScene = gEve->SpawnNewScene("RhoZ Event Data", |
205 | "Scene holding projected geometry for the RhoZ view."); |
9e78371d |
206 | |
5de5a293 |
207 | // -- Projection managers |
208 | // ------------------------ |
f1fefc07 |
209 | |
9e78371d |
210 | gRPhiMgr = new TEveProjectionManager(); |
211 | gRPhiMgr->SetProjection(TEveProjection::kPT_RPhi); |
212 | gEve->AddToListTree(gRPhiMgr, kFALSE); |
213 | { |
214 | TEveProjectionAxes* a = new TEveProjectionAxes(gRPhiMgr); |
215 | a->SetMainColor(kWhite); |
216 | a->SetTitle("R-Phi"); |
217 | a->SetTitleSize(0.05); |
218 | a->SetTitleFont(102); |
219 | a->SetLabelSize(0.025); |
220 | a->SetLabelFont(102); |
f1fefc07 |
221 | gRPhiGeomScene->AddElement(a); |
9e78371d |
222 | } |
9e78371d |
223 | gRPhiMgr->SetCurrentDepth(-10); |
f1fefc07 |
224 | gRPhiMgr->ImportElements(gGeomGentleRPhi, gRPhiGeomScene); |
9e78371d |
225 | gRPhiMgr->SetCurrentDepth(0); |
f1fefc07 |
226 | if (gShowTRD) gRPhiMgr->ImportElements(gGeomGentleTRD, gRPhiGeomScene); |
227 | if (gShowMUONRPhi) gRPhiMgr->ImportElements(gGeomGentleMUON, gRPhiGeomScene); |
9e78371d |
228 | |
9e78371d |
229 | gRhoZMgr = new TEveProjectionManager(); |
230 | gRhoZMgr->SetProjection(TEveProjection::kPT_RhoZ); |
231 | gEve->AddToListTree(gRhoZMgr, kFALSE); |
232 | { |
233 | TEveProjectionAxes* a = new TEveProjectionAxes(gRhoZMgr); |
234 | a->SetMainColor(kWhite); |
235 | a->SetTitle("Rho-Z"); |
236 | a->SetTitleSize(0.05); |
237 | a->SetTitleFont(102); |
238 | a->SetLabelSize(0.025); |
239 | a->SetLabelFont(102); |
f1fefc07 |
240 | gRhoZGeomScene->AddElement(a); |
9e78371d |
241 | } |
242 | gRhoZMgr->SetCurrentDepth(-10); |
f1fefc07 |
243 | gRhoZMgr->ImportElements(gGeomGentleRhoZ, gRhoZGeomScene); |
9e78371d |
244 | gRhoZMgr->SetCurrentDepth(0); |
f1fefc07 |
245 | if (gShowTRD) gRhoZMgr->ImportElements(gGeomGentleTRD, gRhoZGeomScene); |
246 | if (gShowMUONRhoZ) gRhoZMgr->ImportElements(gGeomGentleMUON, gRhoZGeomScene); |
9e78371d |
247 | |
5de5a293 |
248 | // -- Viewers |
249 | // ------------ |
9e78371d |
250 | |
f1fefc07 |
251 | TEveWindowSlot *slot = 0; |
252 | TEveWindowPack *pack = 0; |
253 | |
254 | slot = TEveWindow::CreateWindowInTab(browser->GetTabRight()); |
255 | pack = slot->MakePack(); |
9e78371d |
256 | pack->SetElementName("Multi View"); |
257 | pack->SetHorizontal(); |
258 | pack->SetShowTitleBar(kFALSE); |
259 | pack->NewSlot()->MakeCurrent(); |
f1fefc07 |
260 | g3DView = gEve->SpawnNewViewer("3D View", ""); |
261 | g3DView->AddScene(gEve->GetGlobalScene()); |
262 | g3DView->AddScene(gEve->GetEventScene()); |
263 | |
9e78371d |
264 | pack = pack->NewSlot()->MakePack(); |
265 | pack->SetShowTitleBar(kFALSE); |
266 | pack->NewSlot()->MakeCurrent(); |
f1fefc07 |
267 | gRPhiView = gEve->SpawnNewViewer("RPhi View", ""); |
268 | gRPhiView->GetGLViewer()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY); |
269 | gRPhiView->AddScene(gRPhiGeomScene); |
270 | gRPhiView->AddScene(gRPhiEventScene); |
9e78371d |
271 | |
272 | pack->NewSlot()->MakeCurrent(); |
f1fefc07 |
273 | gRhoZView = gEve->SpawnNewViewer("RhoZ View", ""); |
274 | gRhoZView->GetGLViewer()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY); |
275 | gRhoZView->AddScene(gRhoZGeomScene); |
276 | gRhoZView->AddScene(gRhoZEventScene); |
277 | |
5de5a293 |
278 | // -- List of Viewers |
279 | // -------------------- |
9e78371d |
280 | |
281 | TEveViewerList *viewerlist = new TEveViewerList(); |
282 | viewerlist->AddElement(gEve->GetDefaultViewer()); |
283 | |
f1fefc07 |
284 | viewerlist->AddElement(g3DView); |
285 | viewerlist->AddElement(gRhoZView); |
286 | viewerlist->AddElement(gRPhiView); |
9e78371d |
287 | viewerlist->SwitchColorSet(); |
288 | |
289 | //============================================================================== |
290 | // Macros / QA histograms |
291 | //============================================================================== |
292 | |
293 | // -- Registration of per-event macros |
294 | // ------------------------------------- |
295 | |
296 | AliEveMacroExecutor *exec = new AliEveMacroExecutor(); |
297 | #if 0 |
298 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Track", "kine_tracks.C", "kine_tracks", "", kFALSE)); |
299 | |
300 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hit ITS", "its_hits.C", "its_hits", "", kFALSE)); |
301 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hit TPC", "tpc_hits.C", "tpc_hits", "", kFALSE)); |
302 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hit T0", "t0_hits.C", "t0_hits", "", kFALSE)); |
303 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hit FMD", "fmd_hits.C", "fmd_hits", "", kFALSE)); |
304 | |
305 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "DIG FMD", "fmd_digits.C", "fmd_digits", "", kFALSE)); |
306 | |
307 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW TPC", "tpc_raw.C", "tpc_raw", "", kFALSE)); |
308 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW T0", "t0_raw.C", "t0_raw", "", kFALSE)); |
309 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW FMD", "fmd_raw.C", "fmd_raw", "", kFALSE)); |
310 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW VZERO", "vzero_raw.C", "vzero_raw", "", kFALSE)); |
311 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW ACORDE", "acorde_raw.C", "acorde_raw", "", kFALSE)); |
312 | |
313 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX", "primary_vertex.C", "primary_vertex", "", kTRUE)); |
314 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Ellipse", "primary_vertex.C", "primary_vertex_ellipse", "", kTRUE)); |
315 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Box", "primary_vertex.C", "primary_vertex_box", "kFALSE, 3, 3, 3", kFALSE)); |
316 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX", "primary_vertex.C", "primary_vertex_spd", "", kTRUE)); |
317 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Ellipse", "primary_vertex.C", "primary_vertex_ellipse_spd", "", kTRUE)); |
318 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Box", "primary_vertex.C", "primary_vertex_box_spd", "kFALSE, 3, 3, 3", kFALSE)); |
319 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX", "primary_vertex.C", "primary_vertex_tpc", "", kFALSE)); |
320 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Ellipse", "primary_vertex.C", "primary_vertex_ellipse_tpc", "", kFALSE)); |
321 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Box", "primary_vertex.C", "primary_vertex_box_tpc", "kFALSE, 3, 3, 3", kFALSE)); |
322 | #endif |
323 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC V0", "esd_V0_points.C", "esd_V0_points_onfly")); |
324 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC V0", "esd_V0_points.C", "esd_V0_points_offline")); |
325 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC V0", "esd_V0.C", "esd_V0")); |
326 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC CSCD", "esd_cascade_points.C", "esd_cascade_points")); |
327 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC CSCD", "esd_cascade.C", "esd_cascade")); |
328 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC KINK", "esd_kink_points.C", "esd_kink_points")); |
329 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC KINK", "esd_kink.C", "esd_kink")); |
330 | |
331 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Track", "esd_tracks.C", "esd_tracks", "", kFALSE)); |
332 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Track", "esd_tracks.C", "esd_tracks_MI", "", kFALSE)); |
333 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Track", "esd_tracks.C", "esd_tracks_by_category", "", kTRUE)); |
334 | |
335 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Tracklet", "esd_spd_tracklets.C", "esd_spd_tracklets", "", kFALSE)); |
336 | |
337 | exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC ZDC", "esd_zdc.C", "esd_zdc", "", kFALSE)); |
338 | #if 0 |
339 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus", "clusters.C+", "clusters", "", kFALSE)); |
340 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus ITS", "its_clusters.C+", "its_clusters")); |
341 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus TPC", "tpc_clusters.C+", "tpc_clusters")); |
342 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus TRD", "trd_clusters.C+", "trd_clusters")); |
343 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus TOF", "tof_clusters.C+", "tof_clusters")); |
344 | |
345 | exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus TPC", "vplot_tpc.C+", "vplot_tpc", "", kFALSE)); |
346 | |
347 | exec->AddMacro(new AliEveMacro(AliEveMacro::kAOD, "ANA HF", "aod_HF.C", "aod_HF", "", kFALSE)); |
348 | exec->AddMacro(new AliEveMacro(AliEveMacro::kAOD, "ANA Jets", "jetplane.C", "jetplane", "", kFALSE)); |
349 | |
350 | // -- QA Viewer |
351 | // -------------- |
352 | |
f1fefc07 |
353 | |
9e78371d |
354 | slot = TEveWindow::CreateWindowInTab(browser->GetTabRight()); |
355 | slot->StartEmbedding(); |
f1fefc07 |
356 | |
357 | // gCanvas = new TCanvas("c1","c1", 600, 400); |
9e78371d |
358 | slot->StopEmbedding("QA histograms"); |
9e78371d |
359 | #endif |
360 | |
f1fefc07 |
361 | |
9e78371d |
362 | //============================================================================== |
363 | // Additional GUI components |
364 | //============================================================================== |
365 | |
366 | slot = TEveWindow::CreateWindowInTab(browser->GetTabRight()); |
5de5a293 |
367 | TEveWindowTab *storeTab = slot->MakeTab(); |
9e78371d |
368 | store_tab->SetElementNameTitle("WindowStore", |
369 | "Undocked windows whose previous container is not known\n" |
370 | "are placed here when the main-frame is closed."); |
5de5a293 |
371 | gEve->GetWindowManager()->SetDefaultContainer(storeTab); |
9e78371d |
372 | |
373 | return 0; |
374 | } |
375 | |
5de5a293 |
376 | // ----------------------------------------------------------------- |
377 | void nextEvent() { |
378 | |
379 | if ( gHomerManager->NextEvent() ) |
380 | return; |
381 | |
382 | processEvent(); |
383 | } |
384 | |
9e78371d |
385 | // ----------------------------------------------------------------- |
ea9a0e13 |
386 | Int_t processEvent() { |
9e78371d |
387 | |
388 | Int_t iResult = 0; |
389 | |
390 | gStyle->SetPalette(1, 0); |
391 | gEve->DisableRedraw(); |
392 | |
9e78371d |
393 | // -- Reset |
394 | // ---------- |
395 | if ( gTPCClusters ) gTPCClusters->Reset(); |
396 | if ( gPHOSClusters ) gPHOSClusters->Reset(); |
397 | if ( gTPCTrack ) gTPCTrack->DestroyElements(); |
398 | |
ea9a0e13 |
399 | if ( gHomerManager == NULL) { |
400 | printf ("No BlockList ... "); |
401 | return -1; |
402 | } |
9e78371d |
403 | if (gHomerManager->GetBlockList()->IsEmpty() ) { |
404 | printf ("No Blocks in list ... "); |
ea9a0e13 |
405 | return -2; |
9e78371d |
406 | } |
407 | |
408 | TIter next(gHomerManager->GetBlockList()); |
409 | AliHLTHOMERBlockDesc* block = 0; |
410 | |
411 | // -- Iterate over blocks in the block list |
412 | // ------------------------------------------ |
413 | while ((block = (AliHLTHOMERBlockDesc*)next())) { |
ea9a0e13 |
414 | |
415 | #if 0 |
416 | printf( "------------------- xxxxxxxxxxxxxxx ----------------------\n"); |
417 | printf( "Detector : %s\n", block->GetDetector().Data() ); |
418 | printf( "Datatype : %s\n", block->GetDataType().Data() ); |
419 | if (block->IsTObject() ) |
420 | printf( "Is TObject of class: %s\n", block->GetClassName().Data() ); |
421 | printf( "------------------- xxxxxxxxxxxxxxx ----------------------\n"); |
422 | #endif |
9e78371d |
423 | |
424 | // -- CHECK SOURCE |
425 | // ----------------------------------------------------- |
426 | |
427 | // ++ HLT BLOCK |
428 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
429 | if ( ! block->GetDetector().CompareTo("HLT") ) { |
430 | |
431 | // -- ESDTREE |
432 | if ( ! block->GetDataType().CompareTo("ALIESDV0") ) { |
9e78371d |
433 | if(!gTPCTrack){ |
434 | gTPCTrack = new TEveTrackList("ESD Tracks"); |
435 | gTPCTrack->SetMainColor(6); |
436 | gEve->AddElement(gTPCTrack); |
437 | } |
9e78371d |
438 | iResult = processEsdTracks(block, gTPCTrack); |
439 | } |
f1fefc07 |
440 | |
9e78371d |
441 | // -- Process ROOTObj |
442 | else if ( ! block->GetDataType().CompareTo("ROOTTOBJ") ) { |
f1fefc07 |
443 | if(!gHLTText){ |
444 | gHLTText = new TEveText(); |
445 | //gHLTText->BBoxZero(5, -5, -5, 0); |
446 | //gHLTText->SetExtrude(25); |
447 | //gHLTText->AssertBBoxExtents(25,25,25); |
448 | gEve->AddElement(gHLTText); |
449 | } |
450 | processROOTTOBJ( block, gHLTText ); |
9e78371d |
451 | } |
452 | |
453 | // -- Process HLT RDLST |
454 | else if ( ! block->GetDataType().CompareTo("HLTRDLST") ) { |
f1fefc07 |
455 | ; |
456 | //cout<<"Readlist"<<endl; |
457 | //processHLTRDLST( block ); |
458 | } |
9e78371d |
459 | } // if ( ! block->GetDetector().CompareTo("HLT") ) { |
460 | |
461 | // ++ TPC BLOCK |
462 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
463 | else if ( ! block->GetDetector().CompareTo("TPC") ) { |
464 | |
f1fefc07 |
465 | // -- Process TPC Clusters |
466 | if ( ! block->GetDataType().CompareTo("CLUSTERS") ) { |
f1fefc07 |
467 | if(!gTPCClusters){ |
468 | gTPCClusters = new TEvePointSet("TPC Clusters"); |
469 | gTPCClusters->SetMainColor(kRed); |
470 | gTPCClusters->SetMarkerStyle((Style_t)kFullDotSmall); |
471 | gEve->AddElement(gTPCClusters); |
472 | } |
473 | iResult = processTPCClusters( block , gTPCClusters); |
9e78371d |
474 | } |
f1fefc07 |
475 | } // else if ( ! block->GetDetector().CompareTo("TPC") ) { |
476 | |
9e78371d |
477 | |
f1fefc07 |
478 | // ++ SPD BLOCK |
9e78371d |
479 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
480 | else if ( ! block->GetDetector().CompareTo("ISPD") ){ |
481 | if ( block->GetDataType().CompareTo("CLUSTERS") == 0 ) { |
482 | //processISPDClusters( block ); |
483 | } |
484 | } // else if ( ! block->GetDetector().CompareTo("ISPD") ){ |
485 | |
f1fefc07 |
486 | |
487 | // -- ITS |
488 | else if ( ! block->GetDetector().CompareTo("ITS") ){ |
489 | if ( block->GetDataType().CompareTo("ROOTHIST") == 0 ) { |
490 | iResult = 0; |
491 | //iResult = processITSHist( block ); |
492 | } |
493 | } // else if ( ! block->GetDetector().CompareTo("ISPD") ){ |
494 | |
495 | |
496 | // --------------------------------------------------------- |
9e78371d |
497 | } // while ((block = (AliHLTHOMERBlockDesc*)next())) { |
498 | |
f1fefc07 |
499 | |
9e78371d |
500 | if ( gTPCClusters ) gTPCClusters->ResetBBox(); |
501 | if ( gPHOSClusters ) gPHOSClusters->ResetBBox(); |
502 | if ( gSPDClusters ) gSPDClusters->ResetBBox(); |
503 | if ( gTPCTrack ) gTPCTrack->ElementChanged(); |
504 | |
ea9a0e13 |
505 | |
506 | // -- Set EventID in Window Title |
507 | // -------------------------------------------- |
ea9a0e13 |
508 | TString winTitle("Eve Main Window -- Event ID : "); |
509 | winTitle += Form("0x%016X ", gHomerManager->GetEventID() ); |
510 | gEve->GetBrowser()->SetWindowName(winTitle); |
9e78371d |
511 | |
512 | // -- Set Projections |
513 | // -------------------------------------------- |
9e78371d |
514 | |
515 | // XXX Primary vertex ... to be retrieved from the ESD |
f1fefc07 |
516 | // Double_t x[3] = { 0, 0, 0 }; |
517 | |
f1fefc07 |
518 | TEveElement* top = gEve->GetCurrentEvent(); |
519 | |
ea9a0e13 |
520 | if (gRPhiMgr && top) { |
f1fefc07 |
521 | gRPhiEventScene->DestroyElements(); |
522 | if (gCenterProjectionsAtPrimaryVertex) |
523 | gRPhiMgr->SetCenter(x[0], x[1], x[2]); |
524 | gRPhiMgr->ImportElements(top, gRPhiEventScene); |
9e78371d |
525 | } |
ea9a0e13 |
526 | |
527 | if (gRhoZMgr && top) { |
f1fefc07 |
528 | gRhoZEventScene->DestroyElements(); |
529 | if (gCenterProjectionsAtPrimaryVertex) |
530 | gRhoZMgr->SetCenter(x[0], x[1], x[2]); |
531 | gRhoZMgr->ImportElements(top, gRhoZEventScene); |
9e78371d |
532 | } |
9e78371d |
533 | |
f1fefc07 |
534 | // -------------------------------------------- |
ea9a0e13 |
535 | |
536 | gEve->Redraw3D(0,1); // (0, 1) |
9e78371d |
537 | gEve->EnableRedraw(); |
f1fefc07 |
538 | |
9e78371d |
539 | return iResult; |
540 | } |
541 | |
5de5a293 |
542 | |
9e78371d |
543 | // ----------------------------------------------------------------- |
544 | void loopEvent() { |
5de5a293 |
545 | |
546 | eventTimer.SetCommand("nextEvent()"); |
9e78371d |
547 | eventTimer.Start(6000); |
548 | } |
549 | |
550 | // ----------------------------------------------------------------- |
551 | void stopLoopEvent() { |
552 | eventTimer.Stop(); |
553 | } |
554 | |
f1fefc07 |
555 | // ----------------------------------------------------------------- |
556 | Int_t processITSHist(AliHLTHOMERBlockDesc* block) { |
557 | TH2F* hist = block->GetTObject(); |
558 | |
559 | gCanvas->cd(); |
560 | hist->Draw(); |
561 | return 0; |
562 | } |
9e78371d |
563 | // ----------------------------------------------------------------- |
564 | Int_t processHLTRDLST(AliHLTHOMERBlockDesc* block) { |
565 | |
566 | return 0; |
567 | } |
568 | |
569 | // ----------------------------------------------------------------- |
570 | Int_t processISPDClusters(AliHLTHOMERBlockDesc* block) { |
571 | cout<<"ISPD dump:"<<endl; |
572 | TObject ob = block->GetTObject(); |
573 | ob.Dump(); |
f1fefc07 |
574 | |
9e78371d |
575 | return 0; |
576 | } |
577 | |
578 | // ----------------------------------------------------------------- |
f1fefc07 |
579 | Int_t processROOTTOBJ(AliHLTHOMERBlockDesc* block, TEveText* et) { |
9e78371d |
580 | |
581 | // -- AliHLTGlobalTriggerDecision |
582 | if ( ! block->GetClassName().CompareTo("AliHLTGlobalTriggerDecision") ) { |
583 | |
584 | AliHLTGlobalTriggerDecision *trig = dynamic_cast<AliHLTGlobalTriggerDecision*> block->GetTObject(); |
5de5a293 |
585 | trig->Print(); |
f1fefc07 |
586 | |
ea9a0e13 |
587 | // et->SetText("balle");; |
9e78371d |
588 | |
ea9a0e13 |
589 | // TEveText* tt = new TEveText("Trigger: Class is known ;-) "); |
590 | // gEve->AddElement(tt); |
9e78371d |
591 | |
592 | } |
593 | else { |
594 | printf(" Unknown root object %s",block->GetClassName().Data() ); |
595 | } |
596 | |
597 | return 0; |
598 | } |
599 | |
600 | // ----------------------------------------------------------------- |
601 | Int_t processEsdTracks( AliHLTHOMERBlockDesc* block, TEveTrackList* cont ) { |
602 | |
603 | AliESDEvent* esd = (AliESDEvent *) (block->GetTObject()); |
604 | esd->GetStdContent(); |
605 | |
606 | esd_track_propagator_setup(cont->GetPropagator(),0.1*esd->GetMagneticField(), 520); |
607 | |
608 | printf( "Number of ESD Tracks : %d \n", esd->GetNumberOfTracks()); |
609 | |
610 | for (Int_t iter = 0; iter < esd->GetNumberOfTracks(); ++iter) { |
611 | AliEveTrack* track = esd_make_track(esd->GetTrack(iter), cont); |
612 | cont->AddElement(track); |
613 | } |
614 | |
615 | cont->SetTitle(Form("N=%d", esd->GetNumberOfTracks()) ); |
616 | cont->MakeTracks(); |
617 | |
618 | return 0; |
619 | } |
620 | |
ea9a0e13 |
621 | // ----------------------------------------------------------------- |
622 | Int_t processTPCClusters(AliHLTHOMERBlockDesc* block, TEvePointSet* cont) { |
f1fefc07 |
623 | |
624 | Int_t slice = block->GetSubDetector(); |
625 | Int_t patch = block->GetSubSubDetector(); |
9e78371d |
626 | Float_t phi = ( slice + 0.5 ) * TMath::Pi() / 9.0; |
627 | Float_t cos = TMath::Cos( phi ); |
628 | Float_t sin = TMath::Sin( phi ); |
ea9a0e13 |
629 | |
630 | AliHLTTPCClusterData *cd = reinterpret_cast<AliHLTTPCClusterData*> (block->GetData()); |
631 | UChar_t *data = reinterpret_cast<UChar_t*> (cd->fSpacePoints); |
9e78371d |
632 | |
ea9a0e13 |
633 | if ( cd->fSpacePointCnt != 0 ) { |
634 | for (Int_t iter = 0; iter < cd->fSpacePointCnt; ++iter, data += sizeof(AliHLTTPCSpacePointData)) { |
635 | AliHLTTPCSpacePointData *sp = reinterpret_cast<AliHLTTPCSpacePointData*> (data); |
9e78371d |
636 | cont->SetNextPoint(cos*sp->fX - sin*sp->fY, sin*sp->fX + cos*sp->fY, sp->fZ); |
637 | } |
638 | } |
639 | |
ea9a0e13 |
640 | return 0; |
9e78371d |
641 | } |
642 | |