Merge branch 'histos'
[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
1d8ae8b6 11#if !defined(__CINT__) || defined(__MAKECINT__)
12
ea48ba6e 13//****************** ROOT ******************************************
1d8ae8b6 14#include "TTimer.h"
15#include "TRandom.h"
16#include "TVirtualPad.h"
17#include "TGLViewer.h"
18#include "TThread.h"
19#include "TGFileBrowser.h"
20#include "TStyle.h"
21#include "TList.h"
22#include "TDirectory.h"
23#include "TFile.h"
24#include "TH2.h"
25#include "TCanvas.h"
26#include "TColor.h"
c5e3aa8e 27#include "TVector3.h"
1d8ae8b6 28
ea48ba6e 29//****************** ROOT/EVE **************************************
1d8ae8b6 30#include "TEveManager.h"
31#include "TEvePointSet.h"
32#include "TEveTrack.h"
33#include "TEveVSDStructs.h"
34#include "TEveTrackPropagator.h"
35#include "TEveScene.h"
36#include "TEveElement.h"
37#include "TEveUtil.h"
38#include "TEveEventManager.h"
39#include "TEveProjectionAxes.h"
40#include "TEveWindowManager.h"
41#include "TEveViewer.h"
42#include "TEveText.h"
43#include "TEveProjectionManager.h"
44#include "TEveGeoShape.h"
c5e3aa8e 45#include "TEveBoxSet.h"
46#include "TEveTrans.h"
47#include "TEveRGBAPalette.h"
cfa641b1 48#include "TLine.h"
49#include "TEveStraightLineSet.h"
50#include "TGeoNode.h"
51#include "TGeoManager.h"
52#include "TGLOverlayButton.h"
4d89023a 53
ea48ba6e 54//****************** AliRoot ***************************************
1d8ae8b6 55#include "AliESDEvent.h"
56#include "AliCDBManager.h"
57#include "AliRawReaderMemory.h"
58#include "AliTPCRawStream.h"
59#include "AliGeomManager.h"
ea48ba6e 60
61//****************** AliRoot/EVE ***********************************
1d8ae8b6 62#include "AliHLTHOMERManager.h"
63#include "AliEveHOMERManager.h"
64#include "AliEveTPCLoader.h"
65#include "AliEveTPCData.h"
66#include "AliEveITSDigitsInfo.h"
67#include "AliEveITSModule.h"
68#include "AliEveMacroExecutor.h"
69#include "AliEveMacro.h"
70#include "AliEveTrack.h"
ea48ba6e 71
72//****************** AliRoot/HLT ***********************************
1d8ae8b6 73#include "AliHLTHOMERBlockDesc.h"
74#include "AliHLTHOMERReader.h"
c5e3aa8e 75#include "AliHLTMUONUtils.h"
1d8ae8b6 76#include "AliHLTMUONDataBlockReader.h"
77#include "AliHLTTriggerDecision.h"
1d8ae8b6 78#include "AliHLTGlobalTriggerDecision.h"
c5e3aa8e 79#include "AliHLTTPCCATrackParam.h"
cfa641b1 80
ea48ba6e 81//****************** AliRoot/MUON **********************************
1d8ae8b6 82#include "AliMUONCalibrationData.h"
83#include "AliMUONVCalibParam.h"
84#include "AliMUONGeometryTransformer.h"
85#include "AliMUONGeometryDetElement.h"
cfa641b1 86#include "AliMUONConstants.h"
1d8ae8b6 87
88#include "AliMpCDB.h"
89#include "AliMpDDLStore.h"
90#include "AliMpDetElement.h"
91#include "AliMpDEIterator.h"
92#include "AliMpVSegmentation.h"
93#include "AliMpSegmentation.h"
94#include "AliMpTriggerCrate.h"
95#include "AliMpLocalBoard.h"
1d8ae8b6 96
ff64d287 97//****************** AliRoot/ITS ***********************************
c5e3aa8e 98#include "AliITSRecPoint.h"
99
ea48ba6e 100//****************** AliRoot/TRD ***********************************
101#include "AliHLTTRDCluster.h"
102#include "AliTRDcluster.h"
cfa641b1 103#include "AliTRDCalibraVdriftLinearFit.h"
ea48ba6e 104
ff64d287 105//****************** AliRoot/EMCAL *********************************
cfa641b1 106#include "AliHLTCaloClusterDataStruct.h"
107#include "AliHLTCaloClusterReader.h"
108
109#include "HLT/CALO/AliHLTCaloChannelDataHeaderStruct.h"
110#include "HLT/CALO/AliHLTCaloChannelDataStruct.h"
111
ff64d287 112//****************** AliRoot/PHOS **********************************
cfa641b1 113#include "AliPHOSGeometry.h"
114#include "HLT/PHOS/AliHLTPHOSDigitDataStruct.h"
115#include "AliHLTPHOSChannelDataHeaderStruct.h"
116#include "AliHLTPHOSChannelDataStruct.h"
922c1000 117#include "HLT/CALO/AliHLTCaloChannelDataHeaderStruct.h"
118#include "HLT/CALO/AliHLTCaloChannelDataStruct.h"
922c1000 119#include "AliHLTCaloDigitDataStruct.h"
ea48ba6e 120//****************** Macros ****************************************
1d8ae8b6 121#include "hlt_structs.C"
122#include "hlt_alieve_init.C"
123#include "geom_gentle_hlt.C"
124#include "alice-macros/esd_tracks.C"
cfa641b1 125#include "hlt_esd_tracks.C"
09cdbe4c 126
cfa641b1 127//#include "alieve_vizdb.C"
1d8ae8b6 128
f1fefc07 129#endif
9e78371d 130
f1fefc07 131class TEveTrackList;
9e78371d 132class TEveProjectionManager;
133class TEveGeoShape;
134class TEveUtil;
135class AliEveMacroExecutor;
136class TEveScene;
137class TEveElement;
138class TEveText;
139class AliHLTTriggerDecision;
140class TEvePointSet;
1d8ae8b6 141class TEvePointSetArray;
f1fefc07 142class AliHLTHOMERBlockDesc;
9e78371d 143
f1fefc07 144class TEveViewer;
ea48ba6e 145
cfa641b1 146
9e78371d 147// -----------------------------------------------------------------
148// -- Geometry / Scenes --
149// -----------------------------------------------------------------
150
f1fefc07 151TEveGeoShape *gGeomGentle = 0;
152TEveGeoShape *gGeomGentleRPhi = 0;
153TEveGeoShape *gGeomGentleRhoZ = 0;
154TEveGeoShape *gGeomGentleTRD = 0;
155TEveGeoShape *gGeomGentleMUON = 0;
156
157TEveScene *gRPhiGeomScene = 0;
158TEveScene *gRhoZGeomScene = 0;
159TEveScene *gRPhiEventScene = 0;
160TEveScene *gRhoZEventScene = 0;
161
9e78371d 162TEveProjectionManager *gRPhiMgr = 0;
163TEveProjectionManager *gRhoZMgr = 0;
164
f1fefc07 165TEveViewer *g3DView = 0;
166TEveViewer *gRPhiView = 0;
167TEveViewer *gRhoZView = 0;
168
9e78371d 169// -----------------------------------------------------------------
170// -- Geometry / Scenes Parameters --
171// -----------------------------------------------------------------
172
173// -- Parameters to show different geometries
174Bool_t gShowMUON = kTRUE;
175Bool_t gShowMUONRPhi = kFALSE;
176Bool_t gShowMUONRhoZ = kTRUE;
f1fefc07 177Bool_t gShowTRD = kFALSE;
178
179Bool_t gCenterProjectionsAtPrimaryVertex = kFALSE;
9e78371d 180
181// -----------------------------------------------------------------
182// -- Members --
183// -----------------------------------------------------------------
184
185// -- Timer for automatic event loop
186TTimer eventTimer;
1d8ae8b6 187TTimer eventTimerFast;
9e78371d 188
189// -- HOMERManager
c5e3aa8e 190AliEveHOMERManager* gHomerManager = 0;
191
192// -- Geometry Manager
193TGeoManager* gGeoManager = 0;
194AliPHOSGeometry* gPHOSGeom = 0;
9e78371d 195
196// -- Cluster members
c5e3aa8e 197TEvePointSet* gSPDClusters = 0;
198TEvePointSet* gSSDClusters = 0;
199TEvePointSet* gSDDClusters = 0;
200TEvePointSet* gTRDClusters = 0;
201TEvePointSetArray* gTRDColClusters = 0;
202TEvePointSet* gTPCClusters = 0;
49993c6f 203TEvePointSet* gTPCTestClusters = 0;
c5e3aa8e 204TEvePointSetArray* gTPCColClusters = 0;
205TEveBoxSet* gPHOSBoxSet[5] = {0, 0, 0, 0, 0};
cfa641b1 206TEveBoxSet* gEMCALBoxSet[13] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
c5e3aa8e 207TEvePointSet* gMUONClusters = 0;
cfa641b1 208TEveStraightLineSet* gMUONTracks = 0;
9e78371d 209
f1fefc07 210// -- Text output members
c5e3aa8e 211TEveText* gHLTText = 0;
f1fefc07 212
9e78371d 213// -- Tracks members
c5e3aa8e 214TEveTrackList* gTPCTrack = 0;
9e78371d 215
1d8ae8b6 216// -- Canvas for histograms
c5e3aa8e 217TCanvas* gTRDCanvas = 0;
218TCanvas* gTPCCanvas = 0;
922c1000 219TCanvas* gTPCClustCanvas = 0;
ff64d287 220TCanvas* gTRDCalibCanvas = 0;
221TCanvas* gTRDEORCanvas = 0;
222TCanvas* gPrimVertexCanvas = 0;
223TCanvas* gSPDVertexCanvas = 0;
224TCanvas* gITSCanvas = 0;
225TCanvas* gSSDCanvas0 = 0;
226TCanvas* gSSDCanvas1 = 0;
227TCanvas* gV0Canvas = 0;
922c1000 228TCanvas* gPHOSCanvas = 0;
09cdbe4c 229TCanvas* gEMCALCanvas = 0;
ff64d287 230
231// -- vertex --
232Int_t gSPDVertexHistoCount = 0;
cfa641b1 233
ff64d287 234
235// -- ITS --
236Int_t gITSHistoCount = 0;
237Int_t gSSDHistoCount0 = 0;
238Int_t gSSDHistoCount1 = 0;
1d8ae8b6 239
ea48ba6e 240// -- TRD --
c5e3aa8e 241Int_t gTRDHistoCount = 0;
242Int_t gTRDEvents = 0;
243Int_t gTRDBins = 12;
244
245// -- TPC --
246Int_t gTPCBins = 15;
247TH1F* gTPCCharge = 0;
248TH1F* gTPCQMax = 0;
249TH1F* gTPCQMaxOverCharge = 0;
ea48ba6e 250
922c1000 251TH1F* gTPCPt = 0; // KK
252TH1F* gTPCEta = 0;
253TH1F* gTPCPsi = 0;
254TH1F* gTPCnClusters = 0;
255TH1F* gTPCMult = 0;
256
c5e3aa8e 257// -- PHOS --
258TEveElementList* gPHOSElementList = 0;
922c1000 259Int_t gPHOSHistoCount =0;
cfa641b1 260// -- EMCAL
261TEveElementList* gEMCALElementList = 0;
ff64d287 262TGeoNode* gEMCALNode = 0;
09cdbe4c 263Int_t gEMCALHistoCount =0;
cfa641b1 264
1d8ae8b6 265// --- Flag if eventloop is running
266Bool_t gEventLoopStarted = kFALSE;
f1fefc07 267
cfa641b1 268
269//Container for gGeoManager till it is broken
270TGeoManager *fGeoManager = 0;
9e78371d 271// -----------------------------------------------------------------
272// -- Methods --
273// -----------------------------------------------------------------
274
1d8ae8b6 275Int_t initializeEveViewer( Bool_t TPCMode, Bool_t MUONMode, Bool_t TRDMode );
9e78371d 276
1d8ae8b6 277void nextEvent();
5de5a293 278
ea9a0e13 279Int_t processEvent();
9e78371d 280
c5e3aa8e 281Int_t processPHOSClusters( AliHLTHOMERBlockDesc* block);
922c1000 282Int_t processPHOSDigits(AliHLTHOMERBlockDesc* block);
9e78371d 283
cfa641b1 284Int_t processEMCALClusters( AliHLTHOMERBlockDesc* block);
285
9e78371d 286Int_t processEsdTracks( AliHLTHOMERBlockDesc* block, TEveTrackList* cont );
287
288Int_t processHLTRDLST( AliHLTHOMERBlockDesc* block );
289
1d8ae8b6 290Int_t processROOTTOBJ( AliHLTHOMERBlockDesc* block, TEveText* text );
291
49993c6f 292Int_t processTPCClusters( AliHLTHOMERBlockDesc * block, TEvePointSet *cont, TEvePointSetArray *contCol = NULL );
1d8ae8b6 293
c5e3aa8e 294Int_t processTRDClusters( AliHLTHOMERBlockDesc * block, TEvePointSet *cont, TEvePointSetArray *contCol);
1d8ae8b6 295
ff64d287 296Int_t processTRDHistograms( AliHLTHOMERBlockDesc * block, TCanvas * canvas );
297
298Int_t processITSHistograms( AliHLTHOMERBlockDesc * block, TCanvas * canvas );
299
300Int_t processSSDHistograms( AliHLTHOMERBlockDesc * block, TCanvas * canvas, TCanvas * canvas1 );
1d8ae8b6 301
ff64d287 302Int_t processPrimVertexHistograms( AliHLTHOMERBlockDesc * block, TCanvas * canvas );
cfa641b1 303
ff64d287 304Int_t processSPDVertexHistograms( AliHLTHOMERBlockDesc * block, TCanvas * canvas );
cfa641b1 305
ff64d287 306Int_t processV0Histograms( AliHLTHOMERBlockDesc * block, TCanvas * canvas );
9e78371d 307
ff64d287 308Int_t processTRDCalibHistograms( AliHLTHOMERBlockDesc *block, TCanvas *canvas );
cfa641b1 309
ff64d287 310Int_t processMUONClusters( AliHLTHOMERBlockDesc* block );
c5e3aa8e 311
ff64d287 312Int_t processMUONTracks( AliHLTHOMERBlockDesc* block );
313
314Int_t processITSClusters( AliHLTHOMERBlockDesc* block, TEvePointSet* cont );
315
316Int_t processITSHist( AliHLTHOMERBlockDesc* block );
9e78371d 317
09cdbe4c 318Int_t processBlock( AliHLTHOMERBlockDesc* block );
4d89023a 319
09cdbe4c 320Int_t processAsyncBlock( AliHLTHOMERBlockDesc* block );
4d89023a 321
09cdbe4c 322Int_t updateDisplay();
8fa2fdc9 323Int_t addHistogramsToCanvas(AliHLTHOMERBlockDesc * block, TCanvas * canvas, Int_t &cdCount );
e6b71191 324
cfa641b1 325void writeToFile();
326
327
9e78371d 328// #################################################################
329// #################################################################
330// #################################################################
331
332// -----------------------------------------------------------------
1d8ae8b6 333void onlineDisplay(Bool_t TPCMode = kTRUE, Bool_t MUONMode = kFALSE, Bool_t TRDMode = kFALSE) {
f1fefc07 334
9e78371d 335 // -- Loading Geometry
336 // ---------------------
337 Int_t run = 67179;
338 AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
339 AliCDBManager::Instance()->SetRun(run);
340 AliGeomManager::LoadGeometry();
341
c5e3aa8e 342 // Get the pointer to gGeoManager before it's broken (bug in alieve)
cfa641b1 343 fGeoManager = gGeoManager;
c5e3aa8e 344
9e78371d 345 // -- Create new hM object
346 // -------------------------
347 gHomerManager = new AliEveHOMERManager();
cfa641b1 348 gHomerManager->SetRetryCount(1000,15);
9e78371d 349
350 Int_t iResult = gHomerManager->Initialize();
351 if (iResult) {
352 printf("Error Initializing AliHLTHOMERManager, quitting");
353 return;
354 }
355
356 // -- Add hM to EveTree
357 // ----------------------
358 gEve->AddToListTree(gHomerManager, kTRUE);
359
360 // -- Create SourceList
361 // ----------------------
362 iResult = gHomerManager->CreateEveSourcesListLoop();
363 if (iResult) {
364 printf ("Couldn't find active services. returning\n");
365 return;
366 }
367
368 // -- Initialize pointsets and add macros
369 // ----------------------------------------
1d8ae8b6 370 //TEveUtil::LoadMacro("hlt_alieve_init.C");
371 //hlt_alieve_init(".", -1);
9e78371d 372
373 // -- Initialize Eve
374 // -------------------
1d8ae8b6 375 initializeEveViewer( TPCMode, MUONMode, TRDMode);
9e78371d 376
c5e3aa8e 377 // -- Reset gGeoManager to the original pointer
378 // ----------------------------------------------
cfa641b1 379 gGeoManager = fGeoManager;
c5e3aa8e 380 gPHOSGeom = AliPHOSGeometry::GetInstance("IHEP", "IHEP");
381
9e78371d 382 // -- Finalize Eve
383 // -----------------
384 gSystem->ProcessEvents();
385 gEve->Redraw3D(kTRUE);
f1fefc07 386
1d8ae8b6 387 if ( TPCMode ) {
388 gHomerManager->ConnectEVEtoHOMER("TPC" );
389 } else if ( MUONMode ) {
390 gHomerManager->ConnectEVEtoHOMER("MUON");
391 } else if( TRDMode ) {
392 gHomerManager->ConnectEVEtoHOMER("TRD");
393 } else {
394 cout<<" No detectors selected, nothing will be displayed"<<endl;
395 }
c5e3aa8e 396
397 g_esd_tracks_true_field = kFALSE;
cfa641b1 398
9e78371d 399}
400
1d8ae8b6 401// -------------------------------------------------------------------------
402Int_t initializeEveViewer( Bool_t TPCMode, Bool_t MUONMode, Bool_t TRDMode) {
9e78371d 403
cfa641b1 404 //=============================================================================
405 // Visualization database
406 //============================================================================
407
408 TEveUtil::AssertMacro("VizDB_scan.C");
409
410 // alieve_vizdb();
411
412
413
9e78371d 414 //==============================================================================
ea48ba6e 415 // -- Geometry, scenes, projections and viewers
9e78371d 416 //==============================================================================
417
09cdbe4c 418
f1fefc07 419 TEveBrowser *browser = gEve->GetBrowser();
420 browser->ShowCloseTab(kFALSE);
421
9e78371d 422 // -- Disable extra geometry
423 // ---------------------------
ea48ba6e 424 if (!MUONMode)
9e78371d 425 gShowMUON = gShowMUONRPhi = gShowMUONRhoZ = kFALSE;
ea48ba6e 426
9e78371d 427 // -- Load Geometry
428 // ------------------
429 TEveUtil::LoadMacro("geom_gentle_hlt.C");
f1fefc07 430 gGeomGentle = geom_gentle_hlt();
431 gGeomGentleRPhi = geom_gentle_rphi(); gGeomGentleRPhi->IncDenyDestroy();
432 gGeomGentleRhoZ = geom_gentle_rhoz(); gGeomGentleRhoZ->IncDenyDestroy();
433 gGeomGentleTRD = geom_gentle_trd();
434
cfa641b1 435 gGeoManager = fGeoManager;
436
437 gEMCALNode = gGeoManager->GetTopVolume()->FindNode("XEN1_1");
438
439 TEveGeoTopNode* emcal_re = new TEveGeoTopNode(gGeoManager, gEMCALNode);
440 gEve->AddGlobalElement(emcal_re);
441 gEve->Redraw3D();
442
ea48ba6e 443 if (gShowMUON)
f1fefc07 444 gGeomGentleMUON = geom_gentle_muon(kFALSE);
ea48ba6e 445
446 // -- Scenes
447 // -----------
f1fefc07 448 gRPhiGeomScene = gEve->SpawnNewScene("RPhi Geometry",
449 "Scene holding projected geometry for the RPhi view.");
450 gRhoZGeomScene = gEve->SpawnNewScene("RhoZ Geometry",
451 "Scene holding projected geometry for the RhoZ view.");
452 gRPhiEventScene = gEve->SpawnNewScene("RPhi Event Data",
453 "Scene holding projected geometry for the RPhi view.");
454 gRhoZEventScene = gEve->SpawnNewScene("RhoZ Event Data",
455 "Scene holding projected geometry for the RhoZ view.");
9e78371d 456
ea48ba6e 457 // -- Projection managers
458 // ------------------------
f1fefc07 459
9e78371d 460 gRPhiMgr = new TEveProjectionManager();
461 gRPhiMgr->SetProjection(TEveProjection::kPT_RPhi);
462 gEve->AddToListTree(gRPhiMgr, kFALSE);
463 {
464 TEveProjectionAxes* a = new TEveProjectionAxes(gRPhiMgr);
465 a->SetMainColor(kWhite);
466 a->SetTitle("R-Phi");
467 a->SetTitleSize(0.05);
468 a->SetTitleFont(102);
469 a->SetLabelSize(0.025);
470 a->SetLabelFont(102);
f1fefc07 471 gRPhiGeomScene->AddElement(a);
9e78371d 472 }
9e78371d 473 gRPhiMgr->SetCurrentDepth(-10);
f1fefc07 474 gRPhiMgr->ImportElements(gGeomGentleRPhi, gRPhiGeomScene);
9e78371d 475 gRPhiMgr->SetCurrentDepth(0);
1d8ae8b6 476 gRPhiMgr->ImportElements(gGeomGentleTRD, gRPhiGeomScene);
f1fefc07 477 if (gShowMUONRPhi) gRPhiMgr->ImportElements(gGeomGentleMUON, gRPhiGeomScene);
9e78371d 478
9e78371d 479 gRhoZMgr = new TEveProjectionManager();
480 gRhoZMgr->SetProjection(TEveProjection::kPT_RhoZ);
481 gEve->AddToListTree(gRhoZMgr, kFALSE);
482 {
483 TEveProjectionAxes* a = new TEveProjectionAxes(gRhoZMgr);
484 a->SetMainColor(kWhite);
485 a->SetTitle("Rho-Z");
486 a->SetTitleSize(0.05);
487 a->SetTitleFont(102);
488 a->SetLabelSize(0.025);
489 a->SetLabelFont(102);
f1fefc07 490 gRhoZGeomScene->AddElement(a);
9e78371d 491 }
492 gRhoZMgr->SetCurrentDepth(-10);
f1fefc07 493 gRhoZMgr->ImportElements(gGeomGentleRhoZ, gRhoZGeomScene);
9e78371d 494 gRhoZMgr->SetCurrentDepth(0);
f1fefc07 495 if (gShowTRD) gRhoZMgr->ImportElements(gGeomGentleTRD, gRhoZGeomScene);
496 if (gShowMUONRhoZ) gRhoZMgr->ImportElements(gGeomGentleMUON, gRhoZGeomScene);
9e78371d 497
ea48ba6e 498 // -- Viewers
499 // ------------
9e78371d 500
ea48ba6e 501 TEveWindowSlot *slot = TEveWindow::CreateWindowInTab(browser->GetTabRight());
502 TEveWindowPack *pack = slot->MakePack();
9e78371d 503 pack->SetElementName("Multi View");
504 pack->SetHorizontal();
505 pack->SetShowTitleBar(kFALSE);
506 pack->NewSlot()->MakeCurrent();
f1fefc07 507 g3DView = gEve->SpawnNewViewer("3D View", "");
508 g3DView->AddScene(gEve->GetGlobalScene());
509 g3DView->AddScene(gEve->GetEventScene());
510
cfa641b1 511
512
513
9e78371d 514 pack = pack->NewSlot()->MakePack();
515 pack->SetShowTitleBar(kFALSE);
516 pack->NewSlot()->MakeCurrent();
f1fefc07 517 gRPhiView = gEve->SpawnNewViewer("RPhi View", "");
518 gRPhiView->GetGLViewer()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
519 gRPhiView->AddScene(gRPhiGeomScene);
520 gRPhiView->AddScene(gRPhiEventScene);
9e78371d 521
522 pack->NewSlot()->MakeCurrent();
f1fefc07 523 gRhoZView = gEve->SpawnNewViewer("RhoZ View", "");
524 gRhoZView->GetGLViewer()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
525 gRhoZView->AddScene(gRhoZGeomScene);
526 gRhoZView->AddScene(gRhoZEventScene);
527
cfa641b1 528
529
530 //Add HLT Text to windows
531
532 TGLOverlayButton *ob1 = new TGLOverlayButton(g3DView->GetGLViewer(), "HLT", 0, 20, 110, 60);
533 ob1->SetAlphaValues(0.8, 0.8);
ff64d287 534 // cout << "color" << ob1->GetBackColor() << endl;
cfa641b1 535 //ob1->SetBackColor(8421631);
536 ob1->SetBackColor(10492431);
537 TGLOverlayButton *ob2 = new TGLOverlayButton(g3DView->GetGLViewer(), "ALICE", 0, 0, 110, 20);
538 ob2->SetAlphaValues(0.8, 0.8);
539 ob1->SetBackColor(0.2);
540 TGLOverlayButton *ob3 = new TGLOverlayButton(gEve->GetDefaultGLViewer(), "HLT", 0, 20, 110, 60);
541 ob3->SetAlphaValues(0.8, 0.8);
542 TGLOverlayButton *ob4 = new TGLOverlayButton(gEve->GetDefaultGLViewer(), "ALICE", 0, 0, 110, 20);
543 ob4->SetAlphaValues(0.8, 0.8);
544
545
ea48ba6e 546 // -- List of Viewers
547 // --------------------
9e78371d 548
549 TEveViewerList *viewerlist = new TEveViewerList();
550 viewerlist->AddElement(gEve->GetDefaultViewer());
551
f1fefc07 552 viewerlist->AddElement(g3DView);
553 viewerlist->AddElement(gRhoZView);
554 viewerlist->AddElement(gRPhiView);
9e78371d 555 viewerlist->SwitchColorSet();
556
557 //==============================================================================
ea48ba6e 558 // -- Macros / QA histograms
9e78371d 559 //==============================================================================
560
561 // -- Registration of per-event macros
562 // -------------------------------------
563
564 AliEveMacroExecutor *exec = new AliEveMacroExecutor();
09cdbe4c 565
566
9e78371d 567#if 0
568 exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Track", "kine_tracks.C", "kine_tracks", "", kFALSE));
569
570 exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hit ITS", "its_hits.C", "its_hits", "", kFALSE));
571 exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hit TPC", "tpc_hits.C", "tpc_hits", "", kFALSE));
572 exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hit T0", "t0_hits.C", "t0_hits", "", kFALSE));
573 exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hit FMD", "fmd_hits.C", "fmd_hits", "", kFALSE));
574
575 exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "DIG FMD", "fmd_digits.C", "fmd_digits", "", kFALSE));
576
577 exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW TPC", "tpc_raw.C", "tpc_raw", "", kFALSE));
578 exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW T0", "t0_raw.C", "t0_raw", "", kFALSE));
579 exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW FMD", "fmd_raw.C", "fmd_raw", "", kFALSE));
580 exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW VZERO", "vzero_raw.C", "vzero_raw", "", kFALSE));
581 exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW ACORDE", "acorde_raw.C", "acorde_raw", "", kFALSE));
582
583 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX", "primary_vertex.C", "primary_vertex", "", kTRUE));
584 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Ellipse", "primary_vertex.C", "primary_vertex_ellipse", "", kTRUE));
585 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Box", "primary_vertex.C", "primary_vertex_box", "kFALSE, 3, 3, 3", kFALSE));
586 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX", "primary_vertex.C", "primary_vertex_spd", "", kTRUE));
587 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Ellipse", "primary_vertex.C", "primary_vertex_ellipse_spd", "", kTRUE));
588 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Box", "primary_vertex.C", "primary_vertex_box_spd", "kFALSE, 3, 3, 3", kFALSE));
589 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX", "primary_vertex.C", "primary_vertex_tpc", "", kFALSE));
590 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Ellipse", "primary_vertex.C", "primary_vertex_ellipse_tpc", "", kFALSE));
591 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Box", "primary_vertex.C", "primary_vertex_box_tpc", "kFALSE, 3, 3, 3", kFALSE));
592#endif
593 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC V0", "esd_V0_points.C", "esd_V0_points_onfly"));
594 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC V0", "esd_V0_points.C", "esd_V0_points_offline"));
595 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC V0", "esd_V0.C", "esd_V0"));
596 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC CSCD", "esd_cascade_points.C", "esd_cascade_points"));
597 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC CSCD", "esd_cascade.C", "esd_cascade"));
598 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC KINK", "esd_kink_points.C", "esd_kink_points"));
599 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC KINK", "esd_kink.C", "esd_kink"));
600
601 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Track", "esd_tracks.C", "esd_tracks", "", kFALSE));
602 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Track", "esd_tracks.C", "esd_tracks_MI", "", kFALSE));
603 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Track", "esd_tracks.C", "esd_tracks_by_category", "", kTRUE));
604
605 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Tracklet", "esd_spd_tracklets.C", "esd_spd_tracklets", "", kFALSE));
606
607 exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC ZDC", "esd_zdc.C", "esd_zdc", "", kFALSE));
608#if 0
609 exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus", "clusters.C+", "clusters", "", kFALSE));
610 exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus ITS", "its_clusters.C+", "its_clusters"));
611 exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus TPC", "tpc_clusters.C+", "tpc_clusters"));
612 exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus TRD", "trd_clusters.C+", "trd_clusters"));
613 exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus TOF", "tof_clusters.C+", "tof_clusters"));
614
615 exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clus TPC", "vplot_tpc.C+", "vplot_tpc", "", kFALSE));
616
617 exec->AddMacro(new AliEveMacro(AliEveMacro::kAOD, "ANA HF", "aod_HF.C", "aod_HF", "", kFALSE));
618 exec->AddMacro(new AliEveMacro(AliEveMacro::kAOD, "ANA Jets", "jetplane.C", "jetplane", "", kFALSE));
619
620 // -- QA Viewer
621 // --------------
1d8ae8b6 622# endif
9e78371d 623
c5e3aa8e 624
625 //==============================================================================
626 // -- Histograms
627 //==============================================================================
628
629 if(TRDMode) {
ea48ba6e 630 slot = TEveWindow::CreateWindowInTab(browser->GetTabRight());
631 slot->StartEmbedding();
632
633 gTRDCanvas = new TCanvas("canvasTRD","canvasTRD", 600, 400);
634 gTRDCanvas->Divide(3,2);
09cdbe4c 635 slot->StopEmbedding("TRD QA");
cfa641b1 636
637 slot=TEveWindow::CreateWindowInTab(browser->GetTabRight());
638 slot->StartEmbedding();
639 gTRDCalibCanvas=new TCanvas("CalibCanvasTRD","CalibCanvasTRD",600,400);
640 gTRDCalibCanvas->Divide(2,2);
09cdbe4c 641 slot->StopEmbedding("TRD Calib");
cfa641b1 642
643 slot=TEveWindow::CreateWindowInTab(browser->GetTabRight());
644 slot->StartEmbedding();
645 gTRDEORCanvas=new TCanvas("CalibEORTRD","CalibCEORTRD",600,400);
646 gTRDEORCanvas->Divide(3,2);
09cdbe4c 647 slot->StopEmbedding("TRD QA");
ea48ba6e 648 }
649 else if(TPCMode){
c5e3aa8e 650 slot = TEveWindow::CreateWindowInTab(browser->GetTabRight());
651 slot->StartEmbedding();
652
653 gTPCCanvas = new TCanvas("canvasTPC","canvasTPC", 600, 400);
654 gTPCCharge = new TH1F("ClusterCharge","ClusterCharge",100,0,500);
655 gTPCQMax = new TH1F("QMax","QMax",50,0,250);
656 gTPCQMaxOverCharge = new TH1F("QMaxOverCharge","QMaxOverCharge",50,0,1);
09cdbe4c 657 slot->StopEmbedding("TPC QA");
ea48ba6e 658 }
f1fefc07 659
cfa641b1 660 slot = TEveWindow::CreateWindowInTab(browser->GetTabRight());
ff64d287 661 slot->StartEmbedding();
662 gPrimVertexCanvas = new TCanvas("canvasPrimVertex","canvasPrimVertex", 600, 400);
663 slot->StopEmbedding("Primary Vertex");
664
665 slot = TEveWindow::CreateWindowInTab(browser->GetTabRight());
666 slot->StartEmbedding();
667 gSPDVertexCanvas = new TCanvas("canvasSPDVertex","canvasSPDVertex", 600, 400);
668 slot->StopEmbedding("SPD Vertex");
669
670 slot = TEveWindow::CreateWindowInTab(browser->GetTabRight());
671 slot->StartEmbedding();
672 gV0Canvas = new TCanvas("canvasV0","canvasV0", 600, 400);
673 slot->StopEmbedding("V0");
cfa641b1 674
ff64d287 675 slot = TEveWindow::CreateWindowInTab(browser->GetTabRight());
676 slot->StartEmbedding();
677 gITSCanvas = new TCanvas("canvasITS","canvasITS", 600, 400);
09cdbe4c 678 slot->StopEmbedding("ITS QA");
cfa641b1 679
ff64d287 680 slot = TEveWindow::CreateWindowInTab(browser->GetTabRight());
681 slot->StartEmbedding();
682 gSSDCanvas0 = new TCanvas("canvasSSD0","canvasSSD0", 600, 400);
09cdbe4c 683 slot->StopEmbedding("SSD QA 0");
cfa641b1 684
ff64d287 685 slot = TEveWindow::CreateWindowInTab(browser->GetTabRight());
686 slot->StartEmbedding();
687 gSSDCanvas1 = new TCanvas("canvasSSD1","canvasSSD1", 600, 400);
09cdbe4c 688 slot->StopEmbedding("SSD QA 1");
cfa641b1 689
922c1000 690 slot = TEveWindow::CreateWindowInTab(browser->GetTabRight());
691 slot->StartEmbedding();
692 gPHOSCanvas = new TCanvas("canvasPHOS1","canvasPHOS1", 600, 400);
693 gPHOSCanvas->Divide(3, 2);
09cdbe4c 694 slot->StopEmbedding("PHOS QA");
695
696 slot = TEveWindow::CreateWindowInTab(browser->GetTabRight());
697 slot->StartEmbedding();
698 gEMCALCanvas = new TCanvas("canvasEMCAL","canvasEMCAL", 600, 400);
699 gEMCALCanvas->Divide(3, 2);
700 slot->StopEmbedding("EMCAL QA");
701
922c1000 702
703 slot = TEveWindow::CreateWindowInTab(browser->GetTabRight());
704 slot->StartEmbedding();
705 gTPCClustCanvas = new TCanvas("canvasTPCClust","canvasTPCClust", 600, 400);
706 gTPCClustCanvas->Divide(3, 2);
dcd3b5e8 707 slot->StopEmbedding("TPC Cluster QA Histograms ");
922c1000 708
709
9e78371d 710 //==============================================================================
ea48ba6e 711 // -- Additional GUI components
9e78371d 712 //==============================================================================
713
714 slot = TEveWindow::CreateWindowInTab(browser->GetTabRight());
5de5a293 715 TEveWindowTab *storeTab = slot->MakeTab();
1d8ae8b6 716 storeTab->SetElementNameTitle("WindowStore",
9e78371d 717 "Undocked windows whose previous container is not known\n"
718 "are placed here when the main-frame is closed.");
5de5a293 719 gEve->GetWindowManager()->SetDefaultContainer(storeTab);
9e78371d 720
cfa641b1 721
722
9e78371d 723 return 0;
724}
725
5de5a293 726// -----------------------------------------------------------------
727void nextEvent() {
728
cfa641b1 729 if ( gHomerManager->NextEvent() ) {
730 if (gEventLoopStarted) {
731 cout << "HomerManager failed getting next event, trying to reconnect" << endl;
732
733 gHomerManager->DisconnectHOMER();
734 gHomerManager->ConnectEVEtoHOMER();
735 nextEvent();
736
737 } else {
738 return;
739 }
740 }
741
5de5a293 742 processEvent();
743}
744
9e78371d 745// -----------------------------------------------------------------
ea9a0e13 746Int_t processEvent() {
9e78371d 747
09cdbe4c 748
749
750
751
752
9e78371d 753 Int_t iResult = 0;
754
755 gStyle->SetPalette(1, 0);
756 gEve->DisableRedraw();
757
09cdbe4c 758 //resetDisplay();
759
760
761
ea48ba6e 762 //==============================================================================
9e78371d 763 // -- Reset
ea48ba6e 764 //==============================================================================
ff64d287 765
ea48ba6e 766 if ( gTRDCanvas ) {
767 gTRDCanvas->Clear();
768 gTRDCanvas->Divide(3,2);
769 }
cfa641b1 770 if(gTRDCalibCanvas){
ff64d287 771 gTRDCalibCanvas->Clear();
772 gTRDCalibCanvas->Divide(2,2);
773 }
cfa641b1 774 if(gTRDEORCanvas){
ff64d287 775 gTRDEORCanvas->Clear();
776 gTRDEORCanvas->Divide(3,2);
777 }
778
779 if(gSSDCanvas0) {
780 gSSDCanvas0->Clear();
781 gSSDCanvas0->Divide(6,6);
782 }
783
784 if(gSSDCanvas1) {
785 gSSDCanvas1->Clear();
786 gSSDCanvas1->Divide(2,3);
787 }
788
789 if(gITSCanvas) {
790 gITSCanvas->Clear();
791 gITSCanvas->Divide(3,3);
792 }
793
794 if(gPrimVertexCanvas) {
795 gPrimVertexCanvas->Clear();
796 gPrimVertexCanvas->Divide(2,2);
797 }
798
799 if(gSPDVertexCanvas) {
800 gSPDVertexCanvas->Clear();
801 gSPDVertexCanvas->Divide(2,2);
802 }
cfa641b1 803
ff64d287 804 if(gV0Canvas) {
805 gV0Canvas->Clear();
806 gV0Canvas->Divide(2,2);
cfa641b1 807 }
ea48ba6e 808
922c1000 809 if(gPHOSCanvas) {
810 gPHOSCanvas->Clear();
811 gPHOSCanvas->Divide(3, 3);
812 }
813
09cdbe4c 814 if(gEMCALCanvas) {
815 gEMCALCanvas->Clear();
816 gEMCALCanvas->Divide(3, 3);
817 }
818
ea48ba6e 819 if ( gTPCTrack ) gTPCTrack->DestroyElements();
820
c5e3aa8e 821 if ( gSPDClusters ) gSPDClusters->Reset();
822 if ( gSSDClusters ) gSSDClusters->Reset();
bdff3917 823 if ( gSDDClusters ) gSDDClusters->Reset();
ea48ba6e 824 if ( gTPCClusters ) gTPCClusters->Reset();
49993c6f 825 if ( gTPCTestClusters ) gTPCTestClusters->Reset();
ea48ba6e 826 if ( gTRDClusters ) gTRDClusters->Reset();
c5e3aa8e 827 if ( gMUONClusters ) gMUONClusters->Reset();
cfa641b1 828 if ( gMUONTracks ){
829 gMUONTracks->Destroy();
830 gMUONTracks = 0x0;
831 }
1d8ae8b6 832
c5e3aa8e 833 if ( gPHOSBoxSet[1] )
834 for(int im = 0; im < 5; im++)
835 gPHOSBoxSet[im]->Reset();
836
cfa641b1 837 if ( gEMCALElementList)
838 for(int i = 0; i < 12; i++) {
839 gEMCALBoxSet[i]->Reset();
840 }
841
c5e3aa8e 842 if ( gTPCColClusters )
843 for (Int_t ii = 0; ii <= gTPCBins+1; ++ii)
844 gTPCColClusters->GetBin(ii)->Reset();
845
846 if ( gTRDColClusters )
847 for (Int_t ii = 0; ii <= gTRDBins+1; ++ii)
1d8ae8b6 848 gTRDColClusters->GetBin(ii)->Reset();
1d8ae8b6 849
ea48ba6e 850 gTRDHistoCount = 0;
ff64d287 851 gSPDVertexHistoCount = 0;
852 gSSDHistoCount0 = 0;
853 gSSDHistoCount1 = 0;
854 gITSHistoCount = 0;
922c1000 855 gPHOSHistoCount = 0;
09cdbe4c 856 gEMCALHistoCount = 0;
cfa641b1 857
ea48ba6e 858 //==============================================================================
859 // -- Process Blocks
860 //==============================================================================
1d8ae8b6 861
dcd3b5e8 862 AliHLTHOMERBlockDesc* block = 0;
863
1d8ae8b6 864 if ( gHomerManager->GetBlockList() == NULL) {
922c1000 865 printf ("onlineDisplay: No regular BlockList ... \n");
09cdbe4c 866 cout << endl;
867 //return -1;
868
922c1000 869 } else {
dcd3b5e8 870
871 if (gHomerManager->GetBlockList()->IsEmpty() ) {
09cdbe4c 872 printf ("onlineDisplay: No Sync Blocks in list ... \n");
dcd3b5e8 873 cout<<endl;
09cdbe4c 874 return -2;
dcd3b5e8 875 }
876
09cdbe4c 877
922c1000 878 TIter next(gHomerManager->GetBlockList());
09cdbe4c 879
880
922c1000 881 // -- Iterate over blocks in the block list
882 // ------------------------------------------
883 while ((block = (AliHLTHOMERBlockDesc*)next())) {
09cdbe4c 884 iResult = processBlock(block);
885 }
886 }
cfa641b1 887
09cdbe4c 888 //============================================================================
889 // Read out histograms and detectors outside physics 1 partition
890 //===========================================================================
922c1000 891
cfa641b1 892 TIter anext(gHomerManager->GetAsyncBlockList());
49993c6f 893
cfa641b1 894 while ( (block = (AliHLTHOMERBlockDesc*)anext()) ) {
922c1000 895
09cdbe4c 896 iResult = processAsyncBlock(block);
ff64d287 897
09cdbe4c 898 }
cfa641b1 899
09cdbe4c 900 iResult = updateDisplay();
cfa641b1 901
09cdbe4c 902 return iResult;
903}
cfa641b1 904
905
09cdbe4c 906Int_t updateDisplay() {
907 Int_t iResult = 0;
cfa641b1 908
09cdbe4c 909
c5e3aa8e 910 //==============================================================================
911 // -- Update Objects
912 //==============================================================================
09cdbe4c 913
c5e3aa8e 914 // -- TPC Histograms
915 if ( gTPCCanvas && gTPCCharge && gTPCQMax) {
cfa641b1 916
c5e3aa8e 917 gTPCCanvas->Clear();
918 gTPCCanvas->Divide(1,3);
919
920 gTPCCanvas->cd(1);
921 gTPCCharge->Draw();
922
923 gTPCCanvas->cd(2);
924 gTPCQMax->Draw();
925
926 gTPCCanvas->cd(3);
927 gTPCQMaxOverCharge->Draw();
928
929 gTPCCanvas->Update();
930 }
f1fefc07 931
9e78371d 932 if ( gTPCClusters ) gTPCClusters->ResetBBox();
49993c6f 933 if ( gTPCTestClusters ) gTPCTestClusters->ResetBBox();
1d8ae8b6 934 if ( gTRDClusters ) gTRDClusters->ResetBBox();
9e78371d 935 if ( gSPDClusters ) gSPDClusters->ResetBBox();
c5e3aa8e 936 if ( gSDDClusters ) gSDDClusters->ResetBBox();
937 if ( gSSDClusters ) gSSDClusters->ResetBBox();
938 if ( gMUONClusters ) gMUONClusters->ResetBBox();
939
940 if ( gPHOSBoxSet[1] )
941 for(int im = 0; im < 5; im++)
942 gPHOSBoxSet[im]->ResetBBox();
ea9a0e13 943
cfa641b1 944 if ( gEMCALElementList )
945 for(int sm = 0; sm < 12; sm++)
946 gEMCALBoxSet[sm]->ResetBBox();
947
c5e3aa8e 948 //==============================================================================
ea9a0e13 949 // -- Set EventID in Window Title
c5e3aa8e 950 // -- Update Objects
951 //==============================================================================
952
ea9a0e13 953 TString winTitle("Eve Main Window -- Event ID : ");
954 winTitle += Form("0x%016X ", gHomerManager->GetEventID() );
955 gEve->GetBrowser()->SetWindowName(winTitle);
9e78371d 956
c5e3aa8e 957 //==============================================================================
9e78371d 958 // -- Set Projections
c5e3aa8e 959 //==============================================================================
9e78371d 960
961 // XXX Primary vertex ... to be retrieved from the ESD
ea48ba6e 962 Double_t x[3] = { 0, 0, 0 };
963
f1fefc07 964 TEveElement* top = gEve->GetCurrentEvent();
ea48ba6e 965
ea9a0e13 966 if (gRPhiMgr && top) {
f1fefc07 967 gRPhiEventScene->DestroyElements();
968 if (gCenterProjectionsAtPrimaryVertex)
969 gRPhiMgr->SetCenter(x[0], x[1], x[2]);
970 gRPhiMgr->ImportElements(top, gRPhiEventScene);
9e78371d 971 }
ea9a0e13 972
973 if (gRhoZMgr && top) {
f1fefc07 974 gRhoZEventScene->DestroyElements();
975 if (gCenterProjectionsAtPrimaryVertex)
976 gRhoZMgr->SetCenter(x[0], x[1], x[2]);
977 gRhoZMgr->ImportElements(top, gRhoZEventScene);
9e78371d 978 }
9e78371d 979
c5e3aa8e 980 //==============================================================================
ea9a0e13 981
982 gEve->Redraw3D(0,1); // (0, 1)
9e78371d 983 gEve->EnableRedraw();
f1fefc07 984
9e78371d 985 return iResult;
09cdbe4c 986
9e78371d 987}
988
09cdbe4c 989
f1fefc07 990// -----------------------------------------------------------------
c5e3aa8e 991Int_t processITSHist(AliHLTHOMERBlockDesc* /*block*/) {
f1fefc07 992 return 0;
993}
1d8ae8b6 994
9e78371d 995// -----------------------------------------------------------------
1d8ae8b6 996Int_t processHLTRDLST(AliHLTHOMERBlockDesc* /*block*/) {
9e78371d 997 return 0;
998}
999
1000// -----------------------------------------------------------------
1d8ae8b6 1001Int_t processROOTTOBJ(AliHLTHOMERBlockDesc* block, TEveText* /*et*/) {
9e78371d 1002
1003 // -- AliHLTGlobalTriggerDecision
1004 if ( ! block->GetClassName().CompareTo("AliHLTGlobalTriggerDecision") ) {
1005
1d8ae8b6 1006 AliHLTGlobalTriggerDecision *trig = dynamic_cast<AliHLTGlobalTriggerDecision*>( block->GetTObject());
5de5a293 1007 trig->Print();
f1fefc07 1008
ea9a0e13 1009 // et->SetText("balle");;
9e78371d 1010
ea9a0e13 1011 // TEveText* tt = new TEveText("Trigger: Class is known ;-) ");
1012 // gEve->AddElement(tt);
9e78371d 1013
1014 }
1015 else {
1016 printf(" Unknown root object %s",block->GetClassName().Data() );
1017 }
1018
1019 return 0;
1020}
1021
1022// -----------------------------------------------------------------
1023Int_t processEsdTracks( AliHLTHOMERBlockDesc* block, TEveTrackList* cont ) {
1024
1025 AliESDEvent* esd = (AliESDEvent *) (block->GetTObject());
1026 esd->GetStdContent();
24f29da6 1027
ff64d287 1028 esd_track_propagator_setup(cont->GetPropagator(),-0.1*esd->GetMagneticField(), 520);
9e78371d 1029
cfa641b1 1030 // printf( "Number of ESD Tracks : %d \n", esd->GetNumberOfTracks());
9e78371d 1031
1032 for (Int_t iter = 0; iter < esd->GetNumberOfTracks(); ++iter) {
cfa641b1 1033 //AliEveTrack* track = dynamic_cast<AliEveTrack*>(esd_make_track(esd->GetTrack(iter), cont));
1034 AliEveTrack* track = dynamic_cast<AliEveTrack*>(hlt_esd_make_track(esd->GetTrack(iter), cont));
9e78371d 1035 cont->AddElement(track);
922c1000 1036
24f29da6 1037// gTPCPt->Fill(esd->GetTrack(iter)->GetSignedPt()); // KK
1038// gTPCEta->Fill(esd->GetTrack(iter)->GetSnp());
1039// gTPCPsi->Fill(esd->GetTrack(iter)->GetTgl());
1040// gTPCnClusters->Fill(esd->GetTrack(iter)->GetTPCNcls());
9e78371d 1041 }
1042
24f29da6 1043// gTPCMult->Fill(esd->GetNumberOfTracks()); // KK
922c1000 1044
24f29da6 1045// Int_t icd = 0;
1046// gTPCClustCanvas->Clear();
1047// gTPCClustCanvas->Divide(2, 2);
1048// gTPCClustCanvas->cd(icd++);
1049// gTPCPt->Draw();
1050// gTPCClustCanvas->cd(icd++);
1051// gTPCEta->Draw();
1052// gTPCClustCanvas->cd(icd++);
1053// gTPCPsi->Draw();
1054// gTPCClustCanvas->cd(icd++);
1055// gTPCnClusters->Draw();
1056// gTPCClustCanvas->cd(icd++);
1057// gTPCMult->Draw();
1058// gTPCClustCanvas->Update();
dcd3b5e8 1059
24f29da6 1060
9e78371d 1061 cont->SetTitle(Form("N=%d", esd->GetNumberOfTracks()) );
1062 cont->MakeTracks();
24f29da6 1063
9e78371d 1064 return 0;
1065}
1066
922c1000 1067// // -----------------------------------------------------------------
1068// Int_t processPHOSClusters(AliHLTHOMERBlockDesc* block) {
1069
c5e3aa8e 1070
922c1000 1071// cout <<"Processgin phos clusters"<<endl;
ff64d287 1072
922c1000 1073// AliHLTCaloChannelDataHeaderStruct *chh = reinterpret_cast<AliHLTCaloChannelDataHeaderStruct*> (block->GetData());
cfa641b1 1074
922c1000 1075// AliHLTCaloChannelDataStruct *chd = reinterpret_cast<AliHLTCaloChannelDataStruct*>(chh+1);
cfa641b1 1076
922c1000 1077// for(Int_t i = 0; i < chh->fNChannels; i++, chd++) {
cfa641b1 1078
922c1000 1079// Int_t gain = (chd->fChannelID >> 12)&0x1;
1080// Int_t module = (chd->fChannelID >> 13)&0x1f;
1081// module = 4 -module;
c5e3aa8e 1082
c5e3aa8e 1083
922c1000 1084// if(gain == 1)
cfa641b1 1085
922c1000 1086// {
1087// Float_t x = (static_cast<Float_t>(chd->fChannelID&0x3f) - 32)* 2.2;
1088// Float_t z = (static_cast<Float_t>((chd->fChannelID >> 6)&0x3f) - 28) * 2.2;
1089// // gPHOSBoxSet[ds->fModule]->AddBox(ds->fLocX, 0, ds->fLocZ, 2.2, ds->fEnergy*20, 2.2);
1090// gPHOSBoxSet[module]->AddBox(x, 0, z, 2.2, chd->fEnergy/1, 2.2);
1091// gPHOSBoxSet[module]->DigitValue(static_cast<Int_t>(chd->fEnergy));
1092// }
c5e3aa8e 1093
cfa641b1 1094
1095
922c1000 1096// }
1097// cout <<"done with phos"<<endl;
1098
1099
1100// return 0;
1101// }
1102
1103
1104
1105// // -----------------------------------------------------------------
1106Int_t processPHOSDigits(AliHLTHOMERBlockDesc* block) {
1107
1108 AliHLTCaloDigitDataStruct *ds = reinterpret_cast<AliHLTCaloDigitDataStruct*> (block->GetData());
1109 UInt_t nDigits = block->GetSize()/sizeof(AliHLTCaloDigitDataStruct);
1110
1111
1112 for(UInt_t i = 0; i < nDigits; i++, ds++) {
1113
1114 Float_t x = (ds->fX - 32)* 2.2;
1115 Float_t z = (ds->fZ - 28) * 2.2;
1116
1117 cout << "MODULE DIGITTYP :" << ds->fModule;
1118
1119 gPHOSBoxSet[4-ds->fModule]->AddBox(x, 0, z, 2.2, ds->fEnergy*20, 2.2);
1120 gPHOSBoxSet[4-ds->fModule]->DigitValue(static_cast<Int_t>(ds->fEnergy*10));
cfa641b1 1121 }
1122
1123 return 0;
1124}
1125
922c1000 1126
cfa641b1 1127// // -----------------------------------------------------------------
922c1000 1128Int_t processPHOSClusters(AliHLTHOMERBlockDesc* block) {
cfa641b1 1129
922c1000 1130 AliHLTCaloClusterHeaderStruct *dh = reinterpret_cast<AliHLTCaloClusterHeaderStruct*> (block->GetData());
1131 AliHLTCaloClusterReader * clusterReader = new AliHLTCaloClusterReader();
1132 clusterReader->SetMemory(dh);
cfa641b1 1133
922c1000 1134 AliHLTCaloClusterDataStruct * ds;
1135
1136 Int_t nc = 0;
1137
1138
1139 while(ds = clusterReader->NextCluster()){
1140 nc++;
1141 cout << "Cluster nr " << nc << " Energy " << ds->fEnergy<< " " << ds->fGlobalPos[0] << " " << ds->fGlobalPos[1] << " " << ds->fGlobalPos[2] << endl;
1142
1143
1144 gPHOSBoxSet[2]->AddBox(ds->fGlobalPos[0], 0, ds->fGlobalPos[2], 2.2, -ds->fEnergy*20, 2.2);
1145 gPHOSBoxSet[2]->DigitValue(static_cast<Int_t>(ds->fEnergy*10));
1146 }
1147
1148 return 0;
1149}
cfa641b1 1150
c5e3aa8e 1151
c5e3aa8e 1152
c5e3aa8e 1153// -----------------------------------------------------------------
cfa641b1 1154Int_t processEMCALClusters(AliHLTHOMERBlockDesc* block) {
c5e3aa8e 1155
cfa641b1 1156 AliHLTCaloChannelDataHeaderStruct *dhs = reinterpret_cast<AliHLTCaloChannelDataHeaderStruct*> (block->GetData());
1157 Short_t nC = dhs->fNChannels;
1158 AliHLTUInt8_t *ui = reinterpret_cast<AliHLTUInt8_t*>(dhs) + sizeof(AliHLTCaloChannelDataHeaderStruct);
1159 AliHLTCaloChannelDataStruct *ds = reinterpret_cast<AliHLTCaloChannelDataStruct*>(ui);
1160
1161 UShort_t fX =0;
1162 UShort_t fZ =0;
1163 UShort_t fGain =0;
1164 UShort_t fModuleId =0;
1165
c5e3aa8e 1166
c5e3aa8e 1167
cfa641b1 1168 for(Short_t s = 0; s < nC; s++ ) {
ff64d287 1169
cfa641b1 1170 fX = ds->fChannelID&0x3f;
1171 fZ = (ds->fChannelID >> 6)&0x3f;
1172 fGain = (ds->fChannelID >> 12)&0x1;
1173 fModuleId = (ds->fChannelID >> 13)&0x1f;
1174
1175 // cout << fX << " " << fZ << " " << fGain << " " << fModuleId <<endl;
1176
ff64d287 1177 if ( ( fModuleId >= 0 && fModuleId < 12 ) ) {
cfa641b1 1178 gEMCALBoxSet[fModuleId]->AddBox(10, fX*6-12*6, fZ*6-24*6, ds->fEnergy/4, 6, 6);
1179 gEMCALBoxSet[fModuleId]->DigitValue(static_cast<Int_t>(ds->fEnergy));
1180 }
1181 ds++;
cfa641b1 1182
ff64d287 1183 }
1184
c5e3aa8e 1185 return 0;
1186}
1187
ea9a0e13 1188// -----------------------------------------------------------------
c5e3aa8e 1189Int_t processITSClusters(AliHLTHOMERBlockDesc* block, TEvePointSet* cont) {
1190
1191 AliHLTITSClusterData *cd = reinterpret_cast<AliHLTITSClusterData*> (block->GetData());
1192 UChar_t *data = reinterpret_cast<UChar_t*> (cd->fSpacePoints);
1193
1194 if ( cd->fSpacePointCnt != 0 ) {
1195 for (Int_t iter = 0; iter < cd->fSpacePointCnt; ++iter, data += sizeof(AliHLTITSSpacePointData)) {
1196 AliHLTITSSpacePointData *sp = reinterpret_cast<AliHLTITSSpacePointData*> (data);
f1fefc07 1197
c5e3aa8e 1198 Int_t lab[4] = {0,0,0,0};
1199 Float_t hit[6] = {0,0,0,0,0,0};
1200 Int_t info[3] = {0,0,0};
1201
1202 lab[0] = sp->fTracks[0];
1203 lab[1] = sp->fTracks[1];
1204 lab[2] = sp->fTracks[2];
1205 lab[3] = sp->fIndex;
1206 hit[0] = sp->fY;
1207 hit[1] = sp->fZ;
1208 hit[2] = sp->fSigmaY2;
1209 hit[3] = sp->fSigmaZ2;
1210 hit[4] = sp->fQ;
1211 hit[5] = sp->fSigmaYZ;
1212 info[0] = sp->fNy;
1213 info[1] = sp->fNz;
1214 info[2] = sp->fLayer;
1215
1216 Float_t xyz[3];
1217 AliITSRecPoint recpoint(lab,hit,info);
1218 recpoint.GetGlobalXYZ(xyz);
1219
1220 cont->SetNextPoint(xyz[0], xyz[1], xyz[2]);
1221 }
1222 }
1223 return 0;
1224}
1225
1226// -----------------------------------------------------------------
1227Int_t processTPCClusters(AliHLTHOMERBlockDesc* block, TEvePointSet* cont, TEvePointSetArray *contCol ) {
1228
f1fefc07 1229 Int_t slice = block->GetSubDetector();
9e78371d 1230 Float_t phi = ( slice + 0.5 ) * TMath::Pi() / 9.0;
1231 Float_t cos = TMath::Cos( phi );
1232 Float_t sin = TMath::Sin( phi );
ea9a0e13 1233
1234 AliHLTTPCClusterData *cd = reinterpret_cast<AliHLTTPCClusterData*> (block->GetData());
1235 UChar_t *data = reinterpret_cast<UChar_t*> (cd->fSpacePoints);
9e78371d 1236
ea9a0e13 1237 if ( cd->fSpacePointCnt != 0 ) {
1238 for (Int_t iter = 0; iter < cd->fSpacePointCnt; ++iter, data += sizeof(AliHLTTPCSpacePointData)) {
1239 AliHLTTPCSpacePointData *sp = reinterpret_cast<AliHLTTPCSpacePointData*> (data);
9e78371d 1240 cont->SetNextPoint(cos*sp->fX - sin*sp->fY, sin*sp->fX + cos*sp->fY, sp->fZ);
49993c6f 1241 if (contCol)
1242 contCol->Fill(cos*sp->fX - sin*sp->fY, sin*sp->fX + cos*sp->fY, sp->fZ, sp->fCharge);
c5e3aa8e 1243
1244 gTPCCharge->Fill(sp->fCharge);
1245 gTPCQMax->Fill(sp->fQMax);
1246 gTPCQMaxOverCharge->Fill(((Float_t)sp->fQMax)/((Float_t)sp->fCharge));
9e78371d 1247 }
1248 }
1249
ea9a0e13 1250 return 0;
9e78371d 1251}
1d8ae8b6 1252
ea48ba6e 1253// -----------------------------------------------------------------
1d8ae8b6 1254Int_t processMUONClusters(AliHLTHOMERBlockDesc* block) {
ea48ba6e 1255
1d8ae8b6 1256 Int_t iResult = 0;
1257
1258 unsigned long size = block->GetSize();
ea48ba6e 1259 Int_t * buffer ;
1d8ae8b6 1260
ea48ba6e 1261 buffer = (Int_t *)block->GetData();
1d8ae8b6 1262// cout<<"block size : "<<size<<", buffer : "<<buffer<<", DataType : "<<block->GetDataType()<<endl;
1263
1264// // for(int idata=0;idata<int(size);idata++)
1265// // printf("\tbuffer[%d] : %d\n",idata,buffer[idata]);
1266
1267
1268
1269 if(block->GetDataType().CompareTo("RECHITS") == 0){
1270
1271 AliHLTMUONRecHitsBlockReader trackblock((char*)buffer, size);
1272 const AliHLTMUONRecHitStruct* hit = trackblock.GetArray();
1273
1274 for(AliHLTUInt32_t ientry = 0; ientry < trackblock.Nentries(); ientry++){
1275// cout << setw(13) << left << hit->fX << setw(0);
1276// cout << setw(13) << left << hit->fY << setw(0);
1277// cout << hit->fZ << setw(0) << endl;
1278 if(hit->fX!=0.0 && hit->fY!=0.0 && hit->fZ!=0.0)
1279 gMUONClusters->SetNextPoint(hit->fX,hit->fY,hit->fZ);
1280 hit++;
1281
1282 }// track hit loop
1283 }
1284
1285 else{// if rechits
1286 // if(!strcmp((BlockType(ULong64_t(reader->GetBlockDataType(i)))).Data(),"TRIGRECS")){
1287
1288 AliHLTMUONTriggerRecordsBlockReader trigblock(buffer, size);
1289 const AliHLTMUONTriggerRecordStruct* trigrec = trigblock.GetArray();
1290 for(AliHLTUInt32_t ientry = 0; ientry < trigblock.Nentries(); ientry++){
1291
1292 const AliHLTMUONRecHitStruct* hit = &trigrec->fHit[0];
1293 for(AliHLTUInt32_t ch = 0; ch < 4; ch++)
1294 {
cfa641b1 1295// cout << setw(10) << left << ch + 11 << setw(0);
1296// cout << setw(13) << left << hit->fX << setw(0);
1297// cout << setw(13) << left << hit->fY << setw(0);
1298// cout << hit->fZ << setw(0) << endl;
1d8ae8b6 1299 if(hit->fX!=0.0 && hit->fY!=0.0 && hit->fZ!=0.0)
1300 gMUONClusters->SetNextPoint(hit->fX,hit->fY,hit->fZ);
1301 hit++;
1302 }// trig chamber loop
1303 trigrec++;
1304 }//trig hit loop
1305 }//else trigger
1306
1307 return iResult;
1308}
1309
cfa641b1 1310// -----------------------------------------------------------------
1311Int_t processMUONTracks(AliHLTHOMERBlockDesc* block) {
1312
1313 Int_t iResult = 0;
1314
1315 unsigned long size = block->GetSize();
1316 Int_t * buffer = (Int_t *)block->GetData();
1317 AliHLTMUONRecHitStruct hit1,hit2;
1318 hit1.fX = hit1.fY = hit1.fZ = hit2.fX = hit2.fY = hit2.fZ = 0;
1319 Int_t ch1=0, ch2=0;
1320 Float_t x0=0.0,y0=0.0,z0=0.0;
1321 Float_t x3=0.0,y3=0.0,z3=0.0;
1322 if(block->GetDataType().CompareTo("MANTRACK") == 0){
1323 AliHLTMUONMansoTracksBlockReader mantrackblock(buffer, size);
1324 const AliHLTMUONMansoTrackStruct* mtrack = mantrackblock.GetArray();
1325 for(AliHLTUInt32_t ientry = 0; ientry < mantrackblock.Nentries(); ientry++){
1326 const AliHLTMUONRecHitStruct* hit = &mtrack->fHit[0];
1327 for(AliHLTUInt32_t ch = 0; ch < 4; ch++){
1328 // cout << setw(10) << left << ch + 7 << setw(0);
1329 // cout << setw(13) << left << hit->fX << setw(0);
1330 // cout << setw(13) << left << hit->fY << setw(0);
1331 // cout << hit->fZ << setw(0) << endl;
1332 if(hit->fZ != 0.0){
1333 if(ch==0 || ch==1){
1334 hit1 = *hit; ch1 = ch+6;
1335 }else{
1336 hit2 = *hit; ch2 = ch+6;
1337 }
1338 }
1339 hit++;
1340 }// trig chamber loop
1341 // printf("ch : %d, (X,Y,Z) : (%f,%f,%f)\n",ch1,hit1.fX,hit1.fY,hit1.fZ);
1342 // printf("ch : %d, (X,Y,Z) : (%f,%f,%f)\n",ch2,hit2.fX,hit2.fY,hit2.fZ);
1343 // meminfo();
1344 z3 = AliMUONConstants::DefaultChamberZ(ch2+4);
1345 y3 = hit1.fY - (hit1.fZ-z3)*(hit1.fY - hit2.fY)/(hit1.fZ - hit2.fZ) ;
1346 x3 = hit1.fX - (hit1.fZ-z3)*(hit1.fX - hit2.fX)/(hit1.fZ - hit2.fZ) ;
1347
1348 z0 = AliMUONConstants::DefaultChamberZ(ch1);
1349 y0 = hit1.fY - (hit1.fZ-z0)*(hit1.fY - hit2.fY)/(hit1.fZ - hit2.fZ) ;
1350 x0 = hit1.fX - (hit1.fZ-z0)*(hit1.fX - hit2.fX)/(hit1.fZ - hit2.fZ) ;
1351
1352
1353 gMUONTracks->AddLine(x0,y0,z0,x3,y3,z3);
1354 mtrack++;
1355 }
1356 cout<<"NofManso Tracks : "<<mantrackblock.Nentries()<<endl;
1357 }
1358
1359 return iResult;
1360
1361}
1362
9e78371d 1363
1d8ae8b6 1364// -----------------------------------------------------------------
1365Int_t processTRDClusters(AliHLTHOMERBlockDesc* block, TEvePointSet *cont, TEvePointSetArray *contCol) {
1366
1367 Int_t iResult = 0;
1368
ea48ba6e 1369 Int_t sm = block->GetSubDetector();
1d8ae8b6 1370 if ( sm == 6 ) sm = 7;
ea48ba6e 1371
1d8ae8b6 1372 Float_t phi = ( sm + 0.5 ) * TMath::Pi() / 9.0;
1373 Float_t cos = TMath::Cos( phi );
1374 Float_t sin = TMath::Sin( phi );
1375
ea48ba6e 1376 Byte_t* ptrData = reinterpret_cast<Byte_t*>(block->GetData());
1d8ae8b6 1377 UInt_t ptrSize = block->GetSize();
1378
1379 for (UInt_t size = 0; size+sizeof(AliHLTTRDCluster) <= ptrSize; size+=sizeof(AliHLTTRDCluster) ) {
1380 AliHLTTRDCluster *cluster = reinterpret_cast<AliHLTTRDCluster*>(&(ptrData[size]));
1381
1382 AliTRDcluster *trdCluster = new AliTRDcluster;
1383 cluster->ExportTRDCluster( trdCluster );
1384
1385 contCol->Fill(cos*trdCluster->GetX() - sin*trdCluster->GetY(),
1386 sin*trdCluster->GetX() + cos*trdCluster->GetY(),
1387 trdCluster->GetZ(),
1388 trdCluster->GetQ() );
1389
1390 cont->SetNextPoint(cos*trdCluster->GetX() - sin*trdCluster->GetY(),
ea48ba6e 1391 sin*trdCluster->GetX() + cos*trdCluster->GetY(), trdCluster->GetZ());
1d8ae8b6 1392 }
1393
1394 return iResult;
1395}
1396
1397// -----------------------------------------------------------------
1398Int_t processTRDHistograms(AliHLTHOMERBlockDesc* block, TCanvas * canvas) {
1399
1400 Int_t iResult = 0;
1401
1402 if ( ! block->GetClassName().CompareTo("TH1D")) {
1403 TH1D* histo = reinterpret_cast<TH1D*>(block->GetTObject());
ea48ba6e 1404 ++gTRDHistoCount;
1d8ae8b6 1405
ea48ba6e 1406 TVirtualPad* pad = canvas->cd(gTRDHistoCount);
1d8ae8b6 1407 histo->Draw();
1408 pad->SetGridy();
1409 pad->SetGridx();
1410
1411 if ( ! strcmp(histo->GetName(), "nscls") ) {
1412 gTRDEvents = static_cast<Int_t>(histo->GetEntries());
1413 histo->GetXaxis()->SetRangeUser(0.,15.);
1414 }
1415
1416 if ( ! strcmp(histo->GetName(),"sclsdist") ||
1417 ! strcmp(histo->GetName(),"qClsCand") )
1418 pad->SetLogy();
1419 }
1420 else if ( ! block->GetClassName().CompareTo("TH2F")) {
1421 TH2F *hista = reinterpret_cast<TH2F*>(block->GetTObject());
ea48ba6e 1422 ++gTRDHistoCount;
1d8ae8b6 1423
ea48ba6e 1424 TVirtualPad* pad = canvas->cd(gTRDHistoCount);
1d8ae8b6 1425
1426 if (gTRDEvents > 0)
1427 hista->Scale(1./gTRDEvents);
1428
1429 hista->Draw("COLZ");
1430 pad->SetLogz();
1431 pad->SetGridy();
1432 pad->SetGridx();
1433 }
1434
1435 return iResult;
1436}
1437
ff64d287 1438// -----------------------------------------------------------------
1439Int_t processPrimVertexHistograms(AliHLTHOMERBlockDesc* block, TCanvas * canvas) {
1440
1441 Int_t iResult = 0;
1442
1443 if ( ! block->GetClassName().CompareTo("TH1F")) {
1444 TH1F* histo = reinterpret_cast<TH1F*>(block->GetTObject());
1445 if( histo ){
1446 TString name(histo->GetName());
1447 if( !name.CompareTo("primVertexZ") ){
1448 canvas->cd(2);
1449 histo->Draw();
1450 }else if( !name.CompareTo("primVertexX") ){
1451 canvas->cd(3);
1452 histo->Draw();
1453 }else if( !name.CompareTo("primVertexY") ){
1454 canvas->cd(4);
1455 histo->Draw();
1456 }
1457 }
1458 } else if ( ! block->GetClassName().CompareTo("TH2F")) {
1459 TH2F *hista = reinterpret_cast<TH2F*>(block->GetTObject());
1460 if (hista ){
1461 TString name(hista->GetName());
1462 if( !name.CompareTo("primVertexXY")) {
1463 canvas->cd(1);
1464 hista->Draw();
1465 }
1466 }
1467 }
1468 canvas->cd();
1469
1470 return iResult;
1471}
cfa641b1 1472
1473// -----------------------------------------------------------------
ff64d287 1474Int_t processSPDVertexHistograms(AliHLTHOMERBlockDesc* block, TCanvas * canvas) {
cfa641b1 1475
1476 Int_t iResult = 0;
cfa641b1 1477
1478 if ( ! block->GetClassName().CompareTo("TH1F")) {
cfa641b1 1479 TH1F* histo = reinterpret_cast<TH1F*>(block->GetTObject());
ff64d287 1480 ++gSPDVertexHistoCount;
cfa641b1 1481
ff64d287 1482 canvas->cd(gSPDVertexHistoCount);
cfa641b1 1483 histo->Draw();
cfa641b1 1484
ff64d287 1485 }
1486 else if ( ! block->GetClassName().CompareTo("TH2F")) {
cfa641b1 1487 TH2F *hista = reinterpret_cast<TH2F*>(block->GetTObject());
1488 if (hista) {
ff64d287 1489 ++gSPDVertexHistoCount;
cfa641b1 1490
ff64d287 1491 canvas->cd(gSPDVertexHistoCount);
cfa641b1 1492 hista->Draw();
1493 }
1494 }
1495 canvas->cd();
1496
cfa641b1 1497 return iResult;
ff64d287 1498}
cfa641b1 1499
ff64d287 1500// -----------------------------------------------------------------
1501Int_t processV0Histograms(AliHLTHOMERBlockDesc* block, TCanvas * canvas) {
cfa641b1 1502
4d89023a 1503 cout << "Processing to see if it's V0 histogram, !!!!!!!!!"<<endl;
1504
ff64d287 1505 Int_t iResult = 0;
1506 bool update = 0;
1507 if ( ! block->GetClassName().CompareTo("TH1F")) {
1508 TH1F* histo = reinterpret_cast<TH1F*>(block->GetTObject());
1509 if( histo ){
1510 TString name(histo->GetName());
1511 if( !name.CompareTo("hKShort") ){
1512 canvas->cd(1);
1513 histo->Draw();
1514 update = 1;
1515 }else if( !name.CompareTo("hLambda") ){
1516 canvas->cd(3);
1517 histo->Draw();
1518 update = 1;
1519 }
1520 }
1521 } else if ( ! block->GetClassName().CompareTo("TH2F")) {
1522 TH2F *hista = reinterpret_cast<TH2F*>(block->GetTObject());
1523 if (hista ){
1524 TString name(hista->GetName());
1525 if( !name.CompareTo("hAP")) {
1526 canvas->cd(2);
1527 hista->Draw();
1528 update = 1;
1529 }
1530 else if( !name.CompareTo("hGammaXY")) {
1531 canvas->cd(4);
1532 hista->Draw();
1533 update = 1;
1534 }
1535 }
1536 }
1537 if( update ){
1538 canvas->cd();
1539 canvas->Update();
1540 }
1541 return iResult;
cfa641b1 1542}
1543
ff64d287 1544
1545// -----------------------------------------------------------------
1546Int_t processITSHistograms(AliHLTHOMERBlockDesc* block, TCanvas * canvas) {
1547
1548 Int_t iResult = 0;
1549
1550 if ( ! block->GetClassName().CompareTo("TH1F")) {
1551 TH1F* histo = reinterpret_cast<TH1F*>(block->GetTObject());
1552 ++gITSHistoCount;
1553
1554 canvas->cd(gITSHistoCount);
1555 histo->Draw();
1556
1557 }
1558 else if ( ! block->GetClassName().CompareTo("TH2F")) {
1559 TH2F *hista = reinterpret_cast<TH2F*>(block->GetTObject());
1560 if (hista) {
1561 ++gITSHistoCount;
1562
1563 canvas->cd(gITSHistoCount);
1564 hista->Draw("COLZ");
1565 }
1566 }
1567 canvas->cd();
1568
1569 return iResult;
1570}
09cdbe4c 1571
1572
1573Int_t addHistogramsToCanvas(AliHLTHOMERBlockDesc * block, TCanvas * canvas, Int_t &cdCount ) {
922c1000 1574
1575 Int_t iResult = 0;
1576
09cdbe4c 1577 printf(Form("Adding histogram(s) to canvas %s \n", canvas->GetTitle()));
922c1000 1578
1579 if ( ! block->GetClassName().CompareTo("TObjArray")) {
1580 TIter next((TObjArray*)(block->GetTObject()));
1581 TObject *object;
1582 while (( object = (TObject*) next())) {
922c1000 1583 TH1* histo = dynamic_cast<TH1*>(object);
09cdbe4c 1584 cout <<" cd"<< cdCount << endl;
1585 canvas->cd(++cdCount);
922c1000 1586 cout <<"draw"<<endl;
1587 histo->Draw();
1588 cout <<"drew"<<endl;
1589 }
1590 }
09cdbe4c 1591
1592 // canvas->cd();
1593 canvas->Update();
1594
922c1000 1595 return iResult;
1596}
ff64d287 1597
1598// -----------------------------------------------------------------
1599Int_t processSSDHistograms(AliHLTHOMERBlockDesc* block, TCanvas *canvas0, TCanvas *canvas1) {
1600
1601 Int_t iResult = 0;
1602
1603 if ( ! block->GetClassName().CompareTo("TH1F")) {
1604 TH1F* histo = reinterpret_cast<TH1F*>(block->GetTObject());
1605 ++gSSDHistoCount0;
1606
1607 canvas0->cd(gSSDHistoCount0);
1608 histo->Draw();
1609 }
1610 else if ( ! block->GetClassName().CompareTo("TH2F")) {
1611 TH2F *hista = reinterpret_cast<TH2F*>(block->GetTObject());
1612 if (hista) {
1613 ++gSSDHistoCount1;
1614
1615 canvas1->cd(gSSDHistoCount1);
1616 hista->Draw("COLZ");
1617 }
1618 } else if ( ! block->GetClassName().CompareTo("TObjArray")) {
1619 TIter next((TObjArray*)(block->GetTObject()));
1620 TObject *object;
1621 while (( object = (TObject*) next())) {
1622 TString string;
1623 string = "TH1F";
1624 TString string2;
1625 string2 = "TH2F";
1626
1627 if ( !(string.CompareTo(object->ClassName())) ) {
1628 TH1F* histo = reinterpret_cast<TH1F*>(object);
1629 ++gSSDHistoCount0;
1630
1631 canvas0->cd(gSSDHistoCount0);
1632 histo->Draw();
1633
1634 }
1635 else if ( !(string2.CompareTo(object->ClassName()) ) ) {
1636 TH2F* histo = reinterpret_cast<TH2F*>(object);
1637 ++gSSDHistoCount1;
1638
1639 canvas1->cd(gSSDHistoCount1);
1640 histo->Draw("COLZ");
1641 }
1642 }
1643 }
1644
1645 canvas0->cd(); canvas1->cd();
1646
1647 return iResult;
1648}
1649
1650
cfa641b1 1651//*--------------------------------------------------------------------------------------
1652Int_t processTRDCalibHistograms(AliHLTHOMERBlockDesc* block, TCanvas * canvas) {
1653 Int_t iResult = 0;
1654
1655 TObjArray *HistArray=(TObjArray*)block->GetTObject();
1656 Int_t nCalibHistos=HistArray->GetEntriesFast();
1657 for(Int_t CalibHistoCount=0;CalibHistoCount<nCalibHistos;CalibHistoCount++){
1658 canvas->cd(CalibHistoCount+1);
1659
1660 if(HistArray->At(CalibHistoCount)->InheritsFrom("TH2S")){
1661 TH2S *histCalib=(TH2S*)(HistArray->At(CalibHistoCount));
1662 histCalib->Draw("colz");
1663 }
1664 else if(HistArray->At(CalibHistoCount)->InheritsFrom("TH2")){
1665 //TH2D *histCalib=dynamic_cast<TH2D*>(HistArray->At(CalibHistoCount));
1666 TH2D *histCalib=(TH2D*)(HistArray->At(CalibHistoCount));
1667 histCalib->Draw("lego2");
1668 }
1669 else if(HistArray->At(CalibHistoCount)->InheritsFrom("TH1")){
1670 //TH1D *histCalib=dynamic_cast<TH1D*>(HistArray->At(CalibHistoCount));
1671 TH1D *histCalib=(TH1D*)(HistArray->At(CalibHistoCount));
1672 histCalib->Draw();
1673 }
1674 else if(HistArray->At(CalibHistoCount)->InheritsFrom("AliTRDCalibraVdriftLinearFit")){
1675 //TH2S *histCalib = ((dynamic_cast<AliTRDCalibraVdriftLinearFit*>(HistArray->At(CalibHistoCount)))->GetLinearFitterHisto(10,kTRUE));
1676 TH2S *histCalib =(TH2S*)(((AliTRDCalibraVdriftLinearFit*)HistArray->At(CalibHistoCount))->GetLinearFitterHisto(10,kTRUE));
1677
1678 histCalib->Draw();
1679 }
1680
1681
1682 }
1683 return iResult;
1684}
ea48ba6e 1685//****************************************************************************
1686
922c1000 1687
1688
cfa641b1 1689void writeToFile(){
1690
cfa641b1 1691 TList * bList = gHomerManager->GetBlockList();
1692 TFile * file = TFile::Open(Form("Event_0x%016X_ITS.root", gHomerManager->GetEventID()), "RECREATE");
1693 bList->Write("blockList", TObject::kSingleKey);
1694 file->Close();
1695
1696 bList = gHomerManager->GetAsyncBlockList();
1697 TFile * afile = TFile::Open(Form("Event_0x%016X_Async.root", gHomerManager->GetEventID()), "RECREATE");
1698 bList->Write("blockList", TObject::kSingleKey);
1699 afile->Close();
1700
1701
1702// TIter next(bList);
1703
1704// AliHLTHOMERBlockDesc* block = 0;
1705
1706// // -- Iterate over blocks in the block list
1707// // ------------------------------------------
1708// while ((block = (AliHLTHOMERBlockDesc*)next())) {
1709// cout << "balle " << endl;
1710// }
1711
1712}
1713
1714
ea48ba6e 1715// -----------------------------------------------------------------
1716void loopEvent() {
1717 eventTimer.SetCommand("nextEvent()");
1718 eventTimer.Start(6000);
1719}
1720
1721// -----------------------------------------------------------------
1722void stopLoopEvent() {
1723 eventTimer.Stop();
1724}
1725
1726
1727// -----------------------------------------------------------------
1728void loopEventFast() {
1729 eventTimerFast.SetCommand("nextEvent()");
1730 eventTimerFast.Start(500);
1731}
1732
1733// -----------------------------------------------------------------
1734void stopLoopEventFast() {
1735 eventTimerFast.Stop();
1736}
1737
1d8ae8b6 1738// -----------------------------------------------------------------
1739void EventLoopFast() {
1740
1741 // Start/stop event loop
1742 if ( gEventLoopStarted ) {
1743 loopEventFast();
1744 gEventLoopStarted = kTRUE;
cfa641b1 1745
1746 } else {
1d8ae8b6 1747 stopLoopEventFast();
1748 gEventLoopStarted = kFALSE;
cfa641b1 1749
1d8ae8b6 1750 }
1751}
09cdbe4c 1752
1753
1754
4d89023a 1755Int_t processAsyncBlock(AliHLTHOMERBlockDesc * block) {
09cdbe4c 1756
1757 Int_t iResult = 0;
1758
1759#if 1//DEBUG
1760 printf( "------------------- xxxxxxxxxxxxxxx ----------------------\n");
1761 printf( "Detector : %s\n", block->GetDetector().Data() );
1762 printf( "Datatype : %s\n", block->GetDataType().Data() );
1763 if (block->IsTObject() )
1764 printf( "Is TObject of class: %s\n", block->GetClassName().Data() );
1765 printf( "------------------- xxxxxxxxxxxxxxx ----------------------\n");
1766#endif
1767
1768 // ++ V0 BLOCK
1769 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1770 if ( block->GetDataType().CompareTo("ROOTHIST") == 0 ) {
1771 // -- Process V0 Histos
1772 processV0Histograms( block , gV0Canvas);
1773 }
1774
1775 // ++ vertex BLOCK
1776 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1777 if ( ! block->GetDetector().CompareTo("HLT") &&
1778 !block->GetDataType().CompareTo("ROOTHIST") ) {
1779 // -- Process Vertex Histos
1780 processPrimVertexHistograms( block , gPrimVertexCanvas);
1781 gPrimVertexCanvas->Update();
1782 }
1783
1784 // ++ ISPD Vertex BLOCK
1785 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1786 if ( ! block->GetDetector().CompareTo("ISPD") ){
1787 if ( block->GetDataType().CompareTo("ROOTHIST") == 0 ) {
1788
1789 // -- Process Vertex Histos
1790 processSPDVertexHistograms( block , gSPDVertexCanvas);
1791 gSPDVertexCanvas->Update();
1792 }
1793 }
1794
1795 // ++ ITS BLOCK
1796 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1797 if ( ! block->GetDetector().CompareTo("ITS") ){
1798 if ( block->GetDataType().CompareTo("ROOTHIST") == 0 ) {
1799
1800 // -- Process Vertex Histos
1801 processITSHistograms( block , gITSCanvas);
1802 gITSCanvas->Update();
1803 }
1804 }
1805
1806 // ++ ISSD BLOCK
1807 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1808 if ( ! block->GetDetector().CompareTo("ISSD") ){
1809 if ( block->GetDataType().CompareTo("ROOTOBAR") == 0 ) {
1810
1811 // -- Process Vertex Histos
1812 processSSDHistograms( block , gSSDCanvas0, gSSDCanvas1);
1813 gSSDCanvas0->Update();
1814 gSSDCanvas1->Update();
1815 }
1816 }
1817
1818 // ++ PHOS BLOCK
1819 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1820 if ( ! block->GetDetector().CompareTo("PHOS") ) {
1821
1822 cout << "PHOS"<<endl;
1823
1824 if( !gPHOSElementList ){
1825 gPHOSElementList = new TEveElementList("PHOS Cells");
1826 gEve->AddElement(gPHOSElementList);
1827
1828 TVector3 center;
1829 Float_t angle;
1830
1831 // -- Create boxsets
1832 for(int im = 0; im < 5; im++) {
1833
1834 TEveRGBAPalette* pal = new TEveRGBAPalette(0,120);
1835 pal->SetLimits(-0.1, 1024);
1836 gPHOSBoxSet[im] = new TEveBoxSet(Form("Cells Module %d" , im));
1837 gPHOSBoxSet[im]->SetPalette(pal);
1838 gPHOSBoxSet[im]->Reset(TEveBoxSet::kBT_AABox, kFALSE, 64);
1839 gPHOSBoxSet[im]->SetOwnIds(kTRUE);
1840
1841
1842 gPHOSGeom->GetModuleCenter(center, "CPV", im+1);
1843 angle = gPHOSGeom->GetPHOSAngle(im+1)*TMath::Pi()/180;
1844
1845 gPHOSBoxSet[im]->RefitPlex();
1846 TEveTrans& t = gPHOSBoxSet[im]->RefMainTrans();
1847 t.SetupRotation(1, 2, angle );
1848 t.SetPos(center.X(), center.Y(), center.Z());
1849
1850 gPHOSElementList->AddElement(gPHOSBoxSet[im]);
1851 }
1852 } // for(int im = 0; im < 5; im++) {
1853
1854 // -- Process Digitss
1855 if ( block->GetDataType().CompareTo("CALOCLUS") == 0 ) {
1856
1857 cout << "CHANNELT"<<endl;
1858 iResult = processPHOSClusters( block );
1859
1860 } else if ( block->GetDataType().CompareTo("DIGITTYP") == 0 ) {
1861
1862 cout << "DIGITTYP"<<endl;
1863 iResult - processPHOSDigits( block);
1864 }
1865
1866 else if ( block->GetDataType().CompareTo("ROOTHIST") == 0 ) {
1867 cout << "ROOTHIST"<<endl;
1868 iResult = addHistogramsToCanvas(block, gPHOSCanvas, gPHOSHistoCount);
1869 }
1870
1871 for(int im = 0; im < 5; im++)
1872 gPHOSBoxSet[im]->ElementChanged();
1873
1874 } // else if ( ! block->GetDetector().CompareTo("PHOS") ){
1875
1876 else if ( ! block->GetDetector().CompareTo("EMCA") ){
1877 if ( block->GetDataType().CompareTo("CHANNELT") == 0 ) {
1878
1879 if( !gEMCALElementList ){
1880 gEMCALElementList = new TEveElementList("EMCAL Cells");
1881 gEMCALElementList->SetTitle("Tooltip");
1882 gEve->AddElement(gEMCALElementList);
1883
1884
1885 gStyle->SetPalette(1, 0);
1886 TEveRGBAPalette* pal = new TEveRGBAPalette(0, 512);
1887 pal->SetLimits(0, 1024);
1888
1889
1890 for (Int_t sm=0; sm<12; ++sm) {
1891
1892 TEveBoxSet* q = new TEveBoxSet(Form("SM %d", sm+1));
1893 q->SetOwnIds(kTRUE);
1894
1895 q->Reset(TEveBoxSet::kBT_AABox, kFALSE, 64);
1896 q->RefMainTrans().SetFrom(*gEMCALNode->GetDaughter(sm)->GetMatrix());
1897 q->SetPalette(pal);
1898
1899 gEve->AddElement(q, gEMCALElementList);
1900 gEMCALBoxSet[sm] = q;
1901 }
1902 }
1903 // cout << "Processing emcal digits" << endl;
1904 iResult = processEMCALClusters( block );
1905
1906 for(int sm = 0; sm < 12; sm++) {
1907 gEMCALBoxSet[sm]->ElementChanged();
1908 }
1909
1910
1911 } else if ( block->GetDataType().CompareTo("ROOTHIST") == 0 ) {
1912 iResult = addHistogramsToCanvas(block, gEMCALCanvas, gEMCALHistoCount);
1913 }
1914 } // "EMCAL" blocks end
1915
1916 //Extra TPC clusters set for testing
1917 else if ( ! block->GetDetector().CompareTo("TPC") ) {
1918 if ( ! block->GetDataType().CompareTo("HWCL_ALT") ) {
1919 if(!gTPCTestClusters){
1920
1921 gTPCTestClusters = new TEvePointSet("TPC Clusters Test");
1922 //ggTPCTestClusters->ApplyVizTag("TPC Clusters");
1923 gTPCTestClusters->SetMainColor(kBlue);
1924 gTPCTestClusters->SetMarkerStyle((Style_t)kFullDotSmall);
1925 gEve->AddElement(gTPCTestClusters);
1926 }
1927
1928 iResult = processTPCClusters(block, gTPCTestClusters);
1929 gTPCTestClusters->ElementChanged();
1930 }
1931
1932
1933 }
1934
1935 }
1936
1937
1938
1939
1940
1941Int_t processBlock (AliHLTHOMERBlockDesc * block ){
1942
1943 Int_t iResult = 0;
1944
1945
1946#if 0 //DEBUG
1947 printf( "------------------- xxxxxxxxxxxxxxx ----------------------\n");
1948 printf( "Detector : %s\n", block->GetDetector().Data() );
1949 printf( "Datatype : %s\n", block->GetDataType().Data() );
1950 if (block->IsTObject() )
1951 printf( "Is TObject of class: %s\n", block->GetClassName().Data() );
1952 printf( "------------------- xxxxxxxxxxxxxxx ----------------------\n");
1953#endif
1954
1955 // ++ HLT BLOCK
1956 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1957 if ( ! block->GetDetector().CompareTo("HLT") ) {
1958
1959 // -- ESDTREE
1960 if ( ! block->GetDataType().CompareTo("ALIESDV0") ) {
1961 if(!gTPCTrack){
1962 gTPCTrack = new TEveTrackList("ESD Tracks");
1963 gTPCTrack->SetMainColor(6);
1964 gEve->AddElement(gTPCTrack);
1965 }
1966 iResult = processEsdTracks(block, gTPCTrack);
1967 gTPCTrack->ElementChanged();
1968 } // if ( ! block->GetDataType().CompareTo("ALIESDV0") ) {
1969
1970 // -- Process ROOTObj
1971 else if ( ! block->GetDataType().CompareTo("ROOTTOBJ") ) {
09cdbe4c 1972 processROOTTOBJ( block, gHLTText );
4d89023a 1973 }
09cdbe4c 1974
1975 // -- Process HLT RDLST
1976 else if ( ! block->GetDataType().CompareTo("HLTRDLST") ) {
1977 processHLTRDLST( block );
4d89023a 1978 }
1979
09cdbe4c 1980
1981 } // if ( ! block->GetDetector().CompareTo("HLT") ) {
1982
1983 // ++ TPC BLOCK
1984 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1985 else if ( ! block->GetDetector().CompareTo("TPC") ) {
1986
1987 // -- Process TPC Clusters
1988 if ( ! block->GetDataType().CompareTo("CLUSTERS") ) {
1989 if(!gTPCClusters){
1990 gTPCClusters = new TEvePointSet("TPC Clusters");
1991 //gTPCClusters->ApplyVizTag("TPC Clusters");
1992 gTPCClusters->SetMainColor(kRed);
1993 gTPCClusters->SetMarkerStyle((Style_t)kFullDotSmall);
1994 //gEve->AddElement(gTPCClusters);
1995 }
1996
1997 if(!gTPCColClusters){
1998 gTPCColClusters = new TEvePointSetArray("TPC Clusters Colorized");
1999 gTPCColClusters->SetMainColor(kRed);
2000 gTPCColClusters->SetMarkerStyle(4); // antialiased circle
2001 gTPCColClusters->SetMarkerSize(0.4);
2002 gTPCColClusters->InitBins("Cluster Charge", gTPCBins, 0., gTPCBins*20.);
2003
2004 const Int_t nCol = TColor::GetNumberOfColors();
2005
2006 for (Int_t ii = 0; ii < gTPCBins+1; ++ii)
2007 gTPCColClusters->GetBin(ii)->SetMainColor(TColor::GetColorPalette(ii * nCol / (gTPCBins+2)));
2008
2009 gEve->AddElement(gTPCColClusters);
2010 }
2011
2012 iResult = processTPCClusters(block, gTPCClusters, gTPCColClusters);
2013 //gTPCClusters->ElementChanged();
2014 gTPCColClusters->ElementChanged();
2015 }
2016
2017 } // else if ( ! block->GetDetector().CompareTo("TPC") ) {
2018
2019 // ++ TRD BLOCK
2020 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++
2021 else if ( ! block->GetDetector().CompareTo("TRD") ) {
2022
2023 // -- Process TRD Clusters
2024 if ( ! block->GetDataType().CompareTo("CLUSTERS") ) {
2025
2026 if(!gTRDClusters){
2027 gTRDClusters = new TEvePointSet("TRD Clusters");
2028 gTRDClusters->SetMainColor(kBlue);
2029 gTRDClusters->SetMarkerStyle((Style_t)kFullDotSmall);
2030 //gEve->AddElement(gTRDClusters);
2031 }
2032
2033 if(!gTRDColClusters){
2034 gTRDColClusters = new TEvePointSetArray("TRD Clusters Colorized");
2035 gTRDColClusters->SetMainColor(kRed);
2036 gTRDColClusters->SetMarkerStyle(4); // antialiased circle
2037 // gTRDColClusters->SetMarkerStyle((Style_t)kFullDotSmall);
2038 gTRDColClusters->SetMarkerSize(0.4);
2039 gTRDColClusters->InitBins("Cluster Charge", gTRDBins, 0., gTRDBins*100.);
2040
2041 //TColor::SetPalette(1, 0); // Spectrum palette
2042 const Int_t nCol = TColor::GetNumberOfColors();
2043 for (Int_t ii = 0; ii < gTRDBins+1; ++ii)
2044 gTRDColClusters->GetBin(ii)->SetMainColor(TColor::GetColorPalette(ii * nCol / (gTRDBins+2)));
2045
2046 gEve->AddElement(gTRDColClusters);
2047 }
2048
2049 iResult = processTRDClusters( block, gTRDClusters, gTRDColClusters );
2050 //gTRDClusters->ElementChanged();
2051 gTRDColClusters->ElementChanged();
2052 }
2053
2054 // -- Process TRD Histograms
2055 else if ( block->GetDataType().CompareTo("ROOTHIST") == 0 ) {
2056 iResult = processTRDHistograms( block, gTRDCanvas );
2057 if ( gTRDCanvas) gTRDCanvas->Update();
2058 }
2059 else if(block->GetDataType().CompareTo("CALIBRAH")==0){
2060 iResult=processTRDCalibHistograms(block,gTRDCalibCanvas);
2061 if(gTRDCalibCanvas)gTRDCalibCanvas->Update();
2062 }
2063 else if(block->GetDataType().CompareTo("CALIBEOR")==0){
2064 iResult=processTRDCalibHistograms(block,gTRDEORCanvas);
2065 if(gTRDEORCanvas)gTRDEORCanvas->Update();
2066 }
2067 } // else if ( ! block->GetDetector().CompareTo("TRD") ) {
2068
2069 // ++ MUON BLOCK
2070 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++
2071 else if ( ! block->GetDetector().CompareTo("MUON") && gShowMUON ) {
2072
2073 // -- Process MUON Clusters
2074 if ( (block->GetDataType().CompareTo("RECHITS") == 0) || (block->GetDataType().CompareTo("TRIGRECS") == 0) ) {
2075
2076 if ( !gMUONClusters ) {
2077 gMUONClusters = new TEvePointSet("MUON RecHits");
2078 gMUONClusters->SetMainColor(kBlue);
2079 gMUONClusters->SetMarkerStyle(20);
2080 gEve->AddElement(gMUONClusters);
2081 }
2082
2083 processMUONClusters( block );
2084 gMUONClusters->ElementChanged();
2085
2086 }else if(block->GetDataType().CompareTo("MANTRACK") == 0){
2087
2088 if ( !gMUONTracks ) {
2089 gMUONTracks = new TEveStraightLineSet("MUON Tracks");
2090 gMUONTracks->SetMainColor(kRed);
2091 gMUONTracks->SetLineWidth(3);
2092 gEve->AddElement(gMUONTracks);
2093 }
2094
2095 processMUONTracks( block );
2096 gMUONTracks->ElementChanged();
2097
2098
2099 }
2100 } // else if ( ! block->GetDetector().CompareTo("MUON") && gShowMUON ) {
2101
2102 // ++ ISPD BLOCK
2103 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++
2104 else if ( ! block->GetDetector().CompareTo("ISPD") ){
2105 if ( block->GetDataType().CompareTo("CLUSTERS") == 0 ) {
2106
2107 if(!gSPDClusters){
2108 gSPDClusters = new TEvePointSet("SPD Clusters");
2109 gSPDClusters->SetMainColor(kBlack);
2110 gSPDClusters->SetMarkerStyle((Style_t)kFullDotMedium);
2111 gEve->AddElement(gSPDClusters);
2112 }
2113
2114 processITSClusters( block , gSPDClusters);
2115 gSPDClusters->ElementChanged();
2116
2117 } else if ( block->GetDataType().CompareTo("ROOTHIST") == 0 ) {
2118
2119 // -- Process Vertex Histos
2120 processSPDVertexHistograms( block , gSPDVertexCanvas);
2121 gSPDVertexCanvas->Update();
2122 }
2123 } // else if ( ! block->GetDetector().CompareTo("ISPD") ){
2124
2125 // ++ ISDD BLOCK
2126 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++
2127 else if ( ! block->GetDetector().CompareTo("ISDD") ){
2128 if ( block->GetDataType().CompareTo("CLUSTERS") == 0 ) {
2129
2130 if(!gSDDClusters){
2131 gSDDClusters = new TEvePointSet("SDD Clusters");
2132 gSDDClusters->SetMainColor(kPink);
2133 gSDDClusters->SetMarkerStyle((Style_t)kFullDotMedium);
2134 gEve->AddElement(gSDDClusters);
2135 }
2136
2137 processITSClusters( block , gSDDClusters);
2138 gSDDClusters->ElementChanged();
2139 }
2140 } // else if ( ! block->GetDetector().CompareTo("ISDD") ){
2141
2142 // ++ ISSD BLOCK
2143 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++
2144 else if ( ! block->GetDetector().CompareTo("ISSD") ){
2145 if ( block->GetDataType().CompareTo("CLUSTERS") == 0 ) {
2146
2147 if(!gSSDClusters){
2148 gSSDClusters = new TEvePointSet("SSD Clusters");
2149 gSSDClusters->SetMainColor(kBlue);
2150 gSSDClusters->SetMarkerStyle((Style_t)kFullDotMedium);
2151 gEve->AddElement(gSSDClusters);
2152 }
2153
2154 processITSClusters( block , gSSDClusters);
2155 gSSDClusters->ElementChanged();
2156 }
2157 } // else if ( ! block->GetDetector().CompareTo("ISSD") ){
2158
2159 // ++ ITS BLOCK
2160 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++
2161 else if ( ! block->GetDetector().CompareTo("ITS") ){
2162 if ( block->GetDataType().CompareTo("ROOTHIST") == 0 ) {
2163 iResult = processITSHist( block );
2164 }
2165 } // else if ( ! block->GetDetector().CompareTo("ITS") ){
2166
2167 // ++ PHOS BLOCK
2168 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++
2169 else if ( ! block->GetDetector().CompareTo("PHOS") ) {
2170
2171 // -- Process Digits
2172 //if ( block->GetDataType().CompareTo("DIGITTYP") == 0 ) {
2173 if ( block->GetDataType().CompareTo("CHANNELT") == 0 ) {
2174
2175 if( !gPHOSElementList ){
2176 gPHOSElementList = new TEveElementList("PHOS Cells");
2177 gEve->AddElement(gPHOSElementList);
2178
2179 TVector3 center;
2180 Float_t angle;
2181
2182 // -- Create boxsets
2183 for(int im = 0; im < 5; im++) {
2184
2185 TEveRGBAPalette* pal = new TEveRGBAPalette(0,120);
2186 pal->SetLimits(-0.1, 1024);
2187 gPHOSBoxSet[im] = new TEveBoxSet(Form("Cells Module %d" , im));
2188 gPHOSBoxSet[im]->SetPalette(pal);
2189 gPHOSBoxSet[im]->Reset(TEveBoxSet::kBT_AABox, kFALSE, 64);
2190 gPHOSBoxSet[im]->SetOwnIds(kTRUE);
2191
2192
2193 gPHOSGeom->GetModuleCenter(center, "CPV", im+1);
2194 angle = gPHOSGeom->GetPHOSAngle(im+1)*TMath::Pi()/180;
2195
2196 gPHOSBoxSet[im]->RefitPlex();
2197 TEveTrans& t = gPHOSBoxSet[im]->RefMainTrans();
2198 t.SetupRotation(1, 2, angle );
2199 t.SetPos(center.X(), center.Y(), center.Z());
2200
2201 gPHOSElementList->AddElement(gPHOSBoxSet[im]);
2202 }
2203 } // for(int im = 0; im < 5; im++) {
2204
2205 iResult = processPHOSClusters( block );
2206
2207 for(int im = 0; im < 5; im++)
2208 gPHOSBoxSet[im]->ElementChanged();
2209
2210 } // if ( block->GetDataType().CompareTo("DIGITTYP") == 0 ) {
2211
2212 } // else if ( ! block->GetDetector().CompareTo("PHOS") ){
2213
2214 else if ( ! block->GetDetector().CompareTo("EMCAL") ){
2215 if ( block->GetDataType().CompareTo("CHANNELT") == 0 ) {
2216
2217 if( !gEMCALElementList ){
2218 gEMCALElementList = new TEveElementList("EMCAL Cells");
2219 gEMCALElementList->SetTitle("Tooltip");
2220 gEve->AddElement(gEMCALElementList);
2221
2222
2223 gStyle->SetPalette(1, 0);
2224 TEveRGBAPalette* pal = new TEveRGBAPalette(0, 512);
2225 pal->SetLimits(0, 1024);
2226
2227
2228 for (Int_t sm=0; sm<12; ++sm) {
2229
2230 TEveBoxSet* q = new TEveBoxSet(Form("SM %d", sm+1));
2231 q->SetOwnIds(kTRUE);
2232
2233 q->Reset(TEveBoxSet::kBT_AABox, kFALSE, 64);
2234 q->RefMainTrans().SetFrom(*gEMCALNode->GetDaughter(sm)->GetMatrix());
2235 q->SetPalette(pal);
2236
2237 gEve->AddElement(q, gEMCALElementList);
2238 gEMCALBoxSet[sm] = q;
2239 }
2240 }
2241
2242 iResult = processEMCALClusters( block );
2243
2244 for(int sm = 0; sm < 12; sm++) {
2245 gEMCALBoxSet[sm]->ElementChanged();
2246 }
2247
2248
2249 }
2250
2251 } // "EMCAL" blocks end
2252
2253 // ---------------------------------------------------------
2254} // while ((block = (AliHLTHOMERBlockDesc*)next())) {
2255