PosCalculation.h 1.58 KB
Newer Older
Jean-Luc Pons's avatar
Jean-Luc Pons committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
//+=============================================================================
//
// file :         PositionCalculation.h
//
// description :  Include for the PositionCalculation class.
//                This class is used for computing beam position
//
// project :      LiberaSparkSRBPM TANGO Device Server
//
// copyleft :     European Synchrotron Radiation Facility
//                BP 220, Grenoble 38043
//                FRANCE
//
//-=============================================================================

#ifndef LIBERASPARKSRBPM_POSCALCULATION_H
#define LIBERASPARKSRBPM_POSCALCULATION_H

#include "LiberaSparkSRBPM.h"

#define DOS_CALC 0
#define POLYNOMIAL_CALC 1

namespace LiberaSparkSRBPM_ns {

26

Jean-Luc Pons's avatar
Jean-Luc Pons committed
27 28 29 30 31 32 33 34 35 36
class PosCalculation {

public:

    PosCalculation(LiberaSparkSRBPM *ds);
    void ComputePosition(Int32Buffer &sa, BP &p);
    void ComputeDDPosition(BP &p);
    void SetAlgorithm(int algo);
    int  GetAlgorithm();
    void SetTiltAngle(double angle);
37
    void SetPolynomial(vector<POLY>& hPoly,vector<POLY>& vPoly,vector<POLY>& qPoly,vector<POLY>& sPoly);
Jean-Luc Pons's avatar
Jean-Luc Pons committed
38 39 40 41 42 43 44 45 46 47 48 49 50 51

    double kA;
    double kB;
    double kC;
    double kD;
    double tiltAngle;

private:
    LiberaSparkSRBPM *ds;

    void ComputePosition(BP &p);
    int calculationAlgorithm;

    // Polynomial stuff
52 53 54 55 56 57 58 59 60
    vector<POLY> hPoly;
    vector<POLY> vPoly;
    vector<POLY> qPoly;
    vector<POLY> sPoly;

    double px[MAX_POLYNOMIAL_POWER];
    double py[MAX_POLYNOMIAL_POWER];
    int maxXPow;
    int maxYPow;
Jean-Luc Pons's avatar
Jean-Luc Pons committed
61 62 63 64 65 66 67 68 69 70

    double r11,r12,r21,r22;

    double sumSAThreshold;

};

} // LiberaBrilliance_ns

#endif //LIBERASPARKSRBPM_POSCALCULATION_H