gastro  0.1.0
 All Classes Files Functions Variables Pages
twotransfomapping.h
1 #ifndef TWOTRANSFOMAPPING__H
2 #define TWOTRANSFOMAPPING__H
3 
4 #include "memory"
5 
6 #include "mapping.h"
7 #include "eigenstuff.h"
8 #include "simplepolymapping.h"
9 
12 {
13  SimpleGtransfoMapping *_m1, *_m2;
14  unsigned _nPar1, _nPar2;
15  struct tmpVars // just there to get around constness issues
16  {
17  Eigen::MatrixX2d h1,h2;
18  Eigen::Matrix2d dt2dx;
19  };
20 
21  std::auto_ptr<tmpVars> tmp;
22 
23  public :
26  SimpleGtransfoMapping *ShootM);
28  unsigned Npar() const;
29 
31  void GetMappingIndices(std::vector<unsigned> &Indices) const;
32 
34  void ComputeTransformAndDerivatives(const FatPoint &Where,
35  FatPoint &OutPos,
36  Eigen::MatrixX2d &H) const;
38  void TransformPosAndErrors(const FatPoint &Where,
39  FatPoint &OutPos) const;
40 
42  const Gtransfo& T1() const
43  { return _m1->Transfo();}
44 
46  const Gtransfo& T2() const
47  { return _m2->Transfo();}
48 
49 
50 
52  void PosDerivative(Point &Where, Eigen::Matrix2d &Der, const double & Eps) const;
53 
54  private:
55 
56  friend class ConstrainedPolyModel;
58  void SetWhatToFit(const bool FittingT1, const bool FittingT2);
59 
60 };
61 
62 
63 #endif
The mapping with two transfos in a row.
Definition: twotransfomapping.h:11
virtual class needed in the abstraction of the distortion model
Definition: mapping.h:13
void ComputeTransformAndDerivatives(const FatPoint &Where, FatPoint &OutPos, Eigen::MatrixX2d &H) const
Actually applies the mapping and evaluates the derivatives w.r.t the fitted parameters.
Definition: twotransfomapping.cc:34
void TransformPosAndErrors(const FatPoint &Where, FatPoint &OutPos) const
The same as above but without the parameter derivatives (used to evaluate chi^2)
Definition: twotransfomapping.cc:85
void GetMappingIndices(std::vector< unsigned > &Indices) const
Provides for this parameter set (of length Npar()) how they map into the "grand" fit.
Definition: twotransfomapping.cc:20
void PosDerivative(Point &Where, Eigen::Matrix2d &Der, const double &Eps) const
Currently not implemented.
Definition: twotransfomapping.cc:93
const Gtransfo & T1() const
access to transfos
Definition: twotransfomapping.h:42
Class for a simple mapping implementing a generic Gtransfo.
Definition: simplepolymapping.h:14
const Gtransfo & Transfo() const
Access to the (fitted) transfo.
Definition: simplepolymapping.h:101
This is the model used to fit mappings as the combination of a transformation depending on the chip n...
Definition: constrainedpolymodel.h:22
unsigned Npar() const
Mumber of parameters in total.
Definition: twotransfomapping.cc:14
const Gtransfo & T2() const
access to transfos
Definition: twotransfomapping.h:46