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