lsst.jointcal  master-ga8493ae4fe+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 setMappingIndices(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 
48  void offsetParams(double const *delta) { // this routine is not used when fitting. used for debugging
49  _m1->offsetParams(delta);
50  _m2->offsetParams(delta + _m1->getNpar());
51  }
52 
54  Gtransfo const &getTransfo1() const { return _m1->getTransfo(); }
55 
57  Gtransfo const &getTransfo2() const { return _m2->getTransfo(); }
58 
60  void positionDerivative(Point const &where, Eigen::Matrix2d &derivative, double epsilon) const;
61 
63  void freezeErrorScales();
64 
65 private:
66  friend class ConstrainedPolyModel;
68  void setWhatToFit(const bool fittingT1, const bool fittingT2);
69 };
70 } // namespace jointcal
71 } // namespace lsst
72 
73 #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.
void setMappingIndices(std::vector< unsigned > &indices) const
Sets how this set of parameters (of length Npar()) map into the "grand" fit Expects that indices has ...
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.
void offsetParams(double const *delta)
Remember the error scale and freeze it.
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.
Eigen::Matrix< double, Eigen::Dynamic, 2 > MatrixX2d
Definition: Eigenstuff.h:9
a virtual (interface) class for geometric transformations.
Definition: Gtransfo.h:37
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
void offsetParams(double const *delta)
Remember the error scale and freeze it.
Gtransfo const & getTransfo1() const
access to transfos
Gtransfo const & getTransfo2() const
access to transfos