BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
DifFourVector Class Reference

#include <DifFourVector.h>

Public Member Functions

 DifFourVector ()
 DifFourVector (const DifNumber &mass, const DifVector &p)
 DifFourVector (const double &mass, const DifVector &p)
 DifFourVector (const DifFourVector &v)
 ~DifFourVector ()
HepSymMatrix errorMatrix (const HepSymMatrix &e) const
HepMatrix jacobian () const
DifFourVectoroperator+= (const DifFourVector &v)
DifFourVectoroperator-= (const DifFourVector &v)
DifFourVectoroperator= (const DifFourVector &v)
DifFourVector operator- () const
int nPar () const
DifVector direction () const
DifNumber pMag () const
DifNumber massSq () const
DifNumber mass () const
void print () const
DifFourVectorzeroDerivatives ()
void boostTo (const DifFourVector &)
void boostFrom (const DifFourVector &)
void boostToMe (std::vector< DifFourVector * > &listToBoost) const
void boostFromMe (std::vector< DifFourVector * > &listToBoost) const
 DifFourVector ()
 DifFourVector (const DifNumber &mass, const DifVector &p)
 DifFourVector (const double &mass, const DifVector &p)
 DifFourVector (const DifFourVector &v)
 ~DifFourVector ()
HepSymMatrix errorMatrix (const HepSymMatrix &e) const
HepMatrix jacobian () const
DifFourVectoroperator+= (const DifFourVector &v)
DifFourVectoroperator-= (const DifFourVector &v)
DifFourVectoroperator= (const DifFourVector &v)
DifFourVector operator- () const
int nPar () const
DifVector direction () const
DifNumber pMag () const
DifNumber massSq () const
DifNumber mass () const
void print () const
DifFourVectorzeroDerivatives ()
void boostTo (const DifFourVector &)
void boostFrom (const DifFourVector &)
void boostToMe (std::vector< DifFourVector * > &listToBoost) const
void boostFromMe (std::vector< DifFourVector * > &listToBoost) const
 DifFourVector ()
 DifFourVector (const DifNumber &mass, const DifVector &p)
 DifFourVector (const double &mass, const DifVector &p)
 DifFourVector (const DifFourVector &v)
 ~DifFourVector ()
HepSymMatrix errorMatrix (const HepSymMatrix &e) const
HepMatrix jacobian () const
DifFourVectoroperator+= (const DifFourVector &v)
DifFourVectoroperator-= (const DifFourVector &v)
DifFourVectoroperator= (const DifFourVector &v)
DifFourVector operator- () const
int nPar () const
DifVector direction () const
DifNumber pMag () const
DifNumber massSq () const
DifNumber mass () const
void print () const
DifFourVectorzeroDerivatives ()
void boostTo (const DifFourVector &)
void boostFrom (const DifFourVector &)
void boostToMe (std::vector< DifFourVector * > &listToBoost) const
void boostFromMe (std::vector< DifFourVector * > &listToBoost) const

Public Attributes

DifNumber E
DifVector P

Friends

DifFourVector operator+ (const DifFourVector &a, const DifFourVector &b)
DifFourVector operator- (const DifFourVector &a, const DifFourVector &b)
DifNumber operator* (const DifFourVector &a, const DifFourVector &b)
DifFourVector operator+ (const DifFourVector &a, const DifFourVector &b)
DifFourVector operator- (const DifFourVector &a, const DifFourVector &b)
DifNumber operator* (const DifFourVector &a, const DifFourVector &b)
DifFourVector operator+ (const DifFourVector &a, const DifFourVector &b)
DifFourVector operator- (const DifFourVector &a, const DifFourVector &b)
DifNumber operator* (const DifFourVector &a, const DifFourVector &b)

Detailed Description

Constructor & Destructor Documentation

◆ DifFourVector() [1/12]

◆ DifFourVector() [2/12]

DifFourVector::DifFourVector ( const DifNumber & mass,
const DifVector & p )

Definition at line 28 of file DifFourVector.cxx.

29 : E( sqrt( m * m + p * p ) ), P( p ) {}

◆ DifFourVector() [3/12]

DifFourVector::DifFourVector ( const double & mass,
const DifVector & p )

Definition at line 30 of file DifFourVector.cxx.

31 : E( sqrt( m * m + p * p ) ), P( p ) {}

