Import Geant4 9.6.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 17:01:34 +02:00
parent b1eb5424d2
commit e2d2f9810a
10384 changed files with 698580 additions and 628834 deletions
@@ -48,7 +48,7 @@ namespace HepGeom {
/**
* Constructor from three numbers. */
BasicVector3D(T x, T y, T z) { v_[0] = x; v_[1] = y; v_[2] = z; }
BasicVector3D(T x1, T y1, T z1) { v_[0] = x1; v_[1] = y1; v_[2] = z1; }
/**
* Copy constructor.
@@ -158,7 +158,7 @@ namespace HepGeom {
/**
* Sets components in cartesian coordinate system. */
void set(T x, T y, T z) { v_[0] = x; v_[1] = y; v_[2] = z; }
void set(T x1, T y1, T z1) { v_[0] = x1; v_[1] = y1; v_[2] = z1; }
// ------------------------------------------
// Cylindrical coordinate system: rho, phi, z
@@ -247,7 +247,7 @@ namespace HepGeom {
// ---------------
/**
* Gets pseudo-rapidity: -std::ln(std::tan(theta/2)) */
* Gets pseudo-rapidity: -ln(tan(theta/2)) */
T pseudoRapidity() const;
/**
* Gets pseudo-rapidity. */
+2 -2
View File
@@ -48,7 +48,7 @@ namespace HepGeom {
/**
* Constructor from three numbers. */
Normal3D(float x, float y, float z) : BasicVector3D<float>(x,y,z) {}
Normal3D(float x1, float y1, float z1) : BasicVector3D<float>(x1,y1,z1) {}
/**
* Constructor from array of floats. */
@@ -106,7 +106,7 @@ namespace HepGeom {
/**
* Constructor from three numbers. */
Normal3D(double x, double y, double z) : BasicVector3D<double>(x,y,z) {}
Normal3D(double x1, double y1, double z1) : BasicVector3D<double>(x1,y1,z1) {}
/**
* Constructor from array of floats. */
+1 -1
View File
@@ -37,7 +37,7 @@ namespace HepGeom {
/**
* Constructor from four numbers - creates plane a*x+b*y+c*z+d=0. */
Plane3D(T a, T b, T c, T d) : a_(a), b_(b), c_(c), d_(d) {}
Plane3D(T a1, T b1, T c1, T d1) : a_(a1), b_(b1), c_(c1), d_(d1) {}
/**
* Constructor from normal and point. */
+2 -2
View File
@@ -48,7 +48,7 @@ namespace HepGeom {
/**
* Constructor from three numbers. */
Point3D(float x, float y, float z) : BasicVector3D<float>(x,y,z) {}
Point3D(float x1, float y1, float z1) : BasicVector3D<float>(x1,y1,z1) {}
/**
* Constructor from array of floats. */
@@ -127,7 +127,7 @@ namespace HepGeom {
/**
* Constructor from three numbers. */
Point3D(double x, double y, double z) : BasicVector3D<double>(x,y,z) {}
Point3D(double x1, double y1, double z1) : BasicVector3D<double>(x1,y1,z1) {}
/**
* Constructor from array of floats. */
+2 -2
View File
@@ -48,7 +48,7 @@ namespace HepGeom {
/**
* Constructor from three numbers. */
Vector3D(float x, float y, float z) : BasicVector3D<float>(x,y,z) {}
Vector3D(float x1, float y1, float z1) : BasicVector3D<float>(x1,y1,z1) {}
/**
* Constructor from array of floats. */
@@ -106,7 +106,7 @@ namespace HepGeom {
/**
* Constructor from three numbers. */
Vector3D(double x, double y, double z) : BasicVector3D<double>(x,y,z) {}
Vector3D(double x1, double y1, double z1) : BasicVector3D<double>(x1,y1,z1) {}
/**
* Constructor from array of floats. */
+72 -72
View File
@@ -1,72 +1,72 @@
// $Id:$
// -*- C++ -*-
//
// -----------------------------------------------------------------------
// Hep Random
// --- DoubConv ---
// class header file
// -----------------------------------------------------------------------
//
#ifndef DOUBCONV_HH
#define DOUBCONV_HH
#include <string>
#include <vector>
#include <exception>
namespace CLHEP {
class DoubConvException : public std::exception {
public:
DoubConvException(const std::string & w) throw() : msg(w) {}
~DoubConvException() throw() {}
const char* what() const throw() { return msg.c_str(); }
private:
std::string msg;
};
class DoubConv {
public:
// dto2longs(d) returns (in a vector) two unsigned longs string containing the
// representation of its double input. This is byte-ordering
// independant, and depends for complete portability ONLY on adherance
// to the IEEE 754 standard for 64-bit floating point representation.
// The first unsigned long contains the high-order bits in IEEE; thus
// 1.0 will always be 0x3FF00000, 00000000
static std::vector<unsigned long> dto2longs(double d);
// longs2double (v) returns a double containing the value represented by its
// input, which must be a vector containing 2 unsigned longs.
// The input is taken to be the representation according to
// the IEEE 754 standard for a 64-bit floating point number, whose value
// is returned as a double. The byte-ordering of the double result is,
// of course, tailored to the proper byte-ordering for the system.
static double longs2double (const std::vector<unsigned long> & v);
// dtox(d) returns a 16-character string containing the (zero-filled) hex
// representation of its double input. This is byte-ordering
// independant, and depends for complete portability ONLY on adherance
// to the IEEE 754 standard for 64-bit floating point representation.
static std::string d2x(double d);
private:
union DB8 {
unsigned char b[8];
double d;
};
static void fill_byte_order ();
static bool byte_order_known;
static int byte_order[8];
// Meaning of byte_order: The first (high-order in IEEE 754) byte to
// output (or the high-order byte of the first unsigned long)
// is of db.b[byte_order[0]]. Thus the index INTO byte_order
// is a position in the IEEE representation of the double, and the value
// of byte_order[k] is an offset in the memory representation of the
// double.
};
}
#endif // DOUBCONV_HH
// $Id:$
// -*- C++ -*-
//
// -----------------------------------------------------------------------
// Hep Random
// --- DoubConv ---
// class header file
// -----------------------------------------------------------------------
//
#ifndef DOUBCONV_HH
#define DOUBCONV_HH
#include <string>
#include <vector>
#include <exception>
namespace CLHEP {
class DoubConvException : public std::exception {
public:
DoubConvException(const std::string & w) throw() : msg(w) {}
~DoubConvException() throw() {}
const char* what() const throw() { return msg.c_str(); }
private:
std::string msg;
};
class DoubConv {
public:
// dto2longs(d) returns (in a vector) two unsigned longs string containing the
// representation of its double input. This is byte-ordering
// independant, and depends for complete portability ONLY on adherance
// to the IEEE 754 standard for 64-bit floating point representation.
// The first unsigned long contains the high-order bits in IEEE; thus
// 1.0 will always be 0x3FF00000, 00000000
static std::vector<unsigned long> dto2longs(double d);
// longs2double (v) returns a double containing the value represented by its
// input, which must be a vector containing 2 unsigned longs.
// The input is taken to be the representation according to
// the IEEE 754 standard for a 64-bit floating point number, whose value
// is returned as a double. The byte-ordering of the double result is,
// of course, tailored to the proper byte-ordering for the system.
static double longs2double (const std::vector<unsigned long> & v);
// dtox(d) returns a 16-character string containing the (zero-filled) hex
// representation of its double input. This is byte-ordering
// independant, and depends for complete portability ONLY on adherance
// to the IEEE 754 standard for 64-bit floating point representation.
static std::string d2x(double d);
private:
union DB8 {
unsigned char b[8];
double d;
};
static void fill_byte_order ();
static bool byte_order_known;
static int byte_order[8];
// Meaning of byte_order: The first (high-order in IEEE 754) byte to
// output (or the high-order byte of the first unsigned long)
// is of db.b[byte_order[0]]. Thus the index INTO byte_order
// is a position in the IEEE representation of the double, and the value
// of byte_order[k] is an offset in the memory representation of the
// double.
};
}
#endif // DOUBCONV_HH
+1 -1
View File
@@ -28,7 +28,7 @@
// Put into ranlib by GMH 6/23/89
// Re-written as C++ routine for 32-bit ints MF 1/26/98
// Re-written for CLHEP package KLS 6/04/98
// Removed std::pow() from flat method for speed KLS 7/21/98
// Removed pow() from flat method for speed KLS 7/21/98
// Ken Smith - Added conversion operators: 6th Aug 1998
// Mark Fischler methods for distrib. instance save/restore 12/8/04
// Mark Fischler methods for anonymous save/restore 12/27/04
+1 -1
View File
@@ -14,7 +14,7 @@
// For further information, see http://www.math.keio.ac.jp/~matumoto/emt.html
// =======================================================================
// Ken Smith - Started initial draft: 14th Jul 1998
// - Optimized to get std::pow() out of flat() method: 21st Jul
// - Optimized to get pow() out of flat() method: 21st Jul
// - Added conversion operators: 6th Aug 1998
// M Fischler - Changes in way powers of two are kept: 16-Sep-1998
// Mark Fischler - Methods for distrib. instance save/restore 12/8/04
@@ -12,7 +12,7 @@
// Gabriele Cosmo - Created: 19th August 1998
// =======================================================================
#include <cmath> // for std::log()
#include <cmath> // for log()
namespace CLHEP {
+6 -6
View File
@@ -59,8 +59,8 @@ inline long RandFlat::shootInt(long n) {
return long(shoot()*double(n));
}
inline long RandFlat::shootInt(long m, long n) {
return long(shoot()*double(n-m)) + m;
inline long RandFlat::shootInt(long a, long b) {
return long(shoot()*double(b-a)) + a;
}
inline void RandFlat::shootBits() {
@@ -100,8 +100,8 @@ inline long RandFlat::shootInt(HepRandomEngine* anEngine,
}
inline long RandFlat::shootInt(HepRandomEngine* anEngine,
long m, long n) {
return long(double(n-m)*anEngine->flat()) + m;
long a, long b) {
return long(double(b-a)*anEngine->flat()) + a;
}
inline void RandFlat::shootArray(HepRandomEngine* anEngine,
@@ -141,8 +141,8 @@ inline long RandFlat::fireInt(long n) {
return long(localEngine->flat()*double(n));
}
inline long RandFlat::fireInt(long m, long n) {
return long(localEngine->flat()*double(n-m)) + m;
inline long RandFlat::fireInt(long a, long b) {
return long(localEngine->flat()*double(b-a)) + a;
}
inline void RandFlat::fireBits() {
+2 -2
View File
@@ -106,8 +106,8 @@ protected:
static double* getPStatus() {return status_st;}
static void setPStatus(double sq, double alxm, double g) {
status_st[0] = sq; status_st[1] = alxm; status_st[2] = g;
static void setPStatus(double sq, double alxm, double g1) {
status_st[0] = sq; status_st[1] = alxm; status_st[2] = g1;
}
inline HepRandomEngine* getLocalEngine();
@@ -14,14 +14,14 @@
namespace CLHEP {
inline RandPoisson::RandPoisson(HepRandomEngine & anEngine, double m )
: HepRandom(), meanMax(2.0E9), defaultMean(m),
inline RandPoisson::RandPoisson(HepRandomEngine & anEngine, double a )
: HepRandom(), meanMax(2.0E9), defaultMean(a),
localEngine(&anEngine, do_nothing_deleter()), oldm(-1.0) {
status[0] = status[1] = status[2] = 0.;
}
inline RandPoisson::RandPoisson(HepRandomEngine * anEngine, double m )
: HepRandom(), meanMax(2.0E9), defaultMean(m),
inline RandPoisson::RandPoisson(HepRandomEngine * anEngine, double a )
: HepRandom(), meanMax(2.0E9), defaultMean(a),
localEngine(anEngine), oldm(-1.0) {
status[0] = status[1] = status[2] = 0.;
}
+2 -2
View File
@@ -59,12 +59,12 @@ public:
// For mu > 100 then we use a corrected version of a
// (quick) Gaussian approximation. Naively that would be:
//
// Poisson(mu) ~ std::floor( mu + .5 + Gaussian(std::sqrt(mu)) )
// Poisson(mu) ~ floor( mu + .5 + Gaussian(sqrt(mu)) )
//
// but actually, that would give a slightly incorrect sigma and a
// very different skew than a true Poisson. Instead we return
//
// Poisson(mu) ~ std::floor( a0*mu + a1*g + a2*g*g ) )
// Poisson(mu) ~ floor( a0*mu + a1*g + a2*g*g ) )
// (with g a gaussian normal)
//
// where a0, a1, a2 are chosen to give the exctly correct mean, sigma,
@@ -14,13 +14,13 @@
namespace CLHEP {
inline RandPoissonQ::RandPoissonQ(HepRandomEngine & anEngine, double m )
: RandPoisson(anEngine, m)
inline RandPoissonQ::RandPoissonQ(HepRandomEngine & anEngine, double a )
: RandPoisson(anEngine, a)
{ setupForDefaultMu();
}
inline RandPoissonQ::RandPoissonQ(HepRandomEngine * anEngine, double m )
: RandPoisson(anEngine, m)
inline RandPoissonQ::RandPoissonQ(HepRandomEngine * anEngine, double a )
: RandPoisson(anEngine, a)
{ setupForDefaultMu();
}
+1 -1
View File
@@ -32,7 +32,7 @@
// =======================================================================
// Ken Smith - Created: 9th June 1998
// - Removed std::pow() from flat method: 21st Jul 1998
// - Removed pow() from flat method: 21st Jul 1998
// - Added conversion operators: 6th Aug 1998
// Mark Fischler Methods put, get for instance save/restore 12/8/04
// Mark Fischler methods for anonymous save/restore 12/27/04
+22 -22
View File
@@ -1,22 +1,22 @@
#ifndef HEP_DEFS_H
#define HEP_DEFS_H
#ifdef WIN32
//
// Define DLL export macro for WIN32 systems for
// importing/exporting external symbols to DLLs
//
#if defined G4LIB_BUILD_DLL
#if defined CLHEP_EXPORT
#define DLL_API __declspec( dllexport )
#else
#define DLL_API __declspec( dllimport )
#endif
#else
#define DLL_API
#endif
#else
#define DLL_API
#endif
#endif /* HEP_DEFS_H */
#ifndef HEP_DEFS_H
#define HEP_DEFS_H
#ifdef WIN32
//
// Define DLL export macro for WIN32 systems for
// importing/exporting external symbols to DLLs
//
#if defined G4LIB_BUILD_DLL
#if defined CLHEP_EXPORT
#define DLL_API __declspec( dllexport )
#else
#define DLL_API __declspec( dllimport )
#endif
#else
#define DLL_API
#endif
#else
#define DLL_API
#endif
#endif /* HEP_DEFS_H */
+11
View File
@@ -30,6 +30,17 @@
//
// ======================================================================
// don't generate unnecessary warnings
#if defined __GNUC__
#if __GNUC__ > 3 && __GNUC_MINOR__ > 6
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor"
#endif
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor"
#endif
#include "CLHEP/Utility/defs.h"
#include "CLHEP/Utility/noncopyable.h"
+9 -9
View File
@@ -24,8 +24,8 @@ inline HepAxisAngle::HepAxisAngle() :
axis_( Hep3Vector(0,0,1) ), delta_( 0.0 )
{} // HepAxisAngle::HepAxisAngle()
inline HepAxisAngle::HepAxisAngle( const Hep3Vector axis, Scalar delta ) :
axis_( axis.unit() ), delta_( delta )
inline HepAxisAngle::HepAxisAngle( const Hep3Vector aaxis, Scalar ddelta ) :
axis_( aaxis.unit() ), delta_( ddelta )
{} // HepAxisAngle::HepAxisAngle()
@@ -38,8 +38,8 @@ inline Hep3Vector HepAxisAngle::axis() const {
} // HepAxisAngle::axis()
inline HepAxisAngle & HepAxisAngle::setAxis( const Hep3Vector axis ) {
axis_ = axis.unit();
inline HepAxisAngle & HepAxisAngle::setAxis( const Hep3Vector aaxis ) {
axis_ = aaxis.unit();
return *this;
} // HepAxisAngle::setAxis()
@@ -53,15 +53,15 @@ inline double HepAxisAngle::delta() const {
} // HepAxisAngle::delta()
inline HepAxisAngle & HepAxisAngle::setDelta( Scalar delta ) {
delta_ = delta;
inline HepAxisAngle & HepAxisAngle::setDelta( Scalar ddelta ) {
delta_ = ddelta;
return *this;
} // HepAxisAngle::setDelta()
inline HepAxisAngle & HepAxisAngle::set( const Hep3Vector axis, Scalar delta ) {
axis_ = axis.unit();
delta_ = delta;
inline HepAxisAngle & HepAxisAngle::set( const Hep3Vector aaxis, Scalar ddelta ) {
axis_ = aaxis.unit();
delta_ = ddelta;
return *this;
} // HepAxisAngle::set()
+30 -30
View File
@@ -15,10 +15,10 @@ namespace CLHEP {
inline HepBoost::HepBoost() : rep_() {}
inline HepBoost::HepBoost(const HepBoost & m) : rep_(m.rep_) {}
inline HepBoost::HepBoost(const HepBoost & m1) : rep_(m1.rep_) {}
inline HepBoost & HepBoost::operator = (const HepBoost & m) {
rep_ = m.rep_;
inline HepBoost & HepBoost::operator = (const HepBoost & m1) {
rep_ = m1.rep_;
return *this;
}
@@ -27,20 +27,20 @@ inline HepBoost::HepBoost(double betaX, double betaY, double betaZ)
set(betaX, betaY, betaZ);
}
inline HepBoost::HepBoost(const HepRep4x4Symmetric & m) : rep_(m) {}
inline HepBoost::HepBoost(const HepRep4x4Symmetric & m1) : rep_(m1) {}
inline HepBoost::HepBoost(Hep3Vector direction, double beta)
inline HepBoost::HepBoost(Hep3Vector ddirection, double bbeta)
{
double length = direction.mag();
double length = ddirection.mag();
if (length==0) {
std::cerr << "HepBoost::HepBoost() - "
<< "HepBoost constructed using a zero vector as direction"
<< std::endl;
set(0,0,0);
}
set(beta*direction.x()/length,
beta*direction.y()/length,
beta*direction.z()/length);
set(bbeta*ddirection.x()/length,
bbeta*ddirection.y()/length,
bbeta*ddirection.z()/length);
}
inline HepBoost::HepBoost(const Hep3Vector & boost)
@@ -60,11 +60,11 @@ inline HepBoost & HepBoost::set(const HepBoostZ & boost)
// - Protected method:
inline HepBoost::HepBoost (
double xx, double xy, double xz, double xt,
double yy, double yz, double yt,
double zz, double zt,
double tt) :
rep_ ( xx, xy, xz, xt, yy, yz, yt, zz, zt, tt ) {}
double xx1, double xy1, double xz1, double xt1,
double yy1, double yz1, double yt1,
double zz1, double zt1,
double tt1) :
rep_ ( xx1, xy1, xz1, xt1, yy1, yz1, yt1, zz1, zt1, tt1 ) {}
// ---------- Accessors:
@@ -149,28 +149,28 @@ inline void HepBoost::setBoost(double bx, double by, double bz) {
// ---------- Comparisons:
int HepBoost::compare ( const HepBoost & b ) const {
const HepRep4x4Symmetric & s = b.rep4x4Symmetric();
if (rep_.tt_ < s.tt_) return -1; else if (rep_.tt_ > s.tt_) return 1;
else if (rep_.zt_ < s.zt_) return -1; else if (rep_.zt_ > s.zt_) return 1;
else if (rep_.zz_ < s.zz_) return -1; else if (rep_.zz_ > s.zz_) return 1;
else if (rep_.yt_ < s.yt_) return -1; else if (rep_.yt_ > s.yt_) return 1;
else if (rep_.yz_ < s.yz_) return -1; else if (rep_.yz_ > s.yz_) return 1;
else if (rep_.yy_ < s.yy_) return -1; else if (rep_.yy_ > s.yy_) return 1;
else if (rep_.xt_ < s.xt_) return -1; else if (rep_.xt_ > s.xt_) return 1;
else if (rep_.xz_ < s.xz_) return -1; else if (rep_.xz_ > s.xz_) return 1;
else if (rep_.xy_ < s.xy_) return -1; else if (rep_.xy_ > s.xy_) return 1;
else if (rep_.xx_ < s.xx_) return -1; else if (rep_.xx_ > s.xx_) return 1;
const HepRep4x4Symmetric & s1 = b.rep4x4Symmetric();
if (rep_.tt_ < s1.tt_) return -1; else if (rep_.tt_ > s1.tt_) return 1;
else if (rep_.zt_ < s1.zt_) return -1; else if (rep_.zt_ > s1.zt_) return 1;
else if (rep_.zz_ < s1.zz_) return -1; else if (rep_.zz_ > s1.zz_) return 1;
else if (rep_.yt_ < s1.yt_) return -1; else if (rep_.yt_ > s1.yt_) return 1;
else if (rep_.yz_ < s1.yz_) return -1; else if (rep_.yz_ > s1.yz_) return 1;
else if (rep_.yy_ < s1.yy_) return -1; else if (rep_.yy_ > s1.yy_) return 1;
else if (rep_.xt_ < s1.xt_) return -1; else if (rep_.xt_ > s1.xt_) return 1;
else if (rep_.xz_ < s1.xz_) return -1; else if (rep_.xz_ > s1.xz_) return 1;
else if (rep_.xy_ < s1.xy_) return -1; else if (rep_.xy_ > s1.xy_) return 1;
else if (rep_.xx_ < s1.xx_) return -1; else if (rep_.xx_ > s1.xx_) return 1;
else return 0;
}
inline bool
HepBoost::operator == (const HepBoost & b) const {
const HepRep4x4Symmetric & s = b.rep4x4Symmetric();
const HepRep4x4Symmetric & s1 = b.rep4x4Symmetric();
return (
rep_.xx_==s.xx_ && rep_.xy_==s.xy_ && rep_.xz_==s.xz_ && rep_.xt_==s.xt_
&& rep_.yy_==s.yy_ && rep_.yz_==s.yz_ && rep_.yt_==s.yt_
&& rep_.zz_==s.zz_ && rep_.zt_==s.zt_
&& rep_.tt_==s.tt_
rep_.xx_==s1.xx_ && rep_.xy_==s1.xy_ && rep_.xz_==s1.xz_ && rep_.xt_==s1.xt_
&& rep_.yy_==s1.yy_ && rep_.yz_==s1.yz_ && rep_.yt_==s1.yt_
&& rep_.zz_==s1.zz_ && rep_.zt_==s1.zt_
&& rep_.tt_==s1.tt_
);
}
+3 -3
View File
@@ -25,11 +25,11 @@ inline HepBoostX & HepBoostX::operator = (const HepBoostX & b) {
return *this;
}
inline HepBoostX::HepBoostX(double beta) { set(beta); }
inline HepBoostX::HepBoostX(double bbeta) { set(bbeta); }
// - Protected method:
inline HepBoostX::HepBoostX( double beta, double gamma ) :
beta_(beta), gamma_(gamma) {}
inline HepBoostX::HepBoostX( double bbeta, double ggamma ) :
beta_(bbeta), gamma_(ggamma) {}
// ---------- Accessors:
+3 -3
View File
@@ -25,11 +25,11 @@ inline HepBoostY & HepBoostY::operator = (const HepBoostY & b) {
return *this;
}
inline HepBoostY::HepBoostY(double beta) { set(beta); }
inline HepBoostY::HepBoostY(double bbeta) { set(bbeta); }
// - Protected method:
inline HepBoostY::HepBoostY( double beta, double gamma ) :
beta_(beta), gamma_(gamma) {}
inline HepBoostY::HepBoostY( double bbeta, double ggamma ) :
beta_(bbeta), gamma_(ggamma) {}
// ---------- Accessors:
+3 -3
View File
@@ -25,11 +25,11 @@ inline HepBoostZ & HepBoostZ::operator = (const HepBoostZ & b) {
return *this;
}
inline HepBoostZ::HepBoostZ(double beta) { set(beta); }
inline HepBoostZ::HepBoostZ(double bbeta) { set(bbeta); }
// - Protected method:
inline HepBoostZ::HepBoostZ( double beta, double gamma ) :
beta_(beta), gamma_(gamma) {}
inline HepBoostZ::HepBoostZ( double bbeta, double ggamma ) :
beta_(bbeta), gamma_(ggamma) {}
// ---------- Accessors:
+10 -10
View File
@@ -24,8 +24,8 @@ inline HepEulerAngles::HepEulerAngles()
{} // HepEulerAngles::HepEulerAngles()
inline HepEulerAngles::HepEulerAngles (
double phi, double theta, double psi )
: phi_( phi ), theta_( theta ), psi_( psi )
double phi1, double theta1, double psi1 )
: phi_( phi1 ), theta_( theta1 ), psi_( psi1 )
{} // HepEulerAngles::HepEulerAngles()
inline double HepEulerAngles::getPhi() const {
@@ -36,8 +36,8 @@ inline double HepEulerAngles::phi() const {
return phi_;
} // HepEulerAngles::phi()
inline HepEulerAngles & HepEulerAngles::setPhi( double phi ) {
phi_ = phi;
inline HepEulerAngles & HepEulerAngles::setPhi( double phi1 ) {
phi_ = phi1;
return *this;
} // HepEulerAngles::setPhi()
@@ -49,8 +49,8 @@ inline double HepEulerAngles::theta() const {
return theta_;
} // HepEulerAngles::theta()
inline HepEulerAngles & HepEulerAngles::setTheta( double theta ) {
theta_ = theta;
inline HepEulerAngles & HepEulerAngles::setTheta( double theta1 ) {
theta_ = theta1;
return *this;
} // HepEulerAngles::setTheta()
@@ -62,14 +62,14 @@ inline double HepEulerAngles::psi() const {
return psi_;
} // HepEulerAngles::psi()
inline HepEulerAngles & HepEulerAngles::setPsi( double psi ) {
psi_ = psi;
inline HepEulerAngles & HepEulerAngles::setPsi( double psi1 ) {
psi_ = psi1;
return *this;
} // HepEulerAngles::setPsi()
inline HepEulerAngles &
HepEulerAngles::set( double phi, double theta, double psi ) {
phi_ = phi, theta_ = theta, psi_ = psi;
HepEulerAngles::set( double phi1, double theta1, double psi1 ) {
phi_ = phi1, theta_ = theta1, psi_ = psi1;
return *this;
} // HepEulerAngles::set()
@@ -60,13 +60,13 @@ HepLorentzRotation::operator = (const HepLorentzRotation & r) {
}
inline HepLorentzRotation &
HepLorentzRotation::operator = (const HepRotation & m) {
return set (m.rep4x4());
HepLorentzRotation::operator = (const HepRotation & m1) {
return set (m1.rep4x4());
}
inline HepLorentzRotation &
HepLorentzRotation::operator = (const HepBoost & m) {
return set (m.rep4x4());
HepLorentzRotation::operator = (const HepBoost & m1) {
return set (m1.rep4x4());
}
HepLorentzRotation & HepLorentzRotation::set (const Hep3Vector & p) {
@@ -86,17 +86,17 @@ inline HepLorentzRotation & HepLorentzRotation::set (const HepRotationZ & r) {
return set (r.rep4x4());
}
inline HepLorentzRotation & HepLorentzRotation::set (const HepBoost & boost) {
return set (boost.rep4x4());
inline HepLorentzRotation & HepLorentzRotation::set (const HepBoost & bboost) {
return set (bboost.rep4x4());
}
inline HepLorentzRotation & HepLorentzRotation::set (const HepBoostX & boost) {
return set (boost.rep4x4());
inline HepLorentzRotation & HepLorentzRotation::set (const HepBoostX & bboost) {
return set (bboost.rep4x4());
}
inline HepLorentzRotation & HepLorentzRotation::set (const HepBoostY & boost) {
return set (boost.rep4x4());
inline HepLorentzRotation & HepLorentzRotation::set (const HepBoostY & bboost) {
return set (bboost.rep4x4());
}
inline HepLorentzRotation & HepLorentzRotation::set (const HepBoostZ & boost) {
return set (boost.rep4x4());
inline HepLorentzRotation & HepLorentzRotation::set (const HepBoostZ & bboost) {
return set (bboost.rep4x4());
}
inline HepLorentzRotation::HepLorentzRotation(double bx,
@@ -84,7 +84,7 @@ public:
inline HepLorentzVector(double x, double y, double z);
// Constructor giving the components x, y, z with t-component set to 0.0.
inline HepLorentzVector(double t);
explicit HepLorentzVector(double t);
// Constructor giving the t-component with x, y and z set to 0.0.
inline HepLorentzVector();
@@ -202,7 +202,7 @@ public:
inline double mag() const;
inline double m() const;
// Invariant mass. If m2() is negative then -std::sqrt(-m2()) is returned.
// Invariant mass. If m2() is negative then -sqrt(-m2()) is returned.
inline double mt2() const;
// Transverse mass squared.
@@ -228,7 +228,7 @@ public:
inline void setVectMag(const Hep3Vector & spatial, double magnitude);
inline void setVectM(const Hep3Vector & spatial, double mass);
// Copy spatial coordinates, and set energy = std::sqrt(mass^2 + spatial^2)
// Copy spatial coordinates, and set energy = sqrt(mass^2 + spatial^2)
inline double plus() const;
inline double minus() const;
@@ -251,7 +251,7 @@ public:
// Returns the rapidity, i.e. 0.5*ln((E+pz)/(E-pz))
inline double pseudoRapidity() const;
// Returns the pseudo-rapidity, i.e. -ln(std::tan(theta/2))
// Returns the pseudo-rapidity, i.e. -ln(tan(theta/2))
inline bool isTimelike() const;
// Test if the 4-vector is timelike
@@ -304,7 +304,7 @@ public:
// 0 - Flexible metric convention
static ZMpvMetric_t setMetric( ZMpvMetric_t m );
static ZMpvMetric_t setMetric( ZMpvMetric_t met );
static ZMpvMetric_t getMetric();
// 1 - Construct and set 4-vectors in various ways
@@ -393,7 +393,7 @@ public:
// The same tolerance is used for determining isLightlike, and isParallel
double deltaR(const HepLorentzVector & v) const;
// std::sqrt ( (delta eta)^2 + (delta phi)^2 ) of space part
// sqrt ( (delta eta)^2 + (delta phi)^2 ) of space part
// 4 - Intrinsic properties
@@ -417,7 +417,7 @@ public:
inline double restMass() const;
inline double invariantMass() const;
// Same as m(). If m2() is negative then -std::sqrt(-m2()) is returned.
// Same as m(). If m2() is negative then -sqrt(-m2()) is returned.
// The following properties are rest-frame related,
// and are applicable only to non-spacelike 4-vectors
+78 -78
View File
@@ -18,23 +18,23 @@ inline double HepLorentzVector::z() const { return pp.z(); }
inline double HepLorentzVector::t() const { return ee; }
inline HepLorentzVector::
HepLorentzVector(double x, double y, double z, double t)
: pp(x, y, z), ee(t) {}
HepLorentzVector(double x1, double y1, double z1, double t1)
: pp(x1, y1, z1), ee(t1) {}
inline HepLorentzVector:: HepLorentzVector(double x, double y, double z)
: pp(x, y, z), ee(0) {}
inline HepLorentzVector:: HepLorentzVector(double x1, double y1, double z1)
: pp(x1, y1, z1), ee(0) {}
inline HepLorentzVector:: HepLorentzVector(double t)
: pp(0, 0, 0), ee(t) {}
inline HepLorentzVector:: HepLorentzVector(double t1)
: pp(0, 0, 0), ee(t1) {}
inline HepLorentzVector:: HepLorentzVector()
: pp(0, 0, 0), ee(0) {}
inline HepLorentzVector::HepLorentzVector(const Hep3Vector & p, double e)
: pp(p), ee(e) {}
inline HepLorentzVector::HepLorentzVector(const Hep3Vector & p, double e1)
: pp(p), ee(e1) {}
inline HepLorentzVector::HepLorentzVector(double e, const Hep3Vector & p)
: pp(p), ee(e) {}
inline HepLorentzVector::HepLorentzVector(double e1, const Hep3Vector & p)
: pp(p), ee(e1) {}
inline HepLorentzVector::HepLorentzVector(const HepLorentzVector & p)
: pp(p.x(), p.y(), p.z()), ee(p.t()) {}
@@ -129,16 +129,16 @@ inline double HepLorentzVector::perp2() const { return pp.perp2(); }
inline double HepLorentzVector::perp() const { return pp.perp(); }
inline void HepLorentzVector::setPerp(double a) { pp.setPerp(a); }
inline double HepLorentzVector::perp2(const Hep3Vector &v) const {
return pp.perp2(v);
inline double HepLorentzVector::perp2(const Hep3Vector &v1) const {
return pp.perp2(v1);
}
inline double HepLorentzVector::perp(const Hep3Vector &v) const {
return pp.perp(v);
inline double HepLorentzVector::perp(const Hep3Vector &v1) const {
return pp.perp(v1);
}
inline double HepLorentzVector::angle(const Hep3Vector &v) const {
return pp.angle(v);
inline double HepLorentzVector::angle(const Hep3Vector &v1) const {
return pp.angle(v1);
}
inline double HepLorentzVector::mag2() const {
@@ -146,8 +146,8 @@ inline double HepLorentzVector::mag2() const {
}
inline double HepLorentzVector::mag() const {
double mm = m2();
return mm < 0.0 ? -std::sqrt(-mm) : std::sqrt(mm);
double mmm = m2();
return mmm < 0.0 ? -std::sqrt(-mmm) : std::sqrt(mmm);
}
inline double HepLorentzVector::m2() const {
@@ -161,8 +161,8 @@ inline double HepLorentzVector::mt2() const {
}
inline double HepLorentzVector::mt() const {
double mm = mt2();
return mm < 0.0 ? -std::sqrt(-mm) : std::sqrt(mm);
double mmm = mt2();
return mmm < 0.0 ? -std::sqrt(-mmm) : std::sqrt(mmm);
}
inline double HepLorentzVector::et2() const {
@@ -175,14 +175,14 @@ inline double HepLorentzVector::et() const {
return e() < 0.0 ? -std::sqrt(etet) : std::sqrt(etet);
}
inline double HepLorentzVector::et2(const Hep3Vector & v) const {
double pt2 = pp.perp2(v);
double pv = pp.dot(v.unit());
inline double HepLorentzVector::et2(const Hep3Vector & v1) const {
double pt2 = pp.perp2(v1);
double pv = pp.dot(v1.unit());
return pt2 == 0 ? 0 : e()*e() * pt2/(pt2+pv*pv);
}
inline double HepLorentzVector::et(const Hep3Vector & v) const {
double etet = et2(v);
inline double HepLorentzVector::et(const Hep3Vector & v1) const {
double etet = et2(v1);
return e() < 0.0 ? -std::sqrt(etet) : std::sqrt(etet);
}
@@ -231,14 +231,14 @@ inline double HepLorentzVector::eta( const Hep3Vector & ref ) const {
}
inline HepLorentzVector &
HepLorentzVector::operator *= (const HepRotation & m) {
pp.transform(m);
HepLorentzVector::operator *= (const HepRotation & m1) {
pp.transform(m1);
return *this;
}
inline HepLorentzVector &
HepLorentzVector::transform(const HepRotation & m) {
pp.transform(m);
HepLorentzVector::transform(const HepRotation & m1) {
pp.transform(m1);
return *this;
}
@@ -253,57 +253,57 @@ inline HepLorentzVector operator * (double a, const HepLorentzVector & p) {
// The following were added when ZOOM PhysicsVectors was merged in:
inline HepLorentzVector::HepLorentzVector(
double x, double y, double z, Tcomponent t ) :
pp(x, y, z), ee(t) {}
double x1, double y1, double z1, Tcomponent t1 ) :
pp(x1, y1, z1), ee(t1) {}
inline void HepLorentzVector::set(
double x, double y, double z, Tcomponent t ) {
pp.set(x,y,z);
ee = t;
double x1, double y1, double z1, Tcomponent t1 ) {
pp.set(x1,y1,z1);
ee = t1;
}
inline void HepLorentzVector::set(
double x, double y, double z, double t ) {
set (x,y,z,Tcomponent(t));
double x1, double y1, double z1, double t1 ) {
set (x1,y1,z1,Tcomponent(t1));
}
inline HepLorentzVector::HepLorentzVector(
Tcomponent t, double x, double y, double z ) :
pp(x, y, z), ee(t) {}
Tcomponent t1, double x1, double y1, double z1 ) :
pp(x1, y1, z1), ee(t1) {}
inline void HepLorentzVector::set(
Tcomponent t, double x, double y, double z ) {
pp.set(x,y,z);
ee = t;
Tcomponent t1, double x1, double y1, double z1 ) {
pp.set(x1,y1,z1);
ee = t1;
}
inline void HepLorentzVector::set( Tcomponent t ) {
inline void HepLorentzVector::set( Tcomponent t1 ) {
pp.set(0, 0, 0);
ee = t;
ee = t1;
}
inline void HepLorentzVector::set( double t ) {
inline void HepLorentzVector::set( double t1 ) {
pp.set(0, 0, 0);
ee = t;
ee = t1;
}
inline HepLorentzVector::HepLorentzVector( Tcomponent t ) :
pp(0, 0, 0), ee(t) {}
inline HepLorentzVector::HepLorentzVector( Tcomponent t1 ) :
pp(0, 0, 0), ee(t1) {}
inline void HepLorentzVector::set( const Hep3Vector & v ) {
pp = v;
inline void HepLorentzVector::set( const Hep3Vector & v1 ) {
pp = v1;
ee = 0;
}
inline HepLorentzVector::HepLorentzVector( const Hep3Vector & v ) :
pp(v), ee(0) {}
inline HepLorentzVector::HepLorentzVector( const Hep3Vector & v1 ) :
pp(v1), ee(0) {}
inline void HepLorentzVector::setV(const Hep3Vector & v) {
pp = v;
inline void HepLorentzVector::setV(const Hep3Vector & v1) {
pp = v1;
}
inline HepLorentzVector & HepLorentzVector::operator=(const Hep3Vector & v) {
pp = v;
inline HepLorentzVector & HepLorentzVector::operator=(const Hep3Vector & v1) {
pp = v1;
ee = 0;
return *this;
}
@@ -316,31 +316,31 @@ inline double HepLorentzVector::getT() const { return ee; }
inline Hep3Vector HepLorentzVector::getV() const { return pp; }
inline Hep3Vector HepLorentzVector::v() const { return pp; }
inline void HepLorentzVector::set(double t, const Hep3Vector & v) {
pp = v;
ee = t;
inline void HepLorentzVector::set(double t1, const Hep3Vector & v1) {
pp = v1;
ee = t1;
}
inline void HepLorentzVector::set(const Hep3Vector & v, double t) {
pp = v;
ee = t;
inline void HepLorentzVector::set(const Hep3Vector & v1, double t1) {
pp = v1;
ee = t1;
}
inline void HepLorentzVector::setV( double x,
double y,
double z ) { pp.set(x, y, z); }
inline void HepLorentzVector::setV( double x1,
double y1,
double z1 ) { pp.set(x1, y1, z1); }
inline void HepLorentzVector::setRThetaPhi
( double r, double theta, double phi )
{ pp.setRThetaPhi( r, theta, phi ); }
( double r1, double theta1, double phi1 )
{ pp.setRThetaPhi( r1, theta1, phi1 ); }
inline void HepLorentzVector::setREtaPhi
( double r, double eta, double phi )
{ pp.setREtaPhi( r, eta, phi ); }
( double r1, double eta1, double phi1 )
{ pp.setREtaPhi( r1, eta1, phi1 ); }
inline void HepLorentzVector::setRhoPhiZ
( double rho, double phi, double z )
{ pp.setRhoPhiZ ( rho, phi, z ); }
( double rho1, double phi1, double z1 )
{ pp.setRhoPhiZ ( rho1, phi1, z1 ); }
inline bool HepLorentzVector::isTimelike() const {
return restMass2() > 0;
@@ -402,21 +402,21 @@ inline double HepLorentzVector::invariantMass2
// Each of these is a shell over a boost method.
inline HepLorentzVector boostXOf
(const HepLorentzVector & vec, double beta) {
(const HepLorentzVector & vec, double bbeta) {
HepLorentzVector vv (vec);
return vv.boostX (beta);
return vv.boostX (bbeta);
}
inline HepLorentzVector boostYOf
(const HepLorentzVector & vec, double beta) {
(const HepLorentzVector & vec, double bbeta) {
HepLorentzVector vv (vec);
return vv.boostY (beta);
return vv.boostY (bbeta);
}
inline HepLorentzVector boostZOf
(const HepLorentzVector & vec, double beta) {
(const HepLorentzVector & vec, double bbeta) {
HepLorentzVector vv (vec);
return vv.boostZ (beta);
return vv.boostZ (bbeta);
}
inline HepLorentzVector boostOf
@@ -426,9 +426,9 @@ inline HepLorentzVector boostOf
}
inline HepLorentzVector boostOf
(const HepLorentzVector & vec, const Hep3Vector & axis, double beta) {
(const HepLorentzVector & vec, const Hep3Vector & aaxis, double bbeta) {
HepLorentzVector vv (vec);
return vv.boost (axis, beta);
return vv.boost (aaxis, bbeta);
}
} // namespace CLHEP
+66 -66
View File
@@ -49,10 +49,10 @@ inline HepRotation::HepRotation() : rxx(1.0), rxy(0.0), rxz(0.0),
ryx(0.0), ryy(1.0), ryz(0.0),
rzx(0.0), rzy(0.0), rzz(1.0) {}
inline HepRotation::HepRotation(const HepRotation & m) :
rxx(m.rxx), rxy(m.rxy), rxz(m.rxz),
ryx(m.ryx), ryy(m.ryy), ryz(m.ryz),
rzx(m.rzx), rzy(m.rzy), rzz(m.rzz) {}
inline HepRotation::HepRotation(const HepRotation & m1) :
rxx(m1.rxx), rxy(m1.rxy), rxz(m1.rxz),
ryx(m1.ryx), ryy(m1.ryy), ryz(m1.ryz),
rzx(m1.rzx), rzy(m1.rzy), rzz(m1.rzz) {}
inline HepRotation::HepRotation
(double mxx, double mxy, double mxz,
@@ -62,10 +62,10 @@ inline HepRotation::HepRotation
ryx(myx), ryy(myy), ryz(myz),
rzx(mzx), rzy(mzy), rzz(mzz) {}
inline HepRotation::HepRotation ( const HepRep3x3 & m ) :
rxx(m.xx_), rxy(m.xy_), rxz(m.xz_),
ryx(m.yx_), ryy(m.yy_), ryz(m.yz_),
rzx(m.zx_), rzy(m.zy_), rzz(m.zz_) {}
inline HepRotation::HepRotation ( const HepRep3x3 & m1 ) :
rxx(m1.xx_), rxy(m1.xy_), rxz(m1.xz_),
ryx(m1.yx_), ryy(m1.yy_), ryz(m1.yz_),
rzx(m1.zx_), rzy(m1.zy_), rzz(m1.zz_) {}
inline HepRotation::HepRotation(const HepRotationX & rx) :
rxx(1.0), rxy(0.0), rxz(0.0),
@@ -135,29 +135,29 @@ inline double HepRotation::getPsi () const { return psi(); }
inline double HepRotation::getDelta() const { return delta(); }
inline Hep3Vector HepRotation::getAxis () const { return axis(); }
inline HepRotation & HepRotation::operator = (const HepRotation & m) {
rxx = m.rxx;
rxy = m.rxy;
rxz = m.rxz;
ryx = m.ryx;
ryy = m.ryy;
ryz = m.ryz;
rzx = m.rzx;
rzy = m.rzy;
rzz = m.rzz;
inline HepRotation & HepRotation::operator = (const HepRotation & m1) {
rxx = m1.rxx;
rxy = m1.rxy;
rxz = m1.rxz;
ryx = m1.ryx;
ryy = m1.ryy;
ryz = m1.ryz;
rzx = m1.rzx;
rzy = m1.rzy;
rzz = m1.rzz;
return *this;
}
inline HepRotation & HepRotation::set(const HepRep3x3 & m) {
rxx = m.xx_;
rxy = m.xy_;
rxz = m.xz_;
ryx = m.yx_;
ryy = m.yy_;
ryz = m.yz_;
rzx = m.zx_;
rzy = m.zy_;
rzz = m.zz_;
inline HepRotation & HepRotation::set(const HepRep3x3 & m1) {
rxx = m1.xx_;
rxy = m1.xy_;
rxz = m1.xz_;
ryx = m1.yx_;
ryy = m1.yy_;
ryz = m1.yz_;
rzx = m1.zx_;
rzy = m1.zy_;
rzz = m1.zz_;
return *this;
}
@@ -220,36 +220,36 @@ inline HepRotation HepRotation::operator* (const HepRotation & r) const {
}
inline HepRotation HepRotation::operator * (const HepRotationX & rx) const {
double yy = rx.yy();
double yz = rx.yz();
double zy = -yz;
double zz = yy;
double yy1 = rx.yy();
double yz1 = rx.yz();
double zy1 = -yz1;
double zz1 = yy1;
return HepRotation(
rxx, rxy*yy + rxz*zy, rxy*yz + rxz*zz,
ryx, ryy*yy + ryz*zy, ryy*yz + ryz*zz,
rzx, rzy*yy + rzz*zy, rzy*yz + rzz*zz );
rxx, rxy*yy1 + rxz*zy1, rxy*yz1 + rxz*zz1,
ryx, ryy*yy1 + ryz*zy1, ryy*yz1 + ryz*zz1,
rzx, rzy*yy1 + rzz*zy1, rzy*yz1 + rzz*zz1 );
}
inline HepRotation HepRotation::operator * (const HepRotationY & ry) const {
double xx = ry.xx();
double xz = ry.xz();
double zx = -xz;
double zz = xx;
double xx1 = ry.xx();
double xz1 = ry.xz();
double zx1 = -xz1;
double zz1 = xx1;
return HepRotation(
rxx*xx + rxz*zx, rxy, rxx*xz + rxz*zz,
ryx*xx + ryz*zx, ryy, ryx*xz + ryz*zz,
rzx*xx + rzz*zx, rzy, rzx*xz + rzz*zz );
rxx*xx1 + rxz*zx1, rxy, rxx*xz1 + rxz*zz1,
ryx*xx1 + ryz*zx1, ryy, ryx*xz1 + ryz*zz1,
rzx*xx1 + rzz*zx1, rzy, rzx*xz1 + rzz*zz1 );
}
inline HepRotation HepRotation::operator * (const HepRotationZ & rz) const {
double xx = rz.xx();
double xy = rz.xy();
double yx = -xy;
double yy = xx;
double xx1 = rz.xx();
double xy1 = rz.xy();
double yx1 = -xy1;
double yy1 = xx1;
return HepRotation(
rxx*xx + rxy*yx, rxx*xy + rxy*yy, rxz,
ryx*xx + ryy*yx, ryx*xy + ryy*yy, ryz,
rzx*xx + rzy*yx, rzx*xy + rzy*yy, rzz );
rxx*xx1 + rxy*yx1, rxx*xy1 + rxy*yy1, rxz,
ryx*xx1 + ryy*yx1, ryx*xy1 + ryy*yy1, ryz,
rzx*xx1 + rzy*yx1, rzx*xy1 + rzy*yy1, rzz );
}
@@ -290,8 +290,8 @@ inline HepRotation & HepRotation::invert() {
}
inline HepRotation & HepRotation::rotate
(double delta, const Hep3Vector * p) {
return rotate(delta, *p);
(double ddelta, const Hep3Vector * p) {
return rotate(ddelta, *p);
}
inline bool HepRotation::operator== ( const HepRotation & r ) const {
@@ -319,30 +319,30 @@ inline double HepRotation::setTolerance(double tol) {
}
inline HepRotation operator * (const HepRotationX & rx, const HepRotation & r){
HepRep3x3 m = r.rep3x3();
HepRep3x3 mmm = r.rep3x3();
double c = rx.yy();
double s = rx.zy();
return HepRotation ( m.xx_, m.xy_, m.xz_,
c*m.yx_-s*m.zx_, c*m.yy_-s*m.zy_, c*m.yz_-s*m.zz_,
s*m.yx_+c*m.zx_, s*m.yy_+c*m.zy_, s*m.yz_+c*m.zz_ );
double ss = rx.zy();
return HepRotation ( mmm.xx_, mmm.xy_, mmm.xz_,
c*mmm.yx_-ss*mmm.zx_, c*mmm.yy_-ss*mmm.zy_, c*mmm.yz_-ss*mmm.zz_,
ss*mmm.yx_+c*mmm.zx_, ss*mmm.yy_+c*mmm.zy_, ss*mmm.yz_+c*mmm.zz_ );
}
inline HepRotation operator * (const HepRotationY & ry, const HepRotation & r){
HepRep3x3 m = r.rep3x3();
HepRep3x3 mmm = r.rep3x3();
double c = ry.xx();
double s = ry.xz();
return HepRotation ( c*m.xx_+s*m.zx_, c*m.xy_+s*m.zy_, c*m.xz_+s*m.zz_,
m.yx_, m.yy_, m.yz_,
-s*m.xx_+c*m.zx_,-s*m.xy_+c*m.zy_,-s*m.xz_+c*m.zz_ );
double ss = ry.xz();
return HepRotation ( c*mmm.xx_+ss*mmm.zx_, c*mmm.xy_+ss*mmm.zy_, c*mmm.xz_+ss*mmm.zz_,
mmm.yx_, mmm.yy_, mmm.yz_,
-ss*mmm.xx_+c*mmm.zx_,-ss*mmm.xy_+c*mmm.zy_,-ss*mmm.xz_+c*mmm.zz_ );
}
inline HepRotation operator * (const HepRotationZ & rz, const HepRotation & r){
HepRep3x3 m = r.rep3x3();
HepRep3x3 mmm = r.rep3x3();
double c = rz.xx();
double s = rz.yx();
return HepRotation ( c*m.xx_-s*m.yx_, c*m.xy_-s*m.yy_, c*m.xz_-s*m.yz_,
s*m.xx_+c*m.yx_, s*m.xy_+c*m.yy_, s*m.xz_+c*m.yz_,
m.zx_, m.zy_, m.zz_ );
double ss = rz.yx();
return HepRotation ( c*mmm.xx_-ss*mmm.yx_, c*mmm.xy_-ss*mmm.yy_, c*mmm.xz_-ss*mmm.yz_,
ss*mmm.xx_+c*mmm.yx_, ss*mmm.xy_+c*mmm.yy_, ss*mmm.xz_+c*mmm.yz_,
mmm.zx_, mmm.zy_, mmm.zz_ );
}
} // namespace CLHEP
+3 -3
View File
@@ -257,11 +257,11 @@ public:
protected:
double d;
double its_d;
// The angle of rotation.
double s;
double c;
double its_s;
double its_c;
// Cache the trig functions, for rapid operations.
inline HepRotationX ( double dd, double ss, double cc );
+51 -51
View File
@@ -12,10 +12,10 @@
namespace CLHEP {
inline double HepRotationX::yy() const { return c; }
inline double HepRotationX::yz() const { return -s; }
inline double HepRotationX::zy() const { return s; }
inline double HepRotationX::zz() const { return c; }
inline double HepRotationX::yy() const { return its_c; }
inline double HepRotationX::yz() const { return -its_s; }
inline double HepRotationX::zy() const { return its_s; }
inline double HepRotationX::zz() const { return its_c; }
inline double HepRotationX::xx() const { return 1.0; }
inline double HepRotationX::xy() const { return 0.0; }
@@ -24,25 +24,25 @@ inline double HepRotationX::yx() const { return 0.0; }
inline double HepRotationX::zx() const { return 0.0; }
inline HepRep3x3 HepRotationX::rep3x3() const {
return HepRep3x3 ( 1.0, 0.0, 0.0,
0.0, c, -s,
0.0, s, c );
return HepRep3x3 ( 1.0, 0.0, 0.0,
0.0, its_c, -its_s,
0.0, its_s, its_c );
}
inline HepRotationX::HepRotationX() : d(0.0), s(0.0), c(1.0) {}
inline HepRotationX::HepRotationX() : its_d(0.0), its_s(0.0), its_c(1.0) {}
inline HepRotationX::HepRotationX(const HepRotationX & orig) :
d(orig.d), s(orig.s), c(orig.c)
its_d(orig.its_d), its_s(orig.its_s), its_c(orig.its_c)
{}
inline HepRotationX::HepRotationX(double dd, double ss, double cc) :
d(dd), s(ss), c(cc)
its_d(dd), its_s(ss), its_c(cc)
{}
inline HepRotationX & HepRotationX::operator= (const HepRotationX & orig) {
d = orig.d;
s = orig.s;
c = orig.c;
its_d = orig.its_d;
its_s = orig.its_s;
its_c = orig.its_c;
return *this;
}
@@ -51,24 +51,24 @@ inline HepRotationX::~HepRotationX() {}
inline Hep3Vector HepRotationX::colX() const
{ return Hep3Vector ( 1.0, 0.0, 0.0 ); }
inline Hep3Vector HepRotationX::colY() const
{ return Hep3Vector ( 0.0, c, s ); }
{ return Hep3Vector ( 0.0, its_c, its_s ); }
inline Hep3Vector HepRotationX::colZ() const
{ return Hep3Vector ( 0.0, -s, c ); }
{ return Hep3Vector ( 0.0, -its_s, its_c ); }
inline Hep3Vector HepRotationX::rowX() const
{ return Hep3Vector ( 1.0, 0.0, 0.0 ); }
inline Hep3Vector HepRotationX::rowY() const
{ return Hep3Vector ( 0.0, c, -s ); }
{ return Hep3Vector ( 0.0, its_c, -its_s ); }
inline Hep3Vector HepRotationX::rowZ() const
{ return Hep3Vector ( 0.0, s, c ); }
{ return Hep3Vector ( 0.0, its_s, its_c ); }
inline double HepRotationX::getPhi () const { return phi(); }
inline double HepRotationX::getTheta() const { return theta(); }
inline double HepRotationX::getPsi () const { return psi(); }
inline double HepRotationX::getDelta() const { return d; }
inline double HepRotationX::getDelta() const { return its_d; }
inline Hep3Vector HepRotationX::getAxis () const { return axis(); }
inline double HepRotationX::delta() const { return d; }
inline double HepRotationX::delta() const { return its_d; }
inline Hep3Vector HepRotationX::axis() const { return Hep3Vector(1,0,0); }
inline HepAxisAngle HepRotationX::axisAngle() const {
@@ -76,9 +76,9 @@ inline HepAxisAngle HepRotationX::axisAngle() const {
}
inline void HepRotationX::getAngleAxis
(double & delta, Hep3Vector & axis) const {
delta = d;
axis = getAxis();
(double & ddelta, Hep3Vector & aaxis) const {
ddelta = its_d;
aaxis = getAxis();
}
inline HepLorentzVector HepRotationX::col1() const
@@ -106,37 +106,37 @@ inline double HepRotationX::tz() const { return 0.0; }
inline double HepRotationX::tt() const { return 1.0; }
inline HepRep4x4 HepRotationX::rep4x4() const {
return HepRep4x4 ( 1.0, 0.0, 0.0, 0.0,
0.0, c, -s, 0.0,
0.0, s, c, 0.0,
0.0, 0.0, 0.0, 1.0 );
return HepRep4x4 ( 1.0, 0.0, 0.0, 0.0,
0.0, its_c, -its_s, 0.0,
0.0, its_s, its_c, 0.0,
0.0, 0.0, 0.0, 1.0 );
}
inline bool HepRotationX::isIdentity() const {
return ( d==0 );
return ( its_d==0 );
}
inline int HepRotationX::compare ( const HepRotationX & r ) const {
if (d > r.d) return 1; else if (d < r.d) return -1; else return 0;
if (its_d > r.its_d) return 1; else if (its_d < r.its_d) return -1; else return 0;
}
inline bool HepRotationX::operator==(const HepRotationX & r) const
{ return (d==r.d); }
{ return (its_d==r.its_d); }
inline bool HepRotationX::operator!=(const HepRotationX & r) const
{ return (d!=r.d); }
{ return (its_d!=r.its_d); }
inline bool HepRotationX::operator>=(const HepRotationX & r) const
{ return (d>=r.d); }
{ return (its_d>=r.its_d); }
inline bool HepRotationX::operator<=(const HepRotationX & r) const
{ return (d<=r.d); }
{ return (its_d<=r.its_d); }
inline bool HepRotationX::operator> (const HepRotationX & r) const
{ return (d> r.d); }
{ return (its_d> r.its_d); }
inline bool HepRotationX::operator< (const HepRotationX & r) const
{ return (d< r.d); }
{ return (its_d< r.its_d); }
inline void HepRotationX::rectify() {
d = proper(d); // Just in case!
s = std::sin(d);
c = std::cos(d);
its_d = proper(its_d); // Just in case!
its_s = std::sin(its_d);
its_c = std::cos(its_d);
}
inline Hep3Vector HepRotationX::operator() (const Hep3Vector & p) const {
@@ -144,8 +144,8 @@ inline Hep3Vector HepRotationX::operator() (const Hep3Vector & p) const {
double y = p.y();
double z = p.z();
return Hep3Vector( x,
y * c - z * s,
z * c + y * s );
y * its_c - z * its_s,
z * its_c + y * its_s );
}
inline Hep3Vector HepRotationX::operator * (const Hep3Vector & p) const {
@@ -162,32 +162,32 @@ inline HepLorentzVector HepRotationX::operator *
return operator()(p);
}
inline HepRotationX & HepRotationX::operator *= (const HepRotationX & m) {
return *this = (*this) * (m);
inline HepRotationX & HepRotationX::operator *= (const HepRotationX & m1) {
return *this = (*this) * (m1);
}
inline HepRotationX & HepRotationX::transform(const HepRotationX & m) {
return *this = m * (*this);
inline HepRotationX & HepRotationX::transform(const HepRotationX & m1) {
return *this = m1 * (*this);
}
inline double HepRotationX::proper( double delta ) {
inline double HepRotationX::proper( double ddelta ) {
// -PI < d <= PI
if ( std::fabs(delta) < CLHEP::pi ) {
return delta;
if ( std::fabs(ddelta) < CLHEP::pi ) {
return ddelta;
} else {
register double x = delta / (CLHEP::twopi);
register double x = ddelta / (CLHEP::twopi);
return (CLHEP::twopi) * ( x + std::floor(.5-x) );
}
} // proper()
inline HepRotationX HepRotationX::operator * ( const HepRotationX & rx ) const {
return HepRotationX ( HepRotationX::proper(d+rx.d),
s*rx.c + c*rx.s,
c*rx.c - s*rx.s );
return HepRotationX ( HepRotationX::proper(its_d+rx.its_d),
its_s*rx.its_c + its_c*rx.its_s,
its_c*rx.its_c - its_s*rx.its_s );
}
inline HepRotationX HepRotationX::inverse() const {
return HepRotationX( proper(-d), -s, c );
return HepRotationX( proper(-its_d), -its_s, its_c );
}
inline HepRotationX inverseOf(const HepRotationX & r) {
+3 -3
View File
@@ -256,11 +256,11 @@ public:
protected:
double d;
double its_d;
// The angle of rotation.
double s;
double c;
double its_s;
double its_c;
// Cache the trig functions, for rapid operations.
inline HepRotationY ( double dd, double ss, double cc );
+52 -52
View File
@@ -12,10 +12,10 @@
namespace CLHEP {
inline double HepRotationY::xx() const { return c; }
inline double HepRotationY::xz() const { return s; }
inline double HepRotationY::zx() const { return -s; }
inline double HepRotationY::zz() const { return c; }
inline double HepRotationY::xx() const { return its_c; }
inline double HepRotationY::xz() const { return its_s; }
inline double HepRotationY::zx() const { return -its_s; }
inline double HepRotationY::zz() const { return its_c; }
inline double HepRotationY::yy() const { return 1.0; }
inline double HepRotationY::yx() const { return 0.0; }
@@ -24,51 +24,51 @@ inline double HepRotationY::xy() const { return 0.0; }
inline double HepRotationY::zy() const { return 0.0; }
inline HepRep3x3 HepRotationY::rep3x3() const {
return HepRep3x3 ( c , 0.0, s,
0.0, 1.0, 0.0,
-s , 0.0, c );
return HepRep3x3 ( its_c, 0.0, its_s,
0.0, 1.0, 0.0,
-its_s, 0.0, its_c );
}
inline HepRotationY::HepRotationY() : d(0.0), s(0.0), c(1.0) {}
inline HepRotationY::HepRotationY() : its_d(0.0), its_s(0.0), its_c(1.0) {}
inline HepRotationY::HepRotationY(const HepRotationY & orig) :
d(orig.d), s(orig.s), c(orig.c)
its_d(orig.its_d), its_s(orig.its_s), its_c(orig.its_c)
{}
inline HepRotationY::HepRotationY(double dd, double ss, double cc) :
d(dd), s(ss), c(cc)
its_d(dd), its_s(ss), its_c(cc)
{}
inline HepRotationY & HepRotationY::operator= (const HepRotationY & orig) {
d = orig.d;
s = orig.s;
c = orig.c;
its_d = orig.its_d;
its_s = orig.its_s;
its_c = orig.its_c;
return *this;
}
inline HepRotationY::~HepRotationY() {}
inline Hep3Vector HepRotationY::colX() const
{ return Hep3Vector ( c, 0.0, -s ); }
{ return Hep3Vector ( its_c, 0.0, -its_s ); }
inline Hep3Vector HepRotationY::colY() const
{ return Hep3Vector ( 0.0, 1.0, 0.0 ); }
inline Hep3Vector HepRotationY::colZ() const
{ return Hep3Vector ( s, 0.0, c ); }
{ return Hep3Vector ( its_s, 0.0, its_c ); }
inline Hep3Vector HepRotationY::rowX() const
{ return Hep3Vector ( c, 0.0, s ); }
{ return Hep3Vector ( its_c, 0.0, its_s ); }
inline Hep3Vector HepRotationY::rowY() const
{ return Hep3Vector ( 0.0, 1.0, 0.0 ); }
inline Hep3Vector HepRotationY::rowZ() const
{ return Hep3Vector ( -s, 0.0, c ); }
{ return Hep3Vector ( -its_s, 0.0, its_c ); }
inline double HepRotationY::getPhi () const { return phi(); }
inline double HepRotationY::getTheta() const { return theta(); }
inline double HepRotationY::getPsi () const { return psi(); }
inline double HepRotationY::getDelta() const { return d; }
inline double HepRotationY::getDelta() const { return its_d; }
inline Hep3Vector HepRotationY::getAxis () const { return axis(); }
inline double HepRotationY::delta() const { return d; }
inline double HepRotationY::delta() const { return its_d; }
inline Hep3Vector HepRotationY::axis() const { return Hep3Vector(0,1,0); }
inline HepAxisAngle HepRotationY::axisAngle() const {
@@ -76,46 +76,46 @@ inline HepAxisAngle HepRotationY::axisAngle() const {
}
inline void HepRotationY::getAngleAxis
(double & delta, Hep3Vector & axis) const {
delta = d;
axis = getAxis();
(double & ddelta, Hep3Vector & aaxis) const {
ddelta = its_d;
aaxis = getAxis();
}
inline bool HepRotationY::isIdentity() const {
return ( d==0 );
return ( its_d==0 );
}
inline int HepRotationY::compare ( const HepRotationY & r ) const {
if (d > r.d) return 1; else if (d < r.d) return -1; else return 0;
if (its_d > r.its_d) return 1; else if (its_d < r.its_d) return -1; else return 0;
}
inline bool HepRotationY::operator==(const HepRotationY & r) const
{ return (d==r.d); }
{ return (its_d==r.its_d); }
inline bool HepRotationY::operator!=(const HepRotationY & r) const
{ return (d!=r.d); }
{ return (its_d!=r.its_d); }
inline bool HepRotationY::operator>=(const HepRotationY & r) const
{ return (d>=r.d); }
{ return (its_d>=r.its_d); }
inline bool HepRotationY::operator<=(const HepRotationY & r) const
{ return (d<=r.d); }
{ return (its_d<=r.its_d); }
inline bool HepRotationY::operator> (const HepRotationY & r) const
{ return (d> r.d); }
{ return (its_d> r.its_d); }
inline bool HepRotationY::operator< (const HepRotationY & r) const
{ return (d< r.d); }
{ return (its_d< r.its_d); }
inline void HepRotationY::rectify() {
d = proper(d); // Just in case!
s = std::sin(d);
c = std::cos(d);
its_d = proper(its_d); // Just in case!
its_s = std::sin(its_d);
its_c = std::cos(its_d);
}
inline Hep3Vector HepRotationY::operator() (const Hep3Vector & p) const {
double x = p.x();
double y = p.y();
double z = p.z();
return Hep3Vector( x * c + z * s,
return Hep3Vector( x * its_c + z * its_s,
y,
z * c - x * s );
z * its_c - x * its_s );
}
inline Hep3Vector HepRotationY::operator * (const Hep3Vector & p) const {
@@ -132,32 +132,32 @@ inline HepLorentzVector HepRotationY::operator *
return operator()(p);
}
inline HepRotationY & HepRotationY::operator *= (const HepRotationY & m) {
return *this = (*this) * (m);
inline HepRotationY & HepRotationY::operator *= (const HepRotationY & m1) {
return *this = (*this) * (m1);
}
inline HepRotationY & HepRotationY::transform(const HepRotationY & m) {
return *this = m * (*this);
inline HepRotationY & HepRotationY::transform(const HepRotationY & m1) {
return *this = m1 * (*this);
}
inline double HepRotationY::proper( double delta ) {
// -PI < d <= PI
if ( std::fabs(delta) < CLHEP::pi ) {
return delta;
inline double HepRotationY::proper( double ddelta ) {
// -PI < its_d <= PI
if ( std::fabs(ddelta) < CLHEP::pi ) {
return ddelta;
} else {
register double x = delta / (CLHEP::twopi);
register double x = ddelta / (CLHEP::twopi);
return (CLHEP::twopi) * ( x + std::floor(.5-x) );
}
} // proper()
inline HepRotationY HepRotationY::operator * ( const HepRotationY & ry ) const {
return HepRotationY ( HepRotationY::proper(d+ry.d),
s*ry.c + c*ry.s,
c*ry.c - s*ry.s );
return HepRotationY ( HepRotationY::proper(its_d+ry.its_d),
its_s*ry.its_c + its_c*ry.its_s,
its_c*ry.its_c - its_s*ry.its_s );
}
inline HepRotationY HepRotationY::inverse() const {
return HepRotationY( proper(-d), -s, c );
return HepRotationY( proper(-its_d), -its_s, its_c );
}
inline HepRotationY inverseOf(const HepRotationY & r) {
@@ -193,10 +193,10 @@ inline double HepRotationY::tz() const { return 0.0; }
inline double HepRotationY::tt() const { return 1.0; }
inline HepRep4x4 HepRotationY::rep4x4() const {
return HepRep4x4 ( c , 0.0, s, 0.0,
0.0, 1.0, 0.0, 0.0,
-s , 0.0, c, 0.0,
0.0, 0.0, 0.0, 1.0 );
return HepRep4x4 ( its_c, 0.0, its_s, 0.0,
0.0, 1.0, 0.0, 0.0,
-its_s, 0.0, its_c, 0.0,
0.0, 0.0, 0.0, 1.0 );
}
inline double HepRotationY::getTolerance() {
+3 -3
View File
@@ -258,11 +258,11 @@ public:
protected:
double d;
double its_d;
// The angle of rotation.
double s;
double c;
double its_s;
double its_c;
// Cache the trig functions, for rapid operations.
inline HepRotationZ ( double dd, double ss, double cc );
+52 -52
View File
@@ -12,10 +12,10 @@
namespace CLHEP {
inline double HepRotationZ::xx() const { return c; }
inline double HepRotationZ::xy() const { return -s; }
inline double HepRotationZ::yx() const { return s; }
inline double HepRotationZ::yy() const { return c; }
inline double HepRotationZ::xx() const { return its_c; }
inline double HepRotationZ::xy() const { return -its_s; }
inline double HepRotationZ::yx() const { return its_s; }
inline double HepRotationZ::yy() const { return its_c; }
inline double HepRotationZ::zz() const { return 1.0; }
inline double HepRotationZ::zy() const { return 0.0; }
@@ -24,51 +24,51 @@ inline double HepRotationZ::yz() const { return 0.0; }
inline double HepRotationZ::xz() const { return 0.0; }
inline HepRep3x3 HepRotationZ::rep3x3() const {
return HepRep3x3 ( c, -s, 0.0,
s, c, 0.0,
0.0, 0.0, 1.0 );
return HepRep3x3 ( its_c, -its_s, 0.0,
its_s, its_c, 0.0,
0.0, 0.0, 1.0 );
}
inline HepRotationZ::HepRotationZ() : d(0.0), s(0.0), c(1.0) {}
inline HepRotationZ::HepRotationZ() : its_d(0.0), its_s(0.0), its_c(1.0) {}
inline HepRotationZ::HepRotationZ(const HepRotationZ & orig) :
d(orig.d), s(orig.s), c(orig.c)
its_d(orig.its_d), its_s(orig.its_s), its_c(orig.its_c)
{}
inline HepRotationZ::HepRotationZ(double dd, double ss, double cc) :
d(dd), s(ss), c(cc)
its_d(dd), its_s(ss), its_c(cc)
{}
inline HepRotationZ & HepRotationZ::operator= (const HepRotationZ & orig) {
d = orig.d;
s = orig.s;
c = orig.c;
its_d = orig.its_d;
its_s = orig.its_s;
its_c = orig.its_c;
return *this;
}
inline HepRotationZ::~HepRotationZ() {}
inline Hep3Vector HepRotationZ::colX() const
{ return Hep3Vector ( c, s, 0.0 ); }
{ return Hep3Vector ( its_c, its_s, 0.0 ); }
inline Hep3Vector HepRotationZ::colY() const
{ return Hep3Vector ( -s, c, 0.0 ); }
{ return Hep3Vector ( -its_s, its_c, 0.0 ); }
inline Hep3Vector HepRotationZ::colZ() const
{ return Hep3Vector ( 0.0, 0.0, 1.0 ); }
inline Hep3Vector HepRotationZ::rowX() const
{ return Hep3Vector ( c, -s, 0.0 ); }
{ return Hep3Vector ( its_c, -its_s, 0.0 ); }
inline Hep3Vector HepRotationZ::rowY() const
{ return Hep3Vector ( s, c, 0.0 ); }
{ return Hep3Vector ( its_s, its_c, 0.0 ); }
inline Hep3Vector HepRotationZ::rowZ() const
{ return Hep3Vector ( 0.0, 0.0, 1.0 ); }
inline double HepRotationZ::getPhi () const { return phi(); }
inline double HepRotationZ::getTheta() const { return theta(); }
inline double HepRotationZ::getPsi () const { return psi(); }
inline double HepRotationZ::getDelta() const { return d; }
inline double HepRotationZ::getDelta() const { return its_d; }
inline Hep3Vector HepRotationZ::getAxis () const { return axis(); }
inline double HepRotationZ::delta() const { return d; }
inline double HepRotationZ::delta() const { return its_d; }
inline Hep3Vector HepRotationZ::axis() const { return Hep3Vector(0,0,1); }
inline HepAxisAngle HepRotationZ::axisAngle() const {
@@ -76,44 +76,44 @@ inline HepAxisAngle HepRotationZ::axisAngle() const {
}
inline void HepRotationZ::getAngleAxis
(double & delta, Hep3Vector & axis) const {
delta = d;
axis = getAxis();
(double & ddelta, Hep3Vector & aaxis) const {
ddelta = its_d;
aaxis = getAxis();
}
inline bool HepRotationZ::isIdentity() const {
return ( d==0 );
return ( its_d==0 );
}
inline int HepRotationZ::compare ( const HepRotationZ & r ) const {
if (d > r.d) return 1; else if (d < r.d) return -1; else return 0;
if (its_d > r.its_d) return 1; else if (its_d < r.its_d) return -1; else return 0;
}
inline bool HepRotationZ::operator==(const HepRotationZ & r) const
{ return (d==r.d); }
{ return (its_d==r.its_d); }
inline bool HepRotationZ::operator!=(const HepRotationZ & r) const
{ return (d!=r.d); }
{ return (its_d!=r.its_d); }
inline bool HepRotationZ::operator>=(const HepRotationZ & r) const
{ return (d>=r.d); }
{ return (its_d>=r.its_d); }
inline bool HepRotationZ::operator<=(const HepRotationZ & r) const
{ return (d<=r.d); }
{ return (its_d<=r.its_d); }
inline bool HepRotationZ::operator> (const HepRotationZ & r) const
{ return (d> r.d); }
{ return (its_d> r.its_d); }
inline bool HepRotationZ::operator< (const HepRotationZ & r) const
{ return (d< r.d); }
{ return (its_d< r.its_d); }
inline void HepRotationZ::rectify() {
d = proper(d); // Just in case!
s = std::sin(d);
c = std::cos(d);
its_d = proper(its_d); // Just in case!
its_s = std::sin(its_d);
its_c = std::cos(its_d);
}
inline Hep3Vector HepRotationZ::operator() (const Hep3Vector & p) const {
double x = p.x();
double y = p.y();
double z = p.z();
return Hep3Vector( x * c - y * s,
x * s + y * c,
return Hep3Vector( x * its_c - y * its_s,
x * its_s + y * its_c,
z );
}
@@ -131,32 +131,32 @@ inline HepLorentzVector HepRotationZ::operator *
return operator()(p);
}
inline HepRotationZ & HepRotationZ::operator *= (const HepRotationZ & m) {
return *this = (*this) * (m);
inline HepRotationZ & HepRotationZ::operator *= (const HepRotationZ & m1) {
return *this = (*this) * (m1);
}
inline HepRotationZ & HepRotationZ::transform(const HepRotationZ & m) {
return *this = m * (*this);
inline HepRotationZ & HepRotationZ::transform(const HepRotationZ & m1) {
return *this = m1 * (*this);
}
inline double HepRotationZ::proper( double delta ) {
// -PI < d <= PI
if ( std::fabs(delta) < CLHEP::pi ) {
return delta;
inline double HepRotationZ::proper( double ddelta ) {
// -PI < its_d <= PI
if ( std::fabs(ddelta) < CLHEP::pi ) {
return ddelta;
} else {
register double x = delta / (CLHEP::twopi);
register double x = ddelta / (CLHEP::twopi);
return (CLHEP::twopi) * ( x + std::floor(.5-x) );
}
} // proper()
inline HepRotationZ HepRotationZ::operator * ( const HepRotationZ & rz ) const {
return HepRotationZ ( HepRotationZ::proper(d+rz.d),
s*rz.c + c*rz.s,
c*rz.c - s*rz.s );
return HepRotationZ ( HepRotationZ::proper(its_d+rz.its_d),
its_s*rz.its_c + its_c*rz.its_s,
its_c*rz.its_c - its_s*rz.its_s );
}
inline HepRotationZ HepRotationZ::inverse() const {
return HepRotationZ( proper(-d), -s, c );
return HepRotationZ( proper(-its_d), -its_s, its_c );
}
inline HepRotationZ inverseOf(const HepRotationZ & r) {
@@ -192,10 +192,10 @@ inline double HepRotationZ::tz() const { return 0.0; }
inline double HepRotationZ::tt() const { return 1.0; }
inline HepRep4x4 HepRotationZ::rep4x4() const {
return HepRep4x4 ( c, -s, 0.0, 0.0,
s, c, 0.0, 0.0,
0.0, 0.0, 1.0, 0.0,
0.0, 0.0, 0.0, 1.0 );
return HepRep4x4 ( its_c, -its_s, 0.0, 0.0,
its_s, its_c, 0.0, 0.0,
0.0, 0.0, 1.0, 0.0,
0.0, 0.0, 0.0, 1.0 );
}
inline double HepRotationZ::getTolerance() {
+8 -8
View File
@@ -142,11 +142,11 @@ public:
// |v1 - v2|**2 <= epsilon**2 * |v1.dot(v2)|
double howNear(const Hep3Vector & v ) const;
// std::sqrt ( |v1-v2|**2 / v1.dot(v2) ) with a maximum of 1.
// sqrt ( |v1-v2|**2 / v1.dot(v2) ) with a maximum of 1.
// If v1.dot(v2) is negative, will return 1.
double deltaR(const Hep3Vector & v) const;
// std::sqrt( pseudorapity_difference**2 + deltaPhi **2 )
// sqrt( pseudorapity_difference**2 + deltaPhi **2 )
inline Hep3Vector & operator += (const Hep3Vector &);
// Addition.
@@ -179,7 +179,7 @@ public:
// The angle w.r.t. another 3-vector.
double pseudoRapidity() const;
// Returns the pseudo-rapidity, i.e. -ln(std::tan(theta/2))
// Returns the pseudo-rapidity, i.e. -ln(tan(theta/2))
void setEta ( double p );
// Set pseudo-rapidity, keeping magnitude and phi fixed. (ZOOM)
@@ -307,7 +307,7 @@ public:
// relativistic gamma (considering v as a velocity vector with c=1)
double coLinearRapidity() const;
// inverse std::tanh (beta)
// inverse tanh (beta)
// 5 - Properties relative to Z axis and to an arbitrary direction
@@ -333,11 +333,11 @@ public:
// vector minus its projection along a direction.
double rapidity () const;
// inverse std::tanh(v.z())
// inverse tanh(v.z())
double rapidity (const Hep3Vector & v2) const;
// rapidity with respect to specified direction:
// inverse std::tanh (v.dot(u)) where u is a unit in the direction of v2
// inverse tanh (v.dot(u)) where u is a unit in the direction of v2
double eta(const Hep3Vector & v2) const;
// - ln tan of the angle beween the vector and the ref direction.
@@ -347,7 +347,7 @@ public:
// Decomposition of an angle within reference defined by a direction:
double polarAngle (const Hep3Vector & v2) const;
// The reference direction is Z: the polarAngle is std::abs(v.theta()-v2.theta()).
// The reference direction is Z: the polarAngle is abs(v.theta()-v2.theta()).
double deltaPhi (const Hep3Vector & v2) const;
// v.phi()-v2.phi(), brought into the range (-PI,PI]
@@ -358,7 +358,7 @@ public:
double polarAngle (const Hep3Vector & v2,
const Hep3Vector & ref) const;
// For arbitrary reference direction,
// polarAngle is std::abs(v.angle(ref) - v2.angle(ref)).
// polarAngle is abs(v.angle(ref) - v2.angle(ref)).
double azimAngle (const Hep3Vector & v2,
const Hep3Vector & ref) const;
+30 -30
View File
@@ -29,14 +29,14 @@ inline double Hep3Vector::getX() const { return dx; }
inline double Hep3Vector::getY() const { return dy; }
inline double Hep3Vector::getZ() const { return dz; }
inline void Hep3Vector::setX(double x) { dx = x; }
inline void Hep3Vector::setY(double y) { dy = y; }
inline void Hep3Vector::setZ(double z) { dz = z; }
inline void Hep3Vector::setX(double x1) { dx = x1; }
inline void Hep3Vector::setY(double y1) { dy = y1; }
inline void Hep3Vector::setZ(double z1) { dz = z1; }
inline void Hep3Vector::set(double x, double y, double z) {
dx = x;
dy = y;
dz = z;
inline void Hep3Vector::set(double x1, double y1, double z1) {
dx = x1;
dy = y1;
dz = z1;
}
// --------------
@@ -68,18 +68,18 @@ inline double operator * (const Hep3Vector & a, const Hep3Vector & b) {
// --------------------------
inline void Hep3Vector::setRThetaPhi
( double r, double theta, double phi ) {
setSpherical (r, theta, phi);
( double r1, double theta1, double phi1 ) {
setSpherical (r1, theta1, phi1);
}
inline void Hep3Vector::setREtaPhi
( double r, double eta, double phi ) {
setSpherical (r, 2*std::atan(std::exp(-eta)), phi);
( double r1, double eta1, double phi1 ) {
setSpherical (r1, 2*std::atan(std::exp(-eta1)), phi1);
}
inline void Hep3Vector::setRhoPhiZ
( double rho, double phi, double z) {
setCylindrical (rho, phi, z);
( double rho1, double phi1, double z1) {
setCylindrical (rho1, phi1, z1);
}
// ------------
@@ -88,12 +88,12 @@ inline void Hep3Vector::setRhoPhiZ
inline Hep3Vector::Hep3Vector()
: dx(0.), dy(0.), dz(0.) {}
inline Hep3Vector::Hep3Vector(double x)
: dx(x), dy(0.), dz(0.) {}
inline Hep3Vector::Hep3Vector(double x, double y)
: dx(x), dy(y), dz(0.) {}
inline Hep3Vector::Hep3Vector(double x, double y, double z)
: dx(x), dy(y), dz(z) {}
inline Hep3Vector::Hep3Vector(double x1)
: dx(x1), dy(0.), dz(0.) {}
inline Hep3Vector::Hep3Vector(double x1, double y1)
: dx(x1), dy(y1), dz(0.) {}
inline Hep3Vector::Hep3Vector(double x1, double y1, double z1)
: dx(x1), dy(y1), dz(z1) {}
inline Hep3Vector::Hep3Vector(const Hep3Vector & p)
: dx(p.dx), dy(p.dy), dz(p.dz) {}
@@ -139,7 +139,7 @@ inline double Hep3Vector::cos2Theta() const {
return ptot2 == 0.0 ? 1.0 : dz*dz/ptot2;
}
inline void Hep3Vector::setR(double r) { setMag(r); }
inline void Hep3Vector::setR(double r1) { setMag(r1); }
inline void Hep3Vector::setTheta(double th) {
double ma = mag();
@@ -165,14 +165,14 @@ inline double Hep3Vector::eta() const { return pseudoRapidity();}
inline double Hep3Vector::getRho() const { return perp(); }
inline double Hep3Vector::getEta() const { return pseudoRapidity();}
inline void Hep3Vector::setPerp(double r) {
inline void Hep3Vector::setPerp(double r1) {
double p = perp();
if (p != 0.0) {
dx *= r/p;
dy *= r/p;
dx *= r1/p;
dy *= r1/p;
}
}
inline void Hep3Vector::setRho(double rho) { setPerp (rho); }
inline void Hep3Vector::setRho(double rho1) { setPerp (rho1); }
// ----------
// Comparison
@@ -279,13 +279,13 @@ inline Hep3Vector Hep3Vector::unit() const {
}
inline Hep3Vector Hep3Vector::orthogonal() const {
double x = dx < 0.0 ? -dx : dx;
double y = dy < 0.0 ? -dy : dy;
double z = dz < 0.0 ? -dz : dz;
if (x < y) {
return x < z ? Hep3Vector(0,dz,-dy) : Hep3Vector(dy,-dx,0);
double xx = dx < 0.0 ? -dx : dx;
double yy = dy < 0.0 ? -dy : dy;
double zz = dz < 0.0 ? -dz : dz;
if (xx < yy) {
return xx < zz ? Hep3Vector(0,dz,-dy) : Hep3Vector(dy,-dx,0);
}else{
return y < z ? Hep3Vector(-dz,0,dx) : Hep3Vector(dy,-dx,0);
return yy < zz ? Hep3Vector(-dz,0,dx) : Hep3Vector(dy,-dx,0);
}
}
+1 -1
View File
@@ -58,7 +58,7 @@ public:
inline Hep2Vector(const Hep2Vector & p);
// The copy constructor.
explicit Hep2Vector( const Hep3Vector & s);
explicit Hep2Vector( const Hep3Vector & );
// "demotion" constructor"
// WARNING -- THIS IGNORES THE Z COMPONENT OF THE Hep3Vector.
// SO IN GENERAL, Hep2Vector(v)==v WILL NOT HOLD!
+24 -24
View File
@@ -19,23 +19,23 @@ inline double Hep2Vector::y() const {
return dy;
}
inline Hep2Vector::Hep2Vector(double x, double y)
: dx(x), dy(y) {}
inline Hep2Vector::Hep2Vector(double x1, double y1)
: dx(x1), dy(y1) {}
inline Hep2Vector::Hep2Vector( const Hep3Vector & s)
: dx(s.x()), dy(s.y()) {}
inline Hep2Vector::Hep2Vector( const Hep3Vector & p)
: dx(p.x()), dy(p.y()) {}
inline void Hep2Vector::setX(double x) {
dx = x;
inline void Hep2Vector::setX(double x1) {
dx = x1;
}
inline void Hep2Vector::setY(double y) {
dy = y;
inline void Hep2Vector::setY(double y1) {
dy = y1;
}
inline void Hep2Vector::set(double x, double y) {
dx = x;
dy = y;
inline void Hep2Vector::set(double x1, double y1) {
dx = x1;
dy = y1;
}
double & Hep2Vector::operator[] (int i) { return operator()(i); }
@@ -105,8 +105,8 @@ inline Hep2Vector Hep2Vector::unit() const {
}
inline Hep2Vector Hep2Vector::orthogonal() const {
double x = std::fabs(dx), y = std::fabs(dy);
if (x < y) {
double x1 = std::fabs(dx), y1 = std::fabs(dy);
if (x1 < y1) {
return Hep2Vector(dy,-dx);
}else{
return Hep2Vector(-dy,dx);
@@ -122,25 +122,25 @@ inline double Hep2Vector::angle(const Hep2Vector & q) const {
return ptot2 <= 0.0 ? 0.0 : std::acos(dot(q)/std::sqrt(ptot2));
}
inline void Hep2Vector::setMag(double r){
inline void Hep2Vector::setMag(double r1){
double ph = phi();
setX( r * std::cos(ph) );
setY( r * std::sin(ph) );
setX( r1 * std::cos(ph) );
setY( r1 * std::sin(ph) );
}
inline void Hep2Vector::setR(double r){
setMag(r);
inline void Hep2Vector::setR(double r1){
setMag(r1);
}
inline void Hep2Vector::setPhi(double phi){
inline void Hep2Vector::setPhi(double phi1){
double ma = mag();
setX( ma * std::cos(phi) );
setY( ma * std::sin(phi) );
setX( ma * std::cos(phi1) );
setY( ma * std::sin(phi1) );
}
inline void Hep2Vector::setPolar(double r, double phi){
setX( r * std::cos(phi) );
setY( r * std::sin(phi) );
inline void Hep2Vector::setPolar(double r1, double phi1){
setX( r1 * std::cos(phi1) );
setY( r1 * std::sin(phi1) );
}
inline Hep2Vector operator + (const Hep2Vector & a, const Hep2Vector & b) {