source: branches/Corsika7500Compatibility/mhft/MHexagonalFT.h@ 19811

Last change on this file since 19811 was 5691, checked in by tbretz, 20 years ago
*** empty log message ***
File size: 1.8 KB
Line 
1#ifndef MARS_MHexagonalFT
2#define MARS_MHexagonalFT
3
4#ifndef ROOT_TObject
5#include <TObject.h>
6#endif
7#ifndef ROOT_MArrayF
8#include "MArrayF.h"
9#endif
10#ifndef ROOT_MArrayI
11#include "MArrayI.h"
12#endif
13
14class MArrayD;
15class MGeomCam;
16
17class MHexagonalFT : public TObject
18{
19private:
20
21 int Delta(int i) const
22 {
23 return i==0 || i==(Int_t)fNumRows-1 ? 1 : 0;
24 } // Delta(i) = kronecker(i%(fNumRows-1), 0)
25 float P(int j, int n) const
26 {
27 const Int_t a = Delta(j+n);
28 const Int_t b = Delta(j);
29 const Int_t c = Delta(n);
30
31 return 6./((1+a)*(1+b+c));
32 } // Definition of P(i,j) see paper
33
34 UInt_t fNumRows;
35
36 MArrayF fPsi;
37
38 MArrayI fM;
39 MArrayI fK;
40
41 MArrayF fP;
42
43 MArrayI fIdx;
44
45public:
46 MHexagonalFT();
47 MHexagonalFT(Int_t num);
48
49 void Prepare(Int_t num);
50
51 void TransformFastFWD(const MArrayD &inre, MArrayD &outre, MArrayD &outim) const;
52 void TransformFastBWD(const MArrayD &inre, const MArrayD &inim, MArrayD &outre) const;
53
54 void TransformSlow(const MArrayD &inre, const MArrayD &inim,
55 MArrayD &outre, MArrayD &outim, Bool_t fwd=kTRUE);
56
57 UInt_t GetNumKnots() const { return fP.GetSize(); } // Return number of knots in triangle
58 UInt_t GetNumRows() const { return fNumRows; } // return number of rows in triangle
59
60 UInt_t M(UShort_t i) const { return fM[i]; } // return m-axis-index of absolute index i
61 UInt_t K(UShort_t i) const { return fK[i]; } // return k-axis-index of absolute index i
62
63 Int_t GetRow(UShort_t i) const { return fM[i]+fK[i]; } // return row-index of absolute index i
64 Int_t GetCol(UShort_t i) const { return fM[i]-fK[i]; } // return col-index of absolute index i
65
66 ClassDef(MHexagonalFT,0) // general hexagonal fourier transformation
67};
68
69#endif
Note: See TracBrowser for help on using the repository browser.