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
40 fParam.SetExternalTrackParam( p );
41 fLabel = p->GetLabel();
42 for( Int_t irow=0; irow<160; irow++ ){
43 AddCluster( p->GetClusterPointer(irow), p->GetTrackPointConst(irow) );
47 void AliFlatTPCseed::GetTPCseed( AliTPCseed *p ) const
49 // write to AliTPCseed
55 fParam.GetExternalTrackParam( seed );
56 seed.SetLabel(fLabel);
57 seed.SetNumberOfClusters(fNTPCClusters);
59 AliTPCclusterMI * clusters = new AliTPCclusterMI[fNTPCClusters];
61 const AliFlatTPCCluster *flatClusters = reinterpret_cast< const AliFlatTPCCluster* >( fContent );
63 for( Int_t ic=0; ic<fNTPCClusters; ic++){
64 const AliFlatTPCCluster &flatCluster = flatClusters[ic];
65 int sec = flatCluster.GetSector();
66 int row = flatCluster.GetPadRow();
67 if(sec >= 36) row = row + AliHLTTPCTransform::GetNRowLow();
69 flatCluster.GetTPCCluster( &(clusters[ic]), seed.GetTrackPoint(row) );
70 seed.SetClusterPointer( row , &(clusters[ic]) );
73 new (p) AliTPCseed( seed, kTRUE ); // true means that p creates its own cluster objects