◆ DifFourVector() [4/12]

DifFourVector::DifFourVector ( const DifFourVector & v)

Definition at line 33 of file DifFourVector.cxx.

33: E( v.E ), P( v.P ) {}
**********Class see also m_nmax DOUBLE PRECISION m_amel DOUBLE PRECISION m_x2 DOUBLE PRECISION m_alfinv DOUBLE PRECISION m_Xenph INTEGER m_KeyWtm INTEGER m_idyfs DOUBLE PRECISION m_zini DOUBLE PRECISION m_q2 DOUBLE PRECISION m_Wt_KF DOUBLE PRECISION m_WtCut INTEGER m_KFfin *COMMON c_KarLud $ !Input CMS energy[GeV] $ !CMS energy after beam spread beam strahlung[GeV] $ !Beam energy spread[GeV] $ !z boost due to beam spread $ !electron beam mass *ff pair spectrum $ !minimum v
Definition KarLud.h:35

◆ ~DifFourVector() [1/3]

DifFourVector::~DifFourVector ( )
inline

Definition at line 47 of file InstallArea/x86_64-el9-gcc13-dbg/include/MdcRecoUtil/DifFourVector.h.

47{} // destroy

◆ DifFourVector() [5/12]

DifFourVector::DifFourVector ( )

◆ DifFourVector() [6/12]

DifFourVector::DifFourVector ( const DifNumber & mass,
const DifVector & p )

◆ DifFourVector() [7/12]

DifFourVector::DifFourVector ( const double & mass,
const DifVector & p )

◆ DifFourVector() [8/12]

DifFourVector::DifFourVector ( const DifFourVector & v)

◆ ~DifFourVector() [2/3]

DifFourVector::~DifFourVector ( )
inline

Definition at line 47 of file InstallArea/x86_64-el9-gcc13-opt/include/MdcRecoUtil/DifFourVector.h.

47{} // destroy

◆ DifFourVector() [9/12]

DifFourVector::DifFourVector ( )

◆ DifFourVector() [10/12]

DifFourVector::DifFourVector ( const DifNumber & mass,
const DifVector & p )

◆ DifFourVector() [11/12]

DifFourVector::DifFourVector ( const double & mass,
const DifVector & p )

◆ DifFourVector() [12/12]

DifFourVector::DifFourVector ( const DifFourVector & v)

◆ ~DifFourVector() [3/3]

DifFourVector::~DifFourVector ( )
inline

Member Function Documentation

◆ boostFrom() [1/3]

void DifFourVector::boostFrom ( const DifFourVector & pFrom)

Definition at line 149 of file DifFourVector.cxx.

149 {
150 const DifVector xHat( 1, 0, 0 );
151 const DifVector yHat( 0, 1, 0 );
152 const DifVector zHat( 0, 1, 0 );
153 DifVector z = pFrom.direction();
154 DifVector y = zHat - z * ( zHat * z );
155 if ( y.length() < 0.01 ) y = xHat - z * ( xHat * z );
156 y.normalize();
157 DifVector x( cross( y, z ) );
158
159 DifNumber px = P * x;
160 DifNumber py = P * y;
161 DifNumber pz = P * z;
162
163 DifNumber gamma = pFrom.E / pFrom.mass();
164 DifNumber beta = pFrom.pMag() / pFrom.E;
165
166 DifNumber pzP = gamma * ( pz + beta * E );
167 DifNumber eP = gamma * ( E + beta * pz );
168
169 E = eP;
170 P = px * x + py * y + pzP * z;
171}
Double_t x[10]
EvtVector3R cross(const EvtVector3R &p1, const EvtVector3R &p2)
DifVector direction() const
DifVector & normalize()
DifNumber length() const

◆ boostFrom() [2/3]

void DifFourVector::boostFrom ( const DifFourVector & )

◆ boostFrom() [3/3]

void DifFourVector::boostFrom ( const DifFourVector & )

◆ boostFromMe() [1/3]

void DifFourVector::boostFromMe ( std::vector< DifFourVector * > & listToBoost) const

Definition at line 119 of file DifFourVector.cxx.

