2 // **************************************************************************
3 // This file is property of and copyright by the ALICE HLT Project *
4 // ALICE Experiment at CERN, All rights reserved. *
6 // Primary Authors: Sergey Gorbunov <sergey.gorbunov@kip.uni-heidelberg.de> *
7 // Ivan Kisel <kisel@kip.uni-heidelberg.de> *
8 // for The ALICE HLT Project. *
10 // Permission to use, copy, modify and distribute this software and its *
11 // documentation strictly for non-commercial purposes is hereby granted *
12 // without fee, provided that the above copyright notice appears in all *
13 // copies and that both the copyright notice and this permission notice *
14 // appear in the supporting documentation. The authors make no claims *
15 // about the suitability of this software for any purpose. It is *
16 // provided "as is" without express or implied warranty. *
18 //***************************************************************************
20 #include "AliHLTTPCCATracker.h"
21 #include "AliHLTTPCCAOutTrack.h"
22 #include "AliHLTTPCCAGrid.h"
23 #include "AliHLTTPCCARow.h"
24 #include "AliHLTTPCCATrack.h"
25 #include "AliHLTTPCCATracklet.h"
26 #include "AliHLTTPCCAMath.h"
27 #include "AliHLTTPCCAHit.h"
28 #include "MemoryAssignmentHelpers.h"
30 #include "TStopwatch.h"
31 #include "AliHLTTPCCAHitArea.h"
32 #include "AliHLTTPCCANeighboursFinder.h"
33 #include "AliHLTTPCCANeighboursCleaner.h"
34 #include "AliHLTTPCCAStartHitsFinder.h"
35 #include "AliHLTTPCCATrackletConstructor.h"
36 #include "AliHLTTPCCATrackletSelector.h"
37 #include "AliHLTTPCCAProcess.h"
38 #include "AliHLTTPCCASliceTrack.h"
39 #include "AliHLTTPCCASliceOutput.h"
40 #include "AliHLTTPCCADataCompressor.h"
41 #include "AliHLTTPCCAClusterData.h"
43 #include "AliHLTTPCCATrackParam.h"
45 #if !defined(HLTCA_GPUCODE)
52 #include "AliHLTTPCCADisplay.h"
55 #ifdef HLTCA_INTERNAL_PERFORMANCE
56 #include "AliHLTTPCCAPerformance.h"
60 ClassImp( AliHLTTPCCATracker )
62 #if !defined(HLTCA_GPUCODE)
64 AliHLTTPCCATracker::AliHLTTPCCATracker()
70 fCommonMemorySize( 0 ),
74 fTrackMemorySize( 0 ),
76 fTrackletStartHits( 0 ),
91 GPUd() AliHLTTPCCATracker::~AliHLTTPCCATracker()
94 delete[] fCommonMemory;
96 delete[] fTrackMemory;
102 // ----------------------------------------------------------------------------------
103 GPUd() void AliHLTTPCCATracker::Initialize( const AliHLTTPCCAParam ¶m )
108 fData.InitializeRows( fParam );
113 GPUd() void AliHLTTPCCATracker::StartEvent()
115 // start new event and fresh the memory
121 void AliHLTTPCCATracker::SetupCommonMemory()
123 // set up common memory
125 if ( !fCommonMemory ) {
126 SetPointersCommon(); // just to calculate the size
127 // the 1600 extra bytes are not used unless fCommonMemorySize increases with a later event
128 fCommonMemory = reinterpret_cast<char*> ( new uint4 [ fCommonMemorySize/sizeof( uint4 ) + 100] );
129 SetPointersCommon();// set pointers
134 delete[] fTrackMemory;
145 GPUhd() void AliHLTTPCCATracker::SetPointersCommon()
147 // set all pointers to the event memory
149 char *mem = fCommonMemory;
150 AssignMemory( fNTracklets, mem, 1 );
151 AssignMemory( fNTracks, mem, 1 );
152 AssignMemory( fNTrackHits, mem, 1 );
153 AssignMemory( fNOutTracks, mem, 1 );
154 AssignMemory( fNOutTrackHits, mem, 1 );
156 // calculate the size
158 fCommonMemorySize = mem - fCommonMemory;
162 GPUhd() void AliHLTTPCCATracker::SetPointersHits( int MaxNHits )
164 // set all pointers to the event memory
166 char *mem = fHitMemory;
168 // extra arrays for tpc clusters
170 AssignMemory( fTrackletStartHits, mem, MaxNHits );
172 // arrays for track hits
174 AssignMemory( fTrackHits, mem, 10 * MaxNHits );
176 AssignMemory( fOutTrackHits, mem, 10 * MaxNHits );
178 // calculate the size
180 fHitMemorySize = mem - fHitMemory;
184 GPUhd() void AliHLTTPCCATracker::SetPointersTracks( int MaxNTracks, int MaxNHits )
186 // set all pointers to the tracks memory
188 char *mem = fTrackMemory;
190 // memory for tracklets
192 AssignMemory( fTracklets, mem, MaxNTracks );
194 // memory for selected tracks
196 AssignMemory( fTracks, mem, MaxNTracks );
200 AlignTo < sizeof( void * ) > ( mem );
201 fOutput = reinterpret_cast<AliHLTTPCCASliceOutput *>( mem );
202 mem += AliHLTTPCCASliceOutput::EstimateSize( MaxNTracks, MaxNHits );
204 // memory for output tracks
206 AssignMemory( fOutTracks, mem, MaxNTracks );
208 // calculate the size
210 fTrackMemorySize = mem - fTrackMemory;
214 void AliHLTTPCCATracker::ReadEvent( AliHLTTPCCAClusterData *clusterData )
218 fClusterData = clusterData;
222 //* Convert input hits, create grids, etc.
223 fData.InitFromClusterData( *clusterData );
226 SetPointersHits( fData.NumberOfHits() ); // to calculate the size
227 fHitMemory = reinterpret_cast<char*> ( new uint4 [ fHitMemorySize/sizeof( uint4 ) + 100] );
228 SetPointersHits( fData.NumberOfHits() ); // set pointers for hits
236 GPUh() void AliHLTTPCCATracker::Reconstruct()
238 //* reconstruction of event
239 //std::cout<<"Reconstruct slice "<<fParam.ISlice()<<", nHits="<<NHitsTotal()<<std::endl;
241 fTimers[0] = 0; // find neighbours
242 fTimers[1] = 0; // construct tracklets
243 fTimers[2] = 0; // fit tracklets
244 fTimers[3] = 0; // prolongation of tracklets
245 fTimers[4] = 0; // selection
246 fTimers[5] = 0; // write output
250 //if( fParam.ISlice()<1 ) return; //SG!!!
254 if ( NHitsTotal() < 1 ) {
256 SetPointersTracks( 1, 1 ); // to calculate the size
257 fTrackMemory = reinterpret_cast<char*> ( new uint4 [ fTrackMemorySize/sizeof( uint4 ) + 100] );
258 SetPointersTracks( 1, 1 ); // set pointers for tracks
259 fOutput->SetNTracks( 0 );
260 fOutput->SetNTrackClusters( 0 );
266 //if( fParam.ISlice()==15){
267 AliHLTTPCCADisplay::Instance().ClearView();
268 AliHLTTPCCADisplay::Instance().SetSliceView();
269 AliHLTTPCCADisplay::Instance().SetCurrentSlice( this );
270 AliHLTTPCCADisplay::Instance().DrawSlice( this, 1 );
271 if ( NHitsTotal() > 0 ) {
272 AliHLTTPCCADisplay::Instance().DrawSliceHits( kRed, .5 );
273 AliHLTTPCCADisplay::Instance().Ask();
281 #if !defined(HLTCA_GPUCODE)
283 AliHLTTPCCAProcess<AliHLTTPCCANeighboursFinder>( Param().NRows(), 1, *this );
285 #ifdef HLTCA_INTERNAL_PERFORMANCE
286 //if( Param().ISlice()<=2 )
287 //AliHLTTPCCAPerformance::Instance().LinkPerformance( Param().ISlice() );
292 if ( NHitsTotal() > 0 ) {
293 AliHLTTPCCADisplay::Instance().DrawSliceLinks( -1, -1, 1 );
294 AliHLTTPCCADisplay::Instance().Ask();
299 AliHLTTPCCAProcess<AliHLTTPCCANeighboursCleaner>( Param().NRows() - 2, 1, *this );
300 AliHLTTPCCAProcess<AliHLTTPCCAStartHitsFinder>( Param().NRows() - 4, 1, *this );
302 int nStartHits = *fNTracklets;
305 int nBlocks = NHitsTotal() / nThreads + 1;
306 if ( nBlocks < 12 ) {
308 nThreads = NHitsTotal() / 12 + 1;
309 if ( nThreads % 32 ) nThreads = ( nThreads / 32 + 1 ) * 32;
312 nThreads = NHitsTotal();
315 fData.ClearHitWeights();
316 //AliHLTTPCCAProcess<AliHLTTPCCAUsedHitsInitialiser>( nBlocks, nThreads, *this );
320 SetPointersTracks( nStartHits*2, NHitsTotal() ); // to calculate the size
321 fTrackMemory = reinterpret_cast<char*> ( new uint4 [ fTrackMemorySize/sizeof( uint4 ) + 100] );
322 SetPointersTracks( nStartHits*2, NHitsTotal() ); // set pointers for hits
325 int nMemThreads = AliHLTTPCCATrackletConstructor::NMemThreads();
327 nBlocks = nStartHits / nThreads + 1;
328 if ( nBlocks < 30 ) {
330 nThreads = ( nStartHits ) / 30 + 1;
331 if ( nThreads % 32 ) nThreads = ( nThreads / 32 + 1 ) * 32;
334 nThreads = nStartHits;
337 AliHLTTPCCAProcess1<AliHLTTPCCATrackletConstructor>( nBlocks, nMemThreads + nThreads, *this );
339 //std::cout<<"Slice "<<Param().ISlice()<<": NHits="<<NHitsTotal()<<", NTracklets="<<*NTracklets()<<std::endl;
343 nBlocks = nStartHits / nThreads + 1;
344 if ( nBlocks < 12 ) {
346 nThreads = nStartHits / 12 + 1;
347 nThreads = ( nThreads / 32 + 1 ) * 32;
352 nThreads = nStartHits;
356 AliHLTTPCCAProcess<AliHLTTPCCATrackletSelector>( nBlocks, nThreads, *this );
358 //std::cout<<"Slice "<<Param().ISlice()<<": N start hits/tracklets/tracks = "<<nStartHits<<" "<<nStartHits<<" "<<*fNTracks<<std::endl;
361 //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;
371 AliHLTTPCCADisplay &disp = AliHLTTPCCADisplay::Instance();
372 AliHLTTPCCATracker &slice = *this;
373 std::cout << "N out tracks = " << *slice.NOutTracks() << std::endl;
375 AliHLTTPCCADisplay::Instance().SetCurrentSlice( this );
376 AliHLTTPCCADisplay::Instance().DrawSlice( this, 1 );
377 disp.DrawSliceHits( -1, .5 );
378 for ( int itr = 0; itr < *slice.NOutTracks(); itr++ ) {
379 std::cout << "track N " << itr << ", nhits=" << slice.OutTracks()[itr].NHits() << std::endl;
380 disp.DrawSliceOutTrack( itr, kBlue );
382 //int id = slice.OutTracks()[itr].OrigTrackID();
383 //AliHLTTPCCATrack &tr = Tracks()[id];
384 //for( int ih=0; ih<tr.NHits(); ih++ ){
385 //int ic = (fTrackHits[tr.FirstHitID()+ih]);
386 //std::cout<<ih<<" "<<ID2IRow(ic)<<" "<<ID2IHit(ic)<<std::endl;
388 //disp.DrawSliceTrack( id, kBlue );
396 fTimers[0] = timer0.CpuTime() / 100.;
403 GPUh() void AliHLTTPCCATracker::WriteOutput()
409 //cout<<"output: nTracks = "<<*fNTracks<<", nHitsTotal="<<NHitsTotal()<<std::endl;
411 fOutput->SetNTracks( *fNTracks );
412 fOutput->SetNTrackClusters( *fNTrackHits );
413 fOutput->SetPointers();
417 for ( int iTr = 0; iTr < *fNTracks; iTr++ ) {
418 AliHLTTPCCATrack &iTrack = fTracks[iTr];
420 AliHLTTPCCASliceTrack out;
421 out.SetFirstClusterRef( nStoredHits );
422 out.SetNClusters( iTrack.NHits() );
423 out.SetParam( iTrack.Param() );
425 fOutput->SetTrack( iTr, out );
427 int iID = iTrack.FirstHitID();
428 for ( int ith = 0; ith < iTrack.NHits(); ith++ ) {
429 const AliHLTTPCCAHitId &ic = fTrackHits[iID + ith];
430 int iRow = ic.RowIndex();
431 int ih = ic.HitIndex();
433 const AliHLTTPCCARow &row = fData.Row( iRow );
435 //float y0 = row.Grid().YMin();
436 //float z0 = row.Grid().ZMin();
437 //float stepY = row.HstepY();
438 //float stepZ = row.HstepZ();
441 //const uint4 *tmpint4 = RowData() + row.FullOffset();
442 //const ushort2 *hits = reinterpret_cast<const ushort2*>(tmpint4);
443 //ushort2 hh = hits[ih];
444 //float y = y0 + hh.x*stepY;
445 //float z = z0 + hh.y*stepZ;
447 int clusterIndex = fData.ClusterDataIndex( row, ih );
448 int clusterRowIndex = clusterIndex - fClusterData->RowOffset( iRow );
450 if ( clusterIndex < 0 || clusterIndex >= fClusterData->NumberOfClusters() ) {
451 //std::cout << inpIDtot << ", " << fClusterData->NumberOfClusters()
452 //<< "; " << inpID << ", " << fClusterData->NumberOfClusters( iRow ) << std::endl;
456 if ( clusterRowIndex < 0 || clusterRowIndex >= fClusterData->NumberOfClusters( iRow ) ) {
457 //std::cout << inpIDtot << ", " << fClusterData->NumberOfClusters()
458 //<< "; " << inpID << ", " << fClusterData->NumberOfClusters( iRow ) << std::endl;
463 float origX = fClusterData->X( clusterIndex );
464 float origY = fClusterData->Y( clusterIndex );
465 float origZ = fClusterData->Z( clusterIndex );
468 int id = fClusterData->Id( clusterIndex );
470 unsigned short hPackedYZ = 0;
471 UChar_t hPackedAmp = 0;
473 hUnpackedYZ.x = origY;
474 hUnpackedYZ.y = origZ;
475 float hUnpackedX = origX;
477 fOutput->SetClusterId( nStoredHits, id );
478 fOutput->SetClusterRow( nStoredHits, ( unsigned char ) iRow );
479 fOutput->SetClusterPackedYZ( nStoredHits, hPackedYZ );
480 fOutput->SetClusterPackedAmp( nStoredHits, hPackedAmp );
481 fOutput->SetClusterUnpackedYZ( nStoredHits, hUnpackedYZ );
482 fOutput->SetClusterUnpackedX( nStoredHits, hUnpackedX );
494 for ( int iTr = 0; iTr < *fNTracks; iTr++ ) {
496 const AliHLTTPCCATrack &iTrack = fTracks[iTr];
498 //std::cout<<"iTr = "<<iTr<<", nHits="<<iTrack.NHits()<<std::endl;
500 //if( !iTrack.Alive() ) continue;
501 if ( iTrack.NHits() < 3 ) continue;
502 AliHLTTPCCAOutTrack &out = fOutTracks[*fNOutTracks];
503 out.SetFirstHitRef( *fNOutTrackHits );
505 out.SetOrigTrackID( iTr );
506 out.SetStartPoint( iTrack.Param() );
507 out.SetEndPoint( iTrack.Param() );
509 int iID = iTrack.FirstHitID();
510 int nOutTrackHitsOld = *fNOutTrackHits;
512 for ( int ith = 0; ith < iTrack.NHits(); ith++ ) {
513 const AliHLTTPCCAHitId &ic = fTrackHits[iID + ith];
514 const AliHLTTPCCARow &row = Row( ic );
515 int ih = ic.HitIndex();
516 fOutTrackHits[*fNOutTrackHits] = HitInputID( row, ih );
517 ( *fNOutTrackHits )++;
518 //std::cout<<"write i,row,hit,id="<<ith<<", "<<ID2IRow(ic)<<", "<<ih<<", "<<HitInputID( row, ih )<<std::endl;
519 if ( *fNOutTrackHits >= 10*NHitsTotal() ) {
520 std::cout << "fNOutTrackHits>NHitsTotal()" << std::endl;
524 out.SetNHits( out.NHits() + 1 );
526 if ( out.NHits() >= 2 ) {
529 ( *fNOutTrackHits ) = nOutTrackHitsOld;
535 fTimers[5] += timer.CpuTime();
538 GPUh() void AliHLTTPCCATracker::FitTrackFull( const AliHLTTPCCATrack &/**/, float * /**/ ) const
540 // fit track with material
543 FitTrack( iTrack, tt0 );
544 if ( iTrack.NHits() <= 3 ) return;
546 AliHLTTPCCATrackParam &t = iTrack.Param();
547 AliHLTTPCCATrackParam t0 = t;
553 int iID = iTrack.FirstHitID();
554 for ( int ih = 0; ih < iTrack.NHits(); ih++, iID++ ) {
555 const AliHLTTPCCAHitId &ic = fTrackHits[iID];
556 int iRow = ic.rowIndex();
557 const AliHLTTPCCARow &row = fData.Row( iRow );
558 if ( !t0.TransportToX( row.X() ) ) continue;
560 const AliHLTTPCCAHit &h = ic.hitIndex();
562 // check for wrong hits
564 dy = t0.GetY() - h.Y();
565 dz = t0.GetZ() - h.Z();
567 //if( dy*dy > 3.5*3.5*(/*t0.GetErr2Y() + */h.ErrY()*h.ErrY() ) ) continue;//SG!!!
568 //if( dz*dz > 3.5*3.5*(/*t0.GetErr2Z() + */h.ErrZ()*h.ErrZ() ) ) continue;
571 if ( !t.TransportToX( row.X() ) ) continue;
576 t.Cov()[ 0] = .5 * .5;
578 t.Cov()[ 2] = .5 * .5;
581 t.Cov()[ 5] = .2 * .2;
585 t.Cov()[ 9] = .2 * .2;
590 t.Cov()[14] = .2 * .2;
595 GetErrors2( iRow, t, err2Y, err2Z );
597 if ( !t.Filter2( h.Y(), h.Z(), err2Y, err2Z ) ) continue;
602 float cosPhi = iTrack.Param().GetCosPhi();
603 p0.Param().TransportToX(ID2Row( iTrack.PointID()[0] ).X());
604 p2.Param().TransportToX(ID2Row( iTrack.PointID()[1] ).X());
605 if( p0.Param().GetCosPhi()*cosPhi<0 ){ // change direction
606 float *par = p0.Param().Par();
607 float *cov = p0.Param().Cov();
608 par[2] = -par[2]; // sin phi
609 par[3] = -par[3]; // DzDs
610 par[4] = -par[4]; // kappa
617 p0.Param().CosPhi() = -p0.Param().GetCosPhi();
623 GPUh() void AliHLTTPCCATracker::FitTrack( const AliHLTTPCCATrack &/*track*/, float * /*t0[]*/ ) const
627 AliHLTTPCCAEndPoint &p2 = ID2Point( track.PointID()[1] );
628 const AliHLTTPCCAHit &c0 = ID2Hit( fTrackHits[p0.TrackHitID()].HitID() );
629 const AliHLTTPCCAHit &c1 = ID2Hit( fTrackHits[track.HitID()[1]].HitID() );
630 const AliHLTTPCCAHit &c2 = ID2Hit( fTrackHits[p2.TrackHitID()].HitID() );
631 const AliHLTTPCCARow &row0 = ID2Row( fTrackHits[p0.TrackHitID()].HitID() );
632 const AliHLTTPCCARow &row1 = ID2Row( fTrackHits[track.HitID()[1]].HitID() );
633 const AliHLTTPCCARow &row2 = ID2Row( fTrackHits[p2.TrackHitID()].HitID() );
634 float sp0[5] = {row0.X(), c0.Y(), c0.Z(), c0.ErrY(), c0.ErrZ() };
635 float sp1[5] = {row1.X(), c1.Y(), c1.Z(), c1.ErrY(), c1.ErrZ() };
636 float sp2[5] = {row2.X(), c2.Y(), c2.Z(), c2.ErrY(), c2.ErrZ() };
637 //std::cout<<"Fit track, points ="<<sp0[0]<<" "<<sp0[1]<<" / "<<sp1[0]<<" "<<sp1[1]<<" / "<<sp2[0]<<" "<<sp2[1]<<std::endl;
638 if ( track.NHits() >= 3 ) {
639 p0.Param().ConstructXYZ3( sp0, sp1, sp2, p0.Param().CosPhi(), t0 );
640 p2.Param().ConstructXYZ3( sp2, sp1, sp0, p2.Param().CosPhi(), t0 );
641 //p2.Param() = p0.Param();
642 //p2.Param().TransportToX(row2.X());
643 //p2.Param().Par()[1] = -p2.Param().Par()[1];
644 //p2.Param().Par()[4] = -p2.Param().Par()[4];
646 p0.Param().X() = row0.X();
647 p0.Param().Y() = c0.Y();
648 p0.Param().Z() = c0.Z();
649 p0.Param().Err2Y() = c0.ErrY() * c0.ErrY();
650 p0.Param().Err2Z() = c0.ErrZ() * c0.ErrZ();
651 p2.Param().X() = row2.X();
652 p2.Param().Y() = c2.Y();
653 p2.Param().Z() = c2.Z();
654 p2.Param().Err2Y() = c2.ErrY() * c2.ErrY();
655 p2.Param().Err2Z() = c2.ErrZ() * c2.ErrZ();
661 GPUd() void AliHLTTPCCATracker::GetErrors2( int iRow, float z, float sinPhi, float cosPhi, float DzDs, float &Err2Y, float &Err2Z ) const
664 // Use calibrated cluster error from OCDB
667 fParam.GetClusterErrors2( iRow, z, sinPhi, cosPhi, DzDs, Err2Y, Err2Z );
670 GPUd() void AliHLTTPCCATracker::GetErrors2( int iRow, const AliHLTTPCCATrackParam &t, float &Err2Y, float &Err2Z ) const
673 // Use calibrated cluster error from OCDB
676 fParam.GetClusterErrors2( iRow, t.GetZ(), t.SinPhi(), t.GetCosPhi(), t.DzDs(), Err2Y, Err2Z );
680 #if !defined(HLTCA_GPUCODE)
682 GPUh() void AliHLTTPCCATracker::WriteEvent( std::ostream &out )
684 // write event to the file
685 for ( int iRow = 0; iRow < fParam.NRows(); iRow++ ) {
686 out << fData.Row( iRow ).HitNumberOffset() << " " << fData.Row( iRow ).NHits() << std::endl;
688 out << NHitsTotal() << std::endl;
690 AliHLTResizableArray<float> y( NHitsTotal() ), z( NHitsTotal() );
692 for ( int iRow = 0; iRow < fParam.NRows(); iRow++ ) {
693 const AliHLTTPCCARow &row = Row( iRow );
694 float y0 = row.Grid().YMin();
695 float z0 = row.Grid().ZMin();
696 float stepY = row.HstepY();
697 float stepZ = row.HstepZ();
698 for ( int ih = 0; ih < fData.Row( iRow ).NHits(); ih++ ) {
699 int id = HitInputID( row, ih );
700 y[id] = y0 + HitDataY( row, ih ) * stepY;
701 z[id] = z0 + HitDataZ( row, ih ) * stepZ;
704 for ( int ih = 0; ih < NHitsTotal(); ih++ ) {
705 out << y[ih] << " " << z[ih] << std::endl;
709 GPUh() void AliHLTTPCCATracker::WriteTracks( std::ostream &out )
711 //* Write tracks to file
713 out << fTimers[0] << std::endl;
714 out << *fNOutTrackHits << std::endl;
715 for ( int ih = 0; ih < *fNOutTrackHits; ih++ ) {
716 out << fOutTrackHits[ih] << " ";
720 out << *fNOutTracks << std::endl;
722 for ( int itr = 0; itr < *fNOutTracks; itr++ ) {
723 AliHLTTPCCAOutTrack &t = fOutTracks[itr];
724 AliHLTTPCCATrackParam p1 = t.StartPoint();
725 AliHLTTPCCATrackParam p2 = t.EndPoint();
726 out << t.NHits() << " ";
727 out << t.FirstHitRef() << " ";
728 out << t.OrigTrackID() << " ";
730 out << p1.X() << " ";
731 out << p1.SignCosPhi() << " ";
732 out << p1.Chi2() << " ";
733 out << p1.NDF() << std::endl;
734 for ( int i = 0; i < 5; i++ ) out << p1.Par()[i] << " ";
736 for ( int i = 0; i < 15; i++ ) out << p1.Cov()[i] << " ";
738 out << p2.X() << " ";
739 out << p2.SignCosPhi() << " ";
740 out << p2.Chi2() << " ";
741 out << p2.NDF() << std::endl;
742 for ( int i = 0; i < 5; i++ ) out << p2.Par()[i] << " ";
744 for ( int i = 0; i < 15; i++ ) out << p2.Cov()[i] << " ";
749 GPUh() void AliHLTTPCCATracker::ReadTracks( std::istream &in )
751 //* Read tracks from file
753 in >> *fNOutTrackHits;
755 for ( int ih = 0; ih < *fNOutTrackHits; ih++ ) {
756 in >> fOutTrackHits[ih];
760 for ( int itr = 0; itr < *fNOutTracks; itr++ ) {
761 AliHLTTPCCAOutTrack &t = fOutTracks[itr];
762 AliHLTTPCCATrackParam p1, p2;
765 in >> i; t.SetNHits( i );
766 in >> i; t.SetFirstHitRef( i );
767 in >> i; t.SetOrigTrackID( i );
768 in >> f; p1.SetX( f );
769 in >> f; p1.SetSignCosPhi( f );
770 in >> f; p1.SetChi2( f );
771 in >> i; p1.SetNDF( i );
772 for ( int j = 0; j < 5; j++ ) { in >> f; p1.SetPar( j, f ); }
773 for ( int j = 0; j < 15; j++ ) { in >> f; p1.SetCov( j, f ); }
774 in >> f; p2.SetX( f );
775 in >> f; p2.SetSignCosPhi( f );
776 in >> f; p2.SetChi2( f );
777 in >> i; p2.SetNDF( i );
778 for ( int j = 0; j < 5; j++ ) { in >> f; p2.SetPar( j, f ); }
779 for ( int j = 0; j < 15; j++ ) { in >> f; p2.SetCov( j, f ); }
780 t.SetStartPoint( p1 );