CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
VertexKinematicConstraintT Class Reference

#include <VertexKinematicConstraintT.h>

Inheritance diagram for VertexKinematicConstraintT:
MultiTrackKinematicConstraintT< 2, 4 > MultiTrackKinematicConstraintBaseT

Public Member Functions

virtual VertexKinematicConstraintTclone () const
 
virtual void init (const std::vector< KinematicState > &states, const GlobalPoint &point, const GlobalVector &mf)
 
virtual int numberOfEquations () const
 
 VertexKinematicConstraintT ()
 
virtual ~VertexKinematicConstraintT ()
 
- Public Member Functions inherited from MultiTrackKinematicConstraintT< 2, 4 >
parametersDerivativeType const & parametersDerivative () const
 
positionDerivativeType const & positionDerivative () const
 
valueType const & value () const
 
virtual ~MultiTrackKinematicConstraintT ()
 
- Public Member Functions inherited from MultiTrackKinematicConstraintBaseT
virtual ~MultiTrackKinematicConstraintBaseT ()
 

Private Types

typedef MultiTrackKinematicConstraintT< 2, 4 > super
 

Private Member Functions

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

Private Attributes

double a_i [2]
 
double delta [2]
 
GlobalVector dpos [2]
 
double k [2]
 
double m [2]
 
GlobalVector mom [2]
 
double n [2]
 
double novera [2]
 

Additional Inherited Members

- Public Types inherited from MultiTrackKinematicConstraintT< 2, 4 >
enum  
 
typedef ROOT::Math::SMatrix< double, DIM, 7 *NTRK > parametersDerivativeType
 
typedef ROOT::Math::SMatrix< double, DIM, 3 > positionDerivativeType
 
typedef MultiTrackKinematicConstraintT< NTRK, DIMself
 
typedef ROOT::Math::SVector< double, DIMvalueType
 
- Protected Member Functions inherited from MultiTrackKinematicConstraintT< 2, 4 >
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

Class implementing the vertexing constraint for extended cartesian parametrization (x,y,z,p_x,p_y,p_z,m). The equations and derivatives in general follow the P.Avery's "Applied Fitting Theory-VI" CBX 98-37

Definition at line 14 of file VertexKinematicConstraintT.h.

Member Typedef Documentation

Definition at line 19 of file VertexKinematicConstraintT.h.

Constructor & Destructor Documentation

VertexKinematicConstraintT::VertexKinematicConstraintT ( )

Definition at line 5 of file VertexKinematicConstraintT.cc.

Referenced by clone().

6 {}
VertexKinematicConstraintT::~VertexKinematicConstraintT ( )
virtual

Definition at line 8 of file VertexKinematicConstraintT.cc.

9 {}

Member Function Documentation

virtual VertexKinematicConstraintT* VertexKinematicConstraintT::clone ( void  ) const
inlinevirtual
void VertexKinematicConstraintT::fillParametersDerivative ( ) const
privatevirtual

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

Implements MultiTrackKinematicConstraintT< 2, 4 >.

Definition at line 58 of file VertexKinematicConstraintT.cc.

References a_i, delta, dpos, MultiTrackKinematicConstraintT< 2, 4 >::jac_d(), k, m, mom, n, novera, PV3DBase< T, PVType, FrameType >::perp2(), x, PV3DBase< T, PVType, FrameType >::x(), y, PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by clone().

