CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 (AlgebraicVector curv, double zMagField)
 
AlgebraicMatrix curvilinearToCartesianJacobian (double rho, double theta, double phi, double zMagField)
 
AlgebraicMatrix curvilinearToCartesianJacobian (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 16 of file TwoBodyDecayModel.h.

Constructor & Destructor Documentation

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

Definition at line 5 of file TwoBodyDecayModel.cc.

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

Definition at line 9 of file TwoBodyDecayModel.cc.

9 {}

Member Function Documentation

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

Momenta of the secondaries in cartesian repraesentation.

Definition at line 88 of file TwoBodyDecayModel.cc.

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

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

89 {
90  double px = param[TwoBodyDecayParameters::px];
91  double py = param[TwoBodyDecayParameters::py];
92  double pz = param[TwoBodyDecayParameters::pz];
93  double theta = param[TwoBodyDecayParameters::theta];
94  double phi = param[TwoBodyDecayParameters::phi];
95 
96  // compute transverse and absolute momentum
97  double pT2 = px*px + py*py;
98  double p2 = pT2 + pz*pz;
99  double p = sqrt( p2 );
100 
101  double sphi = sin( phi );
102  double cphi = cos( phi );
103  double stheta = sin( theta );
104  double ctheta = cos( theta );
105 
106  // some constants from kinematics
107  double c1 = 0.5*thePrimaryMass/theSecondaryMass;
108  double c2 = sqrt( c1*c1 - 1. );
109  double c3 = 0.5*c2*ctheta/c1;
110  double c4 = sqrt( p2 + thePrimaryMass*thePrimaryMass );
111 
112  // momentum of decay particle 1 in the primary's boosted frame
113  AlgebraicMatrix pplus( 3, 1 );
114  pplus[0][0] = theSecondaryMass*c2*stheta*cphi;
115  pplus[1][0] = theSecondaryMass*c2*stheta*sphi;
116  pplus[2][0] = 0.5*p + c3*c4;
117 
118  // momentum of decay particle 2 in the primary's boosted frame
119  AlgebraicMatrix pminus( 3, 1 );
120  pminus[0][0] = -pplus[0][0];
121  pminus[1][0] = -pplus[1][0];
122  pminus[2][0] = 0.5*p - c3*c4;
123 
124  AlgebraicMatrix rotMat = rotationMatrix( px, py, pz );
125 
126  return std::make_pair( rotMat*pplus, rotMat*pminus );
127 }
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:46
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
double p2[4]
Definition: TauolaWrapper.h:90
Definition: DDAxes.h:10
const std::pair< AlgebraicVector, AlgebraicVector > TwoBodyDecayModel::cartesianSecondaryMomenta ( const TwoBodyDecay tbd)

Momenta of the secondaries in cartesian repraesentation.

Definition at line 130 of file TwoBodyDecayModel.cc.

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

131 {
132  return cartesianSecondaryMomenta( tbd.parameters() );
133 }
const AlgebraicVector & parameters(void) const
Definition: TwoBodyDecay.h:36
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 135 of file TwoBodyDecayModel.cc.

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

136 {
137  return cartesianSecondaryMomenta( tbdparam.parameters() );
138 }
const AlgebraicVector & parameters(void) const
Get decay parameters.
const std::pair< AlgebraicVector, AlgebraicVector > cartesianSecondaryMomenta(const AlgebraicVector &param)
AlgebraicVector TwoBodyDecayModel::convertCurvilinearToCartesian ( 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 75 of file TwoBodyDecayModel.cc.

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

76 {
77  double rt = fabs( zMagField/curv[0] );
78 
79  AlgebraicVector cart( 3 );
80  cart[0] = rt*cos( curv[2] );
81  cart[1] = rt*sin( curv[2] );
82  cart[2] = rt/tan( curv[1] );
83 
84  return cart;
85 }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
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 39 of file TwoBodyDecayModel.cc.

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

Referenced by curvilinearToCartesianJacobian().

40 {
41  double q = ( ( rho < 0 ) ? -1. : 1. );
42  double conv = q*zMagField;
43 
44  double stheta = sin( theta );
45  double ctheta = cos( theta );
46  double sphi = sin( phi );
47  double cphi = cos( phi );
48 
49  AlgebraicMatrix curv2cart( 3, 3 );
50 
51  curv2cart[0][0] = -rho*cphi;
52  curv2cart[0][1] = -rho*sphi;
53  curv2cart[0][2] = 0.;
54 
55  curv2cart[1][0] = cphi*stheta*ctheta;
56  curv2cart[1][1] = sphi*stheta*ctheta;
57  curv2cart[1][2] = -stheta*stheta;
58 
59  curv2cart[2][0] = -sphi;
60  curv2cart[2][1] = cphi;
61  curv2cart[2][2] = 0.;
62 
63  curv2cart *= rho/conv;
64 
65  return curv2cart;
66 }
static HepMC::IO_HEPEVT conv
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Definition: DDAxes.h:10
Geom::Theta< T > theta() const
CLHEP::HepMatrix AlgebraicMatrix
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Definition: DDAxes.h:10
AlgebraicMatrix TwoBodyDecayModel::curvilinearToCartesianJacobian ( 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 69 of file TwoBodyDecayModel.cc.

References curvilinearToCartesianJacobian().

70 {
71  return this->curvilinearToCartesianJacobian( curv[0], curv[1], curv[2], zMagField );
72 }
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 12 of file TwoBodyDecayModel.cc.

References AlCaHLTBitMon_ParallelJobs::p, p2, and mathSSE::sqrt().

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

13 {
14  // compute transverse and absolute momentum
15  double pT2 = px*px + py*py;
16  double p2 = pT2 + pz*pz;
17  double pT = sqrt( pT2 );
18  double p = sqrt( p2 );
19 
20  AlgebraicMatrix rotMat( 3, 3 );
21 
22  // compute rotation matrix
23  rotMat[0][0] = px*pz/pT/p;
24  rotMat[0][1] = -py/pT;
25  rotMat[0][2] = px/p;
26 
27  rotMat[1][0] = py*pz/pT/p;
28  rotMat[1][1] = px/pT;
29  rotMat[1][2] = py/p;
30 
31  rotMat[2][0] = -pT/p;
32  rotMat[2][1] = 0.;
33  rotMat[2][2] = pz/p;
34 
35  return rotMat;
36 }
CLHEP::HepMatrix AlgebraicMatrix
T sqrt(T t)
Definition: SSEVec.h:46
double p2[4]
Definition: TauolaWrapper.h:90

Member Data Documentation

double TwoBodyDecayModel::thePrimaryMass
private

Definition at line 56 of file TwoBodyDecayModel.h.

Referenced by cartesianSecondaryMomenta().

double TwoBodyDecayModel::theSecondaryMass
private

Definition at line 57 of file TwoBodyDecayModel.h.

Referenced by cartesianSecondaryMomenta().