CLHEP 2.4.6.4
C++ Class Library for High Energy Physics
Loading...
Searching...
No Matches
testBug6740.cc File Reference
#include <iostream>
#include <cmath>
#include <float.h>
#include "CLHEP/Geometry/Point3D.h"
#include "CLHEP/Vector/ThreeVector.h"

Go to the source code of this file.

Typedefs

typedef HepGeom::Point3D< doubleHepPoint3D
 

Functions

int main (int, char **)
 

Typedef Documentation

◆ HepPoint3D

Definition at line 9 of file testBug6740.cc.

Function Documentation

◆ main()

int main ( int  ,
char **   
)

Definition at line 11 of file testBug6740.cc.

11 {
12
13 CLHEP::Hep3Vector d(10,0,0);
14 HepPoint3D a(0,0,0);
15 HepPoint3D pv(1,1,1);
16
17 float expected = 1.41421;
18 int numbad = 0;
19
20 CLHEP::Hep3Vector dist = a-pv; // this does not compile anymore
21 CLHEP::Hep3Vector Cross = dist.cross(d.unit());
22 std::cout << Cross.mag() << std::endl;
23
24 float result = Cross.mag();
25 float eps = 1.0e-5;
26 if( std::fabs(result - expected) > eps ) {
27 ++numbad;
28 std::cout << "Expected " << expected << " got " << result << std::endl;
29 }
30 return numbad;
31
32}
Hep3Vector cross(const Hep3Vector &) const
double mag() const