* AliHLTHOMERBlockDesc holds now a copy of the data
[u/mrichter/AliRoot.git] / EVE / hlt-macros / onlineDisplay.C
CommitLineData
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 21class TEveTrackList;
9e78371d 22class TEveProjectionManager;
23class TEveGeoShape;
24class TEveUtil;
25class AliEveMacroExecutor;
26class TEveScene;
27class TEveElement;
28class TEveText;
29class AliHLTTriggerDecision;
30class TEvePointSet;
f1fefc07 31class AliHLTHOMERBlockDesc;
9e78371d 32
f1fefc07 33class TEveViewer;
9e78371d 34// -----------------------------------------------------------------
35// -- Geometry / Scenes --
36// -----------------------------------------------------------------
37
f1fefc07 38TEveGeoShape *gGeomGentle = 0;
39TEveGeoShape *gGeomGentleRPhi = 0;
40TEveGeoShape *gGeomGentleRhoZ = 0;
41TEveGeoShape *gGeomGentleTRD = 0;
42TEveGeoShape *gGeomGentleMUON = 0;
43
44TEveScene *gRPhiGeomScene = 0;
45TEveScene *gRhoZGeomScene = 0;
46TEveScene *gRPhiEventScene = 0;
47TEveScene *gRhoZEventScene = 0;
48
9e78371d 49TEveProjectionManager *gRPhiMgr = 0;
50TEveProjectionManager *gRhoZMgr = 0;
51
f1fefc07 52TEveViewer *g3DView = 0;
53TEveViewer *gRPhiView = 0;
54TEveViewer *gRhoZView = 0;
55
9e78371d 56// -----------------------------------------------------------------
57// -- Geometry / Scenes Parameters --
58// -----------------------------------------------------------------
59
60// -- Parameters to show different geometries
61Bool_t gShowMUON = kTRUE;
62Bool_t gShowMUONRPhi = kFALSE;
63Bool_t gShowMUONRhoZ = kTRUE;
f1fefc07 64Bool_t gShowTRD = kFALSE;
65
66Bool_t gCenterProjectionsAtPrimaryVertex = kFALSE;
9e78371d 67
68// -----------------------------------------------------------------
69// -- Members --
70// -----------------------------------------------------------------
71
72// -- Timer for automatic event loop
73TTimer eventTimer;
74
75// -- HOMERManager
76AliEveHOMERManager* gHomerManager = 0;
77
78// -- Cluster members
79TEvePointSet* gPHOSClusters = 0;
80TEvePointSet* gTPCClusters = 0;
81TEvePointSet* gSPDClusters = 0;
82
f1fefc07 83// -- Text output members
84TEveText* gHLTText = 0;
85
9e78371d 86// -- Tracks members
87TEveTrackList* gTPCTrack = 0;
88
f1fefc07 89// -- Canvas for histos
90TCanvas* gCanvas = 0;
91
9e78371d 92// -----------------------------------------------------------------
93// -- Methods --
94// -----------------------------------------------------------------
95
96Int_t initializeEveViewer( Bool_t showExtraGeo );
97
ea9a0e13 98Int_t processEvent();
9e78371d 99
f1fefc07 100//Int_t processPHOSClusters( AliHLTHOMERBlockDesc* block);
9e78371d 101
102Int_t processEsdTracks( AliHLTHOMERBlockDesc* block, TEveTrackList* cont );
103
104Int_t processHLTRDLST( AliHLTHOMERBlockDesc* block );
105
106Int_t processROOTTOBJ( AliHLTHOMERBlockDesc* block );
107
108Int_t processTPCClusters (AliHLTHOMERBlockDesc * block, TEvePointSet cont );
109
110// #################################################################
111// #################################################################
112// #################################################################
113
114// -----------------------------------------------------------------
115void onlineDisplay(Bool_t showMuonGeo=kFALSE) {
f1fefc07 116
9e78371d 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);
f1fefc07 160
161 gHomerManager->ConnectEVEtoHOMER("TPC" );
162
9e78371d 163}
164
165// -----------------------------------------------------------------
166Int_t initializeEveViewer( Bool_t showMuonGeo ) {
167
168 //==============================================================================
169 // Geometry, scenes, projections and viewers
170 //==============================================================================
171
f1fefc07 172 TEveBrowser *browser = gEve->GetBrowser();
173 browser->ShowCloseTab(kFALSE);
174
9e78371d 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");
f1fefc07 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
9e78371d 189 if (gShowMUON) {
190 TEveUtil::LoadMacro("geom_gentle_muon.C");
f1fefc07 191 gGeomGentleMUON = geom_gentle_muon(kFALSE);
9e78371d 192 }
193
9e78371d 194
f1fefc07 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.");
9e78371d 205
9e78371d 206
f1fefc07 207 // Projection managers
208
9e78371d 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);
f1fefc07 220 gRPhiGeomScene->AddElement(a);
9e78371d 221 }
9e78371d 222 gRPhiMgr->SetCurrentDepth(-10);
f1fefc07 223 gRPhiMgr->ImportElements(gGeomGentleRPhi, gRPhiGeomScene);
9e78371d 224 gRPhiMgr->SetCurrentDepth(0);
f1fefc07 225 if (gShowTRD) gRPhiMgr->ImportElements(gGeomGentleTRD, gRPhiGeomScene);
226 if (gShowMUONRPhi) gRPhiMgr->ImportElements(gGeomGentleMUON, gRPhiGeomScene);
9e78371d 227
9e78371d 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);
f1fefc07 239 gRhoZGeomScene->AddElement(a);
9e78371d 240 }
241 gRhoZMgr->SetCurrentDepth(-10);
f1fefc07 242 gRhoZMgr->ImportElements(gGeomGentleRhoZ, gRhoZGeomScene);
9e78371d 243 gRhoZMgr->SetCurrentDepth(0);
f1fefc07 244 if (gShowTRD) gRhoZMgr->ImportElements(gGeomGentleTRD, gRhoZGeomScene);
245 if (gShowMUONRhoZ) gRhoZMgr->ImportElements(gGeomGentleMUON, gRhoZGeomScene);
9e78371d 246
f1fefc07 247 // Viewers
9e78371d 248
f1fefc07 249 TEveWindowSlot *slot = 0;
250 TEveWindowPack *pack = 0;
251
252 slot = TEveWindow::CreateWindowInTab(browser->GetTabRight());
253 pack = slot->MakePack();
9e78371d 254 pack->SetElementName("Multi View");
255 pack->SetHorizontal();
256 pack->SetShowTitleBar(kFALSE);
257 pack->NewSlot()->MakeCurrent();
f1fefc07 258 g3DView = gEve->SpawnNewViewer("3D View", "");
259 g3DView->AddScene(gEve->GetGlobalScene());
260 g3DView->AddScene(gEve->GetEventScene());
261
9e78371d 262 pack = pack->NewSlot()->MakePack();
263 pack->SetShowTitleBar(kFALSE);
264 pack->NewSlot()->MakeCurrent();
f1fefc07 265 gRPhiView = gEve->SpawnNewViewer("RPhi View", "");
266 gRPhiView->GetGLViewer()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
267 gRPhiView->AddScene(gRPhiGeomScene);
268 gRPhiView->AddScene(gRPhiEventScene);
9e78371d 269
270 pack->NewSlot()->MakeCurrent();
f1fefc07 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
9e78371d 278
279 TEveViewerList *viewerlist = new TEveViewerList();
280 viewerlist->AddElement(gEve->GetDefaultViewer());
281
f1fefc07 282 viewerlist->AddElement(g3DView);
283 viewerlist->AddElement(gRhoZView);
284 viewerlist->AddElement(gRPhiView);
9e78371d 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
f1fefc07 351
9e78371d 352 slot = TEveWindow::CreateWindowInTab(browser->GetTabRight());
353 slot->StartEmbedding();
f1fefc07 354
355// gCanvas = new TCanvas("c1","c1", 600, 400);
9e78371d 356 slot->StopEmbedding("QA histograms");
9e78371d 357#endif
358
f1fefc07 359
9e78371d 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// -----------------------------------------------------------------
ea9a0e13 375Int_t processEvent() {
9e78371d 376
377 Int_t iResult = 0;
378
ea9a0e13 379 cout << "===============" << endl;
380 cout << " PROCESS EVENT " << endl;
381 cout << "===============" << endl;
382
9e78371d 383 gStyle->SetPalette(1, 0);
384 gEve->DisableRedraw();
385
9e78371d 386 // -- Reset
387 // ----------
388 if ( gTPCClusters ) gTPCClusters->Reset();
389 if ( gPHOSClusters ) gPHOSClusters->Reset();
390 if ( gTPCTrack ) gTPCTrack->DestroyElements();
391
ea9a0e13 392 if ( gHomerManager == NULL) {
393 printf ("No BlockList ... ");
394 return -1;
395 }
9e78371d 396 if (gHomerManager->GetBlockList()->IsEmpty() ) {
397 printf ("No Blocks in list ... ");
ea9a0e13 398 return -2;
9e78371d 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())) {
ea9a0e13 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
9e78371d 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") ) {
9e78371d 426 if(!gTPCTrack){
427 gTPCTrack = new TEveTrackList("ESD Tracks");
428 gTPCTrack->SetMainColor(6);
429 gEve->AddElement(gTPCTrack);
430 }
9e78371d 431 iResult = processEsdTracks(block, gTPCTrack);
432 }
f1fefc07 433
9e78371d 434 // -- Process ROOTObj
435 else if ( ! block->GetDataType().CompareTo("ROOTTOBJ") ) {
f1fefc07 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 );
9e78371d 444 }
445
446 // -- Process HLT RDLST
447 else if ( ! block->GetDataType().CompareTo("HLTRDLST") ) {
f1fefc07 448 ;
449 //cout<<"Readlist"<<endl;
450 //processHLTRDLST( block );
451 }
9e78371d 452 } // if ( ! block->GetDetector().CompareTo("HLT") ) {
453
454 // ++ TPC BLOCK
455 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++
456 else if ( ! block->GetDetector().CompareTo("TPC") ) {
457
f1fefc07 458 // -- Process TPC Clusters
459 if ( ! block->GetDataType().CompareTo("CLUSTERS") ) {
f1fefc07 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);
9e78371d 467 }
f1fefc07 468 } // else if ( ! block->GetDetector().CompareTo("TPC") ) {
469
9e78371d 470
f1fefc07 471 // ++ SPD BLOCK
9e78371d 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
f1fefc07 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 // ---------------------------------------------------------
9e78371d 490 } // while ((block = (AliHLTHOMERBlockDesc*)next())) {
491
f1fefc07 492
9e78371d 493 if ( gTPCClusters ) gTPCClusters->ResetBBox();
494 if ( gPHOSClusters ) gPHOSClusters->ResetBBox();
495 if ( gSPDClusters ) gSPDClusters->ResetBBox();
496 if ( gTPCTrack ) gTPCTrack->ElementChanged();
497
ea9a0e13 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);
9e78371d 505
506 // -- Set Projections
507 // --------------------------------------------
9e78371d 508
509 // XXX Primary vertex ... to be retrieved from the ESD
f1fefc07 510 // Double_t x[3] = { 0, 0, 0 };
511
f1fefc07 512 TEveElement* top = gEve->GetCurrentEvent();
513
ea9a0e13 514 if (gRPhiMgr && top) {
f1fefc07 515 gRPhiEventScene->DestroyElements();
516 if (gCenterProjectionsAtPrimaryVertex)
517 gRPhiMgr->SetCenter(x[0], x[1], x[2]);
518 gRPhiMgr->ImportElements(top, gRPhiEventScene);
9e78371d 519 }
ea9a0e13 520
521 if (gRhoZMgr && top) {
f1fefc07 522 gRhoZEventScene->DestroyElements();
523 if (gCenterProjectionsAtPrimaryVertex)
524 gRhoZMgr->SetCenter(x[0], x[1], x[2]);
525 gRhoZMgr->ImportElements(top, gRhoZEventScene);
9e78371d 526 }
9e78371d 527
f1fefc07 528 // --------------------------------------------
ea9a0e13 529
530 gEve->Redraw3D(0,1); // (0, 1)
9e78371d 531 gEve->EnableRedraw();
f1fefc07 532
9e78371d 533 return iResult;
534}
535
536// -----------------------------------------------------------------
537void loopEvent() {
ea9a0e13 538 eventTimer.SetCommand("processEvent()");
9e78371d 539 eventTimer.Start(6000);
540}
541
542// -----------------------------------------------------------------
543void stopLoopEvent() {
544 eventTimer.Stop();
545}
546
f1fefc07 547// -----------------------------------------------------------------
548Int_t processITSHist(AliHLTHOMERBlockDesc* block) {
549 TH2F* hist = block->GetTObject();
550
551 gCanvas->cd();
552 hist->Draw();
553 return 0;
554}
9e78371d 555// -----------------------------------------------------------------
556Int_t processHLTRDLST(AliHLTHOMERBlockDesc* block) {
557
558 return 0;
559}
560
561// -----------------------------------------------------------------
562Int_t processISPDClusters(AliHLTHOMERBlockDesc* block) {
563 cout<<"ISPD dump:"<<endl;
564 TObject ob = block->GetTObject();
565 ob.Dump();
f1fefc07 566
9e78371d 567 return 0;
568}
569
570// -----------------------------------------------------------------
f1fefc07 571Int_t processROOTTOBJ(AliHLTHOMERBlockDesc* block, TEveText* et) {
9e78371d 572
573 // -- AliHLTGlobalTriggerDecision
574 if ( ! block->GetClassName().CompareTo("AliHLTGlobalTriggerDecision") ) {
575
576 AliHLTGlobalTriggerDecision *trig = dynamic_cast<AliHLTGlobalTriggerDecision*> block->GetTObject();
ea9a0e13 577 // trig->Print();
f1fefc07 578
ea9a0e13 579 // et->SetText("balle");;
9e78371d 580
ea9a0e13 581 // TEveText* tt = new TEveText("Trigger: Class is known ;-) ");
582 // gEve->AddElement(tt);
9e78371d 583
584 }
585 else {
586 printf(" Unknown root object %s",block->GetClassName().Data() );
587 }
588
589 return 0;
590}
591
592// -----------------------------------------------------------------
593Int_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
ea9a0e13 613// -----------------------------------------------------------------
614Int_t processTPCClusters(AliHLTHOMERBlockDesc* block, TEvePointSet* cont) {
f1fefc07 615
616 Int_t slice = block->GetSubDetector();
617 Int_t patch = block->GetSubSubDetector();
9e78371d 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 );
ea9a0e13 621
622 AliHLTTPCClusterData *cd = reinterpret_cast<AliHLTTPCClusterData*> (block->GetData());
623 UChar_t *data = reinterpret_cast<UChar_t*> (cd->fSpacePoints);
9e78371d 624
ea9a0e13 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);
9e78371d 628 cont->SetNextPoint(cos*sp->fX - sin*sp->fY, sin*sp->fX + cos*sp->fY, sp->fZ);
629 }
630 }
631
ea9a0e13 632 return 0;
9e78371d 633}
634