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

#include <EvtVector4R.hh>

Public Member Functions

 EvtVector4R ()
 EvtVector4R (double e, double px, double py, double pz)
void set (int i, double d)
void set (double e, double px, double py, double pz)
EvtVector4Roperator*= (double c)
EvtVector4Roperator/= (double c)
EvtVector4Roperator= (const EvtVector4R &v2)
EvtVector4Roperator+= (const EvtVector4R &v2)
EvtVector4Roperator-= (const EvtVector4R &v2)
double get (int i) const
double cont (const EvtVector4R &v4) const
double mass2 () const
double mass () const
void applyRotateEuler (double alpha, double beta, double gamma)
void applyBoostTo (const EvtVector4R &p4)
void applyBoostTo (const EvtVector3R &boost)
EvtVector4R cross (const EvtVector4R &v2)
double dot (const EvtVector4R &v2) const
double d3mag () const
double scalartripler3 (const EvtVector4R &p1, const EvtVector4R &p2, const EvtVector4R &p3) const
double dotr3 (const EvtVector4R &p1, const EvtVector4R &p2) const
double mag2r3 (const EvtVector4R &p1) const
double magr3 (const EvtVector4R &p1) const
double theta ()
double phi ()

Friends

EvtVector4R rotateEuler (const EvtVector4R &rs, double alpha, double beta, double gamma)
EvtVector4R boostTo (const EvtVector4R &rs, const EvtVector4R &p4)
EvtVector4R boostTo (const EvtVector4R &rs, const EvtVector3R &boost)
EvtVector4R operator* (double d, const EvtVector4R &v2)
EvtVector4R operator* (const EvtVector4R &v2, double d)
EvtVector4R operator/ (const EvtVector4R &v2, double d)
double operator* (const EvtVector4R &v1, const EvtVector4R &v2)
EvtVector4R operator+ (const EvtVector4R &v1, const EvtVector4R &v2)
EvtVector4R operator- (const EvtVector4R &v1, const EvtVector4R &v2)
std::ostream & operator<< (std::ostream &s, const EvtVector4R &v)

Detailed Description

Definition at line 29 of file EvtVector4R.hh.

Constructor & Destructor Documentation

◆ EvtVector4R() [1/2]

◆ EvtVector4R() [2/2]

EvtVector4R::EvtVector4R ( double e,
double px,
double py,
double pz )

Definition at line 32 of file EvtVector4R.cc.

32 {
33
34 v[0] = e;
35 v[1] = p1;
36 v[2] = p2;
37 v[3] = p3;
38}
double p2[4]
double p1[4]

Member Function Documentation

◆ applyBoostTo() [1/2]

void EvtVector4R::applyBoostTo ( const EvtVector3R & boost)

Definition at line 107 of file EvtVector4R.cc.

107 {
108
109 double bx, by, bz, gamma, b2;
110
111 bx = boost.get( 0 );
112 by = boost.get( 1 );
113 bz = boost.get( 2 );
114
115 double bxx = bx * bx;
116 double byy = by * by;
117 double bzz = bz * bz;
118
119 b2 = bxx + byy + bzz;
120
121 if ( b2 == 0.0 ) { return; }
122
123 assert( b2 < 1.0 );
124
125 gamma = 1.0 / sqrt( 1 - b2 );
126
127 double gb2 = ( gamma - 1.0 ) / b2;
128
129 double gb2xy = gb2 * bx * by;
130 double gb2xz = gb2 * bx * bz;
131 double gb2yz = gb2 * by * bz;
132
133 double gbx = gamma * bx;
134 double gby = gamma * by;
135 double gbz = gamma * bz;
136
137 double e2 = v[0];
138 double px2 = v[1];
139 double py2 = v[2];
140 double pz2 = v[3];
141
142 v[0] = gamma * e2 + gbx * px2 + gby * py2 + gbz * pz2;
143
144 v[1] = gbx * e2 + gb2 * bxx * px2 + px2 + gb2xy * py2 + gb2xz * pz2;
145
146 v[2] = gby * e2 + gb2 * byy * py2 + py2 + gb2xy * px2 + gb2yz * pz2;
147
148 v[3] = gbz * e2 + gb2 * bzz * pz2 + pz2 + gb2yz * py2 + gb2xz * px2;
149
150 return;
151}
Double_t e2
double get(int i) const

◆ applyBoostTo() [2/2]

void EvtVector4R::applyBoostTo ( const EvtVector4R & p4)

Definition at line 96 of file EvtVector4R.cc.

