From 36782fc001be02538a56255b13f787ad74b8d4da Mon Sep 17 00:00:00 2001 From: richterm Date: Tue, 20 Feb 2007 16:08:18 +0000 Subject: [PATCH] Jochen Thaeder: Online Display of Heidelberg tracking ws Jan07 --- .../OnlineDisplay/AliHLTTPCDisplay3D.cxx | 269 ++++------- HLT/TPCLib/OnlineDisplay/AliHLTTPCDisplay3D.h | 1 - .../OnlineDisplay/AliHLTTPCDisplayFront.cxx | 10 +- .../OnlineDisplay/AliHLTTPCDisplayFront.h | 47 +- .../OnlineDisplay/AliHLTTPCDisplayMain.cxx | 443 +++++++----------- .../OnlineDisplay/AliHLTTPCDisplayMain.h | 203 +++++++- .../OnlineDisplay/AliHLTTPCDisplayPad.cxx | 2 +- .../OnlineDisplay/AliHLTTPCDisplayPad.h | 2 +- .../OnlineDisplay/AliHLTTPCDisplayPadRow.cxx | 14 +- .../OnlineDisplay/AliHLTTPCDisplayPadRow.h | 3 +- 10 files changed, 486 insertions(+), 508 deletions(-) diff --git a/HLT/TPCLib/OnlineDisplay/AliHLTTPCDisplay3D.cxx b/HLT/TPCLib/OnlineDisplay/AliHLTTPCDisplay3D.cxx index 5c08d3f7493..6a94ad08eff 100644 --- a/HLT/TPCLib/OnlineDisplay/AliHLTTPCDisplay3D.cxx +++ b/HLT/TPCLib/OnlineDisplay/AliHLTTPCDisplay3D.cxx @@ -148,7 +148,50 @@ void AliHLTTPCDisplay3D::Draw(){ fGeom->Draw(""); } // END - DRAW 3D GEOMETRY + //-------------------------------------------------------------------------------------------- + // DRAW 3D PadRow + //-------------------------------------------------------------------------------------------- + if (fDisplay->ExistsRawData() && fDisplay->Get3DSwitchPadRow() && fDisplay->GetDisplaySlice(fDisplay->GetSlicePadRow())){ + + // -- only one padrow + if ( fDisplay->Get3DSwitchRaw() == 1 ) { + fDisplay->GetPadRowPointer()->Draw3D(); + } + // show all padrows + else { + Int_t nRawdata = 0; + TPolyMarker3D *pmRawdata = new TPolyMarker3D(1,6); + pmRawdata->SetBit(kCanDelete); + + if ( fDisplay->GetZeroSuppression() ){ + for (Int_t row=0; row < AliHLTTPCTransform::GetNRows(); row++){ + for (Int_t pad=0; pad < AliHLTTPCTransform::GetNPads(row); pad++){ + for (Int_t timeBin=fDisplay->GetTimeBinMin(); timeBin <= fDisplay->GetTimeBinMax(); timeBin++){ + + Int_t time = (Int_t) fDisplay->fRawDataZeroSuppressed[row][pad][timeBin]; + + if (time != 0) { + Float_t xyz[3]; + + AliHLTTPCTransform::RawHLT2Global(xyz,fDisplay->GetSlicePadRow(), row, pad, timeBin); + + pmRawdata->SetPoint(nRawdata,xyz[0],xyz[1],xyz[2]); + nRawdata++; + } + } // end time + } // end pad + } // end row + } + + pmRawdata->SetMarkerSize(1); + pmRawdata->SetMarkerColor(6); + pmRawdata->Draw("same"); + + } // end show all padrows + + } + //-------------------------------------------------------------------------------------------- // DRAW 3D CLUSTER //-------------------------------------------------------------------------------------------- @@ -279,24 +322,34 @@ void AliHLTTPCDisplay3D::Draw(){ xyzL[1] = gtrack->GetLastPointY(); xyzL[2] = gtrack->GetLastPointZ(); + if ( xyzL[0] == xyzF[0] ) continue; + if ( xyzL[1] == xyzF[1] ) continue; + if ( xyzL[2] == xyzF[2] ) continue; + + #if FIRSTLASTPOINT - // TPolyMarker3D *pmL = new TPolyMarker3D(1,2); - //TPolyMarker3D *pmF = new TPolyMarker3D(1,2); + TPolyMarker3D *pmL = new TPolyMarker3D(1,2); + TPolyMarker3D *pmF = new TPolyMarker3D(1,2); + pmL->SetBit(kCanDelete); + pmF->SetBit(kCanDelete); - TPolyMarker3D pmL(1,2); - TPolyMarker3D pmF(1,2); + //TPolyMarker3D pmL(1,2); + //TPolyMarker3D pmF(1,2); - pmF.SetPoint(0,xyzF[0],xyzF[1],xyzF[2]); - pmL.SetPoint(0,xyzL[0],xyzL[1],xyzL[2]); + pmF->SetPoint(0,xyzF[0],xyzF[1],xyzF[2]); + pmL->SetPoint(0,xyzL[0],xyzL[1],xyzL[2]); #endif Double_t s = 0.; // length of the track - if ( AliHLTTPCTransform::GetBFieldValue() == 0.) + //if ( AliHLTTPCTransform::GetBFieldValue() == 0.) + if ( radius == 999999.0){ // IVAN HACK + s = sqrt ( (xyzL[0] - xyzF[0])*(xyzL[0] - xyzF[0]) + (xyzL[1] - xyzF[1])*(xyzL[1] - xyzF[1]) ); - else { + } + else { // Calculate the length of the track. If it is to flat in in s,z plane use sxy, otherwise use sz if (fabs(lambda) > 0.05){ // length of track calculated out of z @@ -349,13 +402,18 @@ void AliHLTTPCDisplay3D::Draw(){ } - if ( AliHLTTPCTransform::GetBFieldValue() == 0.) { + // if ( AliHLTTPCTransform::GetBFieldValue() == 0.) { + + if ( radius == 999999.0) { // IVAN HACK + // cout << "ENTER IVAN 2 radius="<< radius << endl; for (Double_t ds = 0.; ds < s; ds = ds + DRAWSTEP){ // FILL ARRAYS IN ORDER TO DRAW THE TRACKPOINTS, OUT OF THE PARAMETER - xT[trackPointCounter] = xyzF[0] + ds * cos(phi0); - yT[trackPointCounter] = xyzF[1] + ds * sin(phi0); - zT[trackPointCounter] = xyzF[2] + ds * sin(lambda); + // xT[trackPointCounter] = xyzF[0] + ds * cos(phi0); + // yT[trackPointCounter] = xyzF[1] + ds * sin(phi0); + xT[trackPointCounter] = xyzF[0] + ds * cos(phi0 - 1.57); + yT[trackPointCounter] = xyzF[1] + ds * sin(phi0 - 1.57); + zT[trackPointCounter] = xyzF[2] + ds * sin(lambda); #if TRACKPOLYMARKER pmT.SetPoint(trackPointCounter,xT[trackPointCounter],yT[trackPointCounter],zT[trackPointCounter]); #endif @@ -364,9 +422,12 @@ void AliHLTTPCDisplay3D::Draw(){ if (trackPointCounter > nTrackPoints) printf("N=%d n=%d", nTrackPoints,trackPointCounter); else { - xT[trackPointCounter] = xyzF[0] + s * cos(phi0); - yT[trackPointCounter] = xyzF[1] + s * sin(phi0); - zT[trackPointCounter] = xyzF[2] + s * sin(lambda); + //xT[trackPointCounter] = xyzF[0] + s * cos(phi0); + //yT[trackPointCounter] = xyzF[1] + s * sin(phi0); + + xT[trackPointCounter] = xyzF[0] + s * cos(phi0 - 1.57); + yT[trackPointCounter] = xyzF[1] + s * sin(phi0 - 1.57); + zT[trackPointCounter] = xyzF[2] + s * sin(lambda); #if TRACKPOLYMARKER pmT.SetPoint(trackPointCounter,xT[trackPointCounter],yT[trackPointCounter],zT[trackPointCounter]); #endif @@ -414,14 +475,14 @@ void AliHLTTPCDisplay3D::Draw(){ // --- ADDITIONAL DRAW OPTIONS #if FIRSTLASTPOINT // Draw last point of Track - pmL.SetMarkerSize(3); - pmL.SetMarkerColor(4); - pmL.Draw(); + pmL->SetMarkerSize(3); + pmL->SetMarkerColor(4); + pmL->Draw(); // Draw first point of Track - pmF.SetMarkerSize(3); - pmF.SetMarkerColor(5); - pmF.Draw(); + pmF->SetMarkerSize(3); + pmF->SetMarkerColor(5); + pmF->Draw(); #endif #if TRACKPOLYMARKER // Draw Track -- as polymarker @@ -476,142 +537,7 @@ void AliHLTTPCDisplay3D::Draw(){ } // END - DRAW 3D Tracks - - //-------------------------------------------------------------------------------------------- - // DRAW 3D PadRow - //-------------------------------------------------------------------------------------------- - if (fDisplay->ExistsRawData() && fDisplay->Get3DSwitchPadRow() && fDisplay->GetDisplaySlice(fDisplay->GetSlicePadRow())){ - - // -- only one padrow - if ( fDisplay->Get3DSwitchRaw() == 0 ) { - - fDisplay->GetPadRowPointer()->Draw3D(); - } - // show all padrows - else { - -#if defined(HAVE_HOMERREADER) - HOMERReader* reader = (HOMERReader*)fDisplay->fReader; - - char* rawID = "KPWR_LDD"; - ULong_t blk; - blk = reader->FindBlockNdx( rawID, " CPT",0xFFFFFFFF ); - - Int_t NRawPoints = 0; - TPolyMarker3D* pm = new TPolyMarker3D( ); - pm->SetBit(kCanDelete); - pm->SetMarkerColor(51); - - while ( blk != ~(ULong_t)0 ) { - -#if DEBUG - printf( "Found raw data block %lu\n", blk ); -#endif - // Check for corrupt data -#if HOMER_VERSION >= 2 - AliHLTUInt64_t corruptFlag = reader->GetBlockStatusFlags( blk ); - if (corruptFlag & 0x00000001) { - LOG(AliHLTTPCLog::kError,"AliHLTTPCDisplayMain::ReadData","Block status flags") << "Data block is corrupt"<GetBlockData( blk ); - unsigned long rawDataLen = reader->GetBlockDataLength( blk ); - - ULong_t spec = reader->GetBlockDataSpec( blk ); - Int_t patch = AliHLTTPCDefinitions::GetMinPatchNr( spec ); - Int_t slice = AliHLTTPCDefinitions::GetMinSliceNr( spec ); -#if DEBUG - printf( "Raw data found for slice %u - patch %u\n", slice, patch ); -#endif - - // slice should(not) be displayed - if (!fDisplay->GetDisplaySlice(slice)) continue; - - -#if defined(HAVE_TPC_MAPPING) - AliHLTTPCDigitReaderRaw digitReader(0); - - bool readValue = true; - Int_t rowOffset = 0; - - // Initialize RAW DATA - Int_t firstRow = AliHLTTPCTransform::GetFirstRow(patch); - Int_t lastRow = AliHLTTPCTransform::GetLastRow(patch); - - // Outer sector, patches 2, 3, 4, 5 - start counting in patch 2 with row 0 - if ( patch >= 2 ) rowOffset = AliHLTTPCTransform::GetFirstRow( 2 ); - - // Initialize block for reading packed data - void* tmpDataBlock = (void*) rawDataBlock; - digitReader.InitBlock(tmpDataBlock,rawDataLen,firstRow,lastRow,patch,slice); - - readValue = digitReader.Next(); - - if (!readValue){ - LOG(AliHLTTPCLog::kError,"AliHLTTPCDisplayPadRow::Fill","Read first value") << "No value in data block" << ENDLOG; - continue; - } - - - // blk = reader->FindBlockNdx( rawID, " CPT", 0xFFFFFFFF, blk+1 ); - // continue; - - // Fill 3D Raw Data - while ( readValue ){ - - Int_t row = digitReader.GetRow() + rowOffset; - - UChar_t pad = digitReader.GetPad(); - UShort_t time = digitReader.GetTime(); - UInt_t charge = digitReader.GetSignal(); - if ( charge < 50 ) { - // read next value - readValue = digitReader.Next(); - - if(!readValue) break; //No more value - continue; - } - Float_t xyz[3]; - - // Transform raw coordinates to local coordinates - AliHLTTPCTransform::RawHLT2Global(xyz, slice, row, pad, time); - - NRawPoints++; - pm->SetNextPoint((Double_t)xyz[0],(Double_t)xyz[1],(Double_t)xyz[2]); - - // printf("%u points\n",NRawPoints); - - // read next value - readValue = digitReader.Next(); - - if(!readValue) break; //No more value - } // end while ( readValue ){ - - -#else //! defined(HAVE_TPC_MAPPING) - HLTFatal("DigitReaderRaw not available - check your build"); -#endif //defined(HAVE_TPC_MAPPING) - - blk = reader->FindBlockNdx( rawID, " CPT", 0xFFFFFFFF, blk+1 ); - - } // end while ( blk != ~(ULong_t)0 ) { - pm->Draw(); -#else - HLTFatal("HOMER reader not available"); -#endif // defined(HAVE_HOMERREADER) - - - ////////////////////////////// - - - - - } // end show all padrows - - } - + //-------------------------------------------------------------------------------------------- // DRAW 3D //-------------------------------------------------------------------------------------------- @@ -625,34 +551,10 @@ void AliHLTTPCDisplay3D::Draw(){ fDisplay->GetCanvas3D()->SetPhi(fDisplay->GetPhi()); } - fDisplay->GetCanvas3D()->Modified(); - fDisplay->GetCanvas3D()->Update(); -} + // fDisplay->GetCanvas3D()->Modified(); -//____________________________________________________________________________________________________ -void AliHLTTPCDisplay3D::DrawGeomSector(Int_t sector) { - /* - Char_t fname[256]; - Int_t realsector = sector;// % 18; - - if (realsector < 10){ - sprintf(fname,"LS0%d",realsector); - fGeom->GetNode(fname)->SetLineColor(fDisplay->GetLineColor()); - fGeom->GetNode(fname)->Draw("same"); - sprintf(fname,"US0%d",realsector); - fGeom->GetNode(fname)->SetLineColor(fDisplay->GetLineColor()); - fGeom->GetNode(fname)->Draw("same"); - } - else { - sprintf(fname,"LS%d",realsector); - fGeom->GetNode(fname)->SetLineColor(fDisplay->GetLineColor()); - fGeom->GetNode(fname)->Draw("same"); - sprintf(fname,"US%d",realsector); - fGeom->GetNode(fname)->SetLineColor(fDisplay->GetLineColor()); - fGeom->GetNode(fname)->Draw("same"); - } + fDisplay->GetCanvas3D()->Update(); - */ } //____________________________________________________________________________________________________ @@ -668,6 +570,5 @@ void AliHLTTPCDisplay3D::LoadGeometrie(Char_t *gfile) { fGeom = (TGeometry*)file->Get("AliceGeom"); file->Close(); - //delete file; #### } } diff --git a/HLT/TPCLib/OnlineDisplay/AliHLTTPCDisplay3D.h b/HLT/TPCLib/OnlineDisplay/AliHLTTPCDisplay3D.h index 6d854f1c5a6..be15f4c9705 100644 --- a/HLT/TPCLib/OnlineDisplay/AliHLTTPCDisplay3D.h +++ b/HLT/TPCLib/OnlineDisplay/AliHLTTPCDisplay3D.h @@ -50,7 +50,6 @@ class AliHLTTPCDisplay3D : public AliHLTLogging { // --------------------------------------------------- private: void LoadGeometrie(Char_t *gfile); - void DrawGeomSector(Int_t sector); AliHLTTPCDisplayMain* fDisplay; diff --git a/HLT/TPCLib/OnlineDisplay/AliHLTTPCDisplayFront.cxx b/HLT/TPCLib/OnlineDisplay/AliHLTTPCDisplayFront.cxx index 452bef288f9..b3817bacea9 100644 --- a/HLT/TPCLib/OnlineDisplay/AliHLTTPCDisplayFront.cxx +++ b/HLT/TPCLib/OnlineDisplay/AliHLTTPCDisplayFront.cxx @@ -105,7 +105,7 @@ void AliHLTTPCDisplayFront::Save(){ } //____________________________________________________________________________________________________ -void AliHLTTPCDisplayFront::Fill(Int_t patch, ULong_t dataBlock, ULong_t dataLen){ +void AliHLTTPCDisplayFront::Fill() { // Fill Pad Histogram Int_t timeSwitch = fDisplay->GetFrontDataSwitch(); @@ -253,8 +253,9 @@ void AliHLTTPCDisplayFront::Fill(Int_t patch, ULong_t dataBlock, ULong_t dataLen } // end - else of if ( fDisplay->GetZeroSuppression() ){ +#if 0 if (fDisplay->ExistsClusterData()){ - for (patch=0; patch < 6; patch++){ + for (Int_t patch=0; patch < 6; patch++){ AliHLTTPCSpacePointData *points = fDisplay->GetSpacePointDataPointer(fDisplay->GetSlicePadRow(),patch); if(!points) return; @@ -276,12 +277,13 @@ void AliHLTTPCDisplayFront::Fill(Int_t patch, ULong_t dataBlock, ULong_t dataLen } } } // END if (fDisplay->ExistsClusterData()){ - +#endif } //____________________________________________________________________________________________________ void AliHLTTPCDisplayFront::Draw(){ + fDisplay->GetCanvasFront()->cd(); fDisplay->GetCanvasFront()->Clear(); @@ -316,8 +318,6 @@ void AliHLTTPCDisplayFront::Draw(){ fHistfrontcl->SetMarkerSize(2); fHistfrontcl->SetMarkerColor(1); fHistfrontcl->Draw("psame"); - - cout << "draw" << endl; } if (fDisplay->GetSplitFront()){ diff --git a/HLT/TPCLib/OnlineDisplay/AliHLTTPCDisplayFront.h b/HLT/TPCLib/OnlineDisplay/AliHLTTPCDisplayFront.h index 4106e41a5cb..b15aba3d479 100644 --- a/HLT/TPCLib/OnlineDisplay/AliHLTTPCDisplayFront.h +++ b/HLT/TPCLib/OnlineDisplay/AliHLTTPCDisplayFront.h @@ -21,29 +21,30 @@ class AliHLTTPCDisplayFront : public AliHLTLogging { - public: - AliHLTTPCDisplayFront(AliHLTTPCDisplayMain* display) ; - virtual ~AliHLTTPCDisplayFront(); - - void Fill(Int_t patch, ULong_t dataBlock, ULong_t dataLen); - void Draw(); - void Reset(); - void Save(); - void ExecEvent(Int_t event, Int_t x, Int_t y, TObject *selected); - - private: - AliHLTTPCDisplayMain* fDisplay; - TCanvas * fCanvas; - - TH2F *fHistfront; // histogram for front view of one slice - TH1F *fHistfrontcl; // histogram for cluster in front - Int_t fNTimes; - - Int_t fBinX[2]; // Minimum / Maximum - Bin on X Axis - Int_t fBinY[2]; // Minimum / Maximum - Bin on Y Axis - Int_t fTmpEvent; // Tmp Event for get user range on Axis - - ClassDef(AliHLTTPCDisplayFront,0) +public: + AliHLTTPCDisplayFront(AliHLTTPCDisplayMain* display) ; + virtual ~AliHLTTPCDisplayFront(); + + + void Fill(); + void Draw(); + void Reset(); + void Save(); + void ExecEvent(Int_t event, Int_t x, Int_t y, TObject *selected); + +private: + AliHLTTPCDisplayMain* fDisplay; + TCanvas * fCanvas; + + TH2F *fHistfront; // histogram for front view of one slice + TH1F *fHistfrontcl; // histogram for cluster in front + Int_t fNTimes; + + Int_t fBinX[2]; // Minimum / Maximum - Bin on X Axis + Int_t fBinY[2]; // Minimum / Maximum - Bin on Y Axis + Int_t fTmpEvent; // Tmp Event for get user range on Axis + + ClassDef(AliHLTTPCDisplayFront,0) }; #endif // ALIHLTTPCDISPLAYFRONT_H diff --git a/HLT/TPCLib/OnlineDisplay/AliHLTTPCDisplayMain.cxx b/HLT/TPCLib/OnlineDisplay/AliHLTTPCDisplayMain.cxx index 98c05782c3a..dcf476a0b04 100644 --- a/HLT/TPCLib/OnlineDisplay/AliHLTTPCDisplayMain.cxx +++ b/HLT/TPCLib/OnlineDisplay/AliHLTTPCDisplayMain.cxx @@ -1,18 +1,26 @@ -// $Id$ - -/** \class AliHLTTPCDisplayMain -
-//_____________________________________________________________
-// AliHLTTPCDisplayMain
-//
-// Display class for the HLT events.
-
+/************************************************************************** + * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * * + * Authors: Jochen Thaeder * + * for The ALICE Off-line Project. * + * * + * Permission to use, copy, modify and distribute this software and its * + * documentation strictly for non-commercial purposes is hereby granted * + * without fee, provided that the above copyright notice appears in all * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * + * about the suitability of this software for any purpose. It is * + * provided "as is" without express or implied warranty. * + **************************************************************************/ + +/** @file AliHLTTPCDisplayMain.cxx + @author Jochen Thaeder + @date + @brief Interface class for ALICE HLT online Display */ -// Author: Jochen Thaeder -//*-- Copyright © ALICE HLT Group -#define DEBUG 0 +#define DEBUG 0 #if defined(HAVE_HOMERREADER) #include "HOMERReader.h" @@ -61,9 +69,20 @@ ClassImp(AliHLTTPCDisplayMain) AliHLTTPCDisplayMain::AliHLTTPCDisplayMain(void* pt2GUI, void (*pt2Function)(void*, Int_t)) { //constructor + AliHLTLogging::SetGlobalLogLevel(kHLTLogError); + + fCanvasArray = new TCanvas* [nCanvasTypes]; + fWorkerArray = new void* [nWorkerTypes]; + // set N of TimeBins fgNTimeBins = 1024; // 446 or 1024 + fRawReaderMode = 0; + fZeroSuppressionThreshold = 10; + fOccupancyLimit = 1.0; + fBField = 0.4; + fNTimeBins = 1024; + //callback handler fPt2Gui = pt2GUI; fPadCallback = pt2Function; @@ -73,7 +92,6 @@ AliHLTTPCDisplayMain::AliHLTTPCDisplayMain(void* pt2GUI, void (*pt2Function)(voi fConnect = kFALSE; fEventID = 0; - fDisplayCharge = NULL; fDisplayPadRow = NULL; fDisplayPad = NULL; @@ -163,12 +181,18 @@ AliHLTTPCDisplayMain::AliHLTTPCDisplayMain(void* pt2GUI, void (*pt2Function)(voi //____________________________________________________________________________________________________ AliHLTTPCDisplayMain::~AliHLTTPCDisplayMain() { - //destructor - if ( fTracks ) delete fTracks; - fTracks = NULL; + //destructor + if ( fTracks ) delete fTracks; + fTracks = NULL; + + if ( fCanvasArray ) delete fTracks; + fTracks = NULL; + + if ( fWorkerArray ) delete fWorkerArray; + fWorkerArray = NULL; #if defined(HAVE_HOMERREADER) - HOMERReader* reader= (HOMERReader*) fReader; + HOMERReader* reader= (HOMERReader*) fReader; if (reader) delete reader; @@ -251,12 +275,13 @@ Int_t AliHLTTPCDisplayMain::Connect( unsigned int cnt, const char** hostnames, u // -- ERROR HANDLING for HOMER (error codes and empty blocks) // -------------------------------------------------------------- Int_t ret1 = reader->ReadNextEvent(3000000); // timeout in microseconds (3s) + if ( ret1 ) { Int_t ndx = reader->GetErrorConnectionNdx(); - if ( ret1 == 111 || ret1 == 32 || ret1 == 6 ) { + if ( ret1 == 111 || ret1 == 32 ) { HLTError( "Error, No Connection to source %d: %s (%d)\n", ndx, strerror(ret1), ret1 ); - + delete reader; reader = NULL; @@ -264,15 +289,15 @@ Int_t AliHLTTPCDisplayMain::Connect( unsigned int cnt, const char** hostnames, u } else if (ret1 == 110){ HLTError( "Timout occured, reading event from source %d: %s (%d)\n", ndx, strerror(ret1), ret1 ); - + delete reader; reader = NULL; return -2; } - else if ( ret1 == 56) { + else if ( ret1 == 56 || ret1 == 6 ) { HLTError( "Error reading event from source %d: %s (%d) -- RETRY\n", ndx, strerror(ret1), ret1 ); - + delete reader; reader = NULL; @@ -280,7 +305,7 @@ Int_t AliHLTTPCDisplayMain::Connect( unsigned int cnt, const char** hostnames, u } else { HLTError( "General Error reading event from source %d: %s (%d)\n", ndx, strerror(ret1), ret1 ); - + delete reader; reader = NULL; @@ -306,7 +331,7 @@ Int_t AliHLTTPCDisplayMain::Connect( unsigned int cnt, const char** hostnames, u void *tmp11 = tmp1; ULong64_t* tmp12 = (ULong64_t*)tmp11; *tmp12 = reader->GetBlockDataType( i ); - cout << "XXX=" << tmp1 << endl; + if (!strcmp(tmp1,padrowID)) fExistsRawData = kTRUE; else if (!strcmp(tmp1,spptID)) fExistsClusterData = kTRUE; else if (!strcmp(tmp1,trkID)) fExistsTrackData = kTRUE; @@ -326,7 +351,7 @@ Int_t AliHLTTPCDisplayMain::Connect( unsigned int cnt, const char** hostnames, u // Check if necessary data types are present // ------------------------------------------------------------------------------------ fDisplay3D = new AliHLTTPCDisplay3D(this, gfile); - + if (ExistsRawData()){ fDisplayPadRow = new AliHLTTPCDisplayPadRow(this); fDisplayPad = new AliHLTTPCDisplayPad(this); @@ -341,11 +366,13 @@ Int_t AliHLTTPCDisplayMain::Connect( unsigned int cnt, const char** hostnames, u fDisplayResiduals = new AliHLTTPCDisplayResiduals(this); } - return 0; + #else HLTFatal("HOMER reader not available"); -#endif // defined(HAVE_HOMERREADER) +#endif // defined(HAVE_HOMERREADER) + + return 0; } //____________________________________________________________________________________________________ @@ -372,6 +399,7 @@ Int_t AliHLTTPCDisplayMain::ReadData(Bool_t nextSwitch){ #if defined(HAVE_HOMERREADER) HOMERReader* reader = (HOMERReader*)fReader; + Char_t* spptID="SRETSULC"; // CLUSTERS Char_t* trkID = "SGESKART"; // TRAKSEGS @@ -414,12 +442,12 @@ Int_t AliHLTTPCDisplayMain::ReadData(Bool_t nextSwitch){ } } // end if (nextSwitch) - // -- Set blockCnt and eventID + // -- Get blockCnt and eventID // ------------------------------- ULong_t blockCnt = reader->GetBlockCnt(); fEventID = (ULong64_t)reader->GetEventID(); - HLTDebug( "Event 0x%016LX (%Lu) with %lu blocks\n", (ULong64_t)reader->GetEventID(), (ULong64_t)reader->GetEventID(), blockCnt ); + HLTError( "Event 0x%016LX (%Lu) with %lu blocks\n", (ULong64_t)reader->GetEventID(), (ULong64_t)reader->GetEventID(), blockCnt ); // Loop for Debug only for ( ULong_t i = 0; i < blockCnt; i++ ) { @@ -433,7 +461,7 @@ Int_t AliHLTTPCDisplayMain::ReadData(Bool_t nextSwitch){ ULong_t* tmp22 = (ULong_t*)tmp21; *tmp22 = reader->GetBlockDataOrigin( i ); - HLTDebug( "Block %lu length: %lu - type: %s - origin: %s\n",i, reader->GetBlockDataLength( i ), tmp1, tmp2 ); + HLTError( "Block %lu length: %lu - type: %s - origin: %s\n",i, reader->GetBlockDataLength( i ), tmp1, tmp2 ); } // end for ( ULong_t i = 0; i < blockCnt; i++ ) { @@ -469,142 +497,13 @@ void AliHLTTPCDisplayMain::DisplayEvent(Bool_t newRawSlice){ fDisplayPad->Reset(); fDisplayFront->Reset(); - char* rawID = "KPWR_LDD"; - Int_t padrowpatch = AliHLTTPCTransform::GetPatch(fPadRow); - Int_t maxpadrowpatch = padrowpatch; - - - if (newRawSlice) { - printf("=!=!=!=!=!= READ NEW ARRAY!\n"); - ReadRawData(); - } - - if (fPadRow == 30 || fPadRow == 90 || fPadRow == 139) maxpadrowpatch++; - - for (Int_t patch=0; patch < 6; patch++){ - unsigned long blk; - AliHLTUInt32_t rawSpec = AliHLTTPCDefinitions::EncodeDataSpecification( (AliHLTUInt8_t) fSlicePadRow, (AliHLTUInt8_t) fSlicePadRow, - (AliHLTUInt8_t) patch,(AliHLTUInt8_t) patch ); - // READ RAW DATA BLOCK - blk = reader->FindBlockNdx( rawID, " CPT", rawSpec ); - - if ( ~(unsigned long)0 != blk ){ - -#if HOMER_VERSION >= 2 - // Check for corrupt data - AliHLTUInt64_t corruptFlag = reader->GetBlockStatusFlags( blk ); - if (corruptFlag & 0x00000001) { - LOG(AliHLTTPCLog::kError,"AliHLTTPCDisplayMain::ReadData","Block status flags") << "Data block is corrupt"<GetBlockData( blk ); - unsigned long rawDataLen = reader->GetBlockDataLength( blk ); - - fDisplayFront->Fill(patch, rawDataBlock, rawDataLen); - - if (patch == padrowpatch || patch == maxpadrowpatch ) { - fDisplayPadRow->Fill(patch, rawDataBlock, rawDataLen); - fDisplayPad->Fill(patch, rawDataBlock, rawDataLen); - } - } - } - -#if 0 - // -- READ raw data of one sector into 3D arrays fRawData and fRawDataZeroSuppressed - // ------------------------------------------------------------------------------------- - - // -- reset arrays - memset(fRawData, 0, 159*140*1024*sizeof(UInt_t)); - memset(fRawDataZeroSuppressed, 0, 159*140*1024*sizeof(UInt_t)); - - // -- read raw data blocks - // ----------------------- - ULong_t blk; - blk = reader->FindBlockNdx( rawID, " CPT",0xFFFFFFFF ); - - while ( blk != ~(ULong_t)0 ) { - - HLTDebug( "Found raw data block %lu\n", blk ); - - // -- Check for corrupt data - AliHLTUInt64_t corruptFlag = reader->GetBlockStatusFlags( blk ); - if (corruptFlag & 0x00000001) { - HLTError( "Data block %lu is corrupt\n",blk ); - blk = reader->FindBlockNdx( rawID, " CPT", 0xFFFFFFFF, blk+1 ); - continue; - } - - void* rawDataBlock = (void*) reader->GetBlockData( blk ); - unsigned long rawDataLen = reader->GetBlockDataLength( blk ); - - ULong_t spec = reader->GetBlockDataSpec( blk ); - Int_t patch = AliHLTTPCDefinitions::GetMinPatchNr( spec ); - Int_t slice = AliHLTTPCDefinitions::GetMinSliceNr( spec ); + if (newRawSlice) ReadRawData(); - HLTDebug( "Raw data found for slice %u - patch %u\n", slice, patch ); - // -- Wrong slice for raw data - if ( GetSlicePadRow() != slice) { - blk = reader->FindBlockNdx( rawID, " CPT", 0xFFFFFFFF, blk+1 ); - continue; - } - -#if defined(HAVE_TPC_MAPPING) - - // -- Read data out of block - AliHLTTPCDigitReaderRaw digitReader(0); - - // Initialize RAW DATA - Int_t firstRow = AliHLTTPCTransform::GetFirstRow(patch); - Int_t lastRow = AliHLTTPCTransform::GetLastRow(patch); - - // Outer sector, patches 2, 3, 4, 5 - start counting in patch 2 with row 0 - Int_t rowOffset = 0; - if ( patch >= 2 ) rowOffset = AliHLTTPCTransform::GetFirstRow( 2 ); - - // Initialize block for reading packed data - digitReader.InitBlock(rawDataBlock,rawDataLen,firstRow,lastRow,patch,slice); - - Bool_t readValue = digitReader.Next(); + fDisplayPad->Fill(); + fDisplayPadRow->Fill(); + fDisplayFront->Fill(); - if (!readValue){ - LOG(AliHLTTPCLog::kError,"AliHLTTPCDisplayPadRow::Fill","Read first value") << "No value in data block" << ENDLOG; - blk = reader->FindBlockNdx( rawID, " CPT", 0xFFFFFFFF, blk+1 ); - continue; - } - - // LOOP over raw data and fill arrays - while ( readValue ){ - - Int_t row = digitReader.GetRow() + rowOffset; - Int_t pad = (Int_t) digitReader.GetPad(); - Int_t time = (Int_t) digitReader.GetTime(); - UInt_t signal = (UInt_t) digitReader.GetSignal(); - - fRawData[row][pad][time] = signal; - fRawDataZeroSuppressed[row][pad][time] = signal; - - // -- read next value - readValue = digitReader.Next(); - - // -- No more value - if(!readValue) break; - } // end while ( readValue ){ - - -#else //! defined(HAVE_TPC_MAPPING) - HLTFatal("DigitReaderRaw not available - check your build"); -#endif //defined(HAVE_TPC_MAPPING) - - blk = reader->FindBlockNdx( rawID, " CPT", 0xFFFFFFFF, blk+1 ); - - } // end while ( blk != ~(ULong_t)0 ) { -#endif fDisplayPad->Draw(); fDisplayPadRow->Draw(); @@ -635,6 +534,8 @@ void AliHLTTPCDisplayMain::DisplayEvent(Bool_t newRawSlice){ // TAKE CARE !!! EXISTSxxxData() HANDLING of 3D will be done IN this class !!! fDisplay3D->Draw(); + + cout << "afterdraw" << endl; #else HLTFatal("HOMER raeder not available"); #endif // defined(HAVE_HOMERREADER) @@ -654,101 +555,8 @@ void AliHLTTPCDisplayMain::SaveHistograms(){ } //---------------------------------------------------------------------------------------------------- -// SETUP +// READ DATA //____________________________________________________________________________________________________ -void AliHLTTPCDisplayMain::SetupCluster(Int_t slice, Int_t patch, UInt_t nofClusters, AliHLTTPCSpacePointData* data) { - - if (data && slice>=0 && slice<36 && patch>=0 && patchGetNTracks(); - - for(Int_t j=0; jGetCheckedTrack(j); - if(!gtrack) continue; - - Int_t nHits = gtrack->GetNHits(); - UInt_t *hitnum = gtrack->GetHitNumbers(); - - for(Int_t h=0; h>25) & 0x7f; - Int_t patch = (id>>22) & 0x7; - UInt_t pos = id&0x3fffff; - - AliHLTTPCSpacePointData *points = fClusters[slice][patch]; - - if(!points) { - LOG(AliHLTTPCLog::kError,"AliHLTTPCDisplayMain::SetupTracks","Clusterarray") - <<"No points at slice "<=fNcl[slice][patch]) { - LOG(AliHLTTPCLog::kError,"AliHLTTPCDisplayMain::SetupTracks","Clusterarray") - <<"Pos is too large: pos "< maxSlice) maxSlice += 17; - - for (slice=minSlice;slice<=maxSlice;slice++){ - realslice = slice % 18; - fSliceArray[realslice] = kTRUE; - fSliceArray[realslice+18] = kTRUE; - } - - // Pair of Slices - if (fSlicePair) { - minSlice = fMinSlice + 9; - maxSlice = fMaxSlice + 9; - - if (minSlice > maxSlice) maxSlice += 17; - - for (slice=minSlice;slice<=maxSlice;slice++){ - realslice = slice % 18; - fSliceArray[realslice] = kTRUE; - fSliceArray[realslice+18] = kTRUE; - } - } -} - //____________________________________________________________________________________________________ void AliHLTTPCDisplayMain::ReadRawData(){ // -- READ raw data of one sector into 3D arrays fRawData and fRawDataZeroSuppressed @@ -769,7 +577,6 @@ void AliHLTTPCDisplayMain::ReadRawData(){ while ( blk != ~(ULong_t)0 ) { HLTDebug( "Found raw data block %lu\n", blk ); -#if HOMER_VERSION >= 2 // -- Check for corrupt data AliHLTUInt64_t corruptFlag = reader->GetBlockStatusFlags( blk ); if (corruptFlag & 0x00000001) { @@ -777,7 +584,6 @@ void AliHLTTPCDisplayMain::ReadRawData(){ blk = reader->FindBlockNdx( rawID, " CPT", 0xFFFFFFFF, blk+1 ); continue; } -#endif void* rawDataBlock = (void*) reader->GetBlockData( blk ); unsigned long rawDataLen = reader->GetBlockDataLength( blk ); @@ -797,7 +603,7 @@ void AliHLTTPCDisplayMain::ReadRawData(){ #if defined(HAVE_TPC_MAPPING) // -- Read data out of block - AliHLTTPCDigitReaderRaw digitReader(0); + AliHLTTPCDigitReaderRaw digitReader( GetRawReaderMode() ); // Initialize RAW DATA Int_t firstRow = AliHLTTPCTransform::GetFirstRow(patch); @@ -827,7 +633,7 @@ void AliHLTTPCDisplayMain::ReadRawData(){ Int_t signal=0; Int_t gatingGridOffset=50; - Int_t signalThreshold = 10; + Int_t signalThreshold = GetZeroSuppressionThreshold(); AliHLTTPCPad baseline(gatingGridOffset, GetNTimeBins() ); // just to make later conversion to a list of objects easier @@ -882,7 +688,7 @@ void AliHLTTPCDisplayMain::ReadRawData(){ if (pCurrentPad) { Float_t occupancy=pCurrentPad->GetOccupancy(); - if ( occupancy < 0.01 ) { + if ( occupancy < GetOccupancyLimit() ) { signal = pCurrentPad->GetCorrectedData(); } else { @@ -1078,6 +884,119 @@ void AliHLTTPCDisplayMain::ReadTrackData(){ #endif // defined(HAVE_HOMERREADER) } +//---------------------------------------------------------------------------------------------------- +// SETUP +//____________________________________________________________________________________________________ +void AliHLTTPCDisplayMain::SetupCluster(Int_t slice, Int_t patch, UInt_t nofClusters, AliHLTTPCSpacePointData* data) { + + if (data && slice>=0 && slice<36 && patch>=0 && patchGetNTracks(); + + for(Int_t j=0; jGetCheckedTrack(j); + if(!gtrack) continue; + + Int_t nHits = gtrack->GetNHits(); + UInt_t *hitnum = gtrack->GetHitNumbers(); + + for(Int_t h=0; h>25) & 0x7f; + Int_t patch = (id>>22) & 0x7; + UInt_t pos = id&0x3fffff; + + AliHLTTPCSpacePointData *points = fClusters[slice][patch]; + + if(!points) { + HLTError ( "No points at slice %d patch %d position %d!", slice, patch, pos ); + continue; + } + + if(pos>=fNcl[slice][patch]) { + HLTError ( "Pos is too large: pos %d ncl!", pos,fNcl[slice][patch] ); + continue; + } + points[pos].fUsed = kTRUE; + points[pos].fTrackN = j; + } + } +} + +// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + + +//---------------------------------------------------------------------------------------------------- +// SETTER +//____________________________________________________________________________________________________ + +//____________________________________________________________________________________________________ +void AliHLTTPCDisplayMain::SetSliceArray() { + Int_t slice=0; + Int_t minSlice = fMinSlice; + Int_t maxSlice = fMaxSlice; + Int_t realslice = 0; + + for (slice=0;slice< 36;slice++){ + fSliceArray[slice] = kFALSE; + } + + // Single Slice, or Range + if (minSlice > maxSlice) maxSlice += 17; + + for (slice=minSlice;slice<=maxSlice;slice++){ + realslice = slice % 18; + fSliceArray[realslice] = kTRUE; + fSliceArray[realslice+18] = kTRUE; + } + + // Pair of Slices + if (fSlicePair) { + minSlice = fMinSlice + 9; + maxSlice = fMaxSlice + 9; + + if (minSlice > maxSlice) maxSlice += 17; + + for (slice=minSlice;slice<=maxSlice;slice++){ + realslice = slice % 18; + fSliceArray[realslice] = kTRUE; + fSliceArray[realslice+18] = kTRUE; + } + } +} + + //---------------------------------------------------------------------------------------------------- // GETTER //____________________________________________________________________________________________________ diff --git a/HLT/TPCLib/OnlineDisplay/AliHLTTPCDisplayMain.h b/HLT/TPCLib/OnlineDisplay/AliHLTTPCDisplayMain.h index 5e0aaac94e8..fc2409cadf6 100644 --- a/HLT/TPCLib/OnlineDisplay/AliHLTTPCDisplayMain.h +++ b/HLT/TPCLib/OnlineDisplay/AliHLTTPCDisplayMain.h @@ -3,16 +3,15 @@ #ifndef ALIHLTTPCDISPLAYMAIN_H #define ALIHLTTPCDISPLAYMAIN_H -/** \class AliHLTTPCDisplayMain -
-//_____________________________________________________________
-// AliHLTTPCDisplayMain
-//
-// Display class for the HLT events.
-
+ +/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ + +/** @file AliHLTTPCDisplayMain.h + @author Jochen Thaeder + @date + @brief Interface class for ALICE HLT Online Display */ -// Author: Jochen Thaeder -//*-- Copyright © ALICE HLT Group #include #include @@ -30,37 +29,179 @@ class AliHLTTPCDisplay3D; class AliHLTTPCDisplayResiduals; class AliHLTTPCDisplayFront; +/** + * @class AliHLTTPCDisplayMain + * The class handels the interface between the graphical user interface (@ref AliLHLTGUI) + * and the worker classes for the ALICE HLT online display. It also handles the interface + * to the AnalysisChain via HOMER reader class. Furthermore all relavant global variables + * are stored here via get and set functions. + * @ingroup alihlt_tpc + */ + class AliHLTTPCDisplayMain : public TObject , public AliHLTLogging { - public: + public: + /** standard constructor */ + // AliHLTTPCDisplayMain(); + + /** + * Constructor + * @param pt2GUI Pointer to class AliHLTGUI + * @param pt2Dunction Pointer to callback Function class AliHLTGUI + */ AliHLTTPCDisplayMain(void* pt2GUI, void (*pt2Function)(void*, Int_t)); + + /** not a valid copy constructor, defined according to effective C++ style */ + // AliHLTTPCDisplayMain(const AliHLTTPCDisplayMain&); + /** not a valid assignment op, but defined according to effective C++ style */ + // AliHLTTPCDisplayMain& operator=(const AliHLTTPCDisplayMain&); + + /** standard destructor */ virtual ~AliHLTTPCDisplayMain(); - - Int_t Connect( unsigned int cnt, const char** hostnames, unsigned short* ports,Char_t *gfile="$(ALIHLT_BASEDIR)/geo/alice.geom" ); + + /** Methods for connecting to data sources, reading data and writeing data */ + /** ---------------------------------------------------------------------- */ + + //--> TODO check this file location + /** Connect to Analysis Chain via hosts and Ports specified in @ref AliHLTGUI + * @param cnt Number hosts + * @param hostnames Array of hostnames of the TDS + * @param ports Array of ports of the TDS + * @param gfile Path to the TPC geometry file + */ + Int_t Connect( unsigned int cnt, const char** hostnames, unsigned short* ports,Char_t *gfile="$(ALIHLT_TOPDIR)/build/share/alice-hlt/alice.geom" ); + + /** Disconnet from the Analysis Chain */ Int_t Disconnect(); + /** Reads next event and call reader for raw, clsuter and track data + * @param nextSwitch Switch for reading the next event.
+ Standard is KTRUE. + */ Int_t ReadData(Bool_t nextSwitch = kTRUE); + + /** Read raw data,do zero suppression and check for occupancy limit. Afterwards fill in two arrays (raw and zerosuppressed). */ void ReadRawData(); + + /** Read cluster data and fill cluster structure. */ void ReadClusterData(); + + /** Read track data and fill in track structure. */ void ReadTrackData(); + /** Main working function. Calls worker classes and handles displaying + * @param newrawSlice If set to kTRUE, raw data from a new slice is read and zero suppression is applied.
+ * Standard is kFALSE. + */ void DisplayEvent(Bool_t newRawSlice = kFALSE); + + /** Save all histograms as eps files **/ void SaveHistograms(); - /* - * ********************************** - * SETUP - * ********************************** + + + /** Setup methods */ + /** ------------- */ + + /** Fill cluster data in structure + * @param slice Slice ID of datablock where data is in. + * @param patch Patch ID of datablock where data is in. + * @param nofClusters Number of clusters.in data block. + * @param data Pointer to structure where cluster data is written. */ - void SetupCluster(Int_t slice, Int_t patch, UInt_t nofClusters, AliHLTTPCSpacePointData* data); + void SetupCluster(Int_t slice, Int_t patch, UInt_t nofClusters, AliHLTTPCSpacePointData* data); + + /** Fill track data in structure */ void SetupTracks(); + /** Register methods */ + /** ---------------- */ - /* - * ********************************** - * SETTER - * ********************************** + /** Canvas types + */ + enum AliHLTTPCDisplayCanvasType_t { + Ccharge, + Cpadrow, + Cpad, + CthreeD, + Cresiduals, + Cfront, + Chits_s, + Cq_track, + Cq_s, + Cpadrow_pad, + nCanvasTypes + }; + + /** Worker types + */ + enum AliHLTTPCDisplayWorkerType_t { + Wcharge, + Wpadrow, + Wpad, + WthreeD, + Wresiduals, + Wfront, + nWorkerTypes + }; + + + /** Register canvas + * @param canvasType @ref AliHLTTPCDisplayCanvasType_t + * @param canvas Pointer to TCanvas. + */ + void RegisterCanvas(AliHLTTPCDisplayCanvasType_t canvasType, TCanvas * canvas ){ + fCanvasArray[canvasType] = canvas; + } + + /** Register worker + * @param workerType @ref AliHLTTPCDisplayWorkerType_t + * @param worker Pointer to worker class. + */ + void RegisterWorker(AliHLTTPCDisplayWorkerType_t workerType, void * worker ){ + fWorkerArray[workerType] = worker; + } + + /** Get pointer to canvas + * @param canvasType @ref AliHLTTPCDisplayCanvasType_t + * @return Returns pointer to "canvasType" (@ref AliHLTTPCDisplayCanvasType_t) or NULL if fails. */ + TCanvas * GetCanvas(AliHLTTPCDisplayCanvasType_t canvasType){ + if ( !fCanvasArray[canvasType] ) + return NULL; + else + return fCanvasArray[canvasType]; + } + + /** Get pointer to worker + * @param workerType @ref AliHLTTPCDisplayWorkerType_t + * @return Returns pointer to "workerType" (@ref AliHLTTPCDisplayWorkerType_t) or NULL if fails. + */ + void * GetWorker(AliHLTTPCDisplayWorkerType_t workerType){ + if ( !fWorkerArray[workerType] ) + return NULL; + else + return fWorkerArray[workerType]; + } + + + + void SetRawReaderMode(Int_t f) {fRawReaderMode = f;} + void SetZeroSuppressionThreshold(Int_t f) {fZeroSuppressionThreshold = f;} + void SetOccupancyLimit(Float_t f) {fOccupancyLimit = f;} + void SetBField(Float_t f) {fBField = f;} + void SetNTimeBins(Int_t f) {fNTimeBins = f;} + + Int_t GetRawReaderMode(){return fRawReaderMode;} + Int_t GetZeroSuppressionThreshold(){return fZeroSuppressionThreshold;} + Float_t GetOccupancyLimit() {return fOccupancyLimit;} + Float_t GetBField(){return fBField;} + Int_t GetNTimeBins() {return fNTimeBins;} + + /** Set methods */ + /** ----------- */ + + void SetConnectionStatus(Bool_t f) {fConnect = f;} // canvas ---- @@ -172,7 +313,7 @@ class AliHLTTPCDisplayMain : public TObject , public AliHLTLogging { Int_t GetSlicePadRow(){return fSlicePadRow;} Bool_t GetSplitPadRow(){return fSplitPadRow;} // -- front - Int_t GetNTimeBins(){return fgNTimeBins;} + // Int_t GetNTimeBins(){return fgNTimeBins;} Int_t GetFrontDataSwitch(){return fFrontDataSwitch;} Int_t GetTimeBinMin(){return fTimeBinMin;} Int_t GetTimeBinMax(){return fTimeBinMax;} @@ -242,15 +383,25 @@ Char_t GetTrackParamBfield()); AliHLTTPCTrackParameter fTrackParam; + TCanvas **fCanvasArray; + void **fWorkerArray; + + // --------------------------------------------------- private: - AliHLTTPCDisplayMain(const AliHLTTPCDisplayMain &/*d*/):TObject(){;} - AliHLTTPCDisplayMain& operator=(const AliHLTTPCDisplayMain &/*d*/){return *this;} + // AliHLTTPCDisplayMain(const AliHLTTPCDisplayMain &/*d*/):TObject(){;} + // AliHLTTPCDisplayMain& operator=(const AliHLTTPCDisplayMain &/*d*/){return *this;} void SetSliceArray(); // Fill Array with slices which - // ** global constants ** - Int_t fgNTimeBins; // Number of TimeBins + // ** global constants ** + Int_t fgNTimeBins; // Number of TimeBins + Int_t fRawReaderMode; // raw reader mode + Int_t fZeroSuppressionThreshold; + Float_t fOccupancyLimit; + Float_t fBField; + Int_t fNTimeBins; + // ** HOMER parameter / connection / data exist ** ULong64_t fEventID; // Event ID diff --git a/HLT/TPCLib/OnlineDisplay/AliHLTTPCDisplayPad.cxx b/HLT/TPCLib/OnlineDisplay/AliHLTTPCDisplayPad.cxx index 107484ce545..c85b68d3e97 100644 --- a/HLT/TPCLib/OnlineDisplay/AliHLTTPCDisplayPad.cxx +++ b/HLT/TPCLib/OnlineDisplay/AliHLTTPCDisplayPad.cxx @@ -108,7 +108,7 @@ void AliHLTTPCDisplayPad::Save(){ } //____________________________________________________________________________________________________ -void AliHLTTPCDisplayPad::Fill(Int_t patch, ULong_t dataBlock, ULong_t dataLen){ +void AliHLTTPCDisplayPad::Fill(){ // Fill Pad Histogram Int_t padRow = fDisplay->GetPadRow(); diff --git a/HLT/TPCLib/OnlineDisplay/AliHLTTPCDisplayPad.h b/HLT/TPCLib/OnlineDisplay/AliHLTTPCDisplayPad.h index 4833e2bbb4a..f2f6132cfb3 100644 --- a/HLT/TPCLib/OnlineDisplay/AliHLTTPCDisplayPad.h +++ b/HLT/TPCLib/OnlineDisplay/AliHLTTPCDisplayPad.h @@ -29,7 +29,7 @@ class AliHLTTPCDisplayPad : public AliHLTLogging { AliHLTTPCDisplayPad(AliHLTTPCDisplayMain* display) ; virtual ~AliHLTTPCDisplayPad(); - void Fill(Int_t patch, ULong_t dataBlock, ULong_t dataLen); + void Fill(); void Draw(); void Reset(); void Save(); diff --git a/HLT/TPCLib/OnlineDisplay/AliHLTTPCDisplayPadRow.cxx b/HLT/TPCLib/OnlineDisplay/AliHLTTPCDisplayPadRow.cxx index 087c1f56e8c..9b41ad88b38 100644 --- a/HLT/TPCLib/OnlineDisplay/AliHLTTPCDisplayPadRow.cxx +++ b/HLT/TPCLib/OnlineDisplay/AliHLTTPCDisplayPadRow.cxx @@ -110,7 +110,8 @@ void AliHLTTPCDisplayPadRow::Save(){ } //____________________________________________________________________________________________________ -void AliHLTTPCDisplayPadRow::Fill(Int_t patch, ULong_t dataBlock, ULong_t dataLen){ +//void AliHLTTPCDisplayPadRow::Fill(Int_t patch, ULong_t dataBlock, ULong_t dataLen){ +void AliHLTTPCDisplayPadRow::Fill(){ // Fill PadRow Histogram #if defined(HAVE_TPC_MAPPING) @@ -122,10 +123,12 @@ void AliHLTTPCDisplayPadRow::Fill(Int_t patch, ULong_t dataBlock, ULong_t dataLe Int_t padRow = fDisplay->GetPadRow(); Int_t slice = fDisplay->GetSlicePadRow(); +#if 0 // Initialize RAW DATA Int_t firstRow = AliHLTTPCTransform::GetFirstRow(patch); Int_t lastRow = AliHLTTPCTransform::GetLastRow(patch); + // Outer sector, patches 2, 3, 4, 5 - start counting in patch 2 with row 0 if ( patch >= 2 ) rowOffset = AliHLTTPCTransform::GetFirstRow( 2 ); @@ -139,7 +142,7 @@ void AliHLTTPCDisplayPadRow::Fill(Int_t patch, ULong_t dataBlock, ULong_t dataLe LOG(AliHLTTPCLog::kError,"AliHLTTPCDisplayPadRow::Fill","Read first value") << "No value in data block" << ENDLOG; return; } - +#endif if ( fDisplay->GetZeroSuppression() ){ for (Int_t pad=0; pad < AliHLTTPCTransform::GetNPads(padRow); pad++){ // for (Int_t timeBin=fDisplay->GetTimeBinMin(); timeBin <= fDisplay->GetTimeBinMax(); timeBin++){ @@ -160,7 +163,7 @@ void AliHLTTPCDisplayPadRow::Fill(Int_t patch, ULong_t dataBlock, ULong_t dataLe } // end pad } // end - else of if ( fDisplay->GetZeroSuppression() ){ - +#if 0 // FILL PADROW 3D --- Initialize the colorbins if ( fDisplay->Get3DSwitchPadRow() ){ for (UInt_t ii=0;ii < 20;ii++){ @@ -243,7 +246,9 @@ void AliHLTTPCDisplayPadRow::Fill(Int_t patch, ULong_t dataBlock, ULong_t dataLe //Check where to stop: if(!readValue) break; //No more value } - + +#endif +#if 0 if (fDisplay->ExistsClusterData()){ AliHLTTPCSpacePointData *points = fDisplay->GetSpacePointDataPointer(slice,patch); if(!points) return; @@ -261,6 +266,7 @@ void AliHLTTPCDisplayPadRow::Fill(Int_t patch, ULong_t dataBlock, ULong_t dataLe } } } // END if (fDisplay->ExistsClusterData()){ +#endif #else //! defined(HAVE_TPC_MAPPING) HLTFatal("DigitReaderRaw not available - check your build"); #endif //defined(HAVE_TPC_MAPPING) diff --git a/HLT/TPCLib/OnlineDisplay/AliHLTTPCDisplayPadRow.h b/HLT/TPCLib/OnlineDisplay/AliHLTTPCDisplayPadRow.h index 02f1e285ad4..67308d5a1b7 100644 --- a/HLT/TPCLib/OnlineDisplay/AliHLTTPCDisplayPadRow.h +++ b/HLT/TPCLib/OnlineDisplay/AliHLTTPCDisplayPadRow.h @@ -25,7 +25,8 @@ class AliHLTTPCDisplayPadRow : public AliHLTLogging { AliHLTTPCDisplayPadRow(AliHLTTPCDisplayMain* display) ; virtual ~AliHLTTPCDisplayPadRow(); - void Fill(Int_t patch, ULong_t dataBlock, ULong_t dataLen); + // void Fill(Int_t patch, ULong_t dataBlock, ULong_t dataLen); + void Fill(); void Draw(); void Reset(); void Save(); -- 2.43.5