CMS 3D CMS Logo

TwoBodyDecayModel.cc
Go to the documentation of this file.
1 
3 
4 TwoBodyDecayModel::TwoBodyDecayModel(double mPrimary, double mSecondary)
5  : thePrimaryMass(mPrimary), theSecondaryMass(mSecondary) {}
6 
8 
10  // compute transverse and absolute momentum
11  double pT2 = px * px + py * py;
12  double p2 = pT2 + pz * pz;
13  double pT = sqrt(pT2);
14  double p = sqrt(p2);
15 
16  AlgebraicMatrix rotMat(3, 3);
17 
18  // compute rotation matrix
19  rotMat[0][0] = px * pz / pT / p;
20  rotMat[0][1] = -py / pT;
21  rotMat[0][2] = px / p;
22 
23  rotMat[1][0] = py * pz / pT / p;
24  rotMat[1][1] = px / pT;
25  rotMat[1][2] = py / p;
26 
27  rotMat[2][0] = -pT / p;
28  rotMat[2][1] = 0.;
29  rotMat[2][2] = pz / p;
30 
31  return rotMat;
32 }
33 
35  double theta,
36  double phi,
37  double zMagField) {
38  double q = ((rho < 0) ? -1. : 1.);
39  double conv = q * zMagField;
40 
41  double stheta = sin(theta);
42  double ctheta = cos(theta);
43  double sphi = sin(phi);
44  double cphi = cos(phi);
45 
46  AlgebraicMatrix curv2cart(3, 3);
47 
48  curv2cart[0][0] = -rho * cphi;
49  curv2cart[0][1] = -rho * sphi;
50  curv2cart[0][2] = 0.;
51 
52  curv2cart[1][0] = cphi * stheta * ctheta;
53  curv2cart[1][1] = sphi * stheta * ctheta;
54  curv2cart[1][2] = -stheta * stheta;
55 
56  curv2cart[2][0] = -sphi;
57  curv2cart[2][1] = cphi;
58  curv2cart[2][2] = 0.;
59 
60  curv2cart *= rho / conv;
61 
62  return curv2cart;
63 }
64 
66  return this->curvilinearToCartesianJacobian(curv[0], curv[1], curv[2], zMagField);
67 }
68 
70  double rt = fabs(zMagField / curv[0]);
71 
72  AlgebraicVector cart(3);
73  cart[0] = rt * cos(curv[2]);
74  cart[1] = rt * sin(curv[2]);
75  cart[2] = rt / tan(curv[1]);
76 
77  return cart;
78 }
79 
80 const std::pair<AlgebraicVector, AlgebraicVector> TwoBodyDecayModel::cartesianSecondaryMomenta(
81  const AlgebraicVector &param) {
82  double px = param[TwoBodyDecayParameters::px];
83  double py = param[TwoBodyDecayParameters::py];
84  double pz = param[TwoBodyDecayParameters::pz];
85  double theta = param[TwoBodyDecayParameters::theta];
86  double phi = param[TwoBodyDecayParameters::phi];
87 
88  // compute transverse and absolute momentum
89  double pT2 = px * px + py * py;
90  double p2 = pT2 + pz * pz;
91  double p = sqrt(p2);
92 
93  double sphi = sin(phi);
94  double cphi = cos(phi);
95  double stheta = sin(theta);
96  double ctheta = cos(theta);
97 
98  // some constants from kinematics
99  double c1 = 0.5 * thePrimaryMass / theSecondaryMass;
100  double c2 = sqrt(c1 * c1 - 1.);
101  double c3 = 0.5 * c2 * ctheta / c1;
102  double c4 = sqrt(p2 + thePrimaryMass * thePrimaryMass);
103 
104  // momentum of decay particle 1 in the primary's boosted frame
105  AlgebraicMatrix pplus(3, 1);
106  pplus[0][0] = theSecondaryMass * c2 * stheta * cphi;
107  pplus[1][0] = theSecondaryMass * c2 * stheta * sphi;
108  pplus[2][0] = 0.5 * p + c3 * c4;
109 
110  // momentum of decay particle 2 in the primary's boosted frame
111  AlgebraicMatrix pminus(3, 1);
112  pminus[0][0] = -pplus[0][0];
113  pminus[1][0] = -pplus[1][0];
114  pminus[2][0] = 0.5 * p - c3 * c4;
115 
117 
118  return std::make_pair(rotMat * pplus, rotMat * pminus);
119 }
120 
121 const std::pair<AlgebraicVector, AlgebraicVector> TwoBodyDecayModel::cartesianSecondaryMomenta(const TwoBodyDecay &tbd) {
123 }
124 
125 const std::pair<AlgebraicVector, AlgebraicVector> TwoBodyDecayModel::cartesianSecondaryMomenta(
126  const TwoBodyDecayParameters &tbdparam) {
127  return cartesianSecondaryMomenta(tbdparam.parameters());
128 }
AlgebraicVector convertCurvilinearToCartesian(const AlgebraicVector &curv, double zMagField)
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
const AlgebraicVector & parameters(void) const
Definition: TwoBodyDecay.h:33
const AlgebraicVector & parameters(void) const
Get decay parameters.
AlgebraicMatrix rotationMatrix(double px, double py, double pz)
CLHEP::HepMatrix AlgebraicMatrix
T sqrt(T t)
Definition: SSEVec.h:23
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
TwoBodyDecayModel(double mPrimary=91.1876, double mSecondary=0.105658)
AlgebraicMatrix curvilinearToCartesianJacobian(double rho, double theta, double phi, double zMagField)
CLHEP::HepVector AlgebraicVector
EPOS::IO_EPOS conv
Geom::Theta< T > theta() const
const std::pair< AlgebraicVector, AlgebraicVector > cartesianSecondaryMomenta(const AlgebraicVector &param)