96 {
97
98 double e = p4.get( 0 );
99
100 EvtVector3R boost( p4.get( 1 ) / e, p4.get( 2 ) / e, p4.get( 3 ) / e );
101
102 applyBoostTo( boost );
103
104 return;
105}
double get(int i) const
void applyBoostTo(const EvtVector4R &p4)

Referenced by applyBoostTo(), boostTo, boostTo, and EvtPto3P::initDaughters().

◆ applyRotateEuler()

void EvtVector4R::applyRotateEuler ( double alpha,
double beta,
double gamma )

Definition at line 69 of file EvtVector4R.cc.

69 {
70
71 double sp = sin( phi );
72 double st = sin( theta );
73 double sk = sin( ksi );
74 double cp = cos( phi );
75 double ct = cos( theta );
76 double ck = cos( ksi );
77
78 double x =
79 ( ck * ct * cp - sk * sp ) * v[1] + ( -sk * ct * cp - ck * sp ) * v[2] + st * cp * v[3];
80 double y =
81 ( ck * ct * sp + sk * cp ) * v[1] + ( -sk * ct * sp + ck * cp ) * v[2] + st * sp * v[3];
82 double z = -ck * st * v[1] + sk * st * v[2] + ct * v[3];
83
84 v[1] = x;
85 v[2] = y;
86 v[3] = z;
87}
Double_t x[10]
double phi()
double theta()

Referenced by EvtPto3P::initDaughters(), EvtGenKine::PhaseSpace(), EvtGenKine::PhaseSpacePole(), and rotateEuler.

◆ cont()

double EvtVector4R::cont ( const EvtVector4R & v4) const
inline

Definition at line 156 of file EvtVector4R.hh.

156 {
157
158 return v[0] * v4.v[0] - v[1] * v4.v[1] - v[2] * v4.v[2] - v[3] * v4.v[3];
159}

◆ cross()

EvtVector4R EvtVector4R::cross ( const EvtVector4R & v2)

Definition at line 153 of file EvtVector4R.cc.

153 {
154
155 // Calcs the cross product. Added by djl on July 27, 1995.
156 // Modified for real vectros by ryd Aug 28-96
157
158 EvtVector4R temp;
159
160 temp.v[0] = 0.0;
161 temp.v[1] = v[2] * p2.v[3] - v[3] * p2.v[2];
162 temp.v[2] = v[3] * p2.v[1] - v[1] * p2.v[3];
163 temp.v[3] = v[1] * p2.v[2] - v[2] * p2.v[1];
164
165 return temp;
166}

Referenced by EvtAngSam3::decay(), EvtHAngSam3::decay(), EvtJTO3P::decay(), EvtDecayAngleChi(), EvtmyEulerAngles::EvtmyEulerAngles(), and EvtmyEulerAngles::EvtmyEulerAngles().

◆ d3mag()

◆ dot()

double EvtVector4R::dot ( const EvtVector4R & v2) const

Definition at line 181 of file EvtVector4R.cc.

181 {
182
183 // Returns the dot product of the 3 momentum. Added by
184 // djl on July 27, 1995. for real!!!
185
186 double temp;
187
188 temp = v[1] * p2.v[1];
189 temp += v[2] * p2.v[2];
190 temp += v[3] * p2.v[3];
191
192 return temp;
193
194} // dot

Referenced by EvtHAngSam3::decay(), and EvtDecayAngleChi().

◆ dotr3()

double EvtVector4R::dotr3 ( const EvtVector4R & p1,
const EvtVector4R & p2 ) const

Definition at line 210 of file EvtVector4R.cc.

210 {
211 return 1 / mass2() * ( ( *this ) * p1 ) * ( ( *this ) * p2 ) - p1 * p2;
212}
double mass2() const

Referenced by EvtDecayAnglePhi().

◆ get()

double EvtVector4R::get ( int i) const
inline

Definition at line 171 of file EvtVector4R.hh.

171{ return v[i]; }

