PHCylPoint.C
//---------------------------------------------------------------------------------------
// Class: PHCylPoint.C
//
// Created by: Jane M. Burward-Hoy and Federica Messer
//
// Purpose: The Phenix 3D Spherical Point
//
// Last update: 10/19/99
//--------------------------------------------------------------------------------------
#include "math.h"
#include "PHPoint.h"
#include "PHSphPoint.h"
#include "PHCylPoint.h"
#include "PHGeometron.h"
PHCylPoint::PHCylPoint()
{
r = 0;
z = 0;
phi = 0;
}
PHCylPoint::PHCylPoint(double r0, double p0, double z0)
{
r = r0;
phi = p0;
z = z0;
}
PHCylPoint::PHCylPoint(double r0, PHAngle p0, double z0)
{
r = r0;
phi = p0;
z = z0;
}
PHCylPoint::PHCylPoint(const PHCylPoint &rhs)
{
r = rhs.r;
phi = rhs.phi;
z = rhs.z;
}
PHCylPoint::PHCylPoint(const PHPoint &rhs)
{
PHGeometron* geometry = PHGeometron::instance();
geometry->cartesianToCylindrical(rhs, *this);
}
PHCylPoint::PHCylPoint(const PHSphPoint &rhs)
{
PHGeometron* geometry = PHGeometron::instance();
geometry->sphericalToCylindrical(rhs, *this);
}
PHCylPoint::~PHCylPoint()
{
}
void PHCylPoint::print() const
{
cout << " ( " << r << ", " << phi << ", " << z << " ) " << endl;
}
double dist(const PHCylPoint &sp)
{
cout << "not implemented " << endl;
return 0;
}
PHCylPoint& PHCylPoint::operator= (const PHCylPoint &rhs)
{
r = rhs.r;
phi = rhs.phi;
z = rhs.z;
return *this;
}
PHCylPoint& PHCylPoint::operator= (const PHPoint &rhs)
{
PHGeometron* geometry = PHGeometron::instance();
geometry->cartesianToCylindrical(rhs, *this);
return *this;
}
PHCylPoint& PHCylPoint::operator= (const PHSphPoint &rhs)
{
PHGeometron* geometry = PHGeometron::instance();
geometry->sphericalToCylindrical(rhs, *this);
return *this;
}
ostream& operator<<(ostream& os, PHCylPoint &point)
{
os << " ( " << point.r << ", " << point.phi << ", " << point.z << " ) " ;
return os;
}