18 #pragma implementation
49 dz = r1 * std::cos(theta1);
50 double rho1 ( r1*std::sin(theta1));
51 dy = rho1 * std::sin (phi1);
52 dx = rho1 * std::cos (phi1);
66 dy = rho1 * std::sin (phi1);
67 dx = rho1 * std::cos (phi1);
76 std::cerr <<
"Hep3Vector::setRhoPhiTheta() - "
77 <<
"Attempt set vector components rho, phi, theta with zero rho -- "
78 <<
"zero vector is returned, ignoring theta and phi" << std::endl;
92 dz = rho1 / std::tan (theta1);
93 dy = rho1 * std::sin (phi1);
94 dx = rho1 * std::cos (phi1);
103 std::cerr <<
"Hep3Vector::setRhoPhiEta() - "
104 <<
"Attempt set vector components rho, phi, eta with zero rho -- "
105 <<
"zero vector is returned, ignoring eta and phi" << std::endl;
109 double theta1 (2 * std::atan ( std::exp (-eta1) ));
110 dz = rho1 / std::tan (theta1);
111 dy = rho1 * std::sin (phi1);
112 dx = rho1 * std::cos (phi1);
125 }
else if (
dz < v.
dz ) {
127 }
else if (
dy > v.
dy ) {
129 }
else if (
dy < v.
dy ) {
131 }
else if (
dx > v.
dx ) {
133 }
else if (
dx < v.
dx ) {
170 double v1v2 = std::fabs(
dot(v));
173 return ( (
mag2() == 0) && (v.
mag2() == 0) ) ? 0 : 1;
176 double abscross = v1Xv2.
mag();
177 if ( abscross >= v1v2 ) {
180 return abscross/v1v2;
189 static const double TOOBIG = std::pow(2.0,507);
190 static const double SCALE = std::pow(2.0,-507);
191 double v1v2 = std::fabs(
dot(v));
193 return ( (
mag2() == 0) && (v.
mag2() == 0) );
195 if ( v1v2 >= TOOBIG ) {
199 double x2 = sv1Xsv2.
mag2();
200 double limit = v1v2*SCALE*SCALE;
201 limit = epsilon*epsilon*limit*limit;
202 return ( x2 <= limit );
208 if ( (std::fabs (v1Xv2.
dx) > TOOBIG) ||
209 (std::fabs (v1Xv2.
dy) > TOOBIG) ||
210 (std::fabs (v1Xv2.
dz) > TOOBIG) ) {
214 return ( (v1Xv2.
mag2()) <= ((epsilon * v1v2) * (epsilon * v1v2)) );
222 double v1v2 = std::fabs(
dot(v));
228 double abscross = v1Xv2.
mag();
229 if ( v1v2 >= abscross ) {
232 return v1v2/abscross;
242 static const double TOOBIG = std::pow(2.0,507);
243 static const double SCALE = std::pow(2.0,-507);
244 double v1v2 = std::fabs(
dot(v));
246 if ( v1v2 >= TOOBIG ) {
250 double x2 = sv1Xsv2.
mag2();
251 double limit = epsilon*epsilon*
x2;
252 double y2 = v1v2*SCALE*SCALE;
253 return ( y2*y2 <= limit );
259 if ( (std::fabs (eps_v1Xv2.
dx) > TOOBIG) ||
260 (std::fabs (eps_v1Xv2.
dy) > TOOBIG) ||
261 (std::fabs (eps_v1Xv2.
dz) > TOOBIG) ) {
267 return ( v1v2*v1v2 <= eps_v1Xv2.
mag2() );
297 for (k=0; k<8; k++) {
298 value.u.i[k] = negOne.u.i[k] | posTwo.u.i[k];
static DLL_API double tolerance
bool operator>(const Hep3Vector &v) const
bool operator>=(const Hep3Vector &v) const
double negativeInfinity() const
void setCylindrical(double r, double phi, double z)
int compare(const Hep3Vector &v) const
double dot(const Hep3Vector &) const
bool operator<(const Hep3Vector &v) const
bool isOrthogonal(const Hep3Vector &v, double epsilon=tolerance) const
bool operator<=(const Hep3Vector &v) const
Float_t y2[n_points_geant4]
const XML_Char int const XML_Char * value
void setRhoPhiEta(double rho, double phi, double eta)
double howOrthogonal(const Hep3Vector &v) const
void setRhoPhiTheta(double rho, double phi, double theta)
void setSpherical(double r, double theta, double phi)
bool isParallel(const Hep3Vector &v, double epsilon=tolerance) const
Hep3Vector cross(const Hep3Vector &) const
double epsilon(double density, double temperature)
static double setTolerance(double tol)
double howParallel(const Hep3Vector &v) const
Float_t x2[n_points_geant4]