Referenced by EvtMHelAmp::amplitude(), AngularSam::amps(), EvtHelSys::Angles(), EvtDiracSpinor::applyBoostTo(), EvtRaritaSchwinger::applyBoostTo(), EvtTensor4C::applyBoostTo(), EvtVector4C::applyBoostTo(), applyBoostTo(), EvtTensor4C::cont1(), EvtTensor4C::cont2(), EvtAngH2::decay(), EvtAngSam3::decay(), EvtBody3::decay(), EvtBsquark::decay(), EvtBtoXsll::decay(), EvtConExc::decay(), EvtD0ToKKpipi::decay(), EvtD0ToKpiEtap::decay(), EvtD0ToKpipi0::decay(), EvtD0ToKpipi0pi0::decay(), EvtD0ToKpipipi::decay(), EvtD0ToKSKppimpi0::decay(), EvtD0ToKSLKK::decay(), EvtD0ToKSpi0eta::decay(), EvtD0ToKSpi0pi0::decay(), EvtD0ToKSpi0pi0pi0::decay(), EvtD0ToKSpipipi0pi0::decay(), EvtD0TopipiEta::decay(), EvtDsToEta3pi::decay(), EvtDsToEtapi2pi0::decay(), EvtDsToEtapipi0::decay(), EvtDsToEtappipi0::decay(), EvtDsToKKpi::decay(), EvtDsToKKpipi0::decay(), EvtDsToKKpipipi::decay(), EvtDsToKpipi::decay(), EvtDsToKpPipPimPi0::decay(), EvtDsToKSKmPipPip::decay(), EvtDsToKSKpi0::decay(), EvtDsToKSKpPipPim::decay(), EvtDsToKSKSpi::decay(), EvtDsToKSpipi0::decay(), EvtDsTopipi0pi0::decay(), EvtDsTopipipipi0pi0::decay(), EvtDsToPipPipPimPi0::decay(), EvtDToKKpi::decay(), EvtDToKKpipi0::decay(), EvtDToKmPipPipPi0::decay(), EvtDToKppipi::decay(), EvtDToKppipipi0::decay(), EvtDToKSKmpippip::decay(), EvtDToKSKSK::decay(), EvtDToKSKSpi::decay(), EvtDToKSpieta::decay(), EvtDToKSpipi0pi0::decay(), EvtDToKSpipipi::decay(), EvtDTopiEtaEta::decay(), EvtDTopipi0Eta::decay(), EvtDToPiPi0Etap::decay(), EvtDTopipi0pi0::decay(), EvtEtaDalitz::decay(), EvtFlatQ2::decay(), EvtHAngSam3::decay(), EvtHelPPJ::decay(), EvtJ2BB1::decay(), EvtJetSet::decay(), EvtJTO3P::decay(), EvtKstarstargamma::decay(), EvtLambdaP_BarGamma::decay(), EvtLNuGamma::decay(), EvtLunda::decay(), EvtLundCharm::decay(), EvtMBody3::decay(), EvtOmegaDalitz::decay(), EvtOpenCharm::decay(), EvtSingleParticle2::decay(), EvtSingleParticle::decay(), EvtTauola::decay(), EvtTVSPwave::decay(), EvtVectorIsr::decay(), EvtVVSPwave::decay(), EvtTensor4C::directProd, EvtTensor4C::directProd, EvtPHOTOS::doRadCorr(), EvtPhotonParticle::epsParentPhoton(), EvtAmpA1(), EvtAmpA2(), EvtEulerAngles::EvtEulerAngles(), EvtmyEulerAngles::EvtmyEulerAngles(), EvtVector4C::EvtVector4C(), EvtConExc::findMaxXS(), EvtGen::generateEvent(), EvtConExc::hadron_angle_sampling(), EvtRexc::hadron_angle_sampling(), EvtNeutrinoParticle::init(), EvtPhotonParticle::init(), EvtTensorParticle::init(), EvtPto3P::initDaughters(), EvtVector4C::operator*, EvtVector4C::operator*, EvtVector4C::operator*, operator<<(), and EvtSVVHelAmp::SVVHel().

◆ mag2r3()

double EvtVector4R::mag2r3 ( const EvtVector4R & p1) const

Definition at line 216 of file EvtVector4R.cc.

216 {
217 return Square( ( *this ) * p1 ) / mass2() - p1.mass2();
218}

Referenced by EvtDecayAnglePhi(), and magr3().

◆ magr3()

double EvtVector4R::magr3 ( const EvtVector4R & p1) const

Definition at line 221 of file EvtVector4R.cc.

221{ return sqrt( mag2r3( p1 ) ); }
double mag2r3(const EvtVector4R &p1) const

◆ mass()

◆ mass2()

double EvtVector4R::mass2 ( ) const
inline

◆ operator*=()

EvtVector4R & EvtVector4R::operator*= ( double c)
inline

Definition at line 130 of file EvtVector4R.hh.

