Go to the documentation of this file.
10 #include "CLHEP/Vector/defs.h"
11 #include "CLHEP/Vector/TwoVector.h"
12 #include "CLHEP/Vector/ZMxpv.h"
13 #include "CLHEP/Vector/ThreeVector.h"
24 double oldTolerance (tolerance);
36 "Hep2Vector::operator(): bad index"));
50 "Hep2Vector::operator() : bad index"));
56 double s1 = std::sin(angler);
57 double c = std::cos(angler);
65 ZMthrowA(ZMxpvInfiniteVector(
"Division of Hep2Vector by zero"));
71 os <<
"(" << q.
x() <<
", " << q.
y() <<
")";
76 double &
x,
double & y );
92 }
else if ( dy <
v.dy ) {
94 }
else if ( dx >
v.dx ) {
96 }
else if ( dx <
v.dx ) {
118 double limit =
dot(p)*epsilon*epsilon;
119 return ( (*
this - p).
mag2() <= limit );
123 double d = (*
this - p).
mag2();
125 if ( (pdp > 0) && (d < pdp) ) {
126 return std::sqrt (d/pdp);
127 }
else if ( (pdp == 0) && (d == 0) ) {
137 double v1v2 = std::fabs(
dot(
v));
140 return ( (
mag2() == 0) && (
v.mag2() == 0) ) ? 0 : 1;
142 double abscross = std::fabs ( dx *
v.y() - dy -
v.x() );
143 if ( abscross >= v1v2 ) {
146 return abscross/v1v2;
151 double epsilon)
const {
154 double v1v2 = std::fabs(
dot(
v));
157 return ( (
mag2() == 0) && (
v.mag2() == 0) );
159 double abscross = std::fabs ( dx *
v.y() - dy -
v.x() );
160 return ( abscross <= epsilon * v1v2 );
166 double v1v2 = std::fabs(
dot(
v));
170 double abscross = std::fabs ( dx *
v.y() - dy -
v.x() );
171 if ( v1v2 >= abscross ) {
174 return v1v2/abscross;
179 double epsilon)
const {
182 double v1v2 = std::fabs(
dot(
v));
183 double abscross = std::fabs ( dx *
v.y() - dy -
v.x() );
184 return ( v1v2 <= epsilon * abscross );
double howNear(const Hep2Vector &p) const
HepRotation and so forth isNear() norm2() rectify() static Rotation row1 row4(To avoid bloat in the code pulled in for programs which don 't use all these features, we split the implementation .cc files. Only isNear() goes into the original Rotation.cc) --------------------------------------- HepAxisAngle and HepEulerAngles classes --------------------------------------- These classes are very useful and simple structures for holding the result of a nice intuituve decomposition of a rotation there is no longer much content in the distinct ZOOM PhysicsVectors library The only content left in the library is the object files representing the various Exception objects When we build the CLHEP classes for the ZOOM we will set up so as to use ZOOM SpaceVector is(but we can disable namespace usage and most of our users do so at this point). What I do is leave Hep3Vector in the global namespace
double operator()(int i) const
bool operator<=(const Hep2Vector &v) const
int compare(const Hep2Vector &v) const
static double setTolerance(double tol)
HepLorentzVector operator/(const HepLorentzVector &, double a)
bool isNear(const Hep2Vector &p, double epsilon=tolerance) const
bool operator>(const Hep2Vector &v) const
Signatures of Hep3Vector::rotate For equivalent ZOOM axis There is no harm in leaving this axis CLHEP has implemented a first forming an identity then rotating that by axis and I leave the CLHEP code alone people are of course free to use the ZOOM originated method with signature which I believe will be faster Return types for rotateZ CLHEP and PhysicsVectors each have these three and they are identical except that the ZOOM version returns a reference to while in CLHEP they return void Having methods that alter an object return a reference to that object is convenient for certain chained and costs nothing I don t wish to potentially break ZOOM user code for no good so I have made these CLHEP method conform to this convention There are a couple of other CLHEP rotate and which use the void return type
they are gone ZOOM Features Discontinued The following features of the ZOOM package were felt to be extreme overkill These have been after checking that no existing user code was utilizing as in SpaceVector v
Issues Concerning the PhysicsVectors CLHEP Vector Merge The merge of ZOOM PhysicsVdectors and the CLHEP Vector package is completed The purpose of this document is to list the major issues that affected the merge of these and where relevant describe the resolutions More detailed documents describe more minor issues General Approach As agreed at the June CLHEP the approach is to combine the features of each ZOOM class with the corresponding CLHEP class expanding the interface to create a single lingua franca of what a Hep3Vector(for example) means. We are not forming SpaceVector as an class derived from Hep3Vector and enhancing it in that way. Another rule imposed by the agreement is to avoid using the Exceptions package(even though that will later go into CLHEP for other uses). A desirable goal is to avoid cluttering the interface and enlarging the code linked in when ordinary CLHEP Vector functionallity is used. To this end
void ZMinput2doubles(std::istream &is, const char *type, double &x, double &y)
std::istream & operator>>(std::istream &is, HepAxisAngle &aa)
double howOrthogonal(const Hep2Vector &p) const
void set(double x, double y)
bool isOrthogonal(const Hep2Vector &p, double epsilon=tolerance) const
bool operator<(const Hep2Vector &v) const
double howParallel(const Hep2Vector &p) const
std::ostream & operator<<(std::ostream &os, const HepAxisAngle &aa)
any side effects of that construction would occur twice The semantics of throw x
it has advantages For I leave the ZMthrows but substitute I replaced ZMthrow with ZMthrowA in this package ZMthrowA
bool operator>=(const Hep2Vector &v) const
bool isParallel(const Hep2Vector &p, double epsilon=tolerance) const
double dot(const Hep2Vector &p) const