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