]>
Commit | Line | Data |
---|---|---|
dc9f7928 | 1 | #ifndef ALIHLTTPCFASTTRANSFORM_H |
2 | #define ALIHLTTPCFASTTRANSFORM_H | |
3 | ||
4 | //* This file is property of and copyright by the ALICE HLT Project * | |
5 | //* ALICE Experiment at CERN, All rights reserved. * | |
6 | //* See cxx source for full Copyright notice * | |
7 | ||
8 | /** @file AliHLTTPCFastTransform.h | |
9 | @author Sergey Gorbunov | |
10 | @date | |
11 | @brief | |
12 | */ | |
13 | ||
14 | // see below for class documentation | |
15 | // or | |
16 | // refer to README to build package | |
17 | // or | |
18 | // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt | |
19 | ||
20 | #include"Rtypes.h" | |
21 | #include"AliHLTTPCSpline2D3D.h" | |
22 | ||
23 | class AliTPCTransform; | |
24 | ||
25 | /** | |
26 | * @class AliHLTTPCFastTransform | |
27 | * | |
28 | * The class transforms internal TPC coordinates (pad,time) to XYZ. | |
29 | * | |
30 | * @ingroup alihlt_tpc_components | |
31 | */ | |
32 | ||
33 | ||
34 | ||
35 | class AliHLTTPCFastTransform{ | |
36 | ||
37 | public: | |
38 | ||
39 | static AliHLTTPCFastTransform* Instance(); | |
dc9f7928 | 40 | |
41 | /** standard constructor */ | |
42 | AliHLTTPCFastTransform(); | |
43 | /** destructor */ | |
44 | virtual ~AliHLTTPCFastTransform(); | |
45 | ||
46 | /** initialization */ | |
47 | Int_t Init( AliTPCTransform *transform=0, Int_t TimeStamp=-1 ); | |
dbff40a1 | 48 | |
49 | /** initialization */ | |
50 | Bool_t IsInitialised() const { return fOrigTransform!=NULL; } | |
dc9f7928 | 51 | |
52 | /** set the time stamp */ | |
53 | void SetCurrentTimeStamp( Int_t TimeStamp ); | |
54 | ||
55 | /** Transformation */ | |
56 | Int_t Transform( Int_t Sector, Int_t Row, Float_t Pad, Float_t Time, Float_t XYZ[] ); | |
57 | ||
58 | /** Transformation in double*/ | |
59 | Int_t Transform( Int_t Sector, Int_t Row, Float_t Pad, Float_t Time, Double_t XYZ[] ); | |
60 | ||
61 | /** Initialisation of splines for a particular row */ | |
62 | Int_t InitRow( Int_t iSector, Int_t iRow ); | |
63 | ||
64 | /** total size of the object*/ | |
65 | Int_t GetSize() const ; | |
66 | ||
67 | /** size of a particular row*/ | |
68 | Int_t GetRowSize( Int_t iSec, Int_t iRow ) const; | |
69 | ||
70 | /** last calibrated time bin */ | |
71 | Int_t GetLastTimeBin() const { return fLastTimeBin; } | |
72 | ||
73 | private: | |
74 | ||
75 | /** copy constructor prohibited */ | |
76 | AliHLTTPCFastTransform(const AliHLTTPCFastTransform&); | |
77 | /** assignment operator prohibited */ | |
78 | AliHLTTPCFastTransform& operator=(const AliHLTTPCFastTransform&); | |
79 | ||
9eb867b1 | 80 | static AliHLTTPCFastTransform fgInstance; // singleton control |
dc9f7928 | 81 | |
82 | struct AliRowTransform{ | |
83 | AliHLTTPCSpline2D3D fSpline[3]; | |
84 | }; | |
85 | ||
86 | AliTPCTransform * fOrigTransform; //! transient | |
87 | Int_t fLastTimeStamp; // last time stamp | |
88 | Int_t fLastTimeBin; // last calibrated time bin | |
89 | Float_t fTimeBorder1; //! transient | |
90 | Float_t fTimeBorder2; //! transient | |
91 | ||
92 | AliHLTTPCFastTransform::AliRowTransform *fRows[72][100]; //! transient | |
93 | ||
94 | ClassDef(AliHLTTPCFastTransform,0) | |
95 | }; | |
96 | ||
97 | inline Int_t AliHLTTPCFastTransform::Transform( Int_t iSec, Int_t iRow, Float_t Pad, Float_t Time, Float_t XYZ[] ){ | |
10801676 | 98 | if( iSec<0 || iSec>=72 || iRow<0 || iRow>=100 || !fRows[iSec][iRow] ) return 1; |
dc9f7928 | 99 | Int_t iTime = ( Time>=fTimeBorder2 ) ?2 :( ( Time>fTimeBorder1 ) ?1 :0 ); |
100 | fRows[iSec][iRow]->fSpline[iTime].GetValue(Pad, Time, XYZ); | |
101 | return 0; | |
102 | } | |
103 | ||
104 | inline Int_t AliHLTTPCFastTransform::Transform( Int_t iSec, Int_t iRow, Float_t Pad, Float_t Time, Double_t XYZ[] ){ | |
10801676 | 105 | if( iSec<0 || iSec>=72 || iRow<0 || iRow>=100 || !fRows[iSec][iRow] ) return 1; |
dc9f7928 | 106 | Int_t iTime = ( Time>=fTimeBorder2 ) ?2 :( ( Time>fTimeBorder1 ) ?1 :0 ); |
107 | fRows[iSec][iRow]->fSpline[iTime].GetValue(Pad, Time, XYZ); | |
108 | return 0; | |
109 | } | |
110 | ||
111 | ||
9eb867b1 | 112 | inline AliHLTTPCFastTransform* AliHLTTPCFastTransform::Instance(){ // Singleton implementation |
113 | return &fgInstance; | |
dc9f7928 | 114 | } |
115 | ||
116 | #endif |