* Initial Revision
*
**************************************************************************/
+/*//
+//// General class for a Lorentz four-vector
+///*/
#ifndef ST_LORENTZ_VECTOR_HH
#define ST_LORENTZ_VECTOR_HH
void SetVect(const AliFemtoThreeVector<double>&);
#endif
- T perp() const;
- T perp2() const;
- T pseudoRapidity() const;
- T phi() const;
- T theta() const;
- T cosTheta() const;
+ T Perp() const;
+ T Perp2() const;
+ T PseudoRapidity() const;
+ T Phi() const;
+ T Theta() const;
+ T CosTheta() const;
- T plus() const;
- T minus() const;
+ T Plus() const;
+ T Minus() const;
T m() const;
T m2() const;
T mt() const;
T mt2() const;
- T rapidity() const;
+ T Rapidity() const;
#ifndef ST_NO_MEMBER_TEMPLATES
template<class X> AliFemtoLorentzVector<T> boost(const AliFemtoLorentzVector<X>&) const;
}
template<class T>
-T AliFemtoLorentzVector<T>::plus() const { return (e() + pz()); }
+T AliFemtoLorentzVector<T>::Plus() const { return (e() + pz()); }
template<class T>
-T AliFemtoLorentzVector<T>::minus() const { return (e() - pz()); }
+T AliFemtoLorentzVector<T>::Minus() const { return (e() - pz()); }
template<class T>
T AliFemtoLorentzVector<T>::m() const
template<class T>
T AliFemtoLorentzVector<T>::mt2() const
{
- return this->perp2() + m2();
+ return this->Perp2() + m2();
}
template<class T>
T AliFemtoLorentzVector<T>::t() const {return mX4;}
template<class T>
-T AliFemtoLorentzVector<T>::perp() const {return mThreeVector.perp();}
+T AliFemtoLorentzVector<T>::Perp() const {return mThreeVector.Perp();}
template<class T>
-T AliFemtoLorentzVector<T>::perp2() const {return mThreeVector.perp2();}
+T AliFemtoLorentzVector<T>::Perp2() const {return mThreeVector.Perp2();}
template<class T>
-T AliFemtoLorentzVector<T>::pseudoRapidity() const {return mThreeVector.pseudoRapidity();}
+T AliFemtoLorentzVector<T>::PseudoRapidity() const {return mThreeVector.PseudoRapidity();}
template<class T>
-T AliFemtoLorentzVector<T>::phi() const {return mThreeVector.phi();}
+T AliFemtoLorentzVector<T>::Phi() const {return mThreeVector.Phi();}
template<class T>
-T AliFemtoLorentzVector<T>::theta() const {return mThreeVector.theta();}
+T AliFemtoLorentzVector<T>::Theta() const {return mThreeVector.Theta();}
template<class T>
-T AliFemtoLorentzVector<T>::cosTheta() const {return mThreeVector.cosTheta();}
+T AliFemtoLorentzVector<T>::CosTheta() const {return mThreeVector.CosTheta();}
template<class T>
T AliFemtoLorentzVector<T>::operator() (size_t i) const
}
template<class T>
-T AliFemtoLorentzVector<T>::rapidity() const
+T AliFemtoLorentzVector<T>::Rapidity() const
{
return 0.5*::log((mX4+mThreeVector.z())/(mX4-mThreeVector.z())+1e-20);
}
* Initial Revision
*
**************************************************************************/
+/*//
+//// General class for a three-vector
+///*/
#ifndef ST_THREE_VECTOR_HH
#define ST_THREE_VECTOR_HH
#ifdef __ROOT__
T x() const;
T y() const;
T z() const;
- T theta() const;
- T cosTheta() const;
- T phi() const;
- T perp() const;
- T perp2() const;
- T magnitude() const;
- T mag() const;
- T mag2() const;
- T pseudoRapidity() const;
+ T Theta() const;
+ T CosTheta() const;
+ T Phi() const;
+ T Perp() const;
+ T Perp2() const;
+ T Magnitude() const;
+ T Mag() const;
+ T Mag2() const;
+ T PseudoRapidity() const;
T operator() (size_t) const;
T operator[] (size_t) const;
AliFmThreeVector<T> operator+ ();
AliFmThreeVector<T>& operator*= (double);
AliFmThreeVector<T>& operator/= (double);
- AliFmThreeVector<T> pseudoProduct(double,double,double) const;
+ AliFmThreeVector<T> PseudoProduct(double,double,double) const;
#ifndef ST_NO_MEMBER_TEMPLATES
- template<class X> T angle(const AliFmThreeVector<X>&) const;
- template<class X> AliFmThreeVector<T> cross(const AliFmThreeVector<X>&) const;
- template<class X> T dot (const AliFmThreeVector<X>&) const;
- template<class X> AliFmThreeVector<T> pseudoProduct(const AliFmThreeVector<X>&) const;
+ template<class X> T Angle(const AliFmThreeVector<X>&) const;
+ template<class X> AliFmThreeVector<T> Cross(const AliFmThreeVector<X>&) const;
+ template<class X> T Dot (const AliFmThreeVector<X>&) const;
+ template<class X> AliFmThreeVector<T> PseudoProduct(const AliFmThreeVector<X>&) const;
template<class X> bool operator == (const AliFmThreeVector<X>& v) const;
template<class X> bool operator != (const AliFmThreeVector<X>& v) const;
template<class X> AliFmThreeVector<T>& operator+= (const AliFmThreeVector<X>&);
template<class X> AliFmThreeVector<T>& operator-= (const AliFmThreeVector<X>&);
#else
- T angle(const AliFmThreeVector<float>&) const;
- AliFmThreeVector<T> cross(const AliFmThreeVector<float>&) const;
- T dot (const AliFmThreeVector<float>&) const;
- AliFmThreeVector<T> pseudoProduct(const AliFmThreeVector<float>&) const;
+ T Angle(const AliFmThreeVector<float>&) const;
+ AliFmThreeVector<T> Cross(const AliFmThreeVector<float>&) const;
+ T Dot (const AliFmThreeVector<float>&) const;
+ AliFmThreeVector<T> PseudoProduct(const AliFmThreeVector<float>&) const;
- T angle(const AliFmThreeVector<double>&) const;
- T dot (const AliFmThreeVector<double>&) const;
- AliFmThreeVector<T> cross(const AliFmThreeVector<double>&) const;
- AliFmThreeVector<T> pseudoProduct(const AliFmThreeVector<double>&) const;
+ T Angle(const AliFmThreeVector<double>&) const;
+ T Dot (const AliFmThreeVector<double>&) const;
+ AliFmThreeVector<T> Cross(const AliFmThreeVector<double>&) const;
+ AliFmThreeVector<T> PseudoProduct(const AliFmThreeVector<double>&) const;
bool operator == (const AliFmThreeVector<float>& v) const;
bool operator != (const AliFmThreeVector<float>& v) const;
int valid(double world = 1.e+5) const;
int bad(double world = 1.e+5) const;
protected:
- T mX1, mX2, mX3;
+ T mX1, mX2, mX3; // Three vector components
#ifdef __ROOT__
ClassDef(AliFmThreeVector,3)
#endif /* __ROOT__ */
template<class T>
void AliFmThreeVector<T>::SetPhi(T angle)
{
- double r = magnitude();
- double th = theta();
+ double r = Magnitude();
+ double th = Theta();
mX1 = r*sin(th)*cos(angle);
mX2 = r*sin(th)*sin(angle);
template <class T>
void AliFmThreeVector<T>::SetTheta(T angle)
{
- double r = magnitude();
- double ph = phi();
+ double r = Magnitude();
+ double ph = Phi();
mX1 = r*sin(angle)*cos(ph);
mX2 = r*sin(angle)*sin(ph);
template <class T>
void AliFmThreeVector<T>::SetMagnitude(T r)
{
- double th = theta();
- double ph = phi();
+ double th = Theta();
+ double ph = Phi();
mX1 = r*sin(th)*cos(ph);
mX2 = r*sin(th)*sin(ph);
inline T AliFmThreeVector<T>::z() const {return mX3;}
template<class T>
-inline T AliFmThreeVector<T>::theta() const
+inline T AliFmThreeVector<T>::Theta() const
{
- return acos(cosTheta());
+ return acos(CosTheta());
}
template<class T>
-inline T AliFmThreeVector<T>::cosTheta() const
+inline T AliFmThreeVector<T>::CosTheta() const
{
- return mX3/(mag()+1e-20);
+ return mX3/(Mag()+1e-20);
}
template<class T>
-inline T AliFmThreeVector<T>::phi() const
+inline T AliFmThreeVector<T>::Phi() const
{
return atan2(mX2,mX1);
}
template<class T>
-inline T AliFmThreeVector<T>::pseudoRapidity() const
+inline T AliFmThreeVector<T>::PseudoRapidity() const
{
//
// change code to more optimal:
- // double m = mag();
+ // double m = Mag();
// return 0.5*::log( (m+z())/(m-z()) );
- double tmp = tan(theta()/2.); if (tmp <=0.) return 1e20;
+ double tmp = tan(Theta()/2.); if (tmp <=0.) return 1e20;
return -::log(tmp);
}
template<class T>
inline AliFmThreeVector<T> AliFmThreeVector<T>::Unit() const
{
- double tmp = mag(); if (tmp<=0.) tmp = 1e-20;
+ double tmp = Mag(); if (tmp<=0.) tmp = 1e-20;
return *this/tmp;
}
}
template<class T>
-inline T AliFmThreeVector<T>::perp() const
+inline T AliFmThreeVector<T>::Perp() const
{
return ::sqrt(mX1*mX1+mX2*mX2);
}
template<class T>
-inline T AliFmThreeVector<T>::perp2() const
+inline T AliFmThreeVector<T>::Perp2() const
{
return mX1*mX1+mX2*mX2;
}
template<class T>
-inline T AliFmThreeVector<T>::magnitude() const
+inline T AliFmThreeVector<T>::Magnitude() const
{
- return mag();
+ return Mag();
}
template<class T>
-inline T AliFmThreeVector<T>::mag() const
+inline T AliFmThreeVector<T>::Mag() const
{
return ::sqrt(mX1*mX1+mX2*mX2+mX3*mX3);
}
template<class T>
-inline T AliFmThreeVector<T>::mag2() const
+inline T AliFmThreeVector<T>::Mag2() const
{
return mX1*mX1+mX2*mX2+mX3*mX3;
}
template<class T>
inline AliFmThreeVector<T>
-AliFmThreeVector<T>::pseudoProduct(double x,double y,double z) const
+AliFmThreeVector<T>::PseudoProduct(double x,double y,double z) const
{
return AliFmThreeVector<T>(mX1*x,mX2*y,mX3*z);
}
template<class T>
template<class X>
-inline T AliFmThreeVector<T>::dot(const AliFmThreeVector<X>& v) const
+inline T AliFmThreeVector<T>::Dot(const AliFmThreeVector<X>& v) const
{
return mX1*v.x() + mX2*v.y() + mX3*v.z();
}
template<class T>
template<class X>
inline AliFmThreeVector<T>
-AliFmThreeVector<T>::cross(const AliFmThreeVector<X>& v) const
+AliFmThreeVector<T>::Cross(const AliFmThreeVector<X>& v) const
{
return AliFmThreeVector<T>(mX2*v.z() - mX3*v.y(),
mX3*v.x() - mX1*v.z(),
template<class T>
template<class X>
-inline T AliFmThreeVector<T>::angle(const AliFmThreeVector<X>& vec) const
+inline T AliFmThreeVector<T>::Angle(const AliFmThreeVector<X>& vec) const
{
- double norm = this->mag2()*vec.mag2();
+ double norm = this->Mag2()*vec.Mag2();
- return norm > 0 ? acos(this->dot(vec)/(::sqrt(norm))) : 0;
+ return norm > 0 ? acos(this->Dot(vec)/(::sqrt(norm))) : 0;
}
template<class T>
template<class X>
inline AliFmThreeVector<T>
-AliFmThreeVector<T>::pseudoProduct(const AliFmThreeVector<X>& v) const
+AliFmThreeVector<T>::PseudoProduct(const AliFmThreeVector<X>& v) const
{
- return this->pseudoProduct(v.x(),v.y(),v.z());
+ return this->PseudoProduct(v.x(),v.y(),v.z());
}
#endif
}
template<class T>
-inline T AliFmThreeVector<T>::dot(const AliFmThreeVector<float>& v) const
+inline T AliFmThreeVector<T>::Dot(const AliFmThreeVector<float>& v) const
{
return mX1*v.x() + mX2*v.y() + mX3*v.z();
}
template<class T>
-inline T AliFmThreeVector<T>::dot(const AliFmThreeVector<double>& v) const
+inline T AliFmThreeVector<T>::Dot(const AliFmThreeVector<double>& v) const
{
return mX1*v.x() + mX2*v.y() + mX3*v.z();
}
template<class T>
inline AliFmThreeVector<T>
-AliFmThreeVector<T>::cross(const AliFmThreeVector<float>& v) const
+AliFmThreeVector<T>::Cross(const AliFmThreeVector<float>& v) const
{
return AliFmThreeVector<T>(mX2*v.z() - mX3*v.y(),
mX3*v.x() - mX1*v.z(),
template<class T>
inline AliFmThreeVector<T>
-AliFmThreeVector<T>::cross(const AliFmThreeVector<double>& v) const
+AliFmThreeVector<T>::Cross(const AliFmThreeVector<double>& v) const
{
return AliFmThreeVector<T>(mX2*v.z() - mX3*v.y(),
mX3*v.x() - mX1*v.z(),
}
template<class T>
-inline T AliFmThreeVector<T>::angle(const AliFmThreeVector<float>& v) const
+inline T AliFmThreeVector<T>::Angle(const AliFmThreeVector<float>& v) const
{
- double tmp = mag()*v.mag(); if (tmp <=0) tmp = 1e-20;
- return acos(this->dot(v)/tmp);
+ double tmp = Mag()*v.Mag(); if (tmp <=0) tmp = 1e-20;
+ return acos(this->Dot(v)/tmp);
}
template<class T>
-inline T AliFmThreeVector<T>::angle(const AliFmThreeVector<double>& v) const
+inline T AliFmThreeVector<T>::Angle(const AliFmThreeVector<double>& v) const
{
- double tmp = mag()*v.mag(); if (tmp <=0) tmp = 1e-20;
- return acos(this->dot(v)/tmp);
+ double tmp = Mag()*v.Mag(); if (tmp <=0) tmp = 1e-20;
+ return acos(this->Dot(v)/tmp);
}
template<class T>
inline AliFmThreeVector<T>
-AliFmThreeVector<T>::pseudoProduct(const AliFmThreeVector<float>& v) const
+AliFmThreeVector<T>::PseudoProduct(const AliFmThreeVector<float>& v) const
{
- return this->pseudoProduct(v.x(),v.y(),v.z());
+ return this->PseudoProduct(v.x(),v.y(),v.z());
}
template<class T>
inline AliFmThreeVector<T>
-AliFmThreeVector<T>::pseudoProduct(const AliFmThreeVector<double>& v) const
+AliFmThreeVector<T>::PseudoProduct(const AliFmThreeVector<double>& v) const
{
- return this->pseudoProduct(v.x(),v.y(),v.z());
+ return this->PseudoProduct(v.x(),v.y(),v.z());
}
#endif // ST_NO_MEMBER_TEMPLATES
template<class T>
// Non-member functions
//
template<class T>
-inline T abs(const AliFmThreeVector<T>& v) {return v.mag();}
+inline T abs(const AliFmThreeVector<T>& v) {return v.Mag();}
template<class T, class X>
inline AliFmThreeVector<T>
cross_product(const AliFmThreeVector<T>& v1, const AliFmThreeVector<X>& v2)
{
- return v1.cross(v2);
+ return v1.Cross(v2);
}
template<class T, class X>
inline T operator* (const AliFmThreeVector<T>& v1, const AliFmThreeVector<X>& v2)
{
- return AliFmThreeVector<T>(v1).dot(v2);
+ return AliFmThreeVector<T>(v1).Dot(v2);
}
template<class T>
* Initial Revision
*
**************************************************************************/
+/*//
+//// General class for a Lorentz four-vector
+///*/
#ifndef ST_LORENTZ_VECTOR_HH
#define ST_LORENTZ_VECTOR_HH
void SetVect(const AliFmThreeVector<double>&);
#endif
- T perp() const;
- T perp2() const;
- T pseudoRapidity() const;
- T phi() const;
- T theta() const;
- T cosTheta() const;
+ T Perp() const;
+ T Perp2() const;
+ T PseudoRapidity() const;
+ T Phi() const;
+ T Theta() const;
+ T CosTheta() const;
- T plus() const;
- T minus() const;
+ T Plus() const;
+ T Minus() const;
T m() const;
T m2() const;
T mt() const;
T mt2() const;
- T rapidity() const;
+ T Rapidity() const;
#ifndef ST_NO_MEMBER_TEMPLATES
template<class X> AliFmLorentzVector<T> boost(const AliFmLorentzVector<X>&) const;
#endif
protected:
- AliFmThreeVector<T> mThreeVector;
- T mX4;
+ AliFmThreeVector<T> mThreeVector; // The spatial three-vector
+ T mX4; // The fourth components
#ifdef __ROOT__
ClassDef(AliFmLorentzVector,3)
#endif
}
template<class T>
-T AliFmLorentzVector<T>::plus() const { return (e() + pz()); }
+T AliFmLorentzVector<T>::Plus() const { return (e() + pz()); }
template<class T>
-T AliFmLorentzVector<T>::minus() const { return (e() - pz()); }
+T AliFmLorentzVector<T>::Minus() const { return (e() - pz()); }
template<class T>
T AliFmLorentzVector<T>::m() const
template<class T>
T AliFmLorentzVector<T>::mt2() const
{
- return this->perp2() + m2();
+ return this->Perp2() + m2();
}
template<class T>
T AliFmLorentzVector<T>::t() const {return mX4;}
template<class T>
-T AliFmLorentzVector<T>::perp() const {return mThreeVector.Perp();}
+T AliFmLorentzVector<T>::Perp() const {return mThreeVector.Perp();}
template<class T>
-T AliFmLorentzVector<T>::perp2() const {return mThreeVector.Perp2();}
+T AliFmLorentzVector<T>::Perp2() const {return mThreeVector.Perp2();}
template<class T>
-T AliFmLorentzVector<T>::pseudoRapidity() const {return mThreeVector.PseudoRapidity();}
+T AliFmLorentzVector<T>::PseudoRapidity() const {return mThreeVector.PseudoRapidity();}
template<class T>
-T AliFmLorentzVector<T>::phi() const {return mThreeVector.Phi();}
+T AliFmLorentzVector<T>::Phi() const {return mThreeVector.Phi();}
template<class T>
-T AliFmLorentzVector<T>::theta() const {return mThreeVector.Theta();}
+T AliFmLorentzVector<T>::Theta() const {return mThreeVector.Theta();}
template<class T>
-T AliFmLorentzVector<T>::cosTheta() const {return mThreeVector.CosTheta();}
+T AliFmLorentzVector<T>::CosTheta() const {return mThreeVector.CosTheta();}
template<class T>
T AliFmLorentzVector<T>::operator() (size_t i) const
}
template<class T>
-T AliFmLorentzVector<T>::rapidity() const
+T AliFmLorentzVector<T>::Rapidity() const
{
return 0.5*::log((mX4+mThreeVector.z())/(mX4-mThreeVector.z())+1e-20);
}