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 
116  AlgebraicMatrix rotMat = rotationMatrix(px, py, pz);
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 }
TwoBodyDecayModel::cartesianSecondaryMomenta
const std::pair< AlgebraicVector, AlgebraicVector > cartesianSecondaryMomenta(const AlgebraicVector &param)
Definition: TwoBodyDecayModel.cc:80
TwoBodyDecayParameters::phi
Definition: TwoBodyDecayParameters.h:17
conv
static HepMC::IO_HEPEVT conv
Definition: BeamHaloProducer.cc:48
multPhiCorr_741_25nsDY_cfi.py
py
Definition: multPhiCorr_741_25nsDY_cfi.py:12
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
hcal_runs.rt
rt
Definition: hcal_runs.py:76
ZElectronSkim_cff.rho
rho
Definition: ZElectronSkim_cff.py:38
TwoBodyDecayModel::convertCurvilinearToCartesian
AlgebraicVector convertCurvilinearToCartesian(const AlgebraicVector &curv, double zMagField)
Definition: TwoBodyDecayModel.cc:69
TwoBodyDecayParameters::parameters
const AlgebraicVector & parameters(void) const
Get decay parameters.
Definition: TwoBodyDecayParameters.h:34
HLT_FULL_cff.pT2
pT2
Definition: HLT_FULL_cff.py:9595
TwoBodyDecayParameters::pz
Definition: TwoBodyDecayParameters.h:17
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
AlgebraicVector
CLHEP::HepVector AlgebraicVector
Definition: AlgebraicObjects.h:13
PVValHelper::pT
Definition: PVValidationHelpers.h:70
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
p2
double p2[4]
Definition: TauolaWrapper.h:90
theta
Geom::Theta< T > theta() const
Definition: Basic3DVectorLD.h:150
TwoBodyDecayParameters::theta
Definition: TwoBodyDecayParameters.h:17
TwoBodyDecay::parameters
const AlgebraicVector & parameters(void) const
Definition: TwoBodyDecay.h:33
DDAxes::rho
TwoBodyDecayModel::rotationMatrix
AlgebraicMatrix rotationMatrix(double px, double py, double pz)
Definition: TwoBodyDecayModel.cc:9
BPhysicsValidation_cfi.pminus
pminus
Definition: BPhysicsValidation_cfi.py:53
PVValHelper::phi
Definition: PVValidationHelpers.h:68
TwoBodyDecayParameters
Definition: TwoBodyDecayParameters.h:14
BPhysicsValidation_cfi.pplus
pplus
Definition: BPhysicsValidation_cfi.py:58
funct::tan
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
TwoBodyDecayModel::thePrimaryMass
double thePrimaryMass
Definition: TwoBodyDecayModel.h:53
alignmentValidation.c1
c1
do drawing
Definition: alignmentValidation.py:1025
TwoBodyDecayModel::curvilinearToCartesianJacobian
AlgebraicMatrix curvilinearToCartesianJacobian(double rho, double theta, double phi, double zMagField)
Definition: TwoBodyDecayModel.cc:34
submitPVResolutionJobs.q
q
Definition: submitPVResolutionJobs.py:84
TwoBodyDecayModel.h
DDAxes::phi
multPhiCorr_741_25nsDY_cfi.px
px
Definition: multPhiCorr_741_25nsDY_cfi.py:10
TwoBodyDecayModel::TwoBodyDecayModel
TwoBodyDecayModel(double mPrimary=91.1876, double mSecondary=0.105658)
Definition: TwoBodyDecayModel.cc:4
TwoBodyDecayParameters::py
Definition: TwoBodyDecayParameters.h:17
AlgebraicMatrix
CLHEP::HepMatrix AlgebraicMatrix
Definition: AlgebraicObjects.h:14
TwoBodyDecayModel::theSecondaryMass
double theSecondaryMass
Definition: TwoBodyDecayModel.h:54
TwoBodyDecayParameters::px
Definition: TwoBodyDecayParameters.h:17
TwoBodyDecay
Definition: TwoBodyDecay.h:15
TwoBodyDecayModel::~TwoBodyDecayModel
~TwoBodyDecayModel()
Definition: TwoBodyDecayModel.cc:7