test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
ColinearityKinematicConstraintT< Dim > Class Template Reference

#include <ColinearityKinematicConstraintT.h>

Inheritance diagram for ColinearityKinematicConstraintT< Dim >:
MultiTrackKinematicConstraintT< 2, int(Dim)> MultiTrackKinematicConstraintBaseT

Public Types

typedef
MultiTrackKinematicConstraintT
< 2, int(Dim)> 
super
 
- Public Types inherited from MultiTrackKinematicConstraintT< 2, int(Dim)>
enum  
 
typedef ROOT::Math::SMatrix
< double, DIM, 7 *NTRK > 
parametersDerivativeType
 
typedef ROOT::Math::SMatrix
< double, DIM, 3 > 
positionDerivativeType
 
typedef
MultiTrackKinematicConstraintT
< NTRK, DIM
self
 
typedef ROOT::Math::SVector
< double, DIM
valueType
 

Public Member Functions

virtual
ColinearityKinematicConstraintT
< Dim > * 
clone () const
 
 ColinearityKinematicConstraintT ()
 
void init (const std::vector< KinematicState > &states, const GlobalPoint &ipoint, const GlobalVector &fieldValue)
 
virtual int numberOfEquations () const
 
- Public Member Functions inherited from MultiTrackKinematicConstraintT< 2, int(Dim)>
parametersDerivativeType const & parametersDerivative () const
 
positionDerivativeType const & positionDerivative () const
 
valueType const & value () const
 
virtual ~MultiTrackKinematicConstraintT ()
 
- Public Member Functions inherited from MultiTrackKinematicConstraintBaseT
virtual ~MultiTrackKinematicConstraintBaseT ()
 

Private Member Functions

virtual void fillParametersDerivative () const
 
virtual void fillPositionDerivative () const
 
virtual void fillValue () const
 

Private Attributes

double a_1
 
double a_2
 
AlgebraicVector7 p1
 
AlgebraicVector7 p2
 
GlobalPoint point
 

Additional Inherited Members

- Protected Member Functions inherited from MultiTrackKinematicConstraintT< 2, int(Dim)>
parametersDerivativeTypejac_d () const
 
double & jac_d (size_t i, size_t j) const
 
positionDerivativeTypejac_e () const
 
double & jac_e (size_t i, size_t j) const
 
valueTypevl () const
 
double & vl (size_t i) const
 

Detailed Description

template<enum colinearityKinematic::ConstraintDim Dim>
class ColinearityKinematicConstraintT< Dim >

Definition at line 24 of file ColinearityKinematicConstraintT.h.

Member Typedef Documentation

template<enum colinearityKinematic::ConstraintDim Dim>
typedef MultiTrackKinematicConstraintT<2,int(Dim)> ColinearityKinematicConstraintT< Dim >::super

Definition at line 37 of file ColinearityKinematicConstraintT.h.

Constructor & Destructor Documentation

template<enum colinearityKinematic::ConstraintDim Dim>
ColinearityKinematicConstraintT< Dim >::ColinearityKinematicConstraintT ( )
inline

Definition at line 39 of file ColinearityKinematicConstraintT.h.

39 {}

Member Function Documentation

template<enum colinearityKinematic::ConstraintDim Dim>
virtual ColinearityKinematicConstraintT<Dim>* ColinearityKinematicConstraintT< Dim >::clone ( void  ) const
inlinevirtual
template<enum colinearityKinematic::ConstraintDim Dim>
void ColinearityKinematicConstraintT< Dim >::fillParametersDerivative ( ) const
privatevirtual

fills a matrix of derivatives of constraint equations w.r.t. particle parameters

Implements MultiTrackKinematicConstraintT< 2, int(Dim)>.

Definition at line 119 of file ColinearityKinematicConstraintT.h.

References p1, p2, colinearityKinematic::PhiTheta, point, and mathSSE::sqrt().

