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