// @(#) $Id$
// **************************************************************************
-// This file is property of and copyright by the ALICE HLT Project *
+// This file is property of and copyright by the ALICE HLT Project *
// ALICE Experiment at CERN, All rights reserved. *
// *
// Primary Authors: Sergey Gorbunov <sergey.gorbunov@kip.uni-heidelberg.de> *
//***************************************************************************
#include "AliHLTTPCCATracker.h"
-#include "AliHLTTPCCAOutTrack.h"
-#include "AliHLTTPCCAGrid.h"
#include "AliHLTTPCCARow.h"
#include "AliHLTTPCCATrack.h"
#include "AliHLTTPCCATracklet.h"
#include "AliHLTTPCCAMath.h"
-#include "AliHLTTPCCAHit.h"
+#include "MemoryAssignmentHelpers.h"
#include "TStopwatch.h"
#include "AliHLTTPCCAHitArea.h"
#include "AliHLTTPCCATrackletConstructor.h"
#include "AliHLTTPCCATrackletSelector.h"
#include "AliHLTTPCCAProcess.h"
-#include "AliHLTTPCCAUsedHitsInitialiser.h"
-#include "AliHLTTPCCASliceTrack.h"
-#include "AliHLTTPCCASliceOutput.h"
-#include "AliHLTTPCCADataCompressor.h"
+#include "AliHLTTPCCAClusterData.h"
#include "AliHLTTPCCATrackParam.h"
+#include "AliHLTTPCCAGPUConfig.h"
+
#if !defined(HLTCA_GPUCODE)
#include <iostream>
+#include <iomanip>
+#include <string.h>
#endif
-//#define DRAW
+//#define DRAW1
-#ifdef DRAW
- #include "AliHLTTPCCADisplay.h"
-#endif //DRAW
+#ifdef DRAW1
+#include "AliHLTTPCCADisplay.h"
+#endif //DRAW1
#ifdef HLTCA_INTERNAL_PERFORMANCE
- #include "AliHLTTPCCAPerformance.h"
+//#include "AliHLTTPCCAPerformance.h"
#endif
+#ifdef HLTCA_STANDALONE
+#include "AliHLTTPCCAStandaloneFramework.h"
+#endif
-ClassImp(AliHLTTPCCATracker)
-
-#if !defined(HLTCA_GPUCODE)
-
-AliHLTTPCCATracker::AliHLTTPCCATracker()
- :
- fParam(),
- fNHitsTotal(0),
- fCommonMemory(0),
- fCommonMemorySize(0),
- fHitMemory(0),
- fHitMemorySize(0),
- fTrackMemory(0),
- fTrackMemorySize(0),
- fInputEvent(0),
- fInputEventSize(0),
- fRowData(0),
- fRowDataSize(0),
- fHitInputIDs(0),
- fHitWeights(0),
- fNTracklets(0),
- fTrackletStartHits(0),
- fTracklets(0),
- fNTracks(0),
- fTracks(0),
- fNTrackHits(0),
- fTrackHits(0),
- fOutput(0),
- fNOutTracks(0),
- fOutTracks(0),
- fNOutTrackHits(0),
- fOutTrackHits(0),
- fTmpHitInputIDs(0)
-{
- // constructor
-}
+ClassImp( AliHLTTPCCATracker )
-AliHLTTPCCATracker::AliHLTTPCCATracker( const AliHLTTPCCATracker& )
- :
- fParam(),
- fNHitsTotal(0),
- fCommonMemory(0),
- fCommonMemorySize(0),
- fHitMemory(0),
- fHitMemorySize(0),
- fTrackMemory(0),
- fTrackMemorySize(0),
- fInputEvent(0),
- fInputEventSize(0),
- fRowData(0),
- fRowDataSize(0),
- fHitInputIDs(0),
- fHitWeights(0),
- fNTracklets(0),
- fTrackletStartHits(0),
- fTracklets(0),
- fNTracks(0),
- fTracks(0),
- fNTrackHits(0),
- fTrackHits(0),
- fOutput(0),
- fNOutTracks(0),
- fOutTracks(0),
- fNOutTrackHits(0),
- fOutTrackHits(0),
- fTmpHitInputIDs(0)
-{
- // dummy
-}
-AliHLTTPCCATracker &AliHLTTPCCATracker::operator=( const AliHLTTPCCATracker& )
-{
- // dummy
- fCommonMemory = 0;
- fHitMemory = 0;
- fTrackMemory = 0;
- return *this;
-}
+#if !defined(HLTCA_GPUCODE)
-GPUd() AliHLTTPCCATracker::~AliHLTTPCCATracker()
+AliHLTTPCCATracker::~AliHLTTPCCATracker()
{
// destructor
- if( fCommonMemory ) delete[] fCommonMemory;
- if( fHitMemory ) delete[] fHitMemory;
- if( fTrackMemory ) delete[] fTrackMemory;
- if( fTmpHitInputIDs ) delete[] fTmpHitInputIDs;
+ if (!fIsGPUTracker)
+ {
+ if (fCommonMem) delete fCommonMem;
+ if (fHitMemory) delete[] fHitMemory;
+ if (fTrackletMemory) delete[] fTrackletMemory;
+ if (fTrackMemory) delete[] fTrackMemory;
+ fCommonMem = NULL;
+ fHitMemory = fTrackMemory = NULL;
+ }
}
-#endif
-
-
// ----------------------------------------------------------------------------------
-GPUd() void AliHLTTPCCATracker::Initialize( const AliHLTTPCCAParam ¶m )
+void AliHLTTPCCATracker::Initialize( const AliHLTTPCCAParam ¶m )
{
// initialisation
fParam = param;
fParam.Update();
- for( Int_t irow=0; irow<fParam.NRows(); irow++ ){
- fRows[irow].SetX( fParam.RowX(irow) );
- fRows[irow].SetMaxY( CAMath::Tan( fParam.DAlpha()/2.)*fRows[irow].X() );
- }
+ fData.InitializeRows( fParam );
+
StartEvent();
}
-GPUd() void AliHLTTPCCATracker::StartEvent()
+void AliHLTTPCCATracker::StartEvent()
{
- // start new event and fresh the memory
+ // start new event and fresh the memory
- if( !fCommonMemory ){
- SetPointersCommon(); // just to calculate the size
- fCommonMemory = reinterpret_cast<Char_t*> ( new uint4 [ fCommonMemorySize/sizeof(uint4) + 100] );
- SetPointersCommon();// set pointers
- }
-
- if( fHitMemory ) delete[] fHitMemory;
- fHitMemory = 0;
- if( fTrackMemory ) delete[] fTrackMemory;
- fTrackMemory = 0;
-
- fNHitsTotal = 0;
- *fNTracklets = 0;
- *fNTracks = 0 ;
- *fNTrackHits = 0;
- *fNOutTracks = 0;
- *fNOutTrackHits = 0;
- if( fTmpHitInputIDs ) delete[] fTmpHitInputIDs;
- fTmpHitInputIDs = 0;
+ SetupCommonMemory();
}
-
-
-GPUhd() void AliHLTTPCCATracker::SetPointersCommon()
+void AliHLTTPCCATracker::SetGPUTracker()
{
- // set all pointers to the event memory
-
- ULong_t mem = (ULong_t) fCommonMemory;
- UInt_t sI = sizeof(Int_t);
-
- // set common memory
-
- fNTracklets = (Int_t*) mem;
- mem+= sI;
- fNTracks = (Int_t*) mem;
- mem+= sI;
- fNTrackHits = (Int_t*) mem;
- mem+= sI;
- fNOutTracks = (Int_t*) mem;
- mem+= sI;
- fNOutTrackHits = (Int_t*) mem;
- mem+= sI;
-
- // calculate the size
+ //Make this a GPU Tracker
+ fIsGPUTracker = true;
+ fData.SetGpuSliceData();
+}
- fCommonMemorySize = mem - (ULong_t) fCommonMemory;
+char* AliHLTTPCCATracker::SetGPUTrackerCommonMemory(char* const pGPUMemory)
+{
+ //Set up common Memory Pointer for GPU Tracker
+ fCommonMem = (commonMemoryStruct*) pGPUMemory;
+ return(pGPUMemory + sizeof(commonMemoryStruct));
}
-GPUhd() void AliHLTTPCCATracker::SetPointersHits( Int_t MaxNHits )
+char* AliHLTTPCCATracker::SetGPUTrackerHitsMemory(char* pGPUMemory, int MaxNHits)
{
- // set all pointers to the event memory
+ //Set up Hits Memory Pointers for GPU Tracker
+ fHitMemory = (char*) pGPUMemory;
+ SetPointersHits(MaxNHits);
+ pGPUMemory += fHitMemorySize;
+ AssignMemory(fTrackletTmpStartHits, pGPUMemory, NHitsTotal());
+ AssignMemory(fRowStartHitCountOffset, pGPUMemory, Param().NRows());
+
+ return(pGPUMemory);
+}
- Int_t gridSizeTotal = 2*(2*MaxNHits + 10*Param().NRows());
- //gridSizeTotal *=100;//SG!!!
-
- ULong_t mem = (ULong_t) fHitMemory;
- UInt_t sI = sizeof(Int_t);
- UInt_t sF = sizeof(Float_t);
- UInt_t sS = sizeof(Short_t);
- UInt_t s4 = sizeof(uint4);
-
- // set input event
-
- mem = ( mem/s4 + 1 )*s4;
- fInputEvent = (Char_t*) mem;
- fInputEventSize = (1+fParam.NRows()*2 + 1)*sI + (MaxNHits*3)*sF;
- mem+= fInputEventSize;
-
- // set cluster data for TPC rows
-
- mem = ( mem/s4 + 1 )*s4;
- fRowData = (uint4*) mem;
- fRowDataSize = ( 2*MaxNHits*sS + // yz
- gridSizeTotal*sS + // grid
- 2*MaxNHits*sS + // link up,link down
- fParam.NRows()*s4 // row alignment
- );
- mem += fRowDataSize;
+char* AliHLTTPCCATracker::SetGPUTrackerTrackletsMemory(char* pGPUMemory, int MaxNTracks)
+{
+ //Set up Tracklet Memory Pointers for GPU Tracker
+ fTrackletMemory = (char*) pGPUMemory;
+ SetPointersTracklets(MaxNTracks);
+ pGPUMemory += fTrackletMemorySize;
+ AssignMemory(fGPUTrackletTemp, pGPUMemory, MaxNTracks);
+ AssignMemory(fRowBlockTracklets, pGPUMemory, MaxNTracks * 2 * (Param().NRows() / HLTCA_GPU_SCHED_ROW_STEP + 1));
+ AssignMemory(fRowBlockPos, pGPUMemory, 2 * (Param().NRows() / HLTCA_GPU_SCHED_ROW_STEP + 1));
+ AssignMemory(fBlockStartingTracklet, pGPUMemory, HLTCA_GPU_BLOCK_COUNT);
+
+ return(pGPUMemory);
+}
- // extra arrays for tpc clusters
-
- mem = ( mem/sI + 1 )*sI;
+char* AliHLTTPCCATracker::SetGPUTrackerTracksMemory(char* pGPUMemory, int MaxNTracks, int MaxNHits )
+{
+ //Set up Tracks Memory Pointer for GPU Tracker
+ fTrackMemory = (char*) pGPUMemory;
+ SetPointersTracks(MaxNTracks, MaxNHits);
+ pGPUMemory += fTrackMemorySize;
- fHitInputIDs = (Int_t*) mem;
- mem+= MaxNHits*sI;
+ return(pGPUMemory);
+}
- fTrackletStartHits = (Int_t*) mem;
- mem+= MaxNHits*sI;
+void AliHLTTPCCATracker::DumpSliceData(std::ostream &out)
+{
+ //Dump Slice Input Data to File
+ out << "Slice Data (Slice" << Param().ISlice() << "):" << std::endl;
+ for (int i = 0;i < Param().NRows();i++)
+ {
+ out << "Row: " << i << std::endl;
+ for (int j = 0;j < Row(i).NHits();j++)
+ {
+ if (j && j % 16 == 0) out << std::endl;
+ out << j << '-' << Data().HitDataY(Row(i), j) << '-' << Data().HitDataZ(Row(i), j) << ", ";
+ }
+ out << std::endl;
+ }
+}
- fHitWeights = (Int_t*) mem;
- mem+= MaxNHits*sI;
+void AliHLTTPCCATracker::DumpLinks(std::ostream &out)
+{
+ //Dump Links (after Neighbours Finder / Cleaner) to file
+ out << "Hit Links(Slice" << Param().ISlice() << "):" << std::endl;
+ for (int i = 0;i < Param().NRows();i++)
+ {
+ out << "Row: " << i << std::endl;
+ for (int j = 0;j < Row(i).NHits();j++)
+ {
+ if (j && j % 32 == 0) out << std::endl;
+ out << HitLinkUpData(Row(i), j) << "/" << HitLinkDownData(Row(i), j) << ", ";
+ }
+ out << std::endl;
+ }
+}
- // arrays for track hits
+void AliHLTTPCCATracker::DumpHitWeights(std::ostream &out)
+{
+ //dump hit weights to file
+ out << "Hit Weights(Slice" << Param().ISlice() << "):" << std::endl;
+ for (int i = 0;i < Param().NRows();i++)
+ {
+ out << "Row: " << i << ":" << std::endl;
+ for (int j = 0;j < Row(i).NHits();j++)
+ {
+ if (j && j % 32 == 0) out << std::endl;
+ out << HitWeight(Row(i), j) << ", ";
+ }
+ out << std::endl;
+ }
+}
- fTrackHits = (Int_t*) mem;
- mem+= 10*MaxNHits*sI;//SG!!!
-
- fOutTrackHits = (Int_t*) mem;
- mem+= 10*MaxNHits*sI; //SG!!!
+int AliHLTTPCCATracker::StarthitSortComparison(const void*a, const void* b)
+{
+ //qsort helper function to sort start hits
+ AliHLTTPCCAHitId* aa = (AliHLTTPCCAHitId*) a;
+ AliHLTTPCCAHitId* bb = (AliHLTTPCCAHitId*) b;
- // calculate the size
+ if (aa->RowIndex() != bb->RowIndex()) return(aa->RowIndex() - bb->RowIndex());
+ return(aa->HitIndex() - bb->HitIndex());
+}
- fHitMemorySize = mem - (ULong_t) fHitMemory;
+void AliHLTTPCCATracker::DumpStartHits(std::ostream &out)
+{
+ //sort start hits and dump to file
+ out << "Start Hits: (Slice" << Param().ISlice() << ") (" << *NTracklets() << ")" << std::endl;
+#ifdef HLTCA_GPU_SORT_DUMPDATA
+ qsort(TrackletStartHits(), *NTracklets(), sizeof(AliHLTTPCCAHitId), StarthitSortComparison);
+#endif
+ for (int i = 0;i < *NTracklets();i++)
+ {
+ out << TrackletStartHit(i).RowIndex() << "-" << TrackletStartHit(i).HitIndex() << std::endl;
+ }
+ out << std::endl;
}
+void AliHLTTPCCATracker::DumpTrackHits(std::ostream &out)
+{
+ //dump tracks to file
+ out << "Tracks: (Slice" << Param().ISlice() << ") (" << *NTracks() << ")" << std::endl;
+#ifdef HLTCA_GPU_SORT_DUMPDATA
+ for (int k = 0;k < Param().NRows();k++)
+ {
+ for (int l = 0;l < Row(k).NHits();l++)
+ {
+#endif
+ for (int j = 0;j < *NTracks();j++)
+ {
+ if (Tracks()[j].NHits() == 0 || !Tracks()[j].Alive()) continue;
+#ifdef HLTCA_GPU_SORT_DUMPDATA
+ if (TrackHits()[Tracks()[j].FirstHitID()].RowIndex() == k && TrackHits()[Tracks()[j].FirstHitID()].HitIndex() == l)
+ {
+#endif
+ for (int i = 0;i < Tracks()[j].NHits();i++)
+ {
+ out << TrackHits()[Tracks()[j].FirstHitID() + i].RowIndex() << "-" << TrackHits()[Tracks()[j].FirstHitID() + i].HitIndex() << ", ";
+ }
+ out << "(Track: " << j << ")" << std::endl;
+#ifdef HLTCA_GPU_SORT_DUMPDATA
+ }
+ }
+#endif
+ }
+#ifdef HLTCA_GPU_SORT_DUMPDATA
+ }
+#endif
+}
-GPUhd() void AliHLTTPCCATracker::SetPointersTracks( Int_t MaxNTracks, Int_t MaxNHits )
+void AliHLTTPCCATracker::DumpTrackletHits(std::ostream &out)
{
- // set all pointers to the tracks memory
+ //dump tracklets to file
+ out << "Tracklets: (Slice" << Param().ISlice() << ") (" << *NTracklets() << ")" << std::endl;
+#ifdef HLTCA_GPU_SORT_DUMPDATA
+ AliHLTTPCCAHitId* tmpIds = new AliHLTTPCCAHitId[*NTracklets()];
+ AliHLTTPCCATracklet* tmpTracklets = new AliHLTTPCCATracklet[*NTracklets()];
+ memcpy(tmpIds, TrackletStartHits(), *NTracklets() * sizeof(AliHLTTPCCAHitId));
+ memcpy(tmpTracklets, Tracklets(), *NTracklets() * sizeof(AliHLTTPCCATracklet));
+#ifdef EXTERN_ROW_HITS
+ int* tmpHits = new int[*NTracklets() * Param().NRows()];
+ memcpy(tmpHits, TrackletRowHits(), *NTracklets() * Param().NRows() * sizeof(int));
+#endif
+ qsort(TrackletStartHits(), *NTracklets(), sizeof(AliHLTTPCCAHitId), StarthitSortComparison);
+ for (int i = 0;i < *NTracklets();i++)
+ {
+ for (int j = 0;j < *NTracklets();j++)
+ {
+ if (tmpIds[i].RowIndex() == TrackletStartHit(j).RowIndex() && tmpIds[i].HitIndex() == TrackletStartHit(j).HitIndex())
+ {
+ memcpy(&Tracklets()[j], &tmpTracklets[i], sizeof(AliHLTTPCCATracklet));
+#ifdef EXTERN_ROW_HITS
+ if (tmpTracklets[i].NHits())
+ {
+ for (int k = tmpTracklets[i].FirstRow();k <= tmpTracklets[i].LastRow();k++)
+ {
+ fTrackletRowHits[k * *NTracklets() + j] = tmpHits[k * *NTracklets() + i];
+ }
+ }
+#endif
+ break;
+ }
+ }
+ }
+ delete[] tmpIds;
+ delete[] tmpTracklets;
+#ifdef EXTERN_ROW_HITS
+ delete[] tmpHits;
+#endif
+#endif
+ for (int j = 0;j < *NTracklets();j++)
+ {
+ out << "Tracklet " << std::setw(4) << j << " (Hits: " << std::setw(3) << Tracklets()[j].NHits() << ", Start: " << std::setw(3) << TrackletStartHit(j).RowIndex() << "-" << std::setw(3) << TrackletStartHit(j).HitIndex() << ", Rows: " << (Tracklets()[j].NHits() ? Tracklets()[j].FirstRow() : -1) << " - " << (Tracklets()[j].NHits() ? Tracklets()[j].LastRow() : -1) << ") ";
+ if (Tracklets()[j].NHits() == 0);
+ else if (Tracklets()[j].LastRow() > Tracklets()[j].FirstRow() && (Tracklets()[j].FirstRow() >= Param().NRows() || Tracklets()[j].LastRow() >= Param().NRows()))
+ {
+#ifdef HLTCA_STANDALONE
+ printf("\nError: Tracklet %d First %d Last %d Hits %d", j, Tracklets()[j].FirstRow(), Tracklets()[j].LastRow(), Tracklets()[j].NHits());
+ out << " (Error: Tracklet " << j << " First " << Tracklets()[j].FirstRow() << " Last " << Tracklets()[j].LastRow() << " Hits " << Tracklets()[j].NHits() << ") ";
+ for (int i = 0;i < Param().NRows();i++)
+ {
+ //if (Tracklets()[j].RowHit(i) != -1)
+#ifdef EXTERN_ROW_HITS
+ out << i << "-" << fTrackletRowHits[i * fCommonMem->fNTracklets + j] << ", ";
+#else
+ out << i << "-" << Tracklets()[j].RowHit(i) << ", ";
+#endif
+ }
+#endif
+ }
+ else if (Tracklets()[j].NHits() && Tracklets()[j].LastRow() > Tracklets()[j].FirstRow())
+ {
+ for (int i = Tracklets()[j].FirstRow();i <= Tracklets()[j].LastRow();i++)
+ {
+ //if (Tracklets()[j].RowHit(i) != -1)
+#ifdef EXTERN_ROW_HITS
+ out << i << "-" << fTrackletRowHits[i * fCommonMem->fNTracklets + j] << ", ";
+#else
+ out << i << "-" << Tracklets()[j].RowHit(i) << ", ";
+#endif
+ }
+ }
+ out << std::endl;
+ }
+}
- ULong_t mem = (ULong_t) fTrackMemory;
-
- // memory for tracklets
- mem = ( mem/sizeof(AliHLTTPCCATracklet) + 1 )*sizeof(AliHLTTPCCATracklet);
- fTracklets = (AliHLTTPCCATracklet *) mem;
- mem+= MaxNTracks*sizeof(AliHLTTPCCATracklet);
-
- // memory for selected tracks
-
- mem = ( mem/sizeof(AliHLTTPCCATrack) + 1 )*sizeof(AliHLTTPCCATrack);
- fTracks = (AliHLTTPCCATrack*) mem;
- mem+= MaxNTracks*sizeof(AliHLTTPCCATrack);
-
- // memory for output
+void AliHLTTPCCATracker::SetupCommonMemory()
+{
+ // set up common memory
- mem = ( mem/sizeof(AliHLTTPCCASliceOutput) + 1 )*sizeof(AliHLTTPCCASliceOutput);
- fOutput = (AliHLTTPCCASliceOutput*) mem;
- mem+= AliHLTTPCCASliceOutput::EstimateSize(MaxNTracks, MaxNHits);
-
- // memory for output tracks
+ if (!fIsGPUTracker)
+ {
+ if ( !fCommonMem ) {
+ // the 1600 extra bytes are not used unless fCommonMemorySize increases with a later event
+ //fCommonMemory = reinterpret_cast<char*> ( new uint4 [ fCommonMemorySize/sizeof( uint4 ) + 100] );
+ fCommonMem = new commonMemoryStruct;
+ }
- mem = ( mem/sizeof(AliHLTTPCCAOutTrack) + 1 )*sizeof(AliHLTTPCCAOutTrack);
-
- fOutTracks = (AliHLTTPCCAOutTrack*) mem;
- mem+= MaxNTracks*sizeof(AliHLTTPCCAOutTrack);
+ if (fHitMemory) delete[] fHitMemory;
+ if (fTrackletMemory) delete[] fTrackletMemory;
+ if (fTrackMemory) delete[] fTrackMemory;
+ }
- // calculate the size
+ fHitMemory = fTrackletMemory = fTrackMemory = 0;
- fTrackMemorySize = mem - (ULong_t) fTrackMemory;
+ fData.Clear();
+ fCommonMem->fNTracklets = 0;
+ fCommonMem->fNTracks = 0 ;
+ fCommonMem->fNTrackHits = 0;
}
-
-
-GPUd() void AliHLTTPCCATracker::ReadEvent( const Int_t *RowFirstHit, const Int_t *RowNHits, const Float_t *X, const Float_t *Y, const Float_t *Z, Int_t NHits )
+void AliHLTTPCCATracker::ReadEvent( AliHLTTPCCAClusterData *clusterData )
{
- //* Read event
+ // read event
+
+ fClusterData = clusterData;
StartEvent();
-
- fNHitsTotal = NHits;
-
+
+ //* Convert input hits, create grids, etc.
+ fData.InitFromClusterData( *clusterData );
{
- SetPointersHits(NHits); // to calculate the size
- fHitMemory = reinterpret_cast<Char_t*> ( new uint4 [ fHitMemorySize/sizeof(uint4) + 100] );
- SetPointersHits(NHits); // set pointers for hits
- *fNTracklets = 0;
- *fNTracks = 0 ;
- *fNOutTracks = 0;
- *fNOutTrackHits = 0;
+ if (!fIsGPUTracker)
+ {
+ SetPointersHits( fData.NumberOfHits() ); // to calculate the size
+ fHitMemory = reinterpret_cast<char*> ( new uint4 [ fHitMemorySize/sizeof( uint4 ) + 100] );
+ }
+ SetPointersHits( fData.NumberOfHits() ); // set pointers for hits
}
+}
- reinterpret_cast<Int_t*>( fInputEvent )[0] = fParam.NRows();
- reinterpret_cast<Int_t*>( fInputEvent )[1+fParam.NRows()*2] = NHits;
- Int_t *rowHeaders = reinterpret_cast<Int_t*>( fInputEvent ) +1;
- Float_t *hitsXYZ = reinterpret_cast<Float_t*>( fInputEvent ) + 1+fParam.NRows()*2+1;
- for( Int_t iRow=0; iRow<fParam.NRows(); iRow++ ){
- rowHeaders[iRow*2 ] = RowFirstHit[iRow];
- rowHeaders[iRow*2+1] = RowNHits[iRow];
- }
- for( Int_t iHit=0; iHit<NHits; iHit++ ){
- hitsXYZ[iHit*3 ] = X[iHit];
- hitsXYZ[iHit*3+1] = Y[iHit];
- hitsXYZ[iHit*3+2] = Z[iHit];
- }
+GPUhd() void AliHLTTPCCATracker::SetPointersHits( int MaxNHits )
+{
+ // set all pointers to the event memory
- //SG cell finder - test code
-
- if( fTmpHitInputIDs ) delete[] fTmpHitInputIDs;
- fTmpHitInputIDs = new Int_t [NHits];
- const Float_t areaY = .5;
- const Float_t areaZ = .5;
- Int_t newRowNHitsTotal = 0;
- Bool_t *usedHits = new Bool_t [NHits];
- for( Int_t iHit=0; iHit<NHits; iHit++ ) usedHits[iHit] = 0;
- for( Int_t iRow=0; iRow<fParam.NRows(); iRow++ ){
- rowHeaders[iRow*2 ] = newRowNHitsTotal; // new first hit
- rowHeaders[iRow*2+1] = 0; // new N hits
- Int_t newRowNHits = 0;
- Int_t oldRowFirstHit = RowFirstHit[iRow];
- Int_t oldRowLastHit = oldRowFirstHit + RowNHits[iRow];
- for( Int_t iHit=oldRowFirstHit; iHit<oldRowLastHit; iHit++ ){
- if( usedHits[iHit] ) continue;
- Float_t x0 = X[iHit];
- Float_t y0 = Y[iHit];
- Float_t z0 = Z[iHit];
- Float_t cx = x0;
- Float_t cy = y0;
- Float_t cz = z0;
- Int_t nclu = 1;
- usedHits[iHit]=1;
- if(0) for( Int_t jHit=iHit+1; jHit<oldRowLastHit; jHit++ ){//SG!!!
- //if( usedHits[jHit] ) continue;
- Float_t dy = Y[jHit] - y0;
- Float_t dz = Z[jHit] - z0;
- if( CAMath::Abs(dy)<areaY && CAMath::Abs(dz)<areaZ ){
- cx+=X[jHit];
- cy+=Y[jHit];
- cz+=Z[jHit];
- nclu++;
- usedHits[jHit]=1;
- }
- }
- Int_t id = newRowNHitsTotal+newRowNHits;
- hitsXYZ[id*3+0 ] = cx/nclu;
- hitsXYZ[id*3+1 ] = cy/nclu;
- hitsXYZ[id*3+2 ] = cz/nclu;
- fTmpHitInputIDs[id] = iHit;
- newRowNHits++;
- }
- rowHeaders[iRow*2+1] = newRowNHits;
- newRowNHitsTotal+=newRowNHits;
- }
- fNHitsTotal = newRowNHitsTotal;
- reinterpret_cast<Int_t*>( fInputEvent )[1+fParam.NRows()*2] = newRowNHitsTotal;
+ char *mem = fHitMemory;
- delete[] usedHits;
- SetupRowData();
-}
+ // extra arrays for tpc clusters
+
+#ifdef HLTCA_GPU_SORT_STARTHITS_2
+ AssignMemory( fTrackletStartHits, mem, MaxNHits + 32);
+#else
+ AssignMemory( fTrackletStartHits, mem, MaxNHits);
+#endif
+ // calculate the size
-GPUd() void AliHLTTPCCATracker::SetupRowData()
+ fHitMemorySize = mem - fHitMemory;
+}
+
+GPUhd() void AliHLTTPCCATracker::SetPointersTracklets( int MaxNTracklets )
{
- //* Convert input hits, create grids, etc.
-
- fNHitsTotal = reinterpret_cast<Int_t*>( fInputEvent )[1+fParam.NRows()*2];
- Int_t *rowHeaders = reinterpret_cast<Int_t*>( fInputEvent ) +1;
- Float_t *hitsXYZ = reinterpret_cast<Float_t*>( fInputEvent ) + 1+fParam.NRows()*2+1;
-
- for( Int_t iRow=0; iRow<fParam.NRows(); iRow++ ){
-
- AliHLTTPCCARow &row = fRows[iRow];
- row.SetFirstHit( rowHeaders[iRow*2] );
- row.SetNHits( rowHeaders[iRow*2+1] );
- Float_t yMin=1.e3, yMax=-1.e3, zMin=1.e3, zMax=-1.e3;
- Int_t nGrid = row.NHits();
- for( Int_t i=0; i<row.NHits(); i++ ){
- Int_t j = row.FirstHit()+i;
- Float_t y = hitsXYZ[j*3+1];
- Float_t z = hitsXYZ[j*3+2];
- if( yMax < y ) yMax = y;
- if( yMin > y ) yMin = y;
- if( zMax < z ) zMax = z;
- if( zMin > z ) zMin = z;
- }
- if( nGrid <= 0 ){
- yMin = yMax = zMin = zMax = 0;
- nGrid = 1;
- }
+ // set all pointers to the tracklets memory
+ char *mem = fTrackletMemory;
- AliHLTTPCCAGrid grid;
- grid.Create( yMin, yMax, zMin, zMax, nGrid );
-
- Float_t sy = ( CAMath::Abs( grid.StepYInv() ) >1.e-4 ) ?1./grid.StepYInv() :1;
- Float_t sz = ( CAMath::Abs( grid.StepZInv() ) >1.e-4 ) ?1./grid.StepZInv() :1;
-
- //cout<<"grid n = "<<row.Grid().N()<<" "<<sy<<" "<<sz<<" "<<yMin<<" "<<yMax<<" "<<zMin<<" "<<zMax<<endl;
-
- Bool_t recreate=0;
- if( sy < 2. ) { recreate = 1; sy = 2; }
- if( sz < 2. ) { recreate = 1; sz = 2; }
- //recreate = 1;//SG!!!
- //sy=2;
- //sz=2;
- if( recreate ) grid.Create( yMin, yMax, zMin, zMax, sy, sz );
- row.SetGrid( grid );
- }
+ // memory for tracklets
+
+ AssignMemory( fTracklets, mem, MaxNTracklets );
+#ifdef EXTERN_ROW_HITS
+ AssignMemory( fTrackletRowHits, mem, MaxNTracklets * Param().NRows());
+#endif
+
+ fTrackletMemorySize = mem - fTrackletMemory;
+}
-
- AliHLTTPCCAHit *ffHits = new AliHLTTPCCAHit[ fNHitsTotal ];
- Int_t rowDataOffset = 0;
+GPUhd() void AliHLTTPCCATracker::SetPointersTracks( int MaxNTracks, int MaxNHits )
+{
+ // set all pointers to the tracks memory
+ char *mem = fTrackMemory;
- for( Int_t iRow=0; iRow<fParam.NRows(); iRow++ ){
+ // memory for selected tracks
- AliHLTTPCCARow &row = fRows[iRow];
- const AliHLTTPCCAGrid &grid = row.Grid();
-
- Int_t *c = new Int_t [grid.N() + 3 + 10];
- Int_t *bins = new Int_t [row.NHits()];
- Int_t *filled = new Int_t [row.Grid().N() + 3 + 10 ];
+ AssignMemory( fTracks, mem, MaxNTracks );
+ AssignMemory( fTrackHits, mem, 2 * MaxNHits );
- for( UInt_t bin=0; bin<row.Grid().N()+3; bin++ ) filled[bin] = 0;
+ // calculate the size
- for( Int_t i=0; i<row.NHits(); i++ ){
- Int_t j = row.FirstHit()+i;
- Int_t bin = row.Grid().GetBin( hitsXYZ[3*j+1], hitsXYZ[3*j+2] );
- bins[i] = bin;
- filled[bin]++;
- }
+ fTrackMemorySize = mem - fTrackMemory;
+}
+GPUh() int AliHLTTPCCATracker::CheckEmptySlice() const
+{
+ //Check if the Slice is empty, if so set the output apropriate and tell the reconstuct procesdure to terminate
+ if ( NHitsTotal() < 1 ) {
{
- Int_t n=0;
- for( UInt_t bin=0; bin<row.Grid().N()+3; bin++ ){
- c[bin] = n;
- n+=filled[bin];
- }
+ AliHLTTPCCASliceOutput::Allocate(*fOutput, 0, 0, fOutputControl);
+ AliHLTTPCCASliceOutput* useOutput = *fOutput;
+ if (useOutput == NULL) return(1);
+ useOutput->SetNTracks( 0 );
+ useOutput->SetNTrackClusters( 0 );
}
- for( Int_t i=0; i<row.NHits(); i++ ){
- Int_t bin = bins[i];
- Int_t ind = c[bin] + filled[bin]-1;
-
- AliHLTTPCCAHit &h = ffHits[row.FirstHit()+ind];
- fHitInputIDs[row.FirstHit()+ind] = fTmpHitInputIDs[row.FirstHit()+i];
- h.SetY( hitsXYZ[3*(row.FirstHit()+i)+1] );
- h.SetZ( hitsXYZ[3*(row.FirstHit()+i)+2] );
- filled[bin]--;
- }
+ return 1;
+ }
+ return 0;
+}
- {
- Float_t y0 = row.Grid().YMin();
- Float_t stepY = (row.Grid().YMax() - y0)*(1./65535.);
- Float_t z0 = row.Grid().ZMin();
- Float_t stepZ = (row.Grid().ZMax() - z0)*(1./65535.);
- if( stepY<1.e-4 ) stepY = 1.e-4;
- if( stepZ<1.e-4 ) stepZ = 1.e-4;
- Float_t stepYi = 1./stepY;
- Float_t stepZi = 1./stepZ;
-
- row.SetHy0( y0 );
- row.SetHz0( z0 );
- row.SetHstepY( stepY );
- row.SetHstepZ( stepZ );
- row.SetHstepYi( stepYi );
- row.SetHstepZi( stepZi );
-
- row.SetFullOffset( rowDataOffset );
- ushort2 *p= (ushort2*)( fRowData + row.FullOffset() );
- for( Int_t ih=0; ih<row.NHits(); ih++ ){
- Int_t ihTot = row.FirstHit()+ih;
- AliHLTTPCCAHit &hh = ffHits[ihTot];
- Float_t xx = ((hh.Y() - y0)*stepYi);
- Float_t yy = ((hh.Z() - z0)*stepZi);
- if( xx<0 || yy<0 || xx>=65536 || yy>= 65536 ){
- std::cout<<"!!!! hit packing error!!! "<<xx<<" "<<yy<<" "<<std::endl;
- }
- p[ih].x = (UShort_t) xx;
- p[ih].y = (UShort_t) yy;
- }
- Int_t size = row.NHits()*sizeof(ushort2);
+void AliHLTTPCCATracker::RunNeighboursFinder()
+{
+ //Run the CPU Neighbours Finder
+ AliHLTTPCCAProcess<AliHLTTPCCANeighboursFinder>( Param().NRows(), 1, *this );
+}
- row.SetFullGridOffset( row.NHits()*2 );
- UShort_t *p1 = ((UShort_t *)p) + row.FullGridOffset();
+void AliHLTTPCCATracker::RunNeighboursCleaner()
+{
+ //Run the CPU Neighbours Cleaner
+ AliHLTTPCCAProcess<AliHLTTPCCANeighboursCleaner>( Param().NRows() - 2, 1, *this );
+}
- Int_t n = grid.N();
- for( Int_t i=0; i<n; i++ ){
- p1[i] = c[i];
- }
- UShort_t a = c[n];
- Int_t nn = n+grid.Ny()+3;
- for( Int_t i=n; i<nn; i++ ) p1[i] = a;
+void AliHLTTPCCATracker::RunStartHitsFinder()
+{
+ //Run the CPU Start Hits Finder
+ AliHLTTPCCAProcess<AliHLTTPCCAStartHitsFinder>( Param().NRows() - 4, 1, *this );
+}
- size+= (nn)*sizeof(UShort_t);
- row.SetFullLinkOffset( row.NHits()*2 + nn );
- size+= row.NHits()*2*sizeof(Short_t);
+void AliHLTTPCCATracker::RunTrackletConstructor()
+{
+ //Run CPU Tracklet Constructor
+ AliHLTTPCCATrackletConstructor::AliHLTTPCCATrackletConstructorCPU(*this);
+}
- if( size%16 ) size = size/sizeof(uint4)+1;
- else size = size/sizeof(uint4);
- row.SetFullSize( size );
- //cout<<iRow<<", "<<row.fNHits<<"= "<<size*16<<"b: "<<row.fFullOffset<<" "<<row.fFullSize<<" "<<row.fFullGridOffset<<" "<<row.fFullLinkOffset<<std::endl;
+void AliHLTTPCCATracker::RunTrackletSelector()
+{
+ //Run CPU Tracklet Selector
+ AliHLTTPCCAProcess<AliHLTTPCCATrackletSelector>( 1, fCommonMem->fNTracklets, *this );
+}
- rowDataOffset+=size;
- }
- if( c ) delete[] c;
- if( bins ) delete[] bins;
- if( filled ) delete[] filled;
+#ifdef HLTCA_STANDALONE
+void AliHLTTPCCATracker::StandalonePerfTime(int i)
+{
+ //Query Performance Timer for Standalone Version of Tracker
+ if (fGPUDebugLevel >= 1)
+ {
+ AliHLTTPCCAStandaloneFramework::StandaloneQueryTime(&fPerfTimers[i]);
}
- delete[] ffHits;
}
-
+#else
+void AliHLTTPCCATracker::StandalonePerfTime(int /*i*/) {}
+#endif
GPUh() void AliHLTTPCCATracker::Reconstruct()
{
//* reconstruction of event
- //std::cout<<"Reconstruct slice "<<fParam.ISlice()<<", nHits="<<fNHitsTotal<<std::endl;
+ //std::cout<<"Reconstruct slice "<<fParam.ISlice()<<", nHits="<<NHitsTotal()<<std::endl;
fTimers[0] = 0; // find neighbours
fTimers[1] = 0; // construct tracklets
fTimers[5] = 0; // write output
fTimers[6] = 0;
fTimers[7] = 0;
-
+
//if( fParam.ISlice()<1 ) return; //SG!!!
TStopwatch timer0;
- //SetupRowData();
- if( fNHitsTotal < 1 ){
- {
- SetPointersTracks(1, 1); // to calculate the size
- fTrackMemory = reinterpret_cast<Char_t*> ( new uint4 [ fTrackMemorySize/sizeof(uint4) + 100] );
- SetPointersTracks(1, 1); // set pointers for tracks
- fOutput->SetNTracks(0);
- fOutput->SetNTrackClusters(0);
- }
+ StandalonePerfTime(0);
- return;
- }
-#ifdef DRAW
+ if (CheckEmptySlice()) return;
- AliHLTTPCCADisplay::Instance().ClearView();
+#ifdef DRAW1
+ //if( fParam.ISlice()==2 || fParam.ISlice()==3)
+ {
+ AliHLTTPCCADisplay::Instance().ClearView();
AliHLTTPCCADisplay::Instance().SetSliceView();
AliHLTTPCCADisplay::Instance().SetCurrentSlice( this );
- AliHLTTPCCADisplay::Instance().DrawSlice( this, 1 );
- if( fNHitsTotal>0 ){
- AliHLTTPCCADisplay::Instance().DrawSliceHits( kRed, .5);
+ AliHLTTPCCADisplay::Instance().DrawSlice( this, 1 );
+ if ( NHitsTotal() > 0 ) {
+ AliHLTTPCCADisplay::Instance().DrawSliceHits( kRed, .5 );
AliHLTTPCCADisplay::Instance().Ask();
}
-#endif
+ }
+#endif //DRAW1
- *fNTracks = 0;
- *fNTracklets = 0;
+ fCommonMem->fNTracklets = fCommonMem->fNTracks = fCommonMem->fNTrackHits = 0;
-#if !defined(HLTCA_GPUCODE)
-
- AliHLTTPCCAProcess<AliHLTTPCCANeighboursFinder>( Param().NRows(), 1, *this );
+#if !defined(HLTCA_GPUCODE)
-#ifdef HLTCA_INTERNAL_PERFORMANCE
- //if( Param().ISlice()<=2 )
+ if (fGPUDebugLevel >= 6)
+ {
+ *fGPUDebugOut << std::endl << std::endl << "Slice: " << Param().ISlice() << std::endl;
+ *fGPUDebugOut << "Slice Data:" << std::endl;
+ DumpSliceData(*fGPUDebugOut);
+ }
+
+ StandalonePerfTime(1);
+
+ RunNeighboursFinder();
+
+ StandalonePerfTime(2);
+
+#ifdef TRACKER_KEEP_TEMPDATA
+ if (fLinkTmpMemory) delete[] fLinkTmpMemory;
+ fLinkTmpMemory = new char[fData.MemorySize()];
+ memcpy(fLinkTmpMemory, fData.Memory(), fData.MemorySize());
+#endif
+
+ if (fGPUDebugLevel >= 6) DumpLinks(*fGPUDebugOut);
+
+#ifdef HLTCA_INTERNAL_PERFORMANCE
+ //if( Param().ISlice()<=2 )
//AliHLTTPCCAPerformance::Instance().LinkPerformance( Param().ISlice() );
#endif
-#ifdef DRAW
- if( fNHitsTotal>0 ){
- AliHLTTPCCADisplay::Instance().DrawSliceLinks( -1, -1, 1);
+#ifdef DRAW1
+ if ( NHitsTotal() > 0 ) {
+ AliHLTTPCCADisplay::Instance().DrawSliceLinks( -1, -1, 1 );
AliHLTTPCCADisplay::Instance().Ask();
}
-#endif
+#endif //DRAW1
+ RunNeighboursCleaner();
- AliHLTTPCCAProcess<AliHLTTPCCANeighboursCleaner>( Param().NRows()-2, 1, *this );
- AliHLTTPCCAProcess<AliHLTTPCCAStartHitsFinder>( Param().NRows()-4, 1, *this );
+ StandalonePerfTime(3);
- Int_t nStartHits = *fNTracklets;
-
- Int_t nThreads = 128;
- Int_t nBlocks = fNHitsTotal/nThreads + 1;
- if( nBlocks<12 ){
- nBlocks = 12;
- nThreads = fNHitsTotal/12+1;
- if( nThreads%32 ) nThreads = (nThreads/32+1)*32;
- }
-
- nThreads = fNHitsTotal;
- nBlocks = 1;
+ if (fGPUDebugLevel >= 6) DumpLinks(*fGPUDebugOut);
- AliHLTTPCCAProcess<AliHLTTPCCAUsedHitsInitialiser>(nBlocks, nThreads,*this);
+ RunStartHitsFinder();
+ StandalonePerfTime(4);
+ StandalonePerfTime(5);
- {
- SetPointersTracks(nStartHits, fNHitsTotal); // to calculate the size
- fTrackMemory = reinterpret_cast<Char_t*> ( new uint4 [ fTrackMemorySize/sizeof(uint4) + 100] );
- SetPointersTracks(nStartHits, fNHitsTotal); // set pointers for hits
- }
+ if (fGPUDebugLevel >= 6) DumpStartHits(*fGPUDebugOut);
+
+ fData.ClearHitWeights();
- Int_t nMemThreads = AliHLTTPCCATrackletConstructor::NMemThreads();
- nThreads = 256;//96;
- nBlocks = nStartHits/nThreads + 1;
- if( nBlocks<30 ){
- nBlocks = 30;
- nThreads = (nStartHits)/30+1;
- if( nThreads%32 ) nThreads = (nThreads/32+1)*32;
- }
+ SetPointersTracklets( fCommonMem->fNTracklets * 2 ); // to calculate the size
+ fTrackletMemory = reinterpret_cast<char*> ( new uint4 [ fTrackletMemorySize/sizeof( uint4 ) + 100] );
+ SetPointersTracklets( fCommonMem->fNTracklets * 2 ); // set pointers for hits
- nThreads = nStartHits;
- nBlocks = 1;
+ SetPointersTracks( fCommonMem->fNTracklets * 2, NHitsTotal() ); // to calculate the size
+ fTrackMemory = reinterpret_cast<char*> ( new uint4 [ fTrackMemorySize/sizeof( uint4 ) + 100] );
+ SetPointersTracks( fCommonMem->fNTracklets * 2, NHitsTotal() ); // set pointers for hits
- AliHLTTPCCAProcess1<AliHLTTPCCATrackletConstructor>(nBlocks, nMemThreads+nThreads,*this);
+ StandalonePerfTime(6);
+ StandalonePerfTime(7);
- //std::cout<<"Slice "<<Param().ISlice()<<": NHits="<<fNHitsTotal<<", NTracklets="<<*NTracklets()<<std::endl;
+ RunTrackletConstructor();
- {
- nThreads = 128;
- nBlocks = nStartHits/nThreads + 1;
- if( nBlocks<12 ){
- nBlocks = 12;
- nThreads = nStartHits/12+1;
- nThreads = (nThreads/32+1)*32;
- }
-
- *fNTrackHits = 0;
+ StandalonePerfTime(8);
- nThreads = nStartHits;
- nBlocks = 1;
+ if (fGPUDebugLevel >= 6) DumpTrackletHits(*fGPUDebugOut);
+ if (fGPUDebugLevel >= 6) DumpHitWeights(*fGPUDebugOut);
+ //std::cout<<"Slice "<<Param().ISlice()<<": NHits="<<NHitsTotal()<<", NTracklets="<<*NTracklets()<<std::endl;
- AliHLTTPCCAProcess<AliHLTTPCCATrackletSelector>(nBlocks, nThreads,*this);
+ RunTrackletSelector();
- //std::cout<<"Slice "<<Param().ISlice()<<": N start hits/tracklets/tracks = "<<nStartHits<<" "<<nStartHits<<" "<<*fNTracks<<std::endl;
- }
+ StandalonePerfTime(9);
- //std::cout<<"Memory used for slice "<<fParam.ISlice()<<" : "<<fCommonMemorySize/1024./1024.<<" + "<<fHitMemorySize/1024./1024.<<" + "<<fTrackMemorySize/1024./1024.<<" = "<<( fCommonMemorySize+fHitMemorySize+fTrackMemorySize )/1024./1024.<<" Mb "<<std::endl;
+ //std::cout<<"Slice "<<Param().ISlice()<<": N start hits/tracklets/tracks = "<<nStartHits<<" "<<nStartHits<<" "<<*fNTracks<<std::endl;
-
- WriteOutput();
-
+ if (fGPUDebugLevel >= 6) DumpTrackHits(*fGPUDebugOut);
-#endif
+ //std::cout<<"Memory used for slice "<<fParam.ISlice()<<" : "<<fCommonMemorySize/1024./1024.<<" + "<<fHitMemorySize/1024./1024.<<" + "<<fTrackMemorySize/1024./1024.<<" = "<<( fCommonMemorySize+fHitMemorySize+fTrackMemorySize )/1024./1024.<<" Mb "<<std::endl;
-#ifdef DRAW
- {
- AliHLTTPCCADisplay &disp = AliHLTTPCCADisplay::Instance();
- AliHLTTPCCATracker &slice = *this;
- std::cout<<"N out tracks = "<<*slice.NOutTracks()<<std::endl;
- //disp.Ask();
- AliHLTTPCCADisplay::Instance().SetCurrentSlice( this );
- AliHLTTPCCADisplay::Instance().DrawSlice( this, 1 );
- disp.DrawSliceHits(-1,.5);
- for( Int_t itr=0; itr<*slice.NOutTracks(); itr++ ){
- std::cout<<"track N "<<itr<<", nhits="<<slice.OutTracks()[itr].NHits()<<std::endl;
- disp.DrawSliceOutTrack( itr, kBlue );
- //disp.Ask();
- //int id = slice.OutTracks()[itr].OrigTrackID();
- //AliHLTTPCCATrack &tr = Tracks()[id];
- //for( Int_t ih=0; ih<tr.NHits(); ih++ ){
- //Int_t ic = (fTrackHits[tr.FirstHitID()+ih]);
- //std::cout<<ih<<" "<<ID2IRow(ic)<<" "<<ID2IHit(ic)<<std::endl;
- //}
- //disp.DrawSliceTrack( id, kBlue );
- //disp.Ask();
- }
- disp.Ask();
- }
-#endif
+ WriteOutput();
- timer0.Stop();
- fTimers[0] = timer0.CpuTime()/100.;
+ StandalonePerfTime(10);
- }
+#endif
+#ifdef DRAW1
+ {
+ AliHLTTPCCADisplay &disp = AliHLTTPCCADisplay::Instance();
+ AliHLTTPCCATracker &slice = *this;
+ std::cout << "N out tracks = " << slice.NOutTracks() << std::endl;
+ AliHLTTPCCADisplay::Instance().SetSliceView();
+ AliHLTTPCCADisplay::Instance().SetCurrentSlice( this );
+ AliHLTTPCCADisplay::Instance().DrawSlice( this, 1 );
+ disp.DrawSliceHits( kRed, .5 );
+ disp.Ask();
+ for ( int itr = 0; itr < slice.NOutTracks(); itr++ ) {
+ std::cout << "track N " << itr << ", nhits=" << slice.OutTracks()[itr].NHits() << std::endl;
+ disp.DrawSliceOutTrack( itr, kBlue );
+ //disp.Ask();
+ //int id = slice.OutTracks()[itr].OrigTrackID();
+ //AliHLTTPCCATrack &tr = Tracks()[id];
+ //for( int ih=0; ih<tr.NHits(); ih++ ){
+ //int ic = (fTrackHits[tr.FirstHitID()+ih]);
+ //std::cout<<ih<<" "<<ID2IRow(ic)<<" "<<ID2IHit(ic)<<std::endl;
+ //}
+ //disp.DrawSliceTrack( id, kBlue );
+ //disp.Ask();
+ }
+ disp.Ask();
+ }
+#endif //DRAW1
+ timer0.Stop();
+ fTimers[0] = timer0.CpuTime() / 100.;
+}
GPUh() void AliHLTTPCCATracker::WriteOutput()
{
TStopwatch timer;
- //cout<<"output: nTracks = "<<*fNTracks<<", nHitsTotal="<<fNHitsTotal<<std::endl;
-
+ //cout<<"output: nTracks = "<<*fNTracks<<", nHitsTotal="<<NHitsTotal()<<std::endl;
- fOutput->SetNTracks( *fNTracks );
- fOutput->SetNTrackClusters( *fNTrackHits );
- fOutput->SetPointers();
-
- Float_t *hitsXYZ = reinterpret_cast<Float_t*>( fInputEvent ) + 1+fParam.NRows()*2+1;
+ if (fOutputControl == NULL) fOutputControl = new AliHLTTPCCASliceOutput::outputControlStruct;
+ AliHLTTPCCASliceOutput::Allocate(*fOutput, fCommonMem->fNTracks, fCommonMem->fNTrackHits, fOutputControl);
+ AliHLTTPCCASliceOutput* useOutput = *fOutput;
+ if (useOutput == NULL) return;
- Int_t nStoredHits = 0;
+ useOutput->SetNTracks( fCommonMem->fNTracks );
+ useOutput->SetNTrackClusters( fCommonMem->fNTrackHits );
- for( Int_t iTr=0; iTr<*fNTracks; iTr++){
- AliHLTTPCCATrack &iTrack = fTracks[iTr];
-
- AliHLTTPCCASliceTrack out;
- out.SetFirstClusterRef( nStoredHits );
- out.SetNClusters( iTrack.NHits() );
- out.SetParam( iTrack.Param() );
+ int nStoredHits = 0;
+
+ AliHLTTPCCASliceOutTrack *out = useOutput->FirstTrack();
- fOutput->SetTrack( iTr, out );
+ for ( int iTr = 0; iTr < fCommonMem->fNTracks; iTr++ ) {
+ AliHLTTPCCATrack &iTrack = fTracks[iTr];
- Int_t iID = iTrack.FirstHitID();
- for( Int_t ith=0; ith<iTrack.NHits(); ith++ ){
- Int_t ic = (fTrackHits[iID+ith]);
- Int_t iRow = ID2IRow(ic);
- Int_t ih = ID2IHit(ic);
+ out->SetParam( iTrack.Param() );
+ int nClu = 0;
+ int iID = iTrack.FirstHitID();
- const AliHLTTPCCARow &row = fRows[iRow];
-
- //Float_t y0 = row.Grid().YMin();
- //Float_t z0 = row.Grid().ZMin();
- //Float_t stepY = row.HstepY();
- //Float_t stepZ = row.HstepZ();
- //Float_t x = row.X();
-
- //const uint4 *tmpint4 = RowData() + row.FullOffset();
- //const ushort2 *hits = reinterpret_cast<const ushort2*>(tmpint4);
- //ushort2 hh = hits[ih];
- //Float_t y = y0 + hh.x*stepY;
- //Float_t z = z0 + hh.y*stepZ;
-
- Int_t inpIDtot = fHitInputIDs[row.FirstHit()+ih];
- Int_t inpID = inpIDtot - row.FirstHit();
-
- float origX = hitsXYZ[inpIDtot*3+0];
- float origY = hitsXYZ[inpIDtot*3+1];
- float origZ = hitsXYZ[inpIDtot*3+2];
-
- UInt_t hIDrc = AliHLTTPCCADataCompressor::IRowIClu2IDrc(iRow,inpID);
- UShort_t hPackedYZ = 0;
- UChar_t hPackedAmp = 0;
- float2 hUnpackedYZ = CAMath::MakeFloat2(origY,origZ);
- float hUnpackedX = origX;
-
- fOutput->SetClusterIDrc( nStoredHits, hIDrc );
- fOutput->SetClusterPackedYZ( nStoredHits, hPackedYZ );
- fOutput->SetClusterPackedAmp( nStoredHits, hPackedAmp);
- fOutput->SetClusterUnpackedYZ( nStoredHits, hUnpackedYZ );
- fOutput->SetClusterUnpackedX( nStoredHits, hUnpackedX );
- nStoredHits++;
- }
- }
-
-
- // old stuff
-
- *fNOutTrackHits = 0;
- *fNOutTracks = 0;
-
-
- for( Int_t iTr=0; iTr<*fNTracks; iTr++){
-
- AliHLTTPCCATrack &iTrack = fTracks[iTr];
-
- //cout<<"iTr = "<<iTr<<", nHits="<<iTrack.NHits()<<std::endl;
-
- //if( !iTrack.Alive() ) continue;
- if( iTrack.NHits()<3 ) continue;
- AliHLTTPCCAOutTrack &out = fOutTracks[*fNOutTracks];
- out.SetFirstHitRef( *fNOutTrackHits );
- out.SetNHits( 0 );
- out.SetOrigTrackID( iTr );
- out.SetStartPoint( iTrack.Param() );
- out.SetEndPoint( iTrack.Param() );
-
- Int_t iID = iTrack.FirstHitID();
- Int_t nOutTrackHitsOld = *fNOutTrackHits;
-
- for( Int_t ith=0; ith<iTrack.NHits(); ith++ ){
- Int_t ic = (fTrackHits[iID+ith]);
- const AliHLTTPCCARow &row = ID2Row(ic);
- Int_t ih = ID2IHit(ic);
- fOutTrackHits[*fNOutTrackHits] = fHitInputIDs[row.FirstHit()+ih];
- (*fNOutTrackHits)++;
- //cout<<"write i,row,hit,id="<<ith<<", "<<ID2IRow(ic)<<", "<<ih<<", "<<fHitInputIDs[row.FirstHit()+ih]<<std::endl;
- if( *fNOutTrackHits>=10*fNHitsTotal ){
- std::cout<<"fNOutTrackHits>fNHitsTotal"<<std::endl;
- //exit(0);
- return;//SG!!!
+ for ( int ith = 0; ith < iTrack.NHits(); ith++ ) {
+ const AliHLTTPCCAHitId &ic = fTrackHits[iID + ith];
+ int iRow = ic.RowIndex();
+ int ih = ic.HitIndex();
+
+ const AliHLTTPCCARow &row = fData.Row( iRow );
+
+ int clusterIndex = fData.ClusterDataIndex( row, ih );
+ int clusterRowIndex = clusterIndex - fClusterData->RowOffset( iRow );
+
+ if ( clusterIndex < 0 || clusterIndex >= fClusterData->NumberOfClusters() ) {
+ //std::cout << inpIDtot << ", " << fClusterData->NumberOfClusters()
+ //<< "; " << inpID << ", " << fClusterData->NumberOfClusters( iRow ) << std::endl;
+ //abort();
+ continue;
}
- out.SetNHits( out.NHits() + 1 );
- }
- if( out.NHits() >= 2 ){
- (*fNOutTracks)++;
- }else {
- (*fNOutTrackHits) = nOutTrackHitsOld;
+ if ( clusterRowIndex < 0 || clusterRowIndex >= fClusterData->NumberOfClusters( iRow ) ) {
+ //std::cout << inpIDtot << ", " << fClusterData->NumberOfClusters()
+ //<< "; " << inpID << ", " << fClusterData->NumberOfClusters( iRow ) << std::endl;
+ //abort();
+ continue;
+ }
+
+ float origX = fClusterData->X( clusterIndex );
+ float origY = fClusterData->Y( clusterIndex );
+ float origZ = fClusterData->Z( clusterIndex );
+ int id = fClusterData->Id( clusterIndex );
+ AliHLTTPCCASliceOutCluster c;
+ c.Set( id, iRow, origX, origY, origZ );
+ out->SetCluster( nClu, c );
+ nClu++;
+ nStoredHits++;
}
- }
+ out->SetNClusters( nClu );
+ out = out->NextTrack();
+ }
timer.Stop();
- fTimers[5]+=timer.CpuTime();
+ fTimers[5] += timer.CpuTime();
}
-GPUh() void AliHLTTPCCATracker::FitTrackFull( AliHLTTPCCATrack &/**/, Float_t * /**/ ) const
-{
+#endif
+
+GPUh() void AliHLTTPCCATracker::FitTrackFull( const AliHLTTPCCATrack &/**/, float * /**/ ) const
+{
// fit track with material
-#ifdef XXX
- //* Fit the track
+#ifdef XXX
+ //* Fit the track
FitTrack( iTrack, tt0 );
- if( iTrack.NHits()<=3 ) return;
-
+ if ( iTrack.NHits() <= 3 ) return;
+
AliHLTTPCCATrackParam &t = iTrack.Param();
AliHLTTPCCATrackParam t0 = t;
t.Chi2() = 0;
- t.NDF() = -5;
- Bool_t first = 1;
-
- Int_t iID = iTrack.FirstHitID();
- for( Int_t ih=0; ih<iTrack.NHits(); ih++, iID++ ){
- Int_t *ic = &(fTrackHits[iID]);
- Int_t iRow = ID2IRow(*ic);
- AliHLTTPCCARow &row = fRows[iRow];
- if( !t0.TransportToX( row.X() ) ) continue;
- Float_t dy, dz;
- AliHLTTPCCAHit &h = ID2Hit(*ic);
-
- // check for wrong hits
- if(0){
+ t.NDF() = -5;
+ bool first = 1;
+
+ int iID = iTrack.FirstHitID();
+ for ( int ih = 0; ih < iTrack.NHits(); ih++, iID++ ) {
+ const AliHLTTPCCAHitId &ic = fTrackHits[iID];
+ int iRow = ic.rowIndex();
+ const AliHLTTPCCARow &row = fData.Row( iRow );
+ if ( !t0.TransportToX( row.X() ) ) continue;
+ float dy, dz;
+ const AliHLTTPCCAHit &h = ic.hitIndex();
+
+ // check for wrong hits
+ if ( 0 ) {
dy = t0.GetY() - h.Y();
dz = t0.GetZ() - h.Z();
-
+
//if( dy*dy > 3.5*3.5*(/*t0.GetErr2Y() + */h.ErrY()*h.ErrY() ) ) continue;//SG!!!
- //if( dz*dz > 3.5*3.5*(/*t0.GetErr2Z() + */h.ErrZ()*h.ErrZ() ) ) continue;
+ //if( dz*dz > 3.5*3.5*(/*t0.GetErr2Z() + */h.ErrZ()*h.ErrZ() ) ) continue;
}
- if( !t.TransportToX( row.X() ) ) continue;
+ if ( !t.TransportToX( row.X() ) ) continue;
//* Update the track
-
- if( first ){
- t.Cov()[ 0] = .5*.5;
+
+ if ( first ) {
+ t.Cov()[ 0] = .5 * .5;
t.Cov()[ 1] = 0;
- t.Cov()[ 2] = .5*.5;
+ t.Cov()[ 2] = .5 * .5;
t.Cov()[ 3] = 0;
t.Cov()[ 4] = 0;
- t.Cov()[ 5] = .2*.2;
+ t.Cov()[ 5] = .2 * .2;
t.Cov()[ 6] = 0;
t.Cov()[ 7] = 0;
t.Cov()[ 8] = 0;
- t.Cov()[ 9] = .2*.2;
+ t.Cov()[ 9] = .2 * .2;
t.Cov()[10] = 0;
t.Cov()[11] = 0;
t.Cov()[12] = 0;
t.Cov()[13] = 0;
- t.Cov()[14] = .2*.2;
+ t.Cov()[14] = .2 * .2;
t.Chi2() = 0;
t.NDF() = -5;
}
- Float_t err2Y, err2Z;
+ float err2Y, err2Z;
GetErrors2( iRow, t, err2Y, err2Z );
- if( !t.Filter2( h.Y(), h.Z(), err2Y, err2Z ) ) continue;
+ if ( !t.Filter2( h.Y(), h.Z(), err2Y, err2Z ) ) continue;
- first = 0;
- }
+ first = 0;
+ }
/*
- Float_t cosPhi = iTrack.Param().GetCosPhi();
+ float cosPhi = iTrack.Param().GetCosPhi();
p0.Param().TransportToX(ID2Row( iTrack.PointID()[0] ).X());
- p2.Param().TransportToX(ID2Row( iTrack.PointID()[1] ).X());
+ p2.Param().TransportToX(ID2Row( iTrack.PointID()[1] ).X());
if( p0.Param().GetCosPhi()*cosPhi<0 ){ // change direction
- Float_t *par = p0.Param().Par();
- Float_t *cov = p0.Param().Cov();
+ float *par = p0.Param().Par();
+ float *cov = p0.Param().Cov();
par[2] = -par[2]; // sin phi
par[3] = -par[3]; // DzDs
par[4] = -par[4]; // kappa
#endif
}
-GPUh() void AliHLTTPCCATracker::FitTrack( AliHLTTPCCATrack &/*track*/, Float_t */*t0[]*/ ) const
-{
- //* Fit the track
+GPUh() void AliHLTTPCCATracker::FitTrack( const AliHLTTPCCATrack &/*track*/, float * /*t0[]*/ ) const
+{
+ //* Fit the track
#ifdef XXX
- AliHLTTPCCAEndPoint &p2 = ID2Point(track.PointID()[1]);
- AliHLTTPCCAHit &c0 = ID2Hit(fTrackHits[p0.TrackHitID()].HitID());
- AliHLTTPCCAHit &c1 = ID2Hit(fTrackHits[track.HitID()[1]].HitID());
- AliHLTTPCCAHit &c2 = ID2Hit(fTrackHits[p2.TrackHitID()].HitID());
- AliHLTTPCCARow &row0 = ID2Row(fTrackHits[p0.TrackHitID()].HitID());
- AliHLTTPCCARow &row1 = ID2Row(fTrackHits[track.HitID()[1]].HitID());
- AliHLTTPCCARow &row2 = ID2Row(fTrackHits[p2.TrackHitID()].HitID());
- Float_t sp0[5] = {row0.X(), c0.Y(), c0.Z(), c0.ErrY(), c0.ErrZ() };
- Float_t sp1[5] = {row1.X(), c1.Y(), c1.Z(), c1.ErrY(), c1.ErrZ() };
- Float_t sp2[5] = {row2.X(), c2.Y(), c2.Z(), c2.ErrY(), c2.ErrZ() };
- //cout<<"Fit track, points ="<<sp0[0]<<" "<<sp0[1]<<" / "<<sp1[0]<<" "<<sp1[1]<<" / "<<sp2[0]<<" "<<sp2[1]<<std::endl;
- if( track.NHits()>=3 ){
- p0.Param().ConstructXYZ3(sp0,sp1,sp2,p0.Param().CosPhi(), t0);
- p2.Param().ConstructXYZ3(sp2,sp1,sp0,p2.Param().CosPhi(), t0);
+ AliHLTTPCCAEndPoint &p2 = ID2Point( track.PointID()[1] );
+ const AliHLTTPCCAHit &c0 = ID2Hit( fTrackHits[p0.TrackHitID()].HitID() );
+ const AliHLTTPCCAHit &c1 = ID2Hit( fTrackHits[track.HitID()[1]].HitID() );
+ const AliHLTTPCCAHit &c2 = ID2Hit( fTrackHits[p2.TrackHitID()].HitID() );
+ const AliHLTTPCCARow &row0 = ID2Row( fTrackHits[p0.TrackHitID()].HitID() );
+ const AliHLTTPCCARow &row1 = ID2Row( fTrackHits[track.HitID()[1]].HitID() );
+ const AliHLTTPCCARow &row2 = ID2Row( fTrackHits[p2.TrackHitID()].HitID() );
+ float sp0[5] = {row0.X(), c0.Y(), c0.Z(), c0.ErrY(), c0.ErrZ() };
+ float sp1[5] = {row1.X(), c1.Y(), c1.Z(), c1.ErrY(), c1.ErrZ() };
+ float sp2[5] = {row2.X(), c2.Y(), c2.Z(), c2.ErrY(), c2.ErrZ() };
+ //std::cout<<"Fit track, points ="<<sp0[0]<<" "<<sp0[1]<<" / "<<sp1[0]<<" "<<sp1[1]<<" / "<<sp2[0]<<" "<<sp2[1]<<std::endl;
+ if ( track.NHits() >= 3 ) {
+ p0.Param().ConstructXYZ3( sp0, sp1, sp2, p0.Param().CosPhi(), t0 );
+ p2.Param().ConstructXYZ3( sp2, sp1, sp0, p2.Param().CosPhi(), t0 );
//p2.Param() = p0.Param();
//p2.Param().TransportToX(row2.X());
//p2.Param().Par()[1] = -p2.Param().Par()[1];
p0.Param().X() = row0.X();
p0.Param().Y() = c0.Y();
p0.Param().Z() = c0.Z();
- p0.Param().Err2Y() = c0.ErrY()*c0.ErrY();
- p0.Param().Err2Z() = c0.ErrZ()*c0.ErrZ();
+ p0.Param().Err2Y() = c0.ErrY() * c0.ErrY();
+ p0.Param().Err2Z() = c0.ErrZ() * c0.ErrZ();
p2.Param().X() = row2.X();
p2.Param().Y() = c2.Y();
p2.Param().Z() = c2.Z();
- p2.Param().Err2Y() = c2.ErrY()*c2.ErrY();
- p2.Param().Err2Z() = c2.ErrZ()*c2.ErrZ();
+ p2.Param().Err2Y() = c2.ErrY() * c2.ErrY();
+ p2.Param().Err2Z() = c2.ErrZ() * c2.ErrZ();
}
#endif
}
-
-GPUd() void AliHLTTPCCATracker::GetErrors2( Int_t iRow, Float_t z, Float_t sinPhi, Float_t cosPhi, Float_t DzDs, Float_t &Err2Y, Float_t &Err2Z ) const
+GPUdi() void AliHLTTPCCATracker::GetErrors2( int iRow, float z, float sinPhi, float cosPhi, float DzDs, float &Err2Y, float &Err2Z ) const
{
//
// Use calibrated cluster error from OCDB
//
fParam.GetClusterErrors2( iRow, z, sinPhi, cosPhi, DzDs, Err2Y, Err2Z );
+ Err2Y*=fParam.ClusterError2CorrectionY();
+ Err2Z*=fParam.ClusterError2CorrectionZ();
}
-GPUd() void AliHLTTPCCATracker::GetErrors2( Int_t iRow, const AliHLTTPCCATrackParam &t, Float_t &Err2Y, Float_t &Err2Z ) const
+GPUdi() void AliHLTTPCCATracker::GetErrors2( int iRow, const AliHLTTPCCATrackParam &t, float &Err2Y, float &Err2Z ) const
{
//
// Use calibrated cluster error from OCDB
}
-#if !defined(HLTCA_GPUCODE)
+#if !defined(HLTCA_GPUCODE)
-GPUh() void AliHLTTPCCATracker::WriteEvent( std::ostream &out )
+GPUh() void AliHLTTPCCATracker::WriteEvent( std::ostream &out )
{
// write event to the file
- for( Int_t iRow=0; iRow<fParam.NRows(); iRow++ ){
- out<<fRows[iRow].FirstHit()<<" "<<fRows[iRow].NHits()<<std::endl;
- }
- out<<fNHitsTotal<<std::endl;
-
- Float_t *y = new Float_t [fNHitsTotal];
- Float_t *z = new Float_t [fNHitsTotal];
-
- for( Int_t iRow=0; iRow<fParam.NRows(); iRow++){
- AliHLTTPCCARow &row = fRows[iRow];
- Float_t y0 = row.Grid().YMin();
- Float_t z0 = row.Grid().ZMin();
- Float_t stepY = row.HstepY();
- Float_t stepZ = row.HstepZ();
- const uint4* tmpint4 = RowData() + row.FullOffset();
- const ushort2 *hits = reinterpret_cast<const ushort2*>(tmpint4);
- for( Int_t ih=0; ih<fRows[iRow].NHits(); ih++ ){
- Int_t ihTot = row.FirstHit() + ih;
- Int_t id = fHitInputIDs[ihTot];
- ushort2 hh = hits[ih];
- y[id] = y0 + hh.x*stepY;
- z[id] = z0 + hh.y*stepZ;
+ for ( int iRow = 0; iRow < fParam.NRows(); iRow++ ) {
+ out << fData.Row( iRow ).HitNumberOffset() << " " << fData.Row( iRow ).NHits() << std::endl;
+ }
+ out << NHitsTotal() << std::endl;
+
+ AliHLTResizableArray<float> y( NHitsTotal() ), z( NHitsTotal() );
+
+ for ( int iRow = 0; iRow < fParam.NRows(); iRow++ ) {
+ const AliHLTTPCCARow &row = Row( iRow );
+ float y0 = row.Grid().YMin();
+ float z0 = row.Grid().ZMin();
+ float stepY = row.HstepY();
+ float stepZ = row.HstepZ();
+ for ( int ih = 0; ih < fData.Row( iRow ).NHits(); ih++ ) {
+ int id = HitInputID( row, ih );
+ y[id] = y0 + HitDataY( row, ih ) * stepY;
+ z[id] = z0 + HitDataZ( row, ih ) * stepZ;
}
}
- for( Int_t ih=0; ih<fNHitsTotal; ih++ ){
- out<<y[ih]<<" "<<z[ih]<<std::endl;
+ for ( int ih = 0; ih < NHitsTotal(); ih++ ) {
+ out << y[ih] << " " << z[ih] << std::endl;
}
- delete[] y;
- delete[] z;
}
-GPUh() void AliHLTTPCCATracker::ReadEvent( std::istream &in )
-{
- //* Read event from file
-
- Int_t *rowFirstHit = new Int_t[ Param().NRows()];
- Int_t *rowNHits = new Int_t [ Param().NRows()];
-
- for( Int_t iRow=0; iRow<Param().NRows(); iRow++ ){
- in>>rowFirstHit[iRow]>>rowNHits[iRow];
- }
- Int_t nHits;
- in >> nHits;
-
- Float_t *y = new Float_t[ nHits ];
- Float_t *z = new Float_t[ nHits ];
- for( Int_t ih=0; ih<nHits; ih++ ){
- in>>y[ih]>>z[ih];
- }
- //ReadEvent( rowFirstHit, rowNHits, y, z, nHits );
- if( rowFirstHit ) delete[] rowFirstHit;
- if( rowNHits )delete[] rowNHits;
- if( y )delete[] y;
- if( z )delete[] z;
-}
-
-GPUh() void AliHLTTPCCATracker::WriteTracks( std::ostream &out )
+GPUh() void AliHLTTPCCATracker::WriteTracks( std::ostream &/*out*/ )
{
- //* Write tracks to file
-
- out<<fTimers[0]<<std::endl;
- out<<*fNOutTrackHits<<std::endl;
- for( Int_t ih=0; ih<*fNOutTrackHits; ih++ ){
- out<< fOutTrackHits[ih]<<" ";
- }
- out<<std::endl;
-
- out<<*fNOutTracks<<std::endl;
-
- for( Int_t itr=0; itr<*fNOutTracks; itr++ ){
- AliHLTTPCCAOutTrack &t = fOutTracks[itr];
- AliHLTTPCCATrackParam p1 = t.StartPoint();
- AliHLTTPCCATrackParam p2 = t.EndPoint();
- out<< t.NHits()<<" ";
- out<< t.FirstHitRef()<<" ";
- out<< t.OrigTrackID()<<" ";
- out<<std::endl;
- out<< p1.X()<<" ";
- out<< p1.SignCosPhi()<<" ";
- out<< p1.Chi2()<<" ";
- out<< p1.NDF()<<std::endl;
- for( Int_t i=0; i<5; i++ ) out<<p1.Par()[i]<<" ";
- out<<std::endl;
- for( Int_t i=0; i<15; i++ ) out<<p1.Cov()[i]<<" ";
- out<<std::endl;
- out<< p2.X()<<" ";
- out<< p2.SignCosPhi()<<" ";
- out<< p2.Chi2()<<" ";
- out<< p2.NDF()<<std::endl;
- for( Int_t i=0; i<5; i++ ) out<<p2.Par()[i]<<" ";
- out<<std::endl;
- for( Int_t i=0; i<15; i++ ) out<<p2.Cov()[i]<<" ";
- out<<std::endl;
- }
+ //* Write tracks to file --- dummy
}
-GPUh() void AliHLTTPCCATracker::ReadTracks( std::istream &in )
+GPUh() void AliHLTTPCCATracker::ReadTracks( std::istream &/*in*/ )
{
- //* Read tracks from file
- in>>fTimers[0];
- in>>*fNOutTrackHits;
-
- for( Int_t ih=0; ih<*fNOutTrackHits; ih++ ){
- in>>fOutTrackHits[ih];
- }
- in>>*fNOutTracks;
-
- for( Int_t itr=0; itr<*fNOutTracks; itr++ ){
- AliHLTTPCCAOutTrack &t = fOutTracks[itr];
- AliHLTTPCCATrackParam p1, p2;
- Int_t i;
- Float_t f;
- in>> i; t.SetNHits( i );
- in>> i; t.SetFirstHitRef( i );
- in>> i; t.SetOrigTrackID( i );
- in>> f; p1.SetX( f );
- in>> f; p1.SetSignCosPhi( f );
- in>> f; p1.SetChi2( f );
- in>> i; p1.SetNDF( i );
- for( Int_t j=0; j<5; j++ ){ in>>f; p1.SetPar(j,f); }
- for( Int_t j=0; j<15; j++ ){ in>>f; p1.SetCov(j,f); }
- in>> f; p2.SetX( f );
- in>> f; p2.SetSignCosPhi( f );
- in>> f; p2.SetChi2( f );
- in>> i; p2.SetNDF( i );
- for( Int_t j=0; j<5; j++ ){ in>>f; p2.SetPar(j,f); }
- for( Int_t j=0; j<15; j++ ){ in>>f; p2.SetCov(j,f); }
- t.SetStartPoint( p1 );
- t.SetEndPoint( p2 );
- }
+ //* Read tracks from file -- dummy
}
#endif