#ifndef HGEOMVECTOR2_H
#define HGEOMVECTOR2_H
using namespace std;
#include "TObject.h"
#include "TMath.h"
#include <math.h>
#include <iostream>
#include <iomanip>
#include "hgeomvector.h"
class HGeomVector2 : public HGeomVector {
protected:
Double_t Rad;
Double_t Phi;
Double_t Theta;
public:
HGeomVector2(Double_t dx=0,Double_t dy=0,Double_t dz=0):
HGeomVector(dx,dy,dz)
{
Rad=Phi=Theta=0.0;
}
HGeomVector2(const HGeomVector& v) : HGeomVector(v)
{
Rad=Phi=Theta=0.0;
}
~HGeomVector2() {}
Double_t getRad() const {return Rad;}
Double_t getPhi() const {return Phi;}
Double_t getTheta() const {return Theta;}
void setRad(const Double_t a) {Rad=a;}
void setPhi(const Double_t a) {Phi=a;}
void setTheta(const Double_t a) {Theta=a;}
void sphereCoord(Float_t& rad, Float_t& theta, Float_t& phi);
ClassDef(HGeomVector2,1)
};
inline void HGeomVector2::sphereCoord(Float_t& rad, Float_t& theta, Float_t& phi) {
Double_t r,k;
rad = length();
k = 180./(TMath::Pi());
theta = k*(TMath::ACos(z/rad));
r = TMath::Sqrt(x*x+y*y);
phi = k*(TMath::ACos(x/r));
if (y<0) phi = 360. - phi;
}
#endif /* !HGEOMVECTOR_H */
Last change: Sat May 22 12:56:51 2010
Last generated: 2010-05-22 12:56
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.