2 // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
4 /**************************************************************************
5 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
7 * full copyright notice. *
8 **************************************************************************/
10 // Functions to read data from HOMER.
12 // Setup: edit location of HLT configuration in first line of
13 // homer_display(). This is a temporary solution.
15 // Run as: alieve command_queue.C+ hlt_structs.C+ homer_display.C
17 // nextEvent() will get next event from HOMER.
20 class AliRawReaderMemory;
21 class AliEveHOMERManager;
22 class AliHLTHOMERBlockDesc;
28 class AliEveTPCLoader;
30 class AliEveTPCSector2D;
31 class AliEveTPCSector3D;
32 class AliEveITSDigitsInfo;
34 //***********************************************************
37 #include "TVirtualPad.h"
38 #include "TGLViewer.h"
40 #include "TGFileBrowser.h"
43 #include "TDirectory.h"
44 //***********************************************************
45 #include "TEveManager.h"
46 #include "TEvePointSet.h"
47 #include "TEveTrack.h"
48 #include "TEveVSDStructs.h"
49 #include "TEveTrackPropagator.h"
50 #include "TEvePointSet.h"
51 #include "TEveScene.h"
52 #include "TEveElement.h"
53 // #include "TEveElementList.h"
54 #include "TEveEventManager.h"
55 //***********************************************************
56 #include "AliESDEvent.h"
57 #include "AliCDBManager.h"
58 #include "AliRawReaderMemory.h"
59 #include "AliTPCRawStream.h"
60 #include "AliGeomManager.h"
61 //***********************************************************
62 #include "AliEveHOMERManager.h"
63 #include "AliEveTPCLoader.h"
64 #include "AliEveTPCData.h"
65 #include "AliEveITSDigitsInfo.h"
66 #include "AliEveITSModule.h"
67 //***********************************************************
68 #include "AliHLTHOMERBlockDesc.h"
69 #include "AliHLTHOMERReader.h"
70 //***********************************************************
71 #include "hlt_structs.C"
73 //***********************************************************
74 #include <AliHLTMUONUtils.h>
75 #include "AliHLTMUONDataBlockReader.h"
76 #include "tracking-ca/AliHLTTPCCATrackParam.h"
80 AliEveTPCLoader* gTPCLoader = 0;
81 AliEveTPCData* gTPCData = 0;
82 TEvePointSet* gTPCClusters = 0;
83 TEveTrackList* gTPCTrack = 0;
85 AliEveITSDigitsInfo* gITSDigits = 0;
87 AliRawReaderMemory* gMemReader = 0;
88 AliEveHOMERManager* gHomerManager = 0;
90 TEvePointSet* gMUONClusters = 0;
91 Double_t gSolenoidField = 5;
92 //***********************************************************
94 Int_t globMaxPoint = 0 ;
96 //***********************************************************
105 TThread* ldthread = 0;
110 TGFileBrowser *g_hlt_browser = 0;
111 TCanvas *g_hlt_canvas = 0;
113 TGLViewer::ECameraType camera = TGLViewer::kCameraPerspXOZ;
115 //****************************************************************************
118 //****************************************************************************
119 Int_t processSPDRawData( AliHLTHOMERBlockDesc* block );
120 Int_t drawSPDRawData();
122 //****************************************************************************
123 Int_t processTPCRawData( AliHLTHOMERBlockDesc* block );
124 Int_t processTPCClusters( AliHLTHOMERBlockDesc* block );
125 Int_t processTPCTracks( AliHLTHOMERBlockDesc* block );
127 Int_t processMUONClusters( AliHLTHOMERBlockDesc* block );
129 //****************************************************************************
130 TEveTrack* makeESDTrack( TEveTrackPropagator* rnrStyle,
133 AliExternalTrackParam* tp = 0 );
135 //****************************************************************************
136 void homer_display( Int_t run = 0) {
138 AliCDBManager::Instance()->SetRun(run);
139 AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
141 gMemReader = new AliRawReaderMemory(0, 0);
143 gStyle->SetPalette(1, 0);
144 gEve->DisableRedraw();
146 // -- Create HOMER Manager
147 gHomerManager = new AliEveHOMERManager("/local/home/hlt/AliEVE-Config.xml");
149 // -- Set Realm ( can be "GPN","ACR","HLT","KIP" )
150 gHomerManager->SetRealm("ACR");
152 gEve->AddToListTree(gHomerManager, kTRUE);
154 // -- Create list of HOMER sources
155 gHomerManager->CreateHOMERSourcesList();
158 gTPCLoader = new AliEveTPCLoader;
159 gTPCLoader->SetDoubleSR(kTRUE);
160 gTPCLoader->SetInitParams(40, 900, 2, 100); // Sector params (mint, maxt, thr, maxval)
163 gTPCData = gTPCLoader->GetData();
164 gTPCData->SetLoadPedestal(0);
165 gTPCData->SetLoadThreshold(0);
166 gTPCData->SetAutoPedestal(kFALSE); // For zero suppressed data.
168 gEve->AddElement(gTPCLoader);
170 gEve->Redraw3D(0,1); // (0, 1)
171 gEve->EnableRedraw();
174 //****************************************************************************
179 gStyle->SetPalette(1, 0);
180 gEve->DisableRedraw();
182 // ** Get Next Event from HOMER
183 if ( gHomerManager->NextEvent() )
187 if ( gTPCClusters ) gTPCClusters->Reset();
188 if ( gTPCTrack ) gTPCTrack->DestroyElements();
189 if ( gTPCData ) gTPCData->DropAllSectors();
196 if ( gMUONClusters ) gMUONClusters->Reset();
199 // ----------------------------------- foo A
202 // TList* hListKR = new TList;
203 // TList* hListCF = new TList;
205 // ----------------------------------- foo A
207 TIter next(gHomerManager->GetBlockList());
208 AliHLTHOMERBlockDesc* block = 0;
210 while ((block = (AliHLTHOMERBlockDesc*)next())) {
212 // printf ( "Det : %s\n" ,block->GetDetector().Data() );
213 // printf ( "Datatype : %s\n" ,block->GetDataType().Data() );
218 // -----------------------------------------------------
220 if ( ! block->GetDetector().CompareTo("TPC") ){
223 // +++ CLUSTERS BLOCK
224 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++
226 if ( block->GetDataType().CompareTo("CLUSTERS") == 0 ) {
227 if ( !gTPCClusters ) {
228 gTPCClusters = new TEvePointSet("TPC Clusters");
229 gTPCClusters->SetMainColor(kRed);
230 gTPCClusters->SetMarkerStyle((Style_t)kFullDotSmall);
231 gEve->AddElement(gTPCClusters);
234 // ** Process Clusters
235 processTPCClusters( block );
237 gTPCClusters->ElementChanged();
239 }else if ( block->GetDataType().CompareTo("ESD_TREE") == 0 ) {
241 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++
243 // ** Initialize TPC Tracks
245 gTPCTrack = new TEveTrackList("TPC Tracks");
246 gTPCTrack->SetMainColor(kBlue);
248 gEve->AddElement(gTPCTrack);
250 TEveTrackPropagator* rnrStyle = gTPCTrack->GetPropagator();
251 rnrStyle->SetMagField( 0 );
252 rnrStyle->SetFitDecay( 1 );
254 cout<<"SIZE : "<<block->GetSize()<<endl;
256 processTPCTracks( block );
257 }else if ( block->GetDataType().CompareTo("DDL_RAW") == 0 ) {
258 processTPCRawData( block );
261 } else if ( ! block->GetDetector().CompareTo("MUON") ) {
264 //-----------------------------------------------------
265 if ( (block->GetDataType().CompareTo("RECHITS") == 0) || (block->GetDataType().CompareTo("TRIGRECS") == 0) ) {
267 // printf ( "Inside : Datatype : %s\n" ,block->GetDataType().Data() );
268 // printf ( "Inside : DataSize : %d\n" ,block->GetSize() );
269 if ( !gMUONClusters ) {
270 gMUONClusters = new TEvePointSet("MUON RecHits");
271 gMUONClusters->SetMainColor(kBlue);
272 gMUONClusters->SetMarkerStyle(20);
273 gEve->AddElement(gMUONClusters);
276 // ** Process Clusters
277 processMUONClusters( block );
279 gMUONClusters->ElementChanged();
284 } else if ( ! block->GetDetector().CompareTo("SPD") ) {
287 // -----------------------------------------------------
289 if ( block->GetDataType().CompareTo("DDL_RAW") == 0 ) {
290 // ** Initialize SPD Digits
292 gITSDigits = new AliEveITSDigitsInfo();
295 processSPDRawData( block );
300 printf ("Detector \"%s\" has not been recognized",block->GetDetector().Data());
305 if ( gTPCLoader ) gTPCLoader->UpdateSectors( kTRUE );
306 if ( gTPCClusters ) gTPCClusters->ResetBBox();
307 if ( gTPCTrack ) gTPCTrack->MakeTracks();
308 if ( gITSDigits ) drawSPDRawData();
310 if ( gMUONClusters ) gMUONClusters->ResetBBox();
312 gEve->Redraw3D(0,1); // (0, 1)
313 gEve->EnableRedraw();
318 //****************************************************************************
319 //****************************************************************************
320 //****************************************************************************
322 event_timer.SetCommand("nextEvent()");
323 event_timer.Start(6000);
326 //****************************************************************************
327 void stopLoopEvent() {
331 //****************************************************************************
332 Int_t processTPCRawData(AliHLTHOMERBlockDesc* block) {
336 Int_t sector = block->GetSubDetector().Atoi();
337 Int_t patch = block->GetSubSubDetector().Atoi();
338 Int_t eqId = 768 + patch;
340 if ( patch >= 2) eqId += 4 * sector + 70;
341 else eqId += 2 * sector;
343 printf("sector : %d %d %d -- %p %lu\n", sector, patch, eqId, block->GetData(), block->GetSize());
345 gMemReader->SetMemory( reinterpret_cast<UChar_t*> ( block->GetData() ), block->GetSize() );
346 gMemReader->SetEquipmentID( eqId );
349 AliTPCRawStream tpcStream( gMemReader );
350 gMemReader->Select("TPC");
352 gTPCData->LoadRaw( tpcStream, kTRUE, kTRUE );
357 //****************************************************************************
358 Int_t processTPCClusters(AliHLTHOMERBlockDesc* block) {
361 Int_t slice = block->GetSubDetector().Atoi();
362 Int_t patch = block->GetSubSubDetector().Atoi();
363 Float_t phi = ( slice + 0.5 ) * TMath::Pi() / 9.0;
364 Float_t cos = TMath::Cos( phi );
365 Float_t sin = TMath::Sin( phi );
367 AliHLTTPCClusterData *cd = (AliHLTTPCClusterData*) block->GetData();
368 UChar_t *data = (UChar_t*) cd->fSpacePoints;
370 if ( cd->fSpacePointCnt == 0 ) {
371 printf ("No Clusters found in sector %d patch %d.\n", slice, patch );
376 for (Int_t ii = 0; ii < cd->fSpacePointCnt; ++ii, data += sizeof(AliHLTTPCSpacePointData)) {
377 AliHLTTPCSpacePointData *sp = (AliHLTTPCSpacePointData *) data;
379 gTPCClusters->SetNextPoint(cos*sp->fX - sin*sp->fY, sin*sp->fX + cos*sp->fY, sp->fZ);
386 //****************************************************************************
387 TEveTrack* makeESDTrack( TEveTrackPropagator* rnrStyle,
389 AliESDtrack* esdTrack,
390 AliExternalTrackParam* trackParam ) {
393 Double_t pbuf[3], vbuf[3];
395 TEvePathMark startPoint(TEvePathMark::kReference);
396 TEvePathMark midPoint(TEvePathMark::kReference);
397 TEvePathMark mid1Point(TEvePathMark::kReference);
398 TEvePathMark endPoint(TEvePathMark::kReference);
399 TEvePathMark decPoint(TEvePathMark::kDecay);
401 /*printf("ESD track: %f, %f, %f, %f, %f, %f, %f",
402 esdTrack->GetAlpha(),
408 esdTrack->GetSigned1Pt()
411 cout<<"TPCPoints::"<<esdTrack->GetTPCPoints(0)<<" "<<esdTrack->GetTPCPoints(1)<<" "<<esdTrack->GetTPCPoints(2)<<" "<<esdTrack->GetTPCPoints(3)<<endl;
413 if ( trackParam == 0 )
414 trackParam = esdTrack;
416 rt.fLabel = esdTrack->GetLabel();
418 rt.fStatus = (Int_t) esdTrack->GetStatus();
419 rt.fSign = (Int_t) trackParam->GetSign();
421 Double_t x0 = trackParam->GetX();
422 Double_t dx = esdTrack->GetTPCPoints(2) - x0;
424 for( Double_t x1=x0; x1<x0+dx; x1+=(dx)*.1 ){//SG
425 AliExternalTrackParam startParam = *trackParam;
426 AliHLTTPCCATrackParam t;
427 t.SetExtParam(startParam, gSolenoidField );
428 if( !t.TransportToX(x1) ) continue;
429 t.GetExtParam( startParam, startParam.GetAlpha(), gSolenoidField );
430 if( TMath::Abs(startParam.GetSnp())>.99 ) continue;
432 startParam.GetXYZ(vbuf);
434 { // get momentum manually because trackParam->GetPxPyPz doesn't works for straight lines
436 Double_t pt= TMath::Abs(startParam.GetSigned1Pt());
437 pt = (pt>kAlmost0) ?1./pt :100.;
439 Double_t cA=TMath::Cos(startParam.GetAlpha()), sA=TMath::Sin(startParam.GetAlpha());
441 Double_t sT=startParam.GetSnp();
442 if( sT>kAlmost1 ){ sT = kAlmost1; }
443 else if( sT<-kAlmost1 ){ sT = -kAlmost1; }
444 Double_t cT = TMath::Sqrt(TMath::Abs(1 - sT*sT));
446 pbuf[0] = pt*(cT*cA - sT*sA);
447 pbuf[1] = pt*(sT*cA + cT*sA);
448 pbuf[2] = pt*startParam.GetTgl();
456 startPoint.fV.Set(vbuf);
457 startPoint.fP.Set(pbuf);
459 Double_t ep = esdTrack->GetP(), mc = esdTrack->GetMass();
460 rt.fBeta = ep/TMath::Sqrt(ep*ep + mc*mc);
462 TEveTrack* track = new TEveTrack(&rt, rnrStyle);
464 cout<<"startPoint = "<<vbuf[0]<<" "<<vbuf[1]<<" "<<vbuf[2]<<" "<<pbuf[0]<<" "<<pbuf[1]<<" "<<pbuf[2]<<endl;
467 for( ; TMath::Abs(dx)>=1.; dx*=.9 ){
468 AliExternalTrackParam endParam = *trackParam;
469 //if( !endParam.PropagateTo(x0+dx, gSolenoidField) ) continue;
470 AliHLTTPCCATrackParam t;
471 t.SetExtParam(endParam, gSolenoidField );
472 if( !t.TransportToX(x0+dx) ) continue;
473 t.GetExtParam( endParam, endParam.GetAlpha(), gSolenoidField );
475 if( TMath::Abs(endParam.GetSnp())>.99 ) continue;
477 { // get momentum manually because trackParam->GetPxPyPz doesn't works for straight lines
479 Double_t pt= TMath::Abs(endParam.GetSigned1Pt());
480 pt = (pt>kAlmost0) ?1./pt :100.;
482 Double_t cA=TMath::Cos(endParam.GetAlpha()), sA=TMath::Sin(endParam.GetAlpha());
484 Double_t sT=endParam.GetSnp();
485 if( sT>=kAlmost1 ){ sT = kAlmost1; }
486 else if( sT<-kAlmost1 ){ sT = -kAlmost1; }
487 Double_t cT = TMath::Sqrt(TMath::Abs(1 - sT*sT));
489 endParam.GetXYZ(vbuf);
490 pbuf[0] = pt*(cT*cA - sT*sA);
491 pbuf[1] = pt*(sT*cA + cT*sA);
492 pbuf[2] = pt*endParam.GetTgl();
496 endPoint.fV.Set(vbuf);
497 endPoint.fP.Set(pbuf);
498 decPoint.fV.Set(vbuf);
499 decPoint.fP.Set(pbuf);
501 cout<<"endPoint = "<<vbuf[0]<<" "<<vbuf[1]<<" "<<vbuf[2]<<" "<<pbuf[0]<<" "<<pbuf[1]<<" "<<pbuf[2]<<endl;
504 for( ; TMath::Abs(dx)>=.5; dx*=.8 ){
505 AliExternalTrackParam endParam = *trackParam;
506 //if( !endParam.PropagateTo(x0+dx, gSolenoidField) ) continue;
507 AliHLTTPCCATrackParam t;
508 t.SetExtParam(endParam, gSolenoidField );
509 if( !t.TransportToX(x0+dx) ) continue;
510 t.GetExtParam( endParam, endParam.GetAlpha(), gSolenoidField );
511 if( TMath::Abs(endParam.GetSnp())>.99 ) continue;
513 { // get momentum manually because trackParam->GetPxPyPz doesn't works for straight lines
515 Double_t pt= TMath::Abs(endParam.GetSigned1Pt());
516 pt = (pt>kAlmost0) ?1./pt :100.;
518 Double_t cA=TMath::Cos(endParam.GetAlpha()), sA=TMath::Sin(endParam.GetAlpha());
520 Double_t sT=endParam.GetSnp();
521 if( sT>=kAlmost1 ){ sT = kAlmost1; }
522 else if( sT<-kAlmost1 ){ sT = -kAlmost1; }
523 Double_t cT = TMath::Sqrt(TMath::Abs(1 - sT*sT));
525 endParam.GetXYZ(vbuf);
526 pbuf[0] = pt*(cT*cA - sT*sA);
527 pbuf[1] = pt*(sT*cA + cT*sA);
528 pbuf[2] = pt*endParam.GetTgl();
533 mid1Point.fV.Set(vbuf);
534 mid1Point.fP.Set(pbuf);
536 //cout<<"midPoint = "<<vbuf[0]<<" "<<vbuf[1]<<" "<<vbuf[2]<<" "<<pbuf[0]<<" "<<pbuf[1]<<" "<<pbuf[2]<<endl;
539 for( ; TMath::Abs(dx)>=.5; dx*=.8 ){
540 AliExternalTrackParam endParam = *trackParam;
541 //if( !endParam.PropagateTo(x0+dx, gSolenoidField) ) continue;
542 AliHLTTPCCATrackParam t;
543 t.SetExtParam(endParam, gSolenoidField );
544 if( !t.TransportToX(x0+dx) ) continue;
545 t.GetExtParam( endParam, endParam.GetAlpha(), gSolenoidField );
546 if( TMath::Abs(endParam.GetSnp())>.99 ) continue;
548 { // get momentum manually because trackParam->GetPxPyPz doesn't works for straight lines
550 Double_t pt= TMath::Abs(endParam.GetSigned1Pt());
551 pt = (pt>kAlmost0) ?1./pt :100.;
553 Double_t cA=TMath::Cos(endParam.GetAlpha()), sA=TMath::Sin(endParam.GetAlpha());
555 Double_t sT=endParam.GetSnp();
556 if( sT>=kAlmost1 ){ sT = kAlmost1; }
557 else if( sT<-kAlmost1 ){ sT = -kAlmost1; }
558 Double_t cT = TMath::Sqrt(TMath::Abs(1 - sT*sT));
560 endParam.GetXYZ(vbuf);
561 pbuf[0] = pt*(cT*cA - sT*sA);
562 pbuf[1] = pt*(sT*cA + cT*sA);
563 pbuf[2] = pt*endParam.GetTgl();
568 midPoint.fV.Set(vbuf);
569 midPoint.fP.Set(pbuf);
571 track->AddPathMark( startPoint );
572 track->AddPathMark( midPoint );
573 track->AddPathMark( mid1Point );
574 track->AddPathMark( endPoint );
575 track->AddPathMark( decPoint );
577 //PH The line below is replaced waiting for a fix in Root
578 //PH which permits to use variable siza arguments in CINT
579 //PH on some platforms (alphalinuxgcc, solariscc5, etc.)
580 //PH track->SetName(Form("ESDTrack %d", rt.label));
581 //PH track->SetTitle(Form("pT=%.3f, pZ=%.3f; V=(%.3f, %.3f, %.3f)",
582 //PH rt.sign*TMath::Hypot(rt.P.x, rt.P.y), rt.P.z,
583 //PH rt.V.x, rt.V.y, rt.V.z));
585 sprintf(form,"TEveTrack %d", rt.fIndex);
586 track->SetName(form);
587 track->SetStdTitle();
591 //****************************************************************************
592 Int_t processTPCTracks(AliHLTHOMERBlockDesc* block) {
594 TTree *tr = (TTree*) block->GetTObject();
596 // ofstream fout("ESD_TPC.dat",ios::binary);
597 // fout.write((char*)block->GetData(),block->GetSize());
599 TFile f("ESD_TPC.root","recreate");
603 TFile* esdFile = TFile::Open("ESD_TPC.root");
605 AliESDEvent* esd = new AliESDEvent();
606 TTree* tree = (TTree*) esdFile->Get("esdTree");
607 esd->ReadFromTree(tree);
608 //tr->SetBranchAddress("ESD", &esd);
609 // if(tr->GetBranch("ESD"))
614 TEveTrackPropagator* rnrStyle = gTPCTrack->GetPropagator();
615 rnrStyle->SetMagField( 0.1*esd->GetMagneticField() );
616 gSolenoidField = esd->GetMagneticField();
618 cout << "Number of tracks found :" << esd->GetNumberOfTracks() << endl;
622 for (Int_t ii=0; ii< esd->GetNumberOfTracks(); ii++) {
624 AliESDtrack *esdTrack = esd->GetTrack(ii);
625 AliExternalTrackParam *trackParam = esdTrack;
626 cout<<"\nESD track N"<<ii<<":"<<endl;
629 TEveTrack* track = makeESDTrack( rnrStyle, ii, esdTrack, trackParam );
630 esdTrack->GetPxPyPz(pin);
632 //cout<<"pt : "<<sqrt(pin[0]*pin[0] + pin[1]*pin[1])<<endl;
633 track->SetAttLineAttMarker(gTPCTrack);
634 gEve->AddElement(track, gTPCTrack);
642 //****************************************************************************
643 Int_t processSPDRawData(AliHLTHOMERBlockDesc* block) {
646 Int_t partition = block->GetSubDetector().Atoi();
647 Int_t eqId = partition;
649 gMemReader->SetMemory( reinterpret_cast<UChar_t*> ( block->GetData() ), block->GetSize() );
650 gMemReader->SetEquipmentID( eqId );
653 gITSDigits->ReadRaw( gMemReader, 3);
658 //****************************************************************************
659 Int_t drawSPDRawData() {
664 TString bsSector="Sector";
666 TString bsStave="Stave";
669 Int_t sector, stave, module;
671 //gEve->DisableRedraw();
675 TEveElementList* layer1 = new TEveElementList( "SPD0" );
676 layer1->SetTitle( "SPDs' first layer" );
677 layer1->SetMainColor(2);
678 gEve->AddElement( layer1 );
680 for ( sector=0; sector<10; sector++ ) {
684 TEveElementList* relSector = new TEveElementList( sSector.Data() );
685 relSector->SetMainColor(2);
686 gEve->AddElement( relSector, layer1 );
688 for ( stave=0; stave<2; stave++ ) {
692 TEveElementList* relStave = new TEveElementList( sStave.Data() );
693 relStave->SetMainColor(2);
694 gEve->AddElement( relStave, relSector );
696 for ( module=0; module<4; module++ ) {
698 if ( gITSDigits->GetDigits( ndx, 0 ) &&
699 gITSDigits->GetDigits( ndx, 0 )->GetEntriesFast() > 0) {
701 AliEveITSModule* moduleITS = new AliEveITSModule( ndx, gITSDigits );
702 gEve->AddElement( moduleITS, relStave );
707 } // for ( module=0; module<4; module++ ) {
708 } // for ( stave=0; stave<2; stave++ ) {
709 } // for ( sector=0; sector<10; sector++ ) {
711 // ** second layer **
713 TEveElementList* layer2 = new TEveElementList( "SPD1" );
714 layer2->SetTitle( "SPDs' second layer" );
715 layer2->SetMainColor(2);
716 gEve->AddElement(layer2);
718 for ( sector=0; sector<10; sector++ ) {
722 TEveElementList* relSector = new TEveElementList( sSector.Data() );
723 relSector->SetMainColor(2);
724 gEve->AddElement(relSector, layer2 );
726 for ( stave=0; stave<4; stave++ ) {
730 TEveElementList* relStave = new TEveElementList( sStave.Data() );
731 relStave->SetMainColor(2);
732 gEve->AddElement( relStave, relSector );
734 for ( module=0; module<4; module++) {
736 if ( gITSDigits->GetDigits( ndx, 0 ) &&
737 gITSDigits->GetDigits( ndx, 0 )->GetEntriesFast() > 0) {
739 AliEveITSModule* moduleITS = new AliEveITSModule( ndx, gITSDigits );
740 gEve->AddElement( moduleITS, relStave );
744 } // for ( module=0; module<4; module++) {
745 } // for ( stave=0; stave<2; stave++ ) {
746 } //for ( sector=0; sector<10; sector++ ) {
748 gEve->EnableRedraw();
753 //****************************************************************************
754 Int_t processMUONClusters(AliHLTHOMERBlockDesc* block) {
757 unsigned long size = block->GetSize();
760 // for(int idata=0;idata<int(size);idata++)
761 // printf("\tbuffer[%d] : %d\n",idata,buffer[idata]);
763 buffer = (int *)block->GetData();
765 if(block->GetDataType().CompareTo("RECHITS") == 0){
767 AliHLTMUONRecHitsBlockReader trackblock((char*)buffer, size);
768 const AliHLTMUONRecHitStruct* hit = trackblock.GetArray();
770 for(AliHLTUInt32_t ientry = 0; ientry < trackblock.Nentries(); ientry++){
771 // cout << setw(13) << left << hit->fX << setw(0);
772 // cout << setw(13) << left << hit->fY << setw(0);
773 // cout << hit->fZ << setw(0) << endl;
774 gMUONClusters->SetNextPoint(hit->fX,hit->fY,hit->fZ);
781 // if(!strcmp((BlockType(ULong64_t(reader->GetBlockDataType(i)))).Data(),"TRIGRECS")){
783 AliHLTMUONTriggerRecordsBlockReader trigblock(buffer, size);
784 const AliHLTMUONTriggerRecordStruct* trigrec = trigblock.GetArray();
785 for(AliHLTUInt32_t ientry = 0; ientry < trigblock.Nentries(); ientry++){
787 const AliHLTMUONRecHitStruct* hit = &trigrec->fHit[0];
788 for(AliHLTUInt32_t ch = 0; ch < 4; ch++)
790 // cout << setw(10) << left << ch + 11 << setw(0);
791 // cout << setw(13) << left << hit->fX << setw(0);
792 // cout << setw(13) << left << hit->fY << setw(0);
793 // cout << hit->fZ << setw(0) << endl;
794 gMUONClusters->SetNextPoint(hit->fX,hit->fY,hit->fZ);
796 }// trig chamber loop
802 // //delete[] buffer;
803 // }//nof Block received
804 // }// if any event found
814 //****************************************************************************