]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/global/AliFlatTPCseed.cxx
LHAPDF: Removing lhapdf 5.3.1 version
[u/mrichter/AliRoot.git] / HLT / global / AliFlatTPCseed.cxx
CommitLineData
48ec9ee6 1/* $Id$ */
2
3/**************************************************************************
4 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * *
6 * Author: The ALICE Off-line Project. *
7 * Contributors are mentioned in the code where appropriate. *
8 * *
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 **************************************************************************/
17
18/**
19 * >> Flat structure representing a TPC seed <<
20 *
21 * To be used in the online and offline calibration schema.
22 *
23 *
24 * Primary Authors : Sergey Gorbunov, Jochen Thaeder, Chiara Zampolli
25 *
26 **************************************************************************/
27
28#include "AliFlatTPCseed.h"
bbddf50f 29#include "AliTPCseed.h"
30#include "AliHLTTPCTransform.h"
48ec9ee6 31#include "Riostream.h"
32
48ec9ee6 33
34void AliFlatTPCseed::SetFromTPCseed( const AliTPCseed *p )
35{
36 // initialise from AliTPCseed
37
bbddf50f 38 Reset();
39 if( !p ) return;
bbddf50f 40 fParam.SetExternalTrackParam( p );
bbac6f91 41 fLabel = p->GetLabel();
bbddf50f 42 for( Int_t irow=0; irow<160; irow++ ){
bbac6f91 43 AddCluster( p->GetClusterPointer(irow), p->GetTrackPointConst(irow) );
bbddf50f 44 }
48ec9ee6 45}
86b90cc6 46
47void AliFlatTPCseed::GetTPCseed( AliTPCseed *p ) const
48{
bbddf50f 49 // write to AliTPCseed
50 if( !p ) return;
51 p->Reset();
52
53 AliTPCseed seed;
54
55 fParam.GetExternalTrackParam( seed );
56 seed.SetLabel(fLabel);
57 seed.SetNumberOfClusters(fNTPCClusters);
58
f35b64f6 59 AliTPCclusterMI * clusters = new AliTPCclusterMI[fNTPCClusters];
bbddf50f 60
61 const AliFlatTPCCluster *flatClusters = reinterpret_cast< const AliFlatTPCCluster* >( fContent );
86b90cc6 62
bbddf50f 63 for( Int_t ic=0; ic<fNTPCClusters; ic++){
bbac6f91 64 const AliFlatTPCCluster &flatCluster = flatClusters[ic];
bbddf50f 65 int sec = flatCluster.GetSector();
66 int row = flatCluster.GetPadRow();
67 if(sec >= 36) row = row + AliHLTTPCTransform::GetNRowLow();
bbac6f91 68 if( row<160 ){
69 flatCluster.GetTPCCluster( &(clusters[ic]), seed.GetTrackPoint(row) );
70 seed.SetClusterPointer( row , &(clusters[ic]) );
71 }
bbddf50f 72 }
73 new (p) AliTPCseed( seed, kTRUE ); // true means that p creates its own cluster objects
f35b64f6 74 delete [] clusters;
86b90cc6 75}