3 /**************************************************************************
4 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
6 * Author: The ALICE Off-line Project. *
7 * Contributors are mentioned in the code where appropriate. *
9 * Permission to use, copy, modify and distribute this software and its *
10 * documentation strictly for non-commercial purposes is hereby granted *
11 * without fee, provided that the above copyright notice appears in all *
12 * copies and that both the copyright notice and this permission notice *
13 * appear in the supporting documentation. The authors make no claims *
14 * about the suitability of this software for any purpose. It is *
15 * provided "as is" without express or implied warranty. *
16 **************************************************************************/
19 * >> Flat structure representing a TPC seed <<
21 * To be used in the online and offline calibration schema.
24 * Primary Authors : Sergey Gorbunov, Jochen Thaeder, Chiara Zampolli
26 **************************************************************************/
28 #include "AliFlatTPCseed.h"
29 #include "AliTPCseed.h"
30 #include "AliHLTTPCTransform.h"
31 #include "Riostream.h"
34 void AliFlatTPCseed::SetFromTPCseed( const AliTPCseed *p )
36 // initialise from AliTPCseed
41 fParam.SetExternalTrackParam( p );
42 fLabel = p->GetLabel();
43 AliFlatTPCCluster *clusters = reinterpret_cast< AliFlatTPCCluster* >( fContent );
44 for( Int_t irow=0; irow<160; irow++ ){
45 const AliTPCclusterMI *cl = p->GetClusterPointer(irow);
47 AliFlatTPCCluster &flatCluster = clusters[fNTPCClusters];
48 flatCluster.SetTPCCluster( cl );
53 void AliFlatTPCseed::GetTPCseed( AliTPCseed *p ) const
55 // write to AliTPCseed
61 fParam.GetExternalTrackParam( seed );
62 seed.SetLabel(fLabel);
63 seed.SetNumberOfClusters(fNTPCClusters);
65 AliTPCclusterMI clusters[fNTPCClusters];
67 const AliFlatTPCCluster *flatClusters = reinterpret_cast< const AliFlatTPCCluster* >( fContent );
69 for( Int_t ic=0; ic<fNTPCClusters; ic++){
70 const AliFlatTPCCluster &flatCluster = flatClusters[ic];
71 flatCluster.GetTPCCluster( &(clusters[ic]) );
72 int sec = flatCluster.GetSector();
73 int row = flatCluster.GetPadRow();
74 if(sec >= 36) row = row + AliHLTTPCTransform::GetNRowLow();
75 if( row<160 ) seed.SetClusterPointer( row , &(clusters[ic]) );
77 new (p) AliTPCseed( seed, kTRUE ); // true means that p creates its own cluster objects