130 {
131
132 v[0] *= c;
133 v[1] *= c;
134 v[2] *= c;
135 v[3] *= c;
136
137 return *this;
138}

◆ operator+=()

EvtVector4R & EvtVector4R::operator+= ( const EvtVector4R & v2)
inline

Definition at line 90 of file EvtVector4R.hh.

90 {
91
92 v[0] += v2.v[0];
93 v[1] += v2.v[1];
94 v[2] += v2.v[2];
95 v[3] += v2.v[3];
96
97 return *this;
98}

◆ operator-=()

EvtVector4R & EvtVector4R::operator-= ( const EvtVector4R & v2)
inline

Definition at line 100 of file EvtVector4R.hh.

100 {
101
102 v[0] -= v2.v[0];
103 v[1] -= v2.v[1];
104 v[2] -= v2.v[2];
105 v[3] -= v2.v[3];
106
107 return *this;
108}

◆ operator/=()

EvtVector4R & EvtVector4R::operator/= ( double c)
inline

Definition at line 140 of file EvtVector4R.hh.

140 {
141
142 double cinv = 1.0 / c;
143 v[0] *= cinv;
144 v[1] *= cinv;
145 v[2] *= cinv;
146 v[3] *= cinv;
147
148 return *this;
149}

◆ operator=()

EvtVector4R & EvtVector4R::operator= ( const EvtVector4R & v2)
inline

Definition at line 80 of file EvtVector4R.hh.

80 {
81
82 v[0] = v2.v[0];
83 v[1] = v2.v[1];
84 v[2] = v2.v[2];
85 v[3] = v2.v[3];
86
87 return *this;
88}

◆ phi()

double EvtVector4R::phi ( )

Definition at line 231 of file EvtVector4R.cc.

231{ return ( v[1] == 0 && v[2] == 0 ) ? 0 : atan2( v[2], v[1] ); }

Referenced by applyRotateEuler().

◆ scalartripler3()

double EvtVector4R::scalartripler3 ( const EvtVector4R & p1,
const EvtVector4R & p2,
const EvtVector4R & p3 ) const

Definition at line 199 of file EvtVector4R.cc.

200 {
201 EvtVector4C lc = dual( directProd( *this, p1 ) ).cont2( p2 );
202 EvtVector4R l( real( lc.get( 0 ) ), real( lc.get( 1 ) ), real( lc.get( 2 ) ),
203 real( lc.get( 3 ) ) );
204
205 return -1.0 / mass() * ( l * p3 );
206}
Evt3Rank3C directProd(const EvtVector3C &c1, const EvtVector3C &c2, const EvtVector3C &c3)
EvtTensor4C dual(const EvtTensor4C &t2)
EvtVector4C cont2(const EvtVector4C &v4) const
const EvtComplex & get(int) const
double mass() const

Referenced by EvtDecayAnglePhi().

◆ set() [1/2]

void EvtVector4R::set ( double e,
double px,
double py,
double pz )
inline

Definition at line 175 of file EvtVector4R.hh.

175 {
176
177 v[0] = e;
178 v[1] = p1;
179 v[2] = p2;
180 v[3] = p3;
181}

◆ set() [2/2]

void EvtVector4R::set ( int i,
double d )
inline

Definition at line 173 of file EvtVector4R.hh.

173{ v[i] = d; }

Referenced by EvtbTosllScalarAmp::CalcAmp(), EvtbTosllVectorAmp::CalcAmp(), EvtSemiLeptonicBaryonAmp::CalcAmp(), EvtSemiLeptonicTensorAmp::CalcAmp(), EvtSemiLeptonicVectorAmp::CalcAmp(), EvtbTosllAmp::CalcMaxProb(), EvtSemiLeptonicAmp::CalcMaxProb(), EvtBHadronic::decay(), EvtBTo3piCP::decay(), EvtBToKpipiCP::decay(), EvtCBTo3piMPP::decay(), EvtCBTo3piP00::decay(), EvtDDalitz::decay(), EvtHelPPJ::decay(), EvtJetSet::decay(), EvtJscont::decay(), EvtKstarnunu::decay(), EvtLunda::decay(), EvtLundCharm::decay(), EvtPhokhara::decay(), EvtPhokhara_4pi::decay(), EvtPhokhara_etagam::decay(), EvtPhokhara_etapgam::decay(), EvtPhokhara_K0K0::decay(), EvtPhokhara_KK::decay(), EvtPhokhara_Lambda::decay(), EvtPhokhara_LLB::decay(), EvtPhokhara_nnbar::decay(), EvtPhokhara_pi0gam::decay(), EvtPhokhara_pi0pi0pipi::decay(), EvtPhokhara_pipi::decay(), EvtPhokhara_pipieta::decay(), EvtPhokhara_pipipi0::decay(), EvtPhokhara_ppbar::decay(), EvtPycont::decay(), EvtPyGaGa::decay(), EvtPythia::decay(), EvtSingleParticle2::decay(), EvtSingleParticle::decay(), EvtSinglePoint::decay(), EvtSll::decay(), EvtSLN::decay(), EvtTauola::decay(), EvtTVSPwave::decay(), EvtVSPPwave::decay(), EvtVub::decay(), EvtVubHybrid::decay(), EvtVubNLO::decay(), EvtPHOTOS::doRadCorr(), EvtGen::generateEvent(), EvtParticle::get4Pos(), EvtConExc::hadron_angle_sampling(), EvtRexc::hadron_angle_sampling(), EvtHelSys::Helrotate(), EvtLambdac2pKpi::init(), EvtTrackGen::init(), EvtPto3P::initDaughters(), EvtGenKine::PhaseSpace(), EvtGenKine::PhaseSpacePole(), EvtConExc::SetP4(), and EvtConExc::SetP4Rvalue().