119 {
120 const DifVector xHat( 1, 0, 0 );
121 const DifVector yHat( 0, 1, 0 );
122 const DifVector zHat( 0, 0, 1 );
123 DifVector z = P;
124 z.normalize();
125 DifVector y( zHat - z * ( zHat * z ) );
126 if ( y.lengthSq() < 0.0001 ) y = xHat - z * ( xHat * z );
127 y.normalize();
128 DifVector x( cross( y, z ) );
129
130 DifNumber gamma = E / mass();
131 DifNumber beta = pMag() / E;
132
133 for ( int i = 0; i < (int)list.size(); i++ )
134 {
135 DifFourVector& p4i = *list[i];
136 DifNumber px = p4i.P * x;
137 DifNumber py = p4i.P * y;
138 DifNumber pz = p4i.P * z;
139 DifNumber e = p4i.E;
140
141 DifNumber pzP = gamma * ( pz + beta * e );
142 DifNumber eP = gamma * ( e + beta * pz );
143
144 p4i.E = eP;
145 p4i.P = px * x + py * y + pzP * z;
146 }
147}

◆ boostFromMe() [2/3]

void DifFourVector::boostFromMe ( std::vector< DifFourVector * > & listToBoost) const

◆ boostFromMe() [3/3]

void DifFourVector::boostFromMe ( std::vector< DifFourVector * > & listToBoost) const

◆ boostTo() [1/3]

void DifFourVector::boostTo ( const DifFourVector & pTo)

Definition at line 63 of file DifFourVector.cxx.

63 {
64 const DifVector xHat( 1, 0, 0 );
65 const DifVector yHat( 0, 1, 0 );
66 const DifVector zHat( 0, 1, 0 );
67 DifVector z = pTo.direction();
68 DifVector y = zHat - z * ( zHat * z );
69 if ( y.length() < 0.01 ) y = xHat - z * ( xHat * z );
70 y.normalize();
71 DifVector x( cross( y, z ) );
72
73 DifNumber px = P * x;
74 DifNumber py = P * y;
75 DifNumber pz = P * z;
76
77 DifNumber gamma = pTo.E / pTo.mass();
78 DifNumber beta = pTo.pMag() / pTo.E;
79
80 DifNumber pzP = gamma * ( pz - beta * E );
81 DifNumber eP = gamma * ( E - beta * pz );
82
83 E = eP;
84 P = px * x + py * y + pzP * z;
85
86 return;
87}

◆ boostTo() [2/3]

void DifFourVector::boostTo ( const DifFourVector & )

◆ boostTo() [3/3]

void DifFourVector::boostTo ( const DifFourVector & )

◆ boostToMe() [1/3]

void DifFourVector::boostToMe ( std::vector< DifFourVector * > & listToBoost) const

Definition at line 89 of file DifFourVector.cxx.

89 {
90 const DifVector xHat( 1, 0, 0 );
91 const DifVector yHat( 0, 1, 0 );
92 const DifVector zHat( 0, 0, 1 );
93 DifVector z = P;
94 z.normalize();
95 DifVector y( zHat - z * ( zHat * z ) );
96 if ( y.lengthSq() < 0.0001 ) y = xHat - z * ( xHat * z );
97 y.normalize();
98 DifVector x( cross( y, z ) );
99
100 DifNumber gamma = E / mass();
101 DifNumber beta = pMag() / E;
102
103 for ( int i = 0; i < (int)list.size(); i++ )
104 {
105 DifFourVector& p4i = *list[i];
106 DifNumber px = p4i.P * x;
107 DifNumber py = p4i.P * y;
108 DifNumber pz = p4i.P * z;
109 DifNumber e = p4i.E;
110
111 DifNumber pzP = gamma * ( pz - beta * e );
112 DifNumber eP = gamma * ( e - beta * pz );
113
114 p4i.E = eP;
115 p4i.P = px * x + py * y + pzP * z;
116 }
117}

◆ boostToMe() [2/3]

void DifFourVector::boostToMe ( std::vector< DifFourVector * > & listToBoost) const

◆ boostToMe() [3/3]

void DifFourVector::boostToMe ( std::vector< DifFourVector * > & listToBoost) const

◆ direction() [1/3]

DifVector DifFourVector::direction ( ) const
inline

Referenced by boostFrom(), and boostTo().

◆ direction() [2/3]

DifVector DifFourVector::direction ( ) const
inline

◆ direction() [3/3]

DifVector DifFourVector::direction ( ) const
inline

◆ errorMatrix() [1/3]

HepSymMatrix DifFourVector::errorMatrix ( const HepSymMatrix & e) const