58  {
59  ROOT::Math::SMatrix<double,2,7> el_part_d;
60  for(int j = 0; j!=2; ++j) {
61 
62  if(a_i[j] !=0) {
63 
64  //charged particle
65 
66  //D Jacobian matrix
67  el_part_d(0,0) = mom[j].y() + a_i[j]*dpos[j].x();
68  el_part_d(0,1) = -mom[j].x() + a_i[j]*dpos[j].y();
69  el_part_d(1,0) = -k[j]*(m[j]*mom[j].x() - n[j]*mom[j].y());
70  el_part_d(1,1) = -k[j]*(m[j]*mom[j].y() + n[j]*mom[j].x());
71  el_part_d(1,2) = -1.;
72  el_part_d(0,3) = dpos[j].y();
73  el_part_d(0,4) = -dpos[j].x();
74  el_part_d(1,3) = k[j]*(m[j]*dpos[j].x() - novera[j]*(2*mom[j].x() - a_i[j]*dpos[j].y()));
75  el_part_d(1,4) = k[j]*(m[j]*dpos[j].y() - novera[j]*(2*mom[j].y() + a_i[j]*dpos[j].x()));
76  el_part_d(1,5) = -delta[j] /a_i[j];
77  super::jac_d().Place_at(el_part_d,j*2, j*7);
78  }else{
79  //neutral particle
80  double pt2Inverse = 1./mom[j].perp2();
81  el_part_d(0,0) = mom[j].y();
82  el_part_d(0,1) = -mom[j].x();
83  el_part_d(1,0) = mom[j].x() * (mom[j].z()*pt2Inverse);
84  el_part_d(1,1) = mom[j].y() * (mom[j].z()*pt2Inverse);
85  el_part_d(1,2) = -1.;
86  el_part_d(0,3) = dpos[j].y();
87  el_part_d(0,4) = -dpos[j].x();
88  el_part_d(1,3) = 2*(dpos[j].x()*mom[j].x()+dpos[j].y()*mom[j].y())*pt2Inverse*mom[j].x()*(mom[j].z()*pt2Inverse) - dpos[j].x()*(mom[j].z()*pt2Inverse);
89  el_part_d(1,4) = 2*(dpos[j].x()*mom[j].x()+dpos[j].y()*mom[j].y())*pt2Inverse*mom[j].y()*(mom[j].z()*pt2Inverse) - dpos[j].x()*(mom[j].z()*pt2Inverse);
90  el_part_d(1,5) = - (dpos[j].x()*mom[j].x()+dpos[j].y()*mom[j].y())*pt2Inverse;
91  super::jac_d().Place_at(el_part_d,j*2, j*7);
92  }
93  }
94 }
T y() const
Definition: PV3DBase.h:63
T perp2() const
Definition: PV3DBase.h:71
T z() const
Definition: PV3DBase.h:64
T x() const
Definition: PV3DBase.h:62
void VertexKinematicConstraintT::fillPositionDerivative ( ) const
privatevirtual

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

Implements MultiTrackKinematicConstraintT< 2, 4 >.

Definition at line 96 of file VertexKinematicConstraintT.cc.

