2 // $Id: AliHLTTPCClusterTransformation.h 40939 2010-05-04 15:35:58Z kkanaki $
4 #ifndef ALIHLTTPCCLUSTERTRANSFORMATION_H
5 #define ALIHLTTPCCLUSTERTRANSFORMATION_H
7 //* This file is property of and copyright by the ALICE HLT Project *
8 //* ALICE Experiment at CERN, All rights reserved. *
9 //* See cxx source for full Copyright notice *
11 /** @file AliHLTTPCClusterTransformation.h
12 @author Kalliopi Kanaki, Sergey Gorbunov
17 // see below for class documentation
19 // refer to README to build package
21 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
25 #include "AliHLTTPCTransform.h"
26 #include "AliHLTTPCFastTransform.h"
32 * @class AliHLTTPCClusterTransformation
34 * The class transforms internal TPC coordinates (pad,time) to XYZ.
35 * Allnecessary calibration and alignment corrections are applied
37 * @ingroup alihlt_tpc_components
40 class AliHLTTPCClusterTransformation{
44 /** standard constructor */
45 AliHLTTPCClusterTransformation();
47 virtual ~AliHLTTPCClusterTransformation();
50 Int_t Init( double FieldBz, Long_t TimeStamp );
52 /** Initialised flag */
53 Bool_t IsInitialised() const;
55 /** Deinitialisation */
58 /** Setting the current time stamp */
59 Int_t SetCurrentTimeStamp( Long_t TimeStamp );
61 /** Returns the current time stamp */
62 Long_t GetCurrentTimeStamp() const { return fFastTransform.GetCurrentTimeStamp(); }
64 /** Transformation: calibration and alignment*/
65 Int_t Transform( int Slice, int Row, float Pad, float Time, float XYZ[] );
67 /** Applying reverse alignment */
68 int ReverseAlignment( float XYZ[], int slice, int padrow);
70 /** Last error message */
71 const char* GetLastError() const { return fError.Data(); }
74 void Print(const char* option=NULL) const;
76 /** total size of the object*/
77 Int_t GetSize() const ;
81 /** copy constructor prohibited */
82 AliHLTTPCClusterTransformation(const AliHLTTPCClusterTransformation&);
83 /** assignment operator prohibited */
84 AliHLTTPCClusterTransformation& operator=(const AliHLTTPCClusterTransformation&);
86 /** Set error string */
87 Int_t Error(Int_t code, const char *msg);
89 static AliRecoParam fOfflineRecoParam; //! static container for TPC Reco Param
91 TString fError; // Last error message
93 AliHLTTPCFastTransform fFastTransform;// fast transformation object
95 ClassDef(AliHLTTPCClusterTransformation, 1)
98 inline Int_t AliHLTTPCClusterTransformation::Error(Int_t code, const char *msg)
105 inline Int_t AliHLTTPCClusterTransformation::Transform( int Slice, int Row, float Pad, float Time, float XYZ[] )
107 // Convert row, pad, time to X Y Z
108 Int_t sector=-99, thisrow=-99;
109 AliHLTTPCTransform::Slice2Sector( Slice, Row, sector, thisrow);
110 int err = fFastTransform.Transform(sector, thisrow, Pad, Time, XYZ);
111 if( err!=0 ) return Error(-1,Form( "AliHLTTPCClusterTransformation::Transform: Fast Transformation failed with error %d :%s",err,fFastTransform.GetLastError()) );
115 inline Int_t AliHLTTPCClusterTransformation::ReverseAlignment( float XYZ[], int slice, int padrow)
117 // reverse the alignment correction
118 Int_t sector=-99, thisrow=-99;
119 AliHLTTPCTransform::Slice2Sector( slice, padrow, sector, thisrow);
120 int err = fFastTransform.ReverseAlignment(sector, XYZ);
121 if( err!=0 ) return Error(-1,Form( "AliHLTTPCClusterTransformation::ReverseAlignment: Fast Transformation failed with error %d :%s",err,fFastTransform.GetLastError()) );