lsst.jointcal  master-gc5b79683b0+3
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 private:
17  SimpleGtransfoMapping *_m1, *_m2;
18  unsigned _nPar1, _nPar2;
19  struct tmpVars // just there to get around constness issues
20  {
21  Eigen::MatrixX2d h1, h2;
22  Eigen::Matrix2d dt2dx;
23  };
24 
25  std::unique_ptr<tmpVars> tmp;
26 
27 public:
30 
32  TwoTransfoMapping(TwoTransfoMapping const &) = delete;
36 
38  unsigned getNpar() const;
39 
40  void getMappingIndices(std::vector<unsigned> &indices) const;
41 
43  void computeTransformAndDerivatives(FatPoint const &where, FatPoint &outPoint, Eigen::MatrixX2d &H) const;
45  void transformPosAndErrors(FatPoint const &where, FatPoint &outPoint) const;
46 
53  void offsetParams(Eigen::VectorXd const &delta) {
54  _m1->offsetParams(delta.segment(_m1->getIndex(), _m1->getNpar()));
55  _m2->offsetParams(delta.segment(_m2->getIndex() + _m1->getNpar(), _m2->getNpar()));
56  }
57 
59  Gtransfo const &getTransfo1() const { return _m1->getTransfo(); }
60 
62  Gtransfo const &getTransfo2() const { return _m2->getTransfo(); }
63 
65  void positionDerivative(Point const &where, Eigen::Matrix2d &derivative, double epsilon) const;
66 
68  void freezeErrorScales();
69 
70 private:
71  friend class ConstrainedPolyModel;
73  void setWhatToFit(const bool fittingT1, const bool fittingT2);
74 };
75 } // namespace jointcal
76 } // namespace lsst
77 
78 #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.
Definition: Associations.h:24
void freezeErrorScales()
Currently not implemented.
void offsetParams(Eigen::VectorXd const &delta)
Remember the error scale and freeze it.
Eigen::Matrix< double, Eigen::Dynamic, 2 > MatrixX2d
Definition: Eigenstuff.h:9
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:39
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.