Line data Source code
1 : #ifndef ALICHEB2DSTACKS_H
2 : #define ALICHEB2DSTACKS_H
3 :
4 : /*****************************************************************************
5 : * Stack of 2D->ND Chebishev parameterizations with Short_t *
6 : * coefficients representation *
7 : * *
8 : * Creation requires user function with signature *
9 : * void (*fun)(int slice, float* inp2D,float* valND) *
10 : * and the boundaries of 2D rectangle. *
11 : * The precision of interpolation for each dimension is provided in the *
12 : * precD array (max deviation condition). Note, that actual precision *
13 : * will be affected also by the number of nodes evaluated according to *
14 : * requested int np[2] (same number of points for all output dimensions) *
15 : * or int np[dimOut][2] for individual partition for each dimension *
16 : * *
17 : * Author: ruben.shahoyan@cern.ch *
18 : *****************************************************************************/
19 :
20 : #include "AliCheb2DStack.h"
21 :
22 : class AliCheb2DStackS : public AliCheb2DStack
23 : {
24 : public:
25 : AliCheb2DStackS();
26 : virtual ~AliCheb2DStackS();
27 : //
28 : AliCheb2DStackS(stFun_t fun, int nSlices, int dimOut, const float bmin[2], const float bmax[2],
29 : const int np[2], const float* dead=0, const float *rowXI=0,const float* precD=0);
30 : AliCheb2DStackS(stFun_t fun, int nSlices, int dimOut, const float bmin[2], const float bmax[2],
31 : const int np[][2], const float* dead=0, const float *rowXI=0, const float* precD=0);
32 : //
33 : void Eval(int sliceID, const float *par, float *res) const;
34 : Float_t Eval(int sliceID, int dimOut, const float *par) const;
35 : void Print(const Option_t* opt="") const;
36 : void PrintSlice(int isl, const Option_t* opt) const;
37 : //
38 : protected:
39 : //
40 : void CreateParams(stFun_t fun, const int *np, const float* prc);
41 : float ChebFit(const int np[2], const float* wVals, float* wspace, float prec);
42 : void FillFunValues(stFun_t fun, int slice, int dim, const float *grid, const int np[2], float* wVals);
43 : void FillFunValues(stFun_t fun, int slice, const float *grid, const int np[2], float* wVals);
44 : //
45 : protected:
46 : //
47 : Float_t* fParScale; //[fNParams] scaling param. to bring symmetrized variation to +-MaxShort
48 : Float_t* fParHVar; //[fNParams] half of variation within the row
49 : Short_t* fCoeffs; //[fNCoefsTot] coeffs container (all slices)
50 : //
51 : private:
52 : AliCheb2DStackS(const AliCheb2DStackS& src); // dummy
53 : AliCheb2DStackS& operator=(const AliCheb2DStackS& rhs); // dummy
54 : //
55 176 : ClassDef(AliCheb2DStackS,2) // stack of 2D->fDimOut Chebyshev parameterization slices
56 : };
57 :
58 :
59 : #endif
|