CMS 3D CMS Logo

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

#include <TwoBodyDecayModel.h>

Public Member Functions

const std::pair< AlgebraicVector, AlgebraicVectorcartesianSecondaryMomenta (const AlgebraicVector &param)
 
const std::pair< AlgebraicVector, AlgebraicVectorcartesianSecondaryMomenta (const TwoBodyDecay &tbd)
 
const std::pair< AlgebraicVector, AlgebraicVectorcartesianSecondaryMomenta (const TwoBodyDecayParameters &tbdparam)
 
AlgebraicVector convertCurvilinearToCartesian (const AlgebraicVector &curv, double zMagField)
 
AlgebraicMatrix curvilinearToCartesianJacobian (const AlgebraicVector &curv, double zMagField)
 
AlgebraicMatrix curvilinearToCartesianJacobian (double rho, double theta, double phi, double zMagField)
 
AlgebraicMatrix rotationMatrix (double px, double py, double pz)
 
 TwoBodyDecayModel (double mPrimary=91.1876, double mSecondary=0.105658)
 
 ~TwoBodyDecayModel ()
 

Private Attributes

double thePrimaryMass
 
double theSecondaryMass
 

Detailed Description

/class TwoBodyDecayModel

This class provides useful methods needed for the two-body decay model used by implementations of e.g. class TwoBodyDecayEstimator or TwoBodyDecayLinearizationPointFinder.

/author Edmund Widl

Definition at line 15 of file TwoBodyDecayModel.h.

Constructor & Destructor Documentation

◆ TwoBodyDecayModel()

TwoBodyDecayModel::TwoBodyDecayModel ( double  mPrimary = 91.1876,
double  mSecondary = 0.105658 
)

Definition at line 4 of file TwoBodyDecayModel.cc.

5  : thePrimaryMass(mPrimary), theSecondaryMass(mSecondary) {}

◆ ~TwoBodyDecayModel()

TwoBodyDecayModel::~TwoBodyDecayModel ( )

Definition at line 7 of file TwoBodyDecayModel.cc.

7 {}

Member Function Documentation

◆ cartesianSecondaryMomenta() [1/3]

const std::pair< AlgebraicVector, AlgebraicVector > TwoBodyDecayModel::cartesianSecondaryMomenta ( const AlgebraicVector param)

Momenta of the secondaries in cartesian repraesentation.

Definition at line 80 of file TwoBodyDecayModel.cc.

81  {
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 }

References alignmentValidation::c1, funct::cos(), AlCaHLTBitMon_ParallelJobs::p, p2, phi, TwoBodyDecayParameters::phi, BPhysicsValidation_cfi::pminus, BPhysicsValidation_cfi::pplus, HLT_FULL_cff::pT2, multPhiCorr_741_25nsDY_cfi::px, TwoBodyDecayParameters::px, multPhiCorr_741_25nsDY_cfi::py, TwoBodyDecayParameters::py, TwoBodyDecayParameters::pz, rotationMatrix(), funct::sin(), mathSSE::sqrt(), thePrimaryMass, theSecondaryMass, TwoBodyDecayParameters::theta, and theta().

Referenced by cartesianSecondaryMomenta(), TwoBodyDecayTrajectoryState::construct(), TwoBodyDecayEstimator::constructMatrices(), and TwoBodyDecayMomConstraintProducer::momentaAtVertex().

◆ cartesianSecondaryMomenta() [2/3]

const std::pair< AlgebraicVector, AlgebraicVector > TwoBodyDecayModel::cartesianSecondaryMomenta ( const TwoBodyDecay tbd)

Momenta of the secondaries in cartesian repraesentation.

Definition at line 121 of file TwoBodyDecayModel.cc.

121  {
123 }

References cartesianSecondaryMomenta(), and TwoBodyDecay::parameters().

◆ cartesianSecondaryMomenta() [3/3]

const std::pair< AlgebraicVector, AlgebraicVector > TwoBodyDecayModel::cartesianSecondaryMomenta ( const TwoBodyDecayParameters tbdparam)

Momenta of the secondaries in cartesian repraesentation.

Definition at line 125 of file TwoBodyDecayModel.cc.

126  {
127  return cartesianSecondaryMomenta(tbdparam.parameters());
128 }