Definition at line 35 of file DifFourVector.cxx.

35 {
36 HepSymMatrix temp( 4 );
37 temp( 1, 1 ) = correlation( E, E, e );
38 temp( 1, 2 ) = correlation( E, P.x, e );
39 temp( 1, 3 ) = correlation( E, P.y, e );
40 temp( 1, 4 ) = correlation( E, P.z, e );
41 temp( 2, 2 ) = correlation( P.x, P.x, e );
42 temp( 2, 3 ) = correlation( P.x, P.y, e );
43 temp( 2, 4 ) = correlation( P.x, P.z, e );
44 temp( 3, 3 ) = correlation( P.y, P.y, e );
45 temp( 3, 4 ) = correlation( P.y, P.z, e );
46 temp( 4, 4 ) = correlation( P.z, P.z, e );
47 return temp;
48}
double correlation(const DifNumber &a, const DifNumber &b)
Definition DifNumber.cxx:69

Referenced by errorMatrix().

◆ errorMatrix() [2/3]

HepSymMatrix DifFourVector::errorMatrix ( const HepSymMatrix & e) const

◆ errorMatrix() [3/3]

HepSymMatrix DifFourVector::errorMatrix ( const HepSymMatrix & e) const

◆ jacobian() [1/3]

HepMatrix DifFourVector::jacobian ( ) const

Definition at line 50 of file DifFourVector.cxx.

50 {
51 int npar = E.nPar();
52 HepMatrix temp( 4, npar );
53 for ( int i = 1; i <= npar; i++ )
54 {
55 temp( 1, i ) = E.derivative( i );
56 temp( 2, i ) = P.x.derivative( i );
57 temp( 3, i ) = P.y.derivative( i );
58 temp( 4, i ) = P.z.derivative( i );
59 } // (int i=1; i<=npar; i++)
60 return temp;
61}

◆ jacobian() [2/3]

HepMatrix DifFourVector::jacobian ( ) const

◆ jacobian() [3/3]

HepMatrix DifFourVector::jacobian ( ) const

◆ mass() [1/3]

DifNumber DifFourVector::mass ( ) const
inline

Definition at line 74 of file InstallArea/x86_64-el9-gcc13-dbg/include/MdcRecoUtil/DifFourVector.h.

74 {
75 DifNumber temp = massSq();
76 if ( temp >= 0 ) return sqrt( temp );
77 return -sqrt( -massSq() );
78 }

Referenced by boostFrom(), boostFromMe(), boostTo(), boostToMe(), DifFourVector(), and DifFourVector().

◆ mass() [2/3]

DifNumber DifFourVector::mass ( ) const
inline

Definition at line 74 of file InstallArea/x86_64-el9-gcc13-opt/include/MdcRecoUtil/DifFourVector.h.

74 {
75 DifNumber temp = massSq();
76 if ( temp >= 0 ) return sqrt( temp );
77 return -sqrt( -massSq() );
78 }

◆ mass() [3/3]

DifNumber DifFourVector::mass ( ) const
inline

Definition at line 74 of file Reconstruction/MdcPatRec/MdcRecoUtil/include/MdcRecoUtil/DifFourVector.h.

74 {
75 DifNumber temp = massSq();
76 if ( temp >= 0 ) return sqrt( temp );
77 return -sqrt( -massSq() );
78 }

◆ massSq() [1/3]

DifNumber DifFourVector::massSq ( ) const
inline

Definition at line 73 of file InstallArea/x86_64-el9-gcc13-dbg/include/MdcRecoUtil/DifFourVector.h.

73{ return E * E - P * P; }

Referenced by mass().

◆ massSq() [2/3]

DifNumber DifFourVector::massSq ( ) const
inline

Definition at line 73 of file InstallArea/x86_64-el9-gcc13-opt/include/MdcRecoUtil/DifFourVector.h.

73{ return E * E - P * P; }

◆ massSq() [3/3]

DifNumber DifFourVector::massSq ( ) const
inline

Definition at line 73 of file Reconstruction/MdcPatRec/MdcRecoUtil/include/MdcRecoUtil/DifFourVector.h.

73{ return E * E - P * P; }

◆ nPar() [1/3]

int DifFourVector::nPar ( ) const
inline

◆ nPar() [2/3]