119  {
120 
121 
123 
124  double p1vx = p1(3) - a_1*(point.y() - p1(1));
125  double p1vy = p1(4) + a_1*(point.x() - p1(0));
126  double k1 = 1.0/(p1vx*p1vx + p1vy*p1vy);
127 
128  double p2vx = p2(3) - a_2*(point.y() - p2(1));
129  double p2vy = p2(4) + a_2*(point.x() - p2(0));
130  double k2 = 1.0/(p2vx*p2vx + p2vy*p2vy);
131 
132  // H_phi:
133 
134  //x1 and x2 derivatives: 1st and 8th elements
135  jac_d(0,0) = -k1*a_1*p1vx;
136  jac_d(0,7) = k2*a_2*p2vx;
137 
138  //y1 and y2 derivatives: 2nd and 9th elements:
139  jac_d(0,1) = -k1*a_1*p1vy;
140  jac_d(0,8) = k2*a_2*p2vy;
141 
142  //z1 and z2 components: 3d and 10th elmnets stay 0:
143  jac_d(0,2) = 0.; jac_d(0,9) = 0.;
144 
145  //px1 and px2 components: 4th and 11th elements:
146  jac_d(0,3) = -k1*p1vy;
147  jac_d(0,10) = k2*p2vy;
148 
149  //py1 and py2 components: 5th and 12 elements:
150  jac_d(0,4) = k1*p1vx;
151  jac_d(0,11) = -k2*p2vx;
152 
153 
154  //pz1 and pz2 components: 6th and 13 elements:
155  jac_d(0,5) = 0.; jac_d(0,12) = 0.;
156  //mass components: 7th and 14th elements:
157  jac_d(0,6) = 0.; jac_d(0,13) = 0.;
158 
160  double pt1 = sqrt(p1(3)*p1(3)+p1(4)*p1(4));
161  double pTot1 = p1(3)*p1(3)+p1(4)*p1(4)+p1(5)*p1(5);
162  double pt2 = sqrt(p2(3)*p2(3)+p2(4)*p2(4));
163  double pTot2 = p2(3)*p2(3)+p2(4)*p2(4)+p2(5)*p2(5);
164 
165  // H_theta:
166  //x1 and x2 derivatives: 1st and 8th elements
167  jac_d(1,0) = 0.; jac_d(1,7) = 0.;
168 
169  //y1 and y2 derivatives: 2nd and 9th elements:
170  jac_d(1,1) = 0.; jac_d(1,8) = 0.;
171 
172  //z1 and z2 components: 3d and 10th elmnets stay 0:
173  jac_d(1,2) = 0.; jac_d(1,9) = 0.;
174 
175  jac_d(1,3) = p1(3) * (p1(5)/(pTot1*pt1));
176  jac_d(1,10) = p2(3) * (-p2(5)/(pTot2*pt2));
177 
178  //py1 and py2 components: 5th and 12 elements:
179  jac_d(1,4) = p1(4) * (p1(5)/(pTot1*pt1));
180  jac_d(1,11) = p2(4) * (-p2(5)/(pTot2*pt2));
181 
182  //pz1 and pz2 components: 6th and 13 elements:
183  jac_d(1,5) = - pt1/pTot1;
184  jac_d(1,12) = pt2/pTot2;
185 
186  //mass components: 7th and 14th elements:
187  jac_d(1,6) = 0.; jac_d(1,13) = 0.;
188  }
189 }
ROOT::Math::SMatrix< double, DIM, 7 *NTRK > parametersDerivativeType
T y() const
Definition: PV3DBase.h:63
T sqrt(T t)
Definition: SSEVec.h:48
T x() const
Definition: PV3DBase.h:62
template<enum colinearityKinematic::ConstraintDim Dim>
void ColinearityKinematicConstraintT< Dim >::fillPositionDerivative ( ) const
privatevirtual

Returns a matrix of derivatives of constraint equations w.r.t. vertex position

Implements MultiTrackKinematicConstraintT< 2, int(Dim)>.

Definition at line 192 of file ColinearityKinematicConstraintT.h.

References p1, p2, colinearityKinematic::PhiTheta, and point.

193 {
194 
196 
197  double p1vx = p1(3) - a_1*(point.y() - p1(1));
198  double p1vy = p1(4) + a_1*(point.x() - p1(0));
199  double k1 = 1.0/(p1vx*p1vx + p1vy*p1vy);
200 
201  double p2vx = p2(3) - a_2*(point.y() - p2(1));
202  double p2vy = p2(4) + a_2*(point.x() - p2(0));
203  double k2 = 1.0/(p2vx*p2vx + p2vy*p2vy);
204 
205  // H_phi:
206 
207  // xv component
208  jac_e(0,0) = k1*a_1*p1vx - k2*a_2*p2vx;
209 
210  //yv component
211  jac_e(0,1) = k1*a_1*p1vy - k2*a_2*p2vy;
212 
213  //zv component
214  jac_e(0,2) = 0.;
215 
216  // H_theta: no correlation with vertex position
218  jac_e(1,0) = 0.;
219  jac_e(1,1) = 0.;
220  jac_e(1,2) = 0.;
221  }
222 }
ROOT::Math::SMatrix< double, DIM, 3 > positionDerivativeType
T y() const
Definition: PV3DBase.h:63
T x() const
Definition: PV3DBase.h:62
template<enum colinearityKinematic::ConstraintDim Dim>
void ColinearityKinematicConstraintT< Dim >::fillValue ( ) const
privatevirtual

