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