References a_i, dpos, MultiTrackKinematicConstraintT< 2, 4 >::jac_e(), k, m, mom, n, PV3DBase< T, PVType, FrameType >::perp2(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by clone().

96  {
97 
98  ROOT::Math::SMatrix<double,2,3> el_part_e;
99  for(int j = 0; j!=2; ++j) {
100 
101  if(a_i[j] !=0) {
102 
103  //charged particle
104 
105  //E jacobian matrix
106  el_part_e(0,0) = -(mom[j].y() + a_i[j]*dpos[j].x());
107  el_part_e(0,1) = mom[j].x() - a_i[j]*dpos[j].y();
108  el_part_e(1,0) = k[j]*(m[j]*mom[j].x() - n[j]*mom[j].y());
109  el_part_e(1,1) = k[j]*(m[j]*mom[j].y() + n[j]*mom[j].x());
110  el_part_e(1,2) = 1;
111  super::jac_e().Place_at(el_part_e,2*j,0);
112  }else{
113  //neutral particle
114  double pt2Inverse = 1./mom[j].perp2();
115  el_part_e(0,0) = - mom[j].y();
116  el_part_e(0,1) = mom[j].x();
117  el_part_e(1,0) = -mom[j].x()*mom[j].z()*pt2Inverse;
118  el_part_e(1,1) = -mom[j].y()*mom[j].z()*pt2Inverse;
119  el_part_e(1,2) = 1;
120  super::jac_e().Place_at(el_part_e,2*j,0);
121  }
122  }
123 }
T y() const
Definition: PV3DBase.h:63
T perp2() const
Definition: PV3DBase.h:71
T z() const
Definition: PV3DBase.h:64
T x() const
Definition: PV3DBase.h:62
void VertexKinematicConstraintT::fillValue ( ) const
privatevirtual

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

Implements MultiTrackKinematicConstraintT< 2, 4 >.

Definition at line 40 of file VertexKinematicConstraintT.cc.

References a_i, delta, dpos, mom, PV3DBase< T, PVType, FrameType >::perp2(), MultiTrackKinematicConstraintT< 2, 4 >::vl(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by clone().

41 {
42  //it is 2 equations per track
43  for(int j = 0; j!=2; ++j) {
44 
45  if(a_i[j] !=0) {
46  //vector of values
47  super::vl(j*2) = dpos[j].y()*mom[j].x() - dpos[j].x()*mom[j].y() -a_i[j]*(dpos[j].x()*dpos[j].x() + dpos[j].y()*dpos[j].y())*0.5;
48  super::vl(j*2 +1) = dpos[j].z() - mom[j].z()*delta[j]/a_i[j];
49  }else{
50  //neutral particle
51  double pt2Inverse = 1./mom[j].perp2();
52  super::vl(j*2) = dpos[j].y()*mom[j].x() - dpos[j].x()*mom[j].y();
53  super::vl(j*2 +1) = dpos[j].z() - mom[j].z()*(dpos[j].x() * mom[j].x() + dpos[j].y() * mom[j].y())*pt2Inverse;
54  }
55  }
56 }
T y() const
Definition: PV3DBase.h:63
T perp2() const
Definition: PV3DBase.h:71
T z() const
Definition: PV3DBase.h:64
T x() const
Definition: PV3DBase.h:62
void VertexKinematicConstraintT::init ( const std::vector< KinematicState > &  states,
const GlobalPoint point,
const GlobalVector mf 
)
virtual

Implements MultiTrackKinematicConstraintBaseT.

Definition at line 12 of file VertexKinematicConstraintT.cc.

References a_i, delta, dpos, mps_fire::i, k, m, mom, n, novera, pileupDistInMC::num, PV3DBase< T, PVType, FrameType >::perp2(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

13  {
14  int num = states.size();
15  if(num!=2) throw VertexException("VertexKinematicConstraintT !=2 states passed");
16  double mfz = fieldValue.z();
17 
18  int j=0;
19  for(std::vector<KinematicState>::const_iterator i = states.begin(); i != states.end(); i++)
20  {
21  mom[j] = i->globalMomentum();
22  dpos[j] = ipoint - i->globalPosition();
23  a_i[j] = - i->particleCharge() * mfz;
24 
25  double pvx = mom[j].x() - a_i[j]*dpos[j].y();
26  double pvy = mom[j].y() + a_i[j]*dpos[j].x();
27  double pvt2 = pvx*pvx+pvy*pvy;
28  novera[j] = (dpos[j].x() * mom[j].x() + dpos[j].y()*mom[j].y());
29  n[j] = a_i[j]*novera[j];
30  m[j] = (pvx*mom[j].x() + pvy*mom[j].y());
31  k[j] = -mom[j].z()/(mom[j].perp2()*pvt2);
32  delta[j] = std::atan2(n[j],m[j]);
33 
34  ++j;
35  }
36 }
Common base class.
T y() const
Definition: PV3DBase.h:63
T perp2() const
Definition: PV3DBase.h:71
T z() const
Definition: PV3DBase.h:64
T x() const
Definition: PV3DBase.h:62
int VertexKinematicConstraintT::numberOfEquations ( ) const
virtual

Number of equations per track used for the fit

Implements MultiTrackKinematicConstraintBaseT.

Definition at line 125 of file VertexKinematicConstraintT.cc.

126 {return 2;}

Member Data Documentation

double VertexKinematicConstraintT::a_i[2]
private
double VertexKinematicConstraintT::delta[2]
private

Definition at line 24 of file VertexKinematicConstraintT.h.

Referenced by fillParametersDerivative(), fillValue(), and init().

GlobalVector VertexKinematicConstraintT::dpos[2]
private
double VertexKinematicConstraintT::k[2]
private
double VertexKinematicConstraintT::m[2]
private
GlobalVector VertexKinematicConstraintT::mom[2]
private
double VertexKinematicConstraintT::n[2]
private
double VertexKinematicConstraintT::novera[2]
private

Definition at line 24 of file VertexKinematicConstraintT.h.

Referenced by fillParametersDerivative(), and init().