CMS 3D CMS Logo

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, DIMself
 
typedef ROOT::Math::SVector< double, DIMvalueType
 

Public Member Functions

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

Private Member Functions

void fillParametersDerivative () const override
 
void fillPositionDerivative () const override
 
void fillValue () const override
 

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 23 of file ColinearityKinematicConstraintT.h.

Member Typedef Documentation

◆ super

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

Definition at line 34 of file ColinearityKinematicConstraintT.h.

Constructor & Destructor Documentation

◆ ColinearityKinematicConstraintT()

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

Definition at line 36 of file ColinearityKinematicConstraintT.h.

36 {}

Member Function Documentation

◆ clone()

template<enum colinearityKinematic::ConstraintDim Dim>
ColinearityKinematicConstraintT<Dim>* ColinearityKinematicConstraintT< Dim >::clone ( void  ) const
inlineoverridevirtual

◆ fillParametersDerivative()

template<enum colinearityKinematic::ConstraintDim Dim>
void ColinearityKinematicConstraintT< Dim >::fillParametersDerivative ( ) const
overrideprivatevirtual

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

Implements MultiTrackKinematicConstraintT< 2, int(Dim)>.

Definition at line 115 of file ColinearityKinematicConstraintT.h.

References LaserDQM_cfg::p1, SiStripOfflineCRack_cfg::p2, colinearityKinematic::PhiTheta, point, HLT_2024v13_cff::pt1, HLT_2024v13_cff::pt2, and mathSSE::sqrt().

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

◆ fillPositionDerivative()

template<enum colinearityKinematic::ConstraintDim Dim>
void ColinearityKinematicConstraintT< Dim >::fillPositionDerivative ( ) const
overrideprivatevirtual

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 LaserDQM_cfg::p1, SiStripOfflineCRack_cfg::p2, colinearityKinematic::PhiTheta, and point.

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

◆ fillValue()

template<enum colinearityKinematic::ConstraintDim Dim>
void ColinearityKinematicConstraintT< Dim >::fillValue ( ) const
overrideprivatevirtual

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 87 of file ColinearityKinematicConstraintT.h.

References M_PI, LaserDQM_cfg::p1, SiStripOfflineCRack_cfg::p2, colinearityKinematic::PhiTheta, point, HLT_2024v13_cff::pt1, HLT_2024v13_cff::pt2, and mathSSE::sqrt().

87  {
88  typename super::valueType& vl = super::vl();
89 
90  double p1vx = p1(3) - a_1 * (point.y() - p1(1));
91  double p1vy = p1(4) + a_1 * (point.x() - p1(0));
92 
93  double p2vx = p2(3) - a_2 * (point.y() - p2(1));
94  double p2vy = p2(4) + a_2 * (point.x() - p2(0));
95 
96  // H_phi:
97  vl(0) = atan2(p1vy, p1vx) - atan2(p2vy, p2vx);
98  if (vl(0) > M_PI)
99  vl(0) -= 2.0 * M_PI;
100  if (vl(0) <= -M_PI)
101  vl(0) += 2.0 * M_PI;
102  // H_theta:
103  if (Dim == colinearityKinematic::PhiTheta) {
104  double pt1 = sqrt(p1(3) * p1(3) + p1(4) * p1(4));
105  double pt2 = sqrt(p2(3) * p2(3) + p2(4) * p2(4));
106  vl(1) = atan2(pt1, p1(5)) - atan2(pt2, p2(5));
107  if (vl(1) > M_PI)
108  vl(1) -= 2.0 * M_PI;
109  if (vl(1) <= -M_PI)
110  vl(1) += 2.0 * M_PI;
111  }
112 }
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
T sqrt(T t)
Definition: SSEVec.h:19
#define M_PI

◆ init()

template<enum colinearityKinematic::ConstraintDim Dim>
void ColinearityKinematicConstraintT< Dim >::init ( const std::vector< KinematicState > &  states,
const GlobalPoint ipoint,
const GlobalVector fieldValue 
)
inlineoverridevirtual

Implements MultiTrackKinematicConstraintBaseT.

Definition at line 39 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().

41  {
42  if (states.size() != 2)
43  throw VertexException("ColinearityKinematicConstraint::<2 states passed");
44 
45  point = ipoint;
46 
47  a_1 = -states[0].particleCharge() * fieldValue.z();
48  a_2 = -states[1].particleCharge() * fieldValue.z();
49 
50  p1 = states[0].kinematicParameters().vector();
51  p2 = states[1].kinematicParameters().vector();
52  }
T z() const
Definition: PV3DBase.h:61
Common base class.

◆ numberOfEquations()

template<enum colinearityKinematic::ConstraintDim Dim>
int ColinearityKinematicConstraintT< Dim >::numberOfEquations ( ) const
inlineoverridevirtual

Number of equations per track used for the fit

Implements MultiTrackKinematicConstraintBaseT.

Definition at line 57 of file ColinearityKinematicConstraintT.h.

References colinearityKinematic::Phi.

Member Data Documentation

◆ a_1

template<enum colinearityKinematic::ConstraintDim Dim>
double ColinearityKinematicConstraintT< Dim >::a_1
private

◆ a_2

template<enum colinearityKinematic::ConstraintDim Dim>
double ColinearityKinematicConstraintT< Dim >::a_2
private

◆ p1

template<enum colinearityKinematic::ConstraintDim Dim>
AlgebraicVector7 ColinearityKinematicConstraintT< Dim >::p1
private

◆ p2

template<enum colinearityKinematic::ConstraintDim Dim>
AlgebraicVector7 ColinearityKinematicConstraintT< Dim >::p2
private

◆ point

template<enum colinearityKinematic::ConstraintDim Dim>
GlobalPoint ColinearityKinematicConstraintT< Dim >::point
private