◆ theta()

double EvtVector4R::theta ( )

Definition at line 224 of file EvtVector4R.cc.

224 {
225 return ( v[1] == 0 && v[2] == 0 && v[3] == 0 )
226 ? 0
227 : atan2( sqrt( v[1] * v[1] + v[2] * v[2] ), v[3] );
228}

Referenced by EvtConExc::angularSampling(), EvtRexc::angularSampling(), applyRotateEuler(), EvtAngSamLab::decay(), and EvtConExc::photonSampling().

◆ boostTo [1/2]

EvtVector4R boostTo ( const EvtVector4R & rs,
const EvtVector3R & boost )
friend

Definition at line 62 of file EvtVector4R.cc.

62 {
63
64 EvtVector4R tmp( rs );
65 tmp.applyBoostTo( boost );
66 return tmp;
67}

◆ boostTo [2/2]

EvtVector4R boostTo ( const EvtVector4R & rs,
const EvtVector4R & p4 )
friend

Definition at line 55 of file EvtVector4R.cc.

55 {
56
57 EvtVector4R tmp( rs );
58 tmp.applyBoostTo( p4 );
59 return tmp;
60}

◆ operator* [1/3]

double operator* ( const EvtVector4R & v1,
const EvtVector4R & v2 )
friend

Definition at line 151 of file EvtVector4R.hh.

151 {
152
153 return v1.v[0] * v2.v[0] - v1.v[1] * v2.v[1] - v1.v[2] * v2.v[2] - v1.v[3] * v2.v[3];
154}

◆ operator* [2/3]

EvtVector4R operator* ( const EvtVector4R & v2,
double d )
friend

Definition at line 120 of file EvtVector4R.hh.

120 {
121
122 return EvtVector4R( v2 ) *= c;
123}

◆ operator* [3/3]

EvtVector4R operator* ( double d,
const EvtVector4R & v2 )
friend

Definition at line 115 of file EvtVector4R.hh.

115 {
116
117 return EvtVector4R( v2 ) *= c;
118}

◆ operator+

EvtVector4R operator+ ( const EvtVector4R & v1,
const EvtVector4R & v2 )
friend

Definition at line 166 of file EvtVector4R.hh.

166 {
167
168 return EvtVector4R( v1 ) += v2;
169}

◆ operator-

EvtVector4R operator- ( const EvtVector4R & v1,
const EvtVector4R & v2 )
friend

Definition at line 161 of file EvtVector4R.hh.

161 {
162
163 return EvtVector4R( v1 ) -= v2;
164}

◆ operator/

EvtVector4R operator/ ( const EvtVector4R & v2,
double d )
friend

Definition at line 125 of file EvtVector4R.hh.

125 {
126
127 return EvtVector4R( v2 ) /= c;
128}

◆ operator<<

std::ostream & operator<< ( std::ostream & s,
const EvtVector4R & v )
friend

◆ rotateEuler

EvtVector4R rotateEuler ( const EvtVector4R & rs,
double alpha,
double beta,
double gamma )
friend

Definition at line 48 of file EvtVector4R.cc.

48 {
49
50 EvtVector4R tmp( rs );
51 tmp.applyRotateEuler( alpha, beta, gamma );
52 return tmp;
53}
double alpha

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