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  GlobalVector aX = GlobalVector( p.x(), p.y(), 0.).unit();
24  GlobalVector aY( -aX.y(), aX.x(), 0.);
25  GlobalVector aZ( 0., 0., 1.);
26  theRotation = new Rotation(aX,aY,aZ);
27 }
28 
30 { if( myRotation) delete theRotation; }
31 
33 { return atan2( theRotation->xy(), theRotation->xx() ); }
34 
36 {
37  double val = fabs( 2. * theFit.parA() );
38  double err = 2.*sqrt(theFit.varAA());
39  return Measurement1D(val,err);
40 }
41 
43 {
44  double val = phiRot() + atan(theFit.parB());
45  double err = sqrt(theFit.varBB());
46  return Measurement1D(val,err);
47 }
48 
50 {
51  double val = -theFit.parC();
52  double err = sqrt(theFit.varCC());
53  return Measurement1D(val,err);
54 }
55 
57 { return (theFit.parA() > 0.) ? -1 : 1; }
58 
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:57
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:28
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:56
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