CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ConformalMappingFit.cc
Go to the documentation of this file.
1 #include "ConformalMappingFit.h"
2 
3 using namespace std;
4 
5 template <class T> T sqr( T t) {return t*t;}
6 
8  const std::vector<PointXY> & hits, const std::vector<float> & errRPhi2, const Rotation * rot)
9  : theRotation(rot), myRotation(rot==0)
10 {
12  int hits_size = hits.size();
13  for ( int i= 0; i < hits_size; i++) {
14  if (!theRotation) findRot( hits[i] );
15  PointUV point( hits[i], 1./errRPhi2[i], theRotation);
16  theFit.addPoint( point.u(), point.v(), point.weight());
17  }
18 }
19 
21 {
22  myRotation = true;
23  typedef Rotation::GlobalVector GlobalVector; // ::GlobalVector is float!
24  GlobalVector aX = GlobalVector( p.x(), p.y(), 0.).unit();
25  GlobalVector aY( -aX.y(), aX.x(), 0.);
26  GlobalVector aZ( 0., 0., 1.);
27  theRotation = new Rotation(aX,aY,aZ);
28 }
29 
31 { if( myRotation) delete theRotation; }
32 
34 { return atan2( theRotation->xy(), theRotation->xx() ); }
35 
37 {
38  double val = fabs( 2. * theFit.parA() );
39  double err = 2.*sqrt(theFit.varAA());
40  return Measurement1D(val,err);
41 }
42 
44 {
45  double val = phiRot() + atan(theFit.parB());
46  double err = sqrt(theFit.varBB());
47  return Measurement1D(val,err);
48 }
49 
51 {
52  double val = -theFit.parC();
53  double err = sqrt(theFit.varCC());
54  return Measurement1D(val,err);
55 }
56 
58 { return (theFit.parA() > 0.) ? -1 : 1; }
59 
double parC() const
Definition: ParabolaFit.h:29
T xx() const
int i
Definition: DBlmapReader.cc:9
double varCC() const
Definition: ParabolaFit.h:32
Measurement1D curvature() const
const Rotation * theRotation
T y() const
Definition: PV3DBase.h:63
Measurement1D directionPhi() const
T xy() const
double varBB() const
Definition: ParabolaFit.h:31
void findRot(const PointXY &)
Measurement1D impactParameter() const
T sqrt(T t)
Definition: SSEVec.h:18
void addPoint(double x, double y)
Definition: ParabolaFit.cc:6
T y() const
Cartesian y coordinate.
Vector3DBase unit() const
Definition: Vector3DBase.h:57
double parB() const
Definition: ParabolaFit.h:28
TkRotation< double > Rotation
Square< F >::type sqr(const F &f)
Definition: Square.h:13
double parA() const
Definition: ParabolaFit.h:27
ConformalMappingFit(const std::vector< PointXY > &hits, const std::vector< float > &errRPhi2, const Rotation *rotation=0)
long double T
T x() const
Definition: PV3DBase.h:62
double varAA() const
Definition: ParabolaFit.h:30
T x() const
Cartesian x coordinate.
*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
Global3DVector GlobalVector
Definition: GlobalVector.h:10