ATLAS Offline Software
Loading...
Searching...
No Matches
Trk::MassConstraint Class Reference

Concrete implementation of Trk::IKinematicConstraint to formulate a mass constraint in kinematic vertex fits. More...

#include <MassConstraint.h>

Inheritance diagram for Trk::MassConstraint:
Collaboration diagram for Trk::MassConstraint:

Public Member Functions

 MassConstraint ()=default
 empty constructor
 MassConstraint (double mass)
 standard constructor
virtual ~MassConstraint ()=default
virtual Amg::VectorX vectorOfValues (std::vector< Amg::VectorX > &cart_coordList, std::vector< int > &charges, Amg::Vector3D refPoint, double b_fieldTesla) const override final
 method returning the vector of parameters values.
virtual Amg::MatrixX matrixOfDerivatives (std::vector< Amg::VectorX > &cart_coordList, std::vector< int > &charges, Amg::Vector3D refPoint, double b_fieldTesla) const override final
 method returning the matrix of derivatives.
virtual int numberOfEquations () const override final
 tells the number of equations needed for this type of constraint, that is 1
double mass ()
 tells the mass value used for the constraint

Private Attributes

double m_mass = 0.
 value of mass to be constrained in MeV

Static Private Attributes

static constexpr int s_eqno = 1
 number of constraint-equations used by this type of constraint

Detailed Description

Concrete implementation of Trk::IKinematicConstraint to formulate a mass constraint in kinematic vertex fits.

The constraint is constructed with a mass value (in MeV), to which the invariant mass of the particles emerging from a vertex will be constrained. It calculates the values and derivatives for a list of particles, given by their parameters and charges.

Author
Maaike Limper

Definition at line 26 of file MassConstraint.h.

Constructor & Destructor Documentation

◆ MassConstraint() [1/2]

Trk::MassConstraint::MassConstraint ( )
default

empty constructor

◆ MassConstraint() [2/2]

Trk::MassConstraint::MassConstraint ( double mass)

standard constructor

Parameters
[in]massInvariant mass in MeV to which particles shall be constrained

Definition at line 12 of file MassConstraint.cxx.

13 : m_mass(mass)
14{}
double mass()
tells the mass value used for the constraint
double m_mass
value of mass to be constrained in MeV

◆ ~MassConstraint()

virtual Trk::MassConstraint::~MassConstraint ( )
virtualdefault

Member Function Documentation

◆ mass()

double Trk::MassConstraint::mass ( )
inline

tells the mass value used for the constraint

Definition at line 75 of file MassConstraint.h.

75{ return m_mass; }

◆ matrixOfDerivatives()

Amg::MatrixX Trk::MassConstraint::matrixOfDerivatives ( std::vector< Amg::VectorX > & cart_coordList,
std::vector< int > & charges,
Amg::Vector3D refPoint,
double b_fieldTesla ) const
finaloverridevirtual

method returning the matrix of derivatives.

Method defined through the <nop>IKinematicConstraint base class

Parameters
[in]cart_coordListvector of particles represented in cartesian frame, that is through the parameters (px, py, pz, E, x, y, z).
[in]chargescharge information for the vector of particles
[in]refPointreference point for cartesian coordinates
[in]b_fieldTeslalocal solenoidal approximation of field
[out]matrixof derivatives to enter the constrained-fit equation

Implements Trk::IKinematicConstraint.

Definition at line 60 of file MassConstraint.cxx.