int DifFourVector::nPar ( ) const
inline

◆ nPar() [3/3]

int DifFourVector::nPar ( ) const
inline

◆ operator+=() [1/3]

DifFourVector & DifFourVector::operator+= ( const DifFourVector & v)
inline

◆ operator+=() [2/3]

DifFourVector & DifFourVector::operator+= ( const DifFourVector & v)
inline

◆ operator+=() [3/3]

DifFourVector & DifFourVector::operator+= ( const DifFourVector & v)
inline

◆ operator-() [1/3]

DifFourVector DifFourVector::operator- ( ) const
inline

◆ operator-() [2/3]

DifFourVector DifFourVector::operator- ( ) const
inline

◆ operator-() [3/3]

DifFourVector DifFourVector::operator- ( ) const
inline

◆ operator-=() [1/3]

DifFourVector & DifFourVector::operator-= ( const DifFourVector & v)
inline

◆ operator-=() [2/3]

DifFourVector & DifFourVector::operator-= ( const DifFourVector & v)
inline

◆ operator-=() [3/3]

DifFourVector & DifFourVector::operator-= ( const DifFourVector & v)
inline

◆ operator=() [1/3]

DifFourVector & DifFourVector::operator= ( const DifFourVector & v)
inline

◆ operator=() [2/3]

DifFourVector & DifFourVector::operator= ( const DifFourVector & v)
inline

◆ operator=() [3/3]

DifFourVector & DifFourVector::operator= ( const DifFourVector & v)
inline

◆ pMag() [1/3]

DifNumber DifFourVector::pMag ( ) const
inline

Definition at line 72 of file InstallArea/x86_64-el9-gcc13-dbg/include/MdcRecoUtil/DifFourVector.h.

72{ return P.length(); }

Referenced by boostFrom(), boostFromMe(), boostTo(), and boostToMe().

◆ pMag() [2/3]

DifNumber DifFourVector::pMag ( ) const
inline

Definition at line 72 of file InstallArea/x86_64-el9-gcc13-opt/include/MdcRecoUtil/DifFourVector.h.

72{ return P.length(); }

◆ pMag() [3/3]

DifNumber DifFourVector::pMag ( ) const
inline

Definition at line 72 of file Reconstruction/MdcPatRec/MdcRecoUtil/include/MdcRecoUtil/DifFourVector.h.

72{ return P.length(); }

◆ print() [1/3]

void DifFourVector::print ( ) const

Definition at line 173 of file DifFourVector.cxx.

173 {
174 // SKIP cout << "E:" << endl << E;
175 // SKIP cout << "P:" << endl << P;
176 cout << "SKIP of DifFourVector::print()" << endl; // TEMP
177}

◆ print() [2/3]

void DifFourVector::print ( ) const

◆ print() [3/3]

void DifFourVector::print ( ) const

◆ zeroDerivatives() [1/3]

DifFourVector & DifFourVector::zeroDerivatives ( )
inline

◆ zeroDerivatives() [2/3]

DifFourVector & DifFourVector::zeroDerivatives ( )
inline

◆ zeroDerivatives() [3/3]

DifFourVector & DifFourVector::zeroDerivatives ( )
inline

◆ operator* [1/3]

DifNumber operator* ( const DifFourVector & a,
const DifFourVector & b )
friend

◆ operator* [2/3]

DifNumber operator* ( const DifFourVector & a,
const DifFourVector & b )
friend

◆ operator* [3/3]

DifNumber operator* ( const DifFourVector & a,
const DifFourVector & b )
friend

◆ operator+ [1/3]

DifFourVector operator+ ( const DifFourVector & a,
const DifFourVector & b )
friend

◆ operator+ [2/3]

DifFourVector operator+ ( const DifFourVector & a,
const DifFourVector & b )
friend

◆ operator+ [3/3]

DifFourVector operator+ ( const DifFourVector & a,
const DifFourVector & b )
friend

◆ operator- [1/3]

DifFourVector operator- ( const DifFourVector & a,
const DifFourVector & b )
friend

◆ operator- [2/3]

DifFourVector operator- ( const DifFourVector & a,
const DifFourVector & b )
friend

◆ operator- [3/3]

DifFourVector operator- ( const DifFourVector & a,
const DifFourVector & b )
friend

Member Data Documentation

◆ E

◆ P


The documentation for this class was generated from the following files: