CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
TwoBodyDecayModel Class Reference

#include <TwoBodyDecayModel.h>

Public Member Functions

const std::pair
< AlgebraicVector,
AlgebraicVector
cartesianSecondaryMomenta (const AlgebraicVector &param)
 
const std::pair
< AlgebraicVector,
AlgebraicVector
cartesianSecondaryMomenta (const TwoBodyDecay &tbd)
 
const std::pair
< AlgebraicVector,
AlgebraicVector
cartesianSecondaryMomenta (const TwoBodyDecayParameters &tbdparam)
 
AlgebraicVector convertCurvilinearToCartesian (const AlgebraicVector &curv, double zMagField)
 
AlgebraicMatrix curvilinearToCartesianJacobian (double rho, double theta, double phi, double zMagField)
 
AlgebraicMatrix curvilinearToCartesianJacobian (const AlgebraicVector &curv, 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 ( double  mPrimary = 91.1876,
double  mSecondary = 0.105658 
)

Definition at line 4 of file TwoBodyDecayModel.cc.

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

Definition at line 7 of file TwoBodyDecayModel.cc.

7 {}

Member Function Documentation

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.

References alignmentValidation::c1, funct::cos(), AlCaHLTBitMon_ParallelJobs::p, fireworks::p2, phi, TwoBodyDecayParameters::phi, HLT_FULL_cff::pT2, TwoBodyDecayParameters::px, 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().

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 }
const TString p2
Definition: fwPaths.cc:13
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Theta< T > theta() const
AlgebraicMatrix rotationMatrix(double px, double py, double pz)
CLHEP::HepMatrix AlgebraicMatrix
T sqrt(T t)
Definition: SSEVec.h:19
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
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.

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

121  {
123 }
const AlgebraicVector & parameters(void) const
Definition: TwoBodyDecay.h:33
const std::pair< AlgebraicVector, AlgebraicVector > cartesianSecondaryMomenta(const AlgebraicVector &param)
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.

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

126  {
127  return cartesianSecondaryMomenta(tbdparam.parameters());
128 }
const AlgebraicVector & parameters(void) const
Get decay parameters.
const std::pair< AlgebraicVector, AlgebraicVector > cartesianSecondaryMomenta(const AlgebraicVector &param)
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.

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

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 }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
list rt
Definition: hcal_runs.py:76
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
CLHEP::HepVector AlgebraicVector
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.

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

Referenced by curvilinearToCartesianJacobian().

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 }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Theta< T > theta() const
CLHEP::HepMatrix AlgebraicMatrix
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
EPOS::IO_EPOS conv
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.

References curvilinearToCartesianJacobian().

65  {
66  return this->curvilinearToCartesianJacobian(curv[0], curv[1], curv[2], zMagField);
67 }
AlgebraicMatrix curvilinearToCartesianJacobian(double rho, double theta, double phi, double zMagField)
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.

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

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

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 }
const TString p2
Definition: fwPaths.cc:13
CLHEP::HepMatrix AlgebraicMatrix
T sqrt(T t)
Definition: SSEVec.h:19

Member Data Documentation

double TwoBodyDecayModel::thePrimaryMass
private

Definition at line 53 of file TwoBodyDecayModel.h.

Referenced by cartesianSecondaryMomenta().

double TwoBodyDecayModel::theSecondaryMass
private

Definition at line 54 of file TwoBodyDecayModel.h.

Referenced by cartesianSecondaryMomenta().