fills a vector of values of constraint equations at the point where the input particles are defined.

Implements MultiTrackKinematicConstraintT< 2, int(Dim)>.

Definition at line 93 of file ColinearityKinematicConstraintT.h.

References M_PI, p1, p2, colinearityKinematic::PhiTheta, point, and mathSSE::sqrt().

93  {
94 
95  typename super::valueType & vl = super::vl();
96 
97  double p1vx = p1(3) - a_1*(point.y() - p1(1));
98  double p1vy = p1(4) + a_1*(point.x() - p1(0));
99 
100  double p2vx = p2(3) - a_2*(point.y() - p2(1));
101  double p2vy = p2(4) + a_2*(point.x() - p2(0));
102 
103 
104  // H_phi:
105  vl(0) = atan2(p1vy,p1vx) - atan2(p2vy,p2vx);
106  if ( vl(0) > M_PI ) vl(0) -= 2.0*M_PI;
107  if ( vl(0) <= -M_PI ) vl(0) += 2.0*M_PI;
108  // H_theta:
109  if (Dim==colinearityKinematic::PhiTheta) {
110  double pt1 = sqrt(p1(3)*p1(3)+p1(4)*p1(4));
111  double pt2 = sqrt(p2(3)*p2(3)+p2(4)*p2(4));
112  vl(1) = atan2(pt1,p1(5)) - atan2(pt2,p2(5));
113  if ( vl(1) > M_PI ) vl(1) -= 2.0*M_PI;
114  if ( vl(1) <= -M_PI ) vl(1) += 2.0*M_PI;
115  }
116 }
T y() const
Definition: PV3DBase.h:63
T sqrt(T t)
Definition: SSEVec.h:48
#define M_PI
T x() const
Definition: PV3DBase.h:62
template<enum colinearityKinematic::ConstraintDim Dim>
void ColinearityKinematicConstraintT< Dim >::init ( const std::vector< KinematicState > &  states,
const GlobalPoint ipoint,
const GlobalVector fieldValue 
)
inlinevirtual

Implements MultiTrackKinematicConstraintBaseT.

Definition at line 43 of file ColinearityKinematicConstraintT.h.

References ColinearityKinematicConstraintT< Dim >::a_1, ColinearityKinematicConstraintT< Dim >::a_2, plotBeamSpotDB::ipoint, ColinearityKinematicConstraintT< Dim >::p1, ColinearityKinematicConstraintT< Dim >::p2, ColinearityKinematicConstraintT< Dim >::point, and PV3DBase< T, PVType, FrameType >::z().

44  {
45  if(states.size()!=2) throw VertexException("ColinearityKinematicConstraint::<2 states passed");
46 
47  point = ipoint;
48 
49  a_1 = -states[0].particleCharge()*fieldValue.z();
50  a_2 = -states[1].particleCharge()*fieldValue.z();
51 
52  p1 = states[0].kinematicParameters().vector();
53  p2 = states[1].kinematicParameters().vector();
54  }
Common base class.
T z() const
Definition: PV3DBase.h:64
template<enum colinearityKinematic::ConstraintDim Dim>
virtual int ColinearityKinematicConstraintT< Dim >::numberOfEquations ( ) const
inlinevirtual

Number of equations per track used for the fit

Implements MultiTrackKinematicConstraintBaseT.

Definition at line 59 of file ColinearityKinematicConstraintT.h.

References colinearityKinematic::Phi.

Member Data Documentation

template<enum colinearityKinematic::ConstraintDim Dim>
double ColinearityKinematicConstraintT< Dim >::a_1
private
template<enum colinearityKinematic::ConstraintDim Dim>
double ColinearityKinematicConstraintT< Dim >::a_2
private
template<enum colinearityKinematic::ConstraintDim Dim>
AlgebraicVector7 ColinearityKinematicConstraintT< Dim >::p1
private
template<enum colinearityKinematic::ConstraintDim Dim>
AlgebraicVector7 ColinearityKinematicConstraintT< Dim >::p2
private
template<enum colinearityKinematic::ConstraintDim Dim>
GlobalPoint ColinearityKinematicConstraintT< Dim >::point
private