References cartesianSecondaryMomenta(), and TwoBodyDecayParameters::parameters().

◆ convertCurvilinearToCartesian()

AlgebraicVector TwoBodyDecayModel::convertCurvilinearToCartesian ( const AlgebraicVector curv,
double  zMagField 
)

Convert vector from curvilinear to cartesian coordinates (needs the z-component of magnetic field in inverse GeV as input).

Definition at line 69 of file TwoBodyDecayModel.cc.

69  {
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 }

References funct::cos(), hcal_runs::rt, funct::sin(), and funct::tan().

◆ curvilinearToCartesianJacobian() [1/2]

AlgebraicMatrix TwoBodyDecayModel::curvilinearToCartesianJacobian ( const AlgebraicVector curv,
double  zMagField 
)

Jacobian for transformation from curvilinear to cartesian representation (needs the z-component of magnetic field in inverse GeV as input).

Definition at line 65 of file TwoBodyDecayModel.cc.

65  {
66  return this->curvilinearToCartesianJacobian(curv[0], curv[1], curv[2], zMagField);
67 }

References curvilinearToCartesianJacobian().

◆ curvilinearToCartesianJacobian() [2/2]

AlgebraicMatrix TwoBodyDecayModel::curvilinearToCartesianJacobian ( double  rho,
double  theta,
double  phi,
double  zMagField 
)

Jacobian for transformation from curvilinear to cartesian representation (needs the z-component of magnetic field in inverse GeV as input).

Definition at line 34 of file TwoBodyDecayModel.cc.

37  {
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 }

References conv, funct::cos(), phi, submitPVResolutionJobs::q, rho, funct::sin(), and theta().

Referenced by curvilinearToCartesianJacobian().

◆ rotationMatrix()

AlgebraicMatrix TwoBodyDecayModel::rotationMatrix ( double  px,
double  py,
double  pz 
)

Rotates a vector pointing in z-direction into the direction defined by p=(px,py,pz).

Definition at line 9 of file TwoBodyDecayModel.cc.

9  {
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 }

References AlCaHLTBitMon_ParallelJobs::p, p2, PVValHelper::pT, HLT_FULL_cff::pT2, multPhiCorr_741_25nsDY_cfi::px, multPhiCorr_741_25nsDY_cfi::py, and mathSSE::sqrt().

Referenced by cartesianSecondaryMomenta(), TwoBodyDecayDerivatives::dqsdm(), TwoBodyDecayDerivatives::dqsdphi(), TwoBodyDecayDerivatives::dqsdtheta(), and TwoBodyDecayLinearizationPointFinder::getLinearizationPoint().

Member Data Documentation

◆ thePrimaryMass

double TwoBodyDecayModel::thePrimaryMass
private

Definition at line 53 of file TwoBodyDecayModel.h.

Referenced by cartesianSecondaryMomenta().

◆ theSecondaryMass

double TwoBodyDecayModel::theSecondaryMass
private

Definition at line 54 of file TwoBodyDecayModel.h.

Referenced by cartesianSecondaryMomenta().

TwoBodyDecayModel::cartesianSecondaryMomenta
const std::pair< AlgebraicVector, AlgebraicVector > cartesianSecondaryMomenta(const AlgebraicVector &param)
Definition: TwoBodyDecayModel.cc:80
TwoBodyDecayParameters::phi
Definition: TwoBodyDecayParameters.h:17
multPhiCorr_741_25nsDY_cfi.py
py
Definition: multPhiCorr_741_25nsDY_cfi.py:12
hcal_runs.rt
rt
Definition: hcal_runs.py:76
TwoBodyDecayParameters::parameters
const AlgebraicVector & parameters(void) const
Get decay parameters.
Definition: TwoBodyDecayParameters.h:34
HLT_FULL_cff.pT2
pT2
Definition: HLT_FULL_cff.py:9548
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:71
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
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
BPhysicsValidation_cfi.pminus
pminus
Definition: BPhysicsValidation_cfi.py:53
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
DDAxes::phi
multPhiCorr_741_25nsDY_cfi.px
px
Definition: multPhiCorr_741_25nsDY_cfi.py:10
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
conv
EPOS::IO_EPOS conv
Definition: ReggeGribovPartonMCHadronizer.cc:42