lsst.jointcal  15.0-6-ge2d9597+2
TwoTransfoMapping.h
Go to the documentation of this file.
1 // -*- LSST-C++ -*-
2 #ifndef LSST_JOINTCAL_TWO_TRANSFO_MAPPING_H
3 #define LSST_JOINTCAL_TWO_TRANSFO_MAPPING_H
4 
5 #include "memory"
6 
10 
11 namespace lsst {
12 namespace jointcal {
13 
15 class TwoTransfoMapping : public Mapping {
16 public:
19 
21  TwoTransfoMapping(TwoTransfoMapping const &) = delete;
25 
27  unsigned getNpar() const;
28 
29  void getMappingIndices(std::vector<unsigned> &indices) const;
30 
32  void computeTransformAndDerivatives(FatPoint const &where, FatPoint &outPoint, Eigen::MatrixX2d &H) const;
34  void transformPosAndErrors(FatPoint const &where, FatPoint &outPoint) const;
35 
42  void offsetParams(Eigen::VectorXd const &delta) {
43  _m1->offsetParams(delta.segment(_m1->getIndex(), _m1->getNpar()));
44  _m2->offsetParams(delta.segment(_m2->getIndex() + _m1->getNpar(), _m2->getNpar()));
45  }
46 
48  Gtransfo const &getTransfo1() const { return _m1->getTransfo(); }
49 
51  Gtransfo const &getTransfo2() const { return _m2->getTransfo(); }
52 
54  void positionDerivative(Point const &where, Eigen::Matrix2d &derivative, double epsilon) const;
55 
57  void freezeErrorTransform();
58 
59 private:
60  friend class ConstrainedPolyModel;
62  void setWhatToFit(const bool fittingT1, const bool fittingT2);
63 
64  SimpleGtransfoMapping *_m1, *_m2;
65  unsigned _nPar1, _nPar2;
66  struct tmpVars // just there to get around constness issues
67  {
68  Eigen::MatrixX2d h1, h2;
69  Eigen::Matrix2d dt2dx;
70  };
71 
73 };
74 } // namespace jointcal
75 } // namespace lsst
76 
77 #endif // LSST_JOINTCAL_TWO_TRANSFO_MAPPING_H
TwoTransfoMapping(SimpleGtransfoMapping *chipMapping, SimpleGtransfoMapping *visitMapping)
void positionDerivative(Point const &where, Eigen::Matrix2d &derivative, double epsilon) const
Currently not implemented.
virtual class needed in the abstraction of the distortion model
Definition: Mapping.h:15
A point in a plane.
Definition: Point.h:13
virtual Gtransfo const & getTransfo() const
Access to the (fitted) transfo.
The mapping with two transfos in a row.
void computeTransformAndDerivatives(FatPoint const &where, FatPoint &outPoint, Eigen::MatrixX2d &H) const
Actually applies the mapping and evaluates the derivatives w.r.t the fitted parameters.
A Point with uncertainties.
Definition: FatPoint.h:11
unsigned getNpar() const
Number of parameters in total.
unsigned getNpar() const
Number of parameters in total.
This is the model used to fit mappings as the combination of a transformation depending on the chip n...
Class for a simple mapping implementing a generic Gtransfo.
void offsetParams(Eigen::VectorXd const &delta)
Remember the error scale and freeze it.
Eigen::Matrix< double, Eigen::Dynamic, 2 > MatrixX2d
Definition: Eigenstuff.h:9
void freezeErrorTransform()
Currently not implemented.
unsigned getIndex() const
position of the parameters within the grand fitting scheme
void getMappingIndices(std::vector< unsigned > &indices) const
Sets how this set of parameters (of length Npar()) map into the "grand" fit Expects that indices has ...
a virtual (interface) class for geometric transformations.
Definition: Gtransfo.h:41
void transformPosAndErrors(FatPoint const &where, FatPoint &outPoint) const
The same as above but without the parameter derivatives (used to evaluate chi^2)
TwoTransfoMapping & operator=(TwoTransfoMapping const &)=delete
Gtransfo const & getTransfo1() const
access to transfos
Gtransfo const & getTransfo2() const
access to transfos
void offsetParams(Eigen::VectorXd const &delta)
Remember the error scale and freeze it.