65{
66
67 const unsigned int ntrack = cart_coordList.size();
68
69 Amg::MatrixX matrixDeriv2(1, ntrack * 7);
70
71 const double bend_factor = -0.299792458 * b_fieldTesla;
72
73 for (unsigned int i = 0; i < ntrack; i++) {
74 const double E = cart_coordList[i][3];
75 const double px = cart_coordList[i][0];
76 const double py = cart_coordList[i][1];
77 const double pz = cart_coordList[i][2];
78
79 const double deltaX = refPoint[0] - cart_coordList[i][4];
80 const double deltaY = refPoint[1] - cart_coordList[i][5];
81
82 const double a = charges[i] * bend_factor;
83
84 for (unsigned int jtrack = 0; jtrack < ntrack; jtrack++) {
85 const unsigned int joff = jtrack * 7;
86 matrixDeriv2(0, joff + 0) =
87 matrixDeriv2(0, joff + 0) - 2 * (px - a * deltaY);
88 matrixDeriv2(0, joff + 1) =
89 matrixDeriv2(0, joff + 1) - 2 * (py + a * deltaX);
90 matrixDeriv2(0, joff + 2) = matrixDeriv2(0, joff + 2) - 2 * pz;
91 matrixDeriv2(0, joff + 3) = matrixDeriv2(0, joff + 3) + 2 * E;
92
93 // shouldn't this go to 0 when deltaX = 0 ?! no! when vertex moves px,py
94 // moves and vice-versa so derivative of vertex should depend on px,py
95 matrixDeriv2(0, joff + 4) =
96 matrixDeriv2(0, joff + 4) + 2 * a * (py + a * deltaX);
97 matrixDeriv2(0, joff + 5) =
98 matrixDeriv2(0, joff + 5) - 2 * a * (px - a * deltaY);
99 //(*p_matrixDeriv)[0][joff+6] = (*p_matrixDeriv)[0][joff+6] + 0.; // no
100 //dependence on z!
101 }
102 }
103
104 return matrixDeriv2;
105}
static Double_t a
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
@ pz
global momentum (cartesian)
Definition ParamDefs.h:61
@ px
Definition ParamDefs.h:59
@ py
Definition ParamDefs.h:60

◆ numberOfEquations()

virtual int Trk::MassConstraint::numberOfEquations ( ) const
inlinefinaloverridevirtual

tells the number of equations needed for this type of constraint, that is 1

Implements Trk::IKinematicConstraint.

Definition at line 72 of file MassConstraint.h.

72{ return s_eqno; }
static constexpr int s_eqno
number of constraint-equations used by this type of constraint

◆ vectorOfValues()

Amg::VectorX Trk::MassConstraint::vectorOfValues ( std::vector< Amg::VectorX > & cart_coordList,
std::vector< int > & charges,
Amg::Vector3D refPoint,
double b_fieldTesla ) const
finaloverridevirtual

method returning the vector of parameters values.

Method defined through the <nop>IKinematicConstraint base class

Parameters
[in]cart_coordListvector of particles represented in cartesian frame, that is through the parameters (px, py, pz, E, x, y, z).
[in]chargescharge information for the vector of particles
[in]refPointreference point for cartesian coordinates
[in]b_fieldTeslalocal solenoidal approximation of field
[out]vectorof values to enter the constrained-fit equation

Implements Trk::IKinematicConstraint.

Definition at line 17 of file MassConstraint.cxx.

21{
22
23 unsigned int ntrack = cart_coordList.size();
24
25 Amg::VectorX vectorOfValues2(1, 0);
26
27 const double bend_factor = -0.299792458 * b_fieldTesla;
28
29 double Etot = 0.;
30 double Px = 0.;
31 double Py = 0.;
32 double Pz = 0.;
33
34 for (unsigned int i = 0; i < ntrack; i++) {
35 const double E = cart_coordList[i][3];
36 const double px = cart_coordList[i][0];
37 const double py = cart_coordList[i][1];
38 const double pz = cart_coordList[i][2];
39
40 const double deltaX = refPoint[0] - cart_coordList[i][4];
41 const double deltaY = refPoint[1] - cart_coordList[i][5];
42
43 const double a = charges[i] * bend_factor;
44
45 // sum of values of cartesian coordinates at given reference-point
46 Etot += E;
47 Px += (px - a * deltaY);
48 Py += (py + a * deltaX);
49 Pz += pz;
50 }
51
52 vectorOfValues2[0] =
53 Etot * Etot - Px * Px - Py * Py - Pz * Pz -
54 m_mass * m_mass; // fill vector using sums made in track-loop
55
56 return vectorOfValues2;
57}
Eigen::Matrix< double, Eigen::Dynamic, 1 > VectorX
Dynamic Vector - dynamic allocation.

Member Data Documentation

◆ m_mass

double Trk::MassConstraint::m_mass = 0.
private

value of mass to be constrained in MeV

Definition at line 79 of file MassConstraint.h.

◆ s_eqno

int Trk::MassConstraint::s_eqno = 1
staticconstexprprivate

number of constraint-equations used by this type of constraint

Definition at line 81 of file MassConstraint.h.


The documentation for this class was generated from the following files: