CMS 3D CMS Logo

ConformalMappingFit.h
Go to the documentation of this file.
1 #ifndef ConformalMappingFit_H
2 #define ConformalMappingFit_H
3 
8 
9 #include "ParabolaFit.h"
10 #include <vector>
11 
12 namespace edm {class ParameterSet;}
13 
15 public:
18 
19  ConformalMappingFit( const std::vector<PointXY> & hits, const std::vector<float> & errRPhi2,
20  const Rotation * rotation = nullptr);
21 
23 
24  Measurement1D curvature() const;
25  Measurement1D directionPhi() const;
26  Measurement1D impactParameter() const;
27 
28  int charge() const;
29  double chi2() const { return theFit.chi2(); }
30 
31  const Rotation * rotation() const { return theRotation; }
32 
33  void fixImpactParmaeter(double ip) { theFit.fixParC(ip); }
34  void skipErrorCalculation() { theFit.skipErrorCalculationByDefault(); }
35 
36 private:
37  double phiRot() const;
38  void findRot( const PointXY &);
39 
40 private:
41  const Rotation *theRotation; bool myRotation;
43 
44  template <class T> class MappedPoint {
45  public:
47  MappedPoint() : theU(0), theV(0), theW(0), pRot(0) { }
48  MappedPoint( const T & aU, const T & aV, const T & aWeight,
49  const TkRotation<T> * aRot)
50  : theU(aU), theV(aV), theW(aWeight), pRot(aRot) { }
52  const PointXY & point, const T & weight, const TkRotation<T> * aRot)
53  : pRot(aRot) {
54  T radius2 = point.mag2();
55  Basic3DVector<T> rotated = (*pRot) * point;
56  theU = rotated.x() / radius2;
57  theV = rotated.y() / radius2;
58  theW = weight * radius2 * radius2;
59  }
60  T u() const {return theU; }
61  T v() const {return theV; }
62  T weight() const {return theW; }
63  PointXY unmap () const {
64  T invRadius2 = theU*theU+theV*theV;
66  = (*pRot).multiplyInverse(Basic2DVector<T>(theU,theV));
67  return PointXY(tmp.x()/invRadius2, tmp.y()/invRadius2);
68  }
69  T unmappedWeight() const {
70  T invRadius2 = theU*theU+theV*theV;
71  return theW * invRadius2 * invRadius2;
72  }
73  private:
74  T theU, theV, theW;
76  };
77 
78 };
79 
80 #endif
T y() const
Cartesian y coordinate.
T x() const
Cartesian x coordinate.
const Rotation * theRotation
MappedPoint(const PointXY &point, const T &weight, const TkRotation< T > *aRot)
Basic2DVector< double > PointXY
Definition: weight.py:1
T theW
T curvature(T InversePt, const edm::EventSetup &iSetup)
void fixImpactParmaeter(double ip)
TkRotation< double > Rotation
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
HLT enums.
MappedPoint(const T &aU, const T &aV, const T &aWeight, const TkRotation< T > *aRot)
const Rotation * rotation() const
long double T
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5