CLHEP Namespace Reference


Namespaces

namespace  detail

Functions

HepBoost inverseOf (const HepBoost &lt)
HepBoostX inverseOf (const HepBoostX &b)
HepBoostY inverseOf (const HepBoostY &b)
HepBoostZ inverseOf (const HepBoostZ &b)
HepLorentzRotation inverseOf (const HepLorentzRotation &lt)
HepLorentzVector operator * (const HepLorentzVector &p, double a)
HepLorentzVector operator * (double a, const HepLorentzVector &p)
HepLorentzVector boostXOf (const HepLorentzVector &vec, double bbeta)
HepLorentzVector boostYOf (const HepLorentzVector &vec, double bbeta)
HepLorentzVector boostZOf (const HepLorentzVector &vec, double bbeta)
HepLorentzVector boostOf (const HepLorentzVector &vec, const Hep3Vector &betaVector)
HepLorentzVector boostOf (const HepLorentzVector &vec, const Hep3Vector &aaxis, double bbeta)
HepRotation inverseOf (const HepRotation &r)
HepRotation operator * (const HepRotationX &rx, const HepRotation &r)
HepRotation operator * (const HepRotationY &ry, const HepRotation &r)
HepRotation operator * (const HepRotationZ &rz, const HepRotation &r)
HepRotationX inverseOf (const HepRotationX &r)
HepRotationY inverseOf (const HepRotationY &r)
HepRotationZ inverseOf (const HepRotationZ &r)
Hep3Vector operator+ (const Hep3Vector &a, const Hep3Vector &b)
Hep3Vector operator- (const Hep3Vector &a, const Hep3Vector &b)
Hep3Vector operator * (const Hep3Vector &p, double a)
Hep3Vector operator * (double a, const Hep3Vector &p)
double operator * (const Hep3Vector &a, const Hep3Vector &b)
Hep2Vector operator+ (const Hep2Vector &a, const Hep2Vector &b)
Hep2Vector operator- (const Hep2Vector &a, const Hep2Vector &b)
Hep2Vector operator * (const Hep2Vector &p, double a)
Hep2Vector operator * (double a, const Hep2Vector &p)
double operator * (const Hep2Vector &a, const Hep2Vector &b)
std::ostream & operator<< (std::ostream &os, const HepAxisAngle &aa)
void ZMinputAxisAngle (std::istream &is, double &x, double &y, double &z, double &delta)
std::istream & operator>> (std::istream &is, HepAxisAngle &aa)
unsigned long crc32ul (const std::string &s)
std::ostream & operator<< (std::ostream &os, const HepEulerAngles &ea)
void ZMinput3doubles (std::istream &is, const char *type, double &x, double &y, double &z)
std::istream & operator>> (std::istream &is, HepEulerAngles &ea)
double transformSmall (double r)
HepLorentzRotation operator * (const HepRotation &r, const HepLorentzRotation &lt)
std::ostream & operator<< (std::ostream &os, const HepLorentzVector &v1)
std::istream & operator>> (std::istream &is, HepLorentzVector &v1)
HepLorentzVector operator/ (const HepLorentzVector &w, double c)
HepLorentzVector rotationXOf (const HepLorentzVector &vec, double phi)
HepLorentzVector rotationYOf (const HepLorentzVector &vec, double phi)
HepLorentzVector rotationZOf (const HepLorentzVector &vec, double phi)
HepLorentzVector rotationOf (const HepLorentzVector &vec, const Hep3Vector &aaxis, double ddelta)
HepLorentzVector rotationOf (const HepLorentzVector &vec, const HepAxisAngle &ax)
HepLorentzVector rotationOf (const HepLorentzVector &vec, const HepEulerAngles &e1)
HepLorentzVector rotationOf (const HepLorentzVector &vec, double phi1, double theta1, double psi1)
std::ostream & operator<< (std::ostream &os, const HepRandom &dist)
std::istream & operator>> (std::istream &is, HepRandom &dist)
std::ostream & operator<< (std::ostream &os, const HepRandomEngine &e)
std::istream & operator>> (std::istream &is, HepRandomEngine &e)
double gammln (double xx)
Hep3Vector rotationOf (const Hep3Vector &vec, const HepAxisAngle &ax)
Hep3Vector rotationOf (const Hep3Vector &vec, const Hep3Vector &axis, double ddelta)
Hep3Vector rotationOf (const Hep3Vector &vec, const HepEulerAngles &ex)
Hep3Vector rotationOf (const Hep3Vector &vec, double phi, double theta, double psi)
Hep3Vector rotationXOf (const Hep3Vector &vec, double ddelta)
Hep3Vector rotationYOf (const Hep3Vector &vec, double ddelta)
Hep3Vector rotationZOf (const Hep3Vector &vec, double ddelta)
std::ostream & operator<< (std::ostream &os, const Hep3Vector &v)
std::istream & operator>> (std::istream &is, Hep3Vector &v)
const Hep3Vector HepXHat (1.0, 0.0, 0.0)
const Hep3Vector HepYHat (0.0, 1.0, 0.0)
const Hep3Vector HepZHat (0.0, 0.0, 1.0)
Hep3Vector operator/ (const Hep3Vector &v1, double c)
Hep2Vector operator/ (const Hep2Vector &p, double a)
std::ostream & operator<< (std::ostream &os, const Hep2Vector &q)
void ZMinput2doubles (std::istream &is, const char *type, double &x, double &y)
std::istream & operator>> (std::istream &is, Hep2Vector &p)


Function Documentation

HepBoost CLHEP::inverseOf ( const HepBoost &  lt  )  [inline]

Definition at line 268 of file Boost.icc.

00268                                                   {
00269   return HepBoost( lt.xx(),  lt.yx(),  lt.zx(), -lt.tx(),
00270                              lt.yy(),  lt.zy(), -lt.ty(),
00271                                        lt.zz(), -lt.tz(),
00272                                                  lt.tt());
00273 }

HepBoostX CLHEP::inverseOf ( const HepBoostX &  b  )  [inline]

Definition at line 182 of file BoostX.icc.

00182                                                    {
00183   return HepBoostX( -b.beta(), b.gamma());
00184 }

HepBoostY CLHEP::inverseOf ( const HepBoostY &  b  )  [inline]

Definition at line 181 of file BoostY.icc.

00181                                                    {
00182   return HepBoostY( -b.beta(), b.gamma());
00183 }

HepBoostZ CLHEP::inverseOf ( const HepBoostZ &  b  )  [inline]

Definition at line 186 of file BoostZ.icc.

00186                                                    {
00187   return HepBoostZ( -b.beta(), b.gamma());
00188 }

HepLorentzRotation CLHEP::inverseOf ( const HepLorentzRotation &  lt  )  [inline]

Definition at line 359 of file LorentzRotation.icc.

00359                                                                       {
00360   return HepLorentzRotation( 
00361          HepRep4x4(
00362                              lt.mxx,  lt.myx,  lt.mzx, -lt.mtx,
00363                              lt.mxy,  lt.myy,  lt.mzy, -lt.mty,
00364                              lt.mxz,  lt.myz,  lt.mzz, -lt.mtz,
00365                             -lt.mxt, -lt.myt, -lt.mzt,  lt.mtt )  );
00366 }

HepLorentzVector CLHEP::operator * ( const HepLorentzVector &  p,
double  a 
) [inline]

Definition at line 245 of file LorentzVector.icc.

00245                                                                           {
00246   return HepLorentzVector(a*p.x(), a*p.y(), a*p.z(), a*p.t());
00247 }

HepLorentzVector CLHEP::operator * ( double  a,
const HepLorentzVector &  p 
) [inline]

Definition at line 249 of file LorentzVector.icc.

00249                                                                           {
00250   return HepLorentzVector(a*p.x(), a*p.y(), a*p.z(), a*p.t());
00251 }

HepLorentzVector CLHEP::boostXOf ( const HepLorentzVector &  vec,
double  bbeta 
) [inline]

Definition at line 405 of file LorentzVector.icc.

00405                                                      {
00406   HepLorentzVector vv (vec);
00407   return vv.boostX (bbeta);
00408 }

HepLorentzVector CLHEP::boostYOf ( const HepLorentzVector &  vec,
double  bbeta 
) [inline]

Definition at line 411 of file LorentzVector.icc.

00411                                                      {
00412   HepLorentzVector vv (vec);
00413   return vv.boostY (bbeta);
00414 }

HepLorentzVector CLHEP::boostZOf ( const HepLorentzVector &  vec,
double  bbeta 
) [inline]

Definition at line 417 of file LorentzVector.icc.

00417                                                      {
00418   HepLorentzVector vv (vec);
00419   return vv.boostZ (bbeta);
00420 }

HepLorentzVector CLHEP::boostOf ( const HepLorentzVector &  vec,
const Hep3Vector &  betaVector 
) [inline]

Definition at line 423 of file LorentzVector.icc.

Referenced by G4QMDReaction::ApplyYourself().

00423                                                                        {
00424   HepLorentzVector vv (vec);
00425   return vv.boost (betaVector);
00426 }

HepLorentzVector CLHEP::boostOf ( const HepLorentzVector &  vec,
const Hep3Vector &  aaxis,
double  bbeta 
) [inline]

Definition at line 429 of file LorentzVector.icc.

00429                                                                             {
00430   HepLorentzVector vv (vec);
00431   return vv.boost (aaxis, bbeta);
00432 }

HepRotation CLHEP::inverseOf ( const HepRotation &  r  )  [inline]

Definition at line 284 of file Rotation.icc.

00284                                                      {
00285   return r.inverse();
00286 }

HepRotation CLHEP::operator * ( const HepRotationX &  rx,
const HepRotation &  r 
) [inline]

Definition at line 321 of file Rotation.icc.

00321                                                                               {
00322   HepRep3x3 mmm = r.rep3x3();
00323   double c = rx.yy();
00324   double ss = rx.zy();
00325   return HepRotation (        mmm.xx_,           mmm.xy_,          mmm.xz_,
00326                         c*mmm.yx_-ss*mmm.zx_, c*mmm.yy_-ss*mmm.zy_, c*mmm.yz_-ss*mmm.zz_,
00327                         ss*mmm.yx_+c*mmm.zx_, ss*mmm.yy_+c*mmm.zy_, ss*mmm.yz_+c*mmm.zz_ );
00328 }

HepRotation CLHEP::operator * ( const HepRotationY &  ry,
const HepRotation &  r 
) [inline]

Definition at line 330 of file Rotation.icc.

00330                                                                               {
00331   HepRep3x3 mmm = r.rep3x3();
00332   double c = ry.xx();
00333   double ss = ry.xz();
00334   return HepRotation (  c*mmm.xx_+ss*mmm.zx_, c*mmm.xy_+ss*mmm.zy_, c*mmm.xz_+ss*mmm.zz_,
00335                               mmm.yx_,           mmm.yy_,          mmm.yz_,
00336                        -ss*mmm.xx_+c*mmm.zx_,-ss*mmm.xy_+c*mmm.zy_,-ss*mmm.xz_+c*mmm.zz_ );
00337 }

HepRotation CLHEP::operator * ( const HepRotationZ &  rz,
const HepRotation &  r 
) [inline]

Definition at line 339 of file Rotation.icc.

00339                                                                               {
00340   HepRep3x3 mmm = r.rep3x3();
00341   double c = rz.xx();
00342   double ss = rz.yx();
00343   return HepRotation (  c*mmm.xx_-ss*mmm.yx_, c*mmm.xy_-ss*mmm.yy_, c*mmm.xz_-ss*mmm.yz_,
00344                         ss*mmm.xx_+c*mmm.yx_, ss*mmm.xy_+c*mmm.yy_, ss*mmm.xz_+c*mmm.yz_,
00345                               mmm.zx_,           mmm.zy_,          mmm.zz_       );
00346 }

HepRotationX CLHEP::inverseOf ( const HepRotationX &  r  )  [inline]

Definition at line 193 of file RotationX.icc.

00193                                                       {
00194   return r.inverse();
00195 }

HepRotationY CLHEP::inverseOf ( const HepRotationY &  r  )  [inline]

Definition at line 163 of file RotationY.icc.

00163                                                       {
00164   return r.inverse();
00165 }

HepRotationZ CLHEP::inverseOf ( const HepRotationZ &  r  )  [inline]

Definition at line 162 of file RotationZ.icc.

00162                                                       {
00163   return r.inverse();
00164 }

Hep3Vector CLHEP::operator+ ( const Hep3Vector &  a,
const Hep3Vector &  b 
) [inline]

Definition at line 46 of file ThreeVector.icc.

00046                                                                           {
00047   return Hep3Vector(a.x() + b.x(), a.y() + b.y(), a.z() + b.z());
00048 }

Hep3Vector CLHEP::operator- ( const Hep3Vector &  a,
const Hep3Vector &  b 
) [inline]

Definition at line 50 of file ThreeVector.icc.

00050                                                                           {
00051   return Hep3Vector(a.x() - b.x(), a.y() - b.y(), a.z() - b.z());
00052 }

Hep3Vector CLHEP::operator * ( const Hep3Vector &  p,
double  a 
) [inline]

Definition at line 54 of file ThreeVector.icc.

00054                                                               {
00055   return Hep3Vector(a*p.x(), a*p.y(), a*p.z());
00056 }

Hep3Vector CLHEP::operator * ( double  a,
const Hep3Vector &  p 
) [inline]

Definition at line 58 of file ThreeVector.icc.

00058                                                               {
00059   return Hep3Vector(a*p.x(), a*p.y(), a*p.z());
00060 }

double CLHEP::operator * ( const Hep3Vector &  a,
const Hep3Vector &  b 
) [inline]

Definition at line 62 of file ThreeVector.icc.

00062                                                                       {
00063   return a.dot(b);
00064 }

Hep2Vector CLHEP::operator+ ( const Hep2Vector &  a,
const Hep2Vector &  b 
) [inline]

Definition at line 146 of file TwoVector.icc.

00146                                                                           {
00147   return Hep2Vector(a.x() + b.x(), a.y() + b.y());
00148 }

Hep2Vector CLHEP::operator- ( const Hep2Vector &  a,
const Hep2Vector &  b 
) [inline]

Definition at line 150 of file TwoVector.icc.

00150                                                                           {
00151   return Hep2Vector(a.x() - b.x(), a.y() - b.y());
00152 }

Hep2Vector CLHEP::operator * ( const Hep2Vector &  p,
double  a 
) [inline]

Definition at line 154 of file TwoVector.icc.

00154                                                               {
00155   return Hep2Vector(a*p.x(), a*p.y());
00156 }

Hep2Vector CLHEP::operator * ( double  a,
const Hep2Vector &  p 
) [inline]

Definition at line 158 of file TwoVector.icc.

00158                                                               {
00159   return Hep2Vector(a*p.x(), a*p.y());
00160 }

double CLHEP::operator * ( const Hep2Vector &  a,
const Hep2Vector &  b 
) [inline]

Definition at line 162 of file TwoVector.icc.

00162                                                                       {
00163   return a.dot(b);
00164 }

std::ostream& CLHEP::operator<< ( std::ostream &  os,
const HepAxisAngle &  aa 
)

Definition at line 85 of file AxisAngle.cc.

00085                                                                   {
00086   os << '(' << aa.axis() << ", " << aa.delta() << ')';
00087   return  os;
00088 }  // operator<<()

void CLHEP::ZMinputAxisAngle ( std::istream &  is,
double &  x,
double &  y,
double &  z,
double &  delta 
)

Definition at line 156 of file ZMinput.cc.

References ZMinput3doubles().

Referenced by operator>>().

00158                                          {
00159 // Accepted formats are 
00160 // parenthesis optional, then
00161 // any acceptable format for a Hep3Vector, then
00162 // optional comma, then
00163 // delta, then
00164 // close parenthesis if opened at start.
00165 //
00166 // But if there is an open parenthesis, it must be for the overall
00167 // object.  That is, if the axis has parentheses, the form must be 
00168 // ( (x,y,z) , delta ) 
00169 
00170   char c;
00171   bool parenthesis = false;
00172 
00173   if ( !eatwhitespace(is) ) {
00174     std::cerr << "istream ended before trying to input AxisAngle \n";
00175     return;
00176   }
00177 
00178   if ( !is.get(c) ) { fouledup(); return; }
00179   if ( c == '(' ) {
00180     parenthesis = true;
00181     if ( !eatwhitespace(is) ) {
00182       std::cerr << "istream ended after ( trying to input AxisAngle \n";
00183       return;
00184     }
00185   } else {
00186     is.putback(c);
00187   }  
00188 
00189   // At this point, parenthesis or not, the next item read is supposed to
00190   // be a valid Hep3Vector axis.
00191 
00192   ZMinput3doubles ( is, "axis of AxisAngle", x, y, z );
00193   if (!is) return;
00194 
00195   if ( !eatwhitespace(is) ) {
00196     std::cerr << "istream ended before delta of AxisAngle \n";
00197     return;
00198   } 
00199 
00200   if ( !is.get(c) ) { fouledup(); return; }
00201   if ( c == ',' ) {
00202     if ( !eatwhitespace(is) ) {
00203       std::cerr << "istream ended ater axis and comma in AxisAngle \n"; 
00204       return;
00205     }
00206   } else {
00207     is.putback(c);
00208   }
00209 
00210   // At this point, comma or not, the next item read is supposed to
00211   // be the number delta.
00212 
00213   if (!(is >> delta)) {
00214     std::cerr << "Could not delta value in input of AxisAngle \n";
00215     return;
00216   }
00217 
00218   // Finally, check for the closing parenthesis if there was an open paren.
00219 
00220   if (parenthesis) {
00221     if ( !eatwhitespace(is) ) {
00222       std::cerr << "No closing parenthesis in input of AxisAngle \n";
00223       return;
00224     } 
00225     if ( !is.get(c) ) { fouledup(); return; }
00226     if ( c != ')' ) {
00227       std::cerr << "Missing closing parenthesis in input of AxisAngle \n";
00228       if ( isdigit(c) || (c=='-') || (c=='+') ) {
00229         is.putback('@');
00230       } else {
00231         is.putback('c');
00232       }
00233       int m;
00234       is >> m;  // This fails, leaving the state bad.
00235       return;
00236     }
00237   }
00238 
00239   return;
00240 
00241 }

std::istream& CLHEP::operator>> ( std::istream &  is,
HepAxisAngle &  aa 
)

Definition at line 95 of file AxisAngle.cc.

References ZMinputAxisAngle().

00095                                                             {
00096   Hep3Vector axis;
00097   double delta;
00098   double x,y,z;
00099   ZMinputAxisAngle ( is, x, y, z, delta );
00100   axis.set(x,y,z);
00101   aa.set ( axis, delta );
00102   return  is;
00103 }  // operator>>()

unsigned long CLHEP::crc32ul ( const std::string &  s  ) 

Definition at line 37 of file engineIDulong.cc.

00037                                            {
00038   static std::vector<unsigned long> crc_table =  gen_crc_table();
00039   unsigned long crc = 0;
00040   int end = s.length();
00041   for (int j = 0; j != end; ++j) {
00042     int i = ( (int) ( crc >> 24) ^ s[j] ) & 0xff;
00043     crc = ( ( crc << 8 ) ^ crc_table[i] ) & 0xffffffffUL;
00044   }
00045   return crc;
00046 }

std::ostream& CLHEP::operator<< ( std::ostream &  os,
const HepEulerAngles &  ea 
)

Definition at line 100 of file EulerAngles.cc.

00101 {
00102   os << "(" << ea.phi() << ", " << ea.theta() << ", " << ea.psi() << ")";
00103   return  os;
00104 }  // operator<<()

void CLHEP::ZMinput3doubles ( std::istream &  is,
const char *  type,
double &  x,
double &  y,
double &  z 
)

Definition at line 42 of file ZMinput.cc.

Referenced by operator>>(), and ZMinputAxisAngle().

00043                                                              {
00044 
00045 // Accepted formats are 
00046 // x y z
00047 // x, y, z (each comma is optional, and whitespace ignored if comma present)
00048 // ( x, y, z ) (commas optional)
00049 
00050   char c;
00051   bool parenthesis = false;
00052 
00053   if ( !eatwhitespace(is) ) {
00054     std::cerr << "istream ended before trying to input " << type << "\n";
00055     return;
00056   }
00057 
00058   if ( !is.get(c) ) { fouledup(); return; }
00059   if ( c == '(' ) {
00060     parenthesis = true;
00061     if ( !eatwhitespace(is) ) {
00062       std::cerr << "istream ended after ( trying to input " << type << "\n";
00063       return;
00064     }
00065   } else {
00066     is.putback(c);
00067   }  
00068 
00069   // At this point, parenthesis or not, the next item read is supposed to
00070   // be the number x.
00071 
00072   if (!(is >> x)) {
00073     std::cerr << "Could not read first value in input of " << type << "\n";
00074     return;
00075   }
00076 
00077   if ( !eatwhitespace(is) ) {
00078     std::cerr << "istream ended before second value of " << type << "\n";
00079     return;
00080   } 
00081 
00082   if ( !is.get(c) ) { fouledup(); return; }
00083   if ( c == ',' ) {
00084     if ( !eatwhitespace(is) ) {
00085       std::cerr << "istream ended ater one value and comma in " 
00086                                                         << type << "\n";
00087       return;
00088     }
00089   } else {
00090     is.putback(c);
00091   }
00092 
00093   // At this point, comma or not, the next item read is supposed to
00094   // be the number y.
00095 
00096   if (!(is >> y)) {
00097     std::cerr << "Could not read second value in input of " << type << "\n";
00098     return;
00099   }
00100 
00101   if ( !eatwhitespace(is) ) {
00102     std::cerr << "istream ended before third value of " << type << "\n";
00103     return;
00104   } 
00105 
00106   if ( !is.get(c) ) { fouledup(); return; }
00107   if ( c == ',' ) {
00108     if ( !eatwhitespace(is) ) {
00109       std::cerr << "istream ended ater two values and comma in " 
00110                                                         << type << "\n";
00111       return;
00112     }
00113   } else {
00114     is.putback(c);
00115   }
00116 
00117   // At this point, comma or not, the next item read is supposed to
00118   // be the number z.
00119 
00120   if (!(is >> z)) {
00121     std::cerr << "Could not read third value in input of " << type << "\n";
00122     return;
00123   }
00124 
00125   // Finally, check for the closing parenthesis if there was an open paren.
00126 
00127   if (parenthesis) {
00128     if ( !eatwhitespace(is) ) {
00129       std::cerr << "No closing parenthesis in input of " << type << "\n";
00130       return;
00131     } 
00132     if ( !is.get(c) ) { fouledup(); return; }
00133     if ( c != ')' ) {
00134       std::cerr << "Missing closing parenthesis in input of " 
00135                                                         << type << "\n";
00136       // Now a trick to do (as nearly as we can) what 
00137       // is.putback(c); is.setstate(std::ios_base::failbit); 
00138       // would do (because using ios_base will confuse old CLHEP compilers):
00139       if ( isdigit(c) || (c=='-') || (c=='+') ) {
00140         is.putback('@');
00141       } else {
00142         is.putback('c');
00143       }
00144       int m;
00145       is >> m;  // This fails, leaving the state bad, and the istream
00146                 // otherwise unchanged, except if the next char might
00147                 // have started a valid int, it turns to @
00148       return;
00149     }
00150   }
00151 
00152   return;
00153 
00154 }

std::istream& CLHEP::operator>> ( std::istream &  is,
HepEulerAngles &  ea 
)

Definition at line 109 of file EulerAngles.cc.

References ZMinput3doubles().

00109                                                               {
00110   double thePhi;
00111   double theTheta;
00112   double thePsi;
00113   ZMinput3doubles ( is, "HepEulerAngle", thePhi , theTheta , thePsi );
00114   ea.set ( thePhi , theTheta , thePsi );
00115   return  is;
00116 }  // operator>>()

double CLHEP::RandGaussQ::transformSmall ( double  r  ) 

Definition at line 219 of file flatToGaussian.cc.

00219                                  {
00220 
00221   // Solve for -v in the asymtotic formula 
00222   //
00223   // errInt (-v) =  exp(-v*v/2)         1     1*3    1*3*5
00224   //               ------------ * (1 - ---- + ---- - ----- + ... )
00225   //               v*sqrt(2*pi)        v**2   v**4   v**6
00226 
00227   // The value of r (=errInt(-v)) supplied is going to less than 2.0E-13,
00228   // which is such that v < -7.25.  Since the value of r is meaningful only
00229   // to an absolute error of 1E-16 (double precision accuracy for a number 
00230   // which on the high side could be of the form 1-epsilon), computing
00231   // v to more than 3-4 digits of accuracy is suspect; however, to ensure 
00232   // smoothness with the table generator (which uses quite a few terms) we
00233   // also use terms up to 1*3*5* ... *13/v**14, and insist on accuracy of
00234   // solution at the level of 1.0e-7.
00235 
00236   // This routine is called less than one time in a trillion firings, so
00237   // speed is of no concern.  As a matter of technique, we terminate the
00238   // iterations in case they would be infinite, but this should not happen.
00239 
00240   double eps = 1.0e-7;
00241   double guess = 7.5;
00242   double v;
00243   
00244   for ( int i = 1; i < 50; i++ ) {
00245     double vn2 = 1.0/(guess*guess);
00246     double s1 = -13*11*9*7*5*3 * vn2*vn2*vn2*vn2*vn2*vn2*vn2;
00247             s1 +=    11*9*7*5*3 * vn2*vn2*vn2*vn2*vn2*vn2;
00248             s1 +=      -9*7*5*3 * vn2*vn2*vn2*vn2*vn2;
00249             s1 +=         7*5*3 * vn2*vn2*vn2*vn2;
00250             s1 +=          -5*3 * vn2*vn2*vn2;
00251             s1 +=            3 * vn2*vn2    - vn2  +    1.0;
00252     v = std::sqrt ( 2.0 * std::log ( s1 / (r*guess*std::sqrt(CLHEP::twopi)) ) );
00253     if ( std::abs(v-guess) < eps ) break;
00254     guess = v;
00255   }
00256  
00257   return -v;
00258 
00259 } // transformSmall()

HepLorentzRotation CLHEP::operator * ( const HepRotation &  r,
const HepLorentzRotation &  lt 
)

Definition at line 264 of file LorentzRotation.cc.

00265                                                               {
00266   r.rep4x4();
00267   lt.rep4x4();
00268   return HepLorentzRotation( HepRep4x4(
00269          r.xx()*lt.xx() + r.xy()*lt.yx() + r.xz()*lt.zx() + r.xt()*lt.tx(),
00270          r.xx()*lt.xy() + r.xy()*lt.yy() + r.xz()*lt.zy() + r.xt()*lt.ty(),
00271          r.xx()*lt.xz() + r.xy()*lt.yz() + r.xz()*lt.zz() + r.xt()*lt.tz(),
00272          r.xx()*lt.xt() + r.xy()*lt.yt() + r.xz()*lt.zt() + r.xt()*lt.tt(),
00273 
00274          r.yx()*lt.xx() + r.yy()*lt.yx() + r.yz()*lt.zx() + r.yt()*lt.tx(),
00275          r.yx()*lt.xy() + r.yy()*lt.yy() + r.yz()*lt.zy() + r.yt()*lt.ty(),
00276          r.yx()*lt.xz() + r.yy()*lt.yz() + r.yz()*lt.zz() + r.yt()*lt.tz(),
00277          r.yx()*lt.xt() + r.yy()*lt.yt() + r.yz()*lt.zt() + r.yt()*lt.tt(),
00278 
00279          r.zx()*lt.xx() + r.zy()*lt.yx() + r.zz()*lt.zx() + r.zt()*lt.tx(),
00280          r.zx()*lt.xy() + r.zy()*lt.yy() + r.zz()*lt.zy() + r.zt()*lt.ty(),
00281          r.zx()*lt.xz() + r.zy()*lt.yz() + r.zz()*lt.zz() + r.zt()*lt.tz(),
00282          r.zx()*lt.xt() + r.zy()*lt.yt() + r.zz()*lt.zt() + r.zt()*lt.tt(),
00283 
00284          r.tx()*lt.xx() + r.ty()*lt.yx() + r.tz()*lt.zx() + r.tt()*lt.tx(),
00285          r.tx()*lt.xy() + r.ty()*lt.yy() + r.tz()*lt.zy() + r.tt()*lt.ty(),
00286          r.tx()*lt.xz() + r.ty()*lt.yz() + r.tz()*lt.zz() + r.tt()*lt.tz(),
00287          r.tx()*lt.xt() + r.ty()*lt.yt() + r.tz()*lt.zt() + r.tt()*lt.tt() ) );
00288 }

std::ostream& CLHEP::operator<< ( std::ostream &  os,
const HepLorentzVector &  v1 
)

Definition at line 90 of file LorentzVector.cc.

00091 {
00092   return os << "(" << v1.x() << "," << v1.y() << "," << v1.z()
00093             << ";" << v1.t() << ")";
00094 }

std::istream& CLHEP::operator>> ( std::istream &  is,
HepLorentzVector &  v1 
)

Definition at line 96 of file LorentzVector.cc.

00096                                                                  {
00097 
00098 // Required format is ( a, b, c; d ) that is, four numbers, preceded by
00099 // (, followed by ), components of the spatial vector separated by commas,
00100 // time component separated by semicolon. The four numbers are taken
00101 // as x, y, z, t.
00102 
00103   double x, y, z, t;
00104   char c;
00105 
00106   is >> std::ws >> c;
00107     // ws is defined to invoke eatwhite(istream & )
00108     // see (Stroustrup gray book) page 333 and 345.
00109   if (is.fail() || c != '(' ) {
00110     std::cerr << "Could not find required opening parenthesis "
00111               << "in input of a HepLorentzVector" << std::endl;
00112     return is;
00113   }
00114 
00115   is >> x >> std::ws >> c;
00116   if (is.fail() || c != ',' ) {
00117     std::cerr << "Could not find x value and required trailing comma "
00118               << "in input of a HepLorentzVector" << std::endl; 
00119     return is;
00120   }
00121 
00122   is >> y >> std::ws >> c;
00123   if (is.fail() || c != ',' ) {
00124     std::cerr << "Could not find y value and required trailing comma "
00125               <<  "in input of a HepLorentzVector" << std::endl;
00126     return is;
00127   }
00128 
00129   is >> z >> std::ws >> c;
00130   if (is.fail() || c != ';' ) {
00131     std::cerr << "Could not find z value and required trailing semicolon "
00132                  <<  "in input of a HepLorentzVector" << std::endl;
00133     return is;
00134   }
00135 
00136   is >> t >> std::ws >> c;
00137   if (is.fail() || c != ')' ) {
00138     std::cerr << "Could not find t value and required close parenthesis "
00139                  << "in input of a HepLorentzVector" << std::endl;
00140     return is;
00141   }
00142 
00143   v1.setX(x);
00144   v1.setY(y);
00145   v1.setZ(z);
00146   v1.setT(t);
00147   return is;
00148 }

HepLorentzVector CLHEP::operator/ ( const HepLorentzVector &  w,
double  c 
)

Definition at line 165 of file LorentzVector.cc.

00165                                                                    {
00166 //  if (c == 0) {
00167 //    std::cerr << "HepLorentzVector::operator /() - "
00168 //      << "Attempt to do LorentzVector / 0 -- \n"
00169 //      << "division by zero would produce infinite or NAN components"
00170 //      << std::endl;
00171 //  }
00172   double oneOverC = 1.0/c;
00173   return HepLorentzVector (w.getV() * oneOverC,
00174                         w.getT() * oneOverC);
00175 } /* LV = w / c */

HepLorentzVector CLHEP::rotationXOf ( const HepLorentzVector &  vec,
double  phi 
)

Definition at line 28 of file LorentzVectorB.cc.

00028                                                   {
00029   HepLorentzVector vv (vec);
00030   return vv.rotateX (phi);
00031 }

HepLorentzVector CLHEP::rotationYOf ( const HepLorentzVector &  vec,
double  phi 
)

Definition at line 34 of file LorentzVectorB.cc.

00034                                                   {
00035   HepLorentzVector vv (vec);
00036   return vv.rotateY (phi);
00037 }

HepLorentzVector CLHEP::rotationZOf ( const HepLorentzVector &  vec,
double  phi 
)

Definition at line 40 of file LorentzVectorB.cc.

00040                                                   {
00041   HepLorentzVector vv (vec);
00042   return vv.rotateZ (phi);
00043 }

HepLorentzVector CLHEP::rotationOf ( const HepLorentzVector &  vec,
const Hep3Vector &  aaxis,
double  ddelta 
)

Definition at line 47 of file LorentzVectorR.cc.

00049                                             {
00050   HepLorentzVector vv (vec);
00051   return vv.rotate (aaxis, ddelta);
00052 }

HepLorentzVector CLHEP::rotationOf ( const HepLorentzVector &  vec,
const HepAxisAngle &  ax 
)

Definition at line 55 of file LorentzVectorR.cc.

00055                                                                 {
00056   HepLorentzVector vv (vec);
00057   return vv.rotate (ax);
00058 }

HepLorentzVector CLHEP::rotationOf ( const HepLorentzVector &  vec,
const HepEulerAngles &  e1 
)

Definition at line 61 of file LorentzVectorR.cc.

00061                                                                   {
00062   HepLorentzVector vv (vec);
00063   return vv.rotate (e1);
00064 }

HepLorentzVector CLHEP::rotationOf ( const HepLorentzVector &  vec,
double  phi1,
double  theta1,
double  psi1 
)

Definition at line 66 of file LorentzVectorR.cc.

00069                                                 {
00070   HepLorentzVector vv (vec);
00071   return vv.rotate (phi1, theta1, psi1);
00072 }

std::ostream& CLHEP::operator<< ( std::ostream &  os,
const HepRandom &  dist 
)

Definition at line 116 of file Random.cc.

00116                                                                   {
00117   return dist.put(os);
00118 }

std::istream& CLHEP::operator>> ( std::istream &  is,
HepRandom &  dist 
)

Definition at line 120 of file Random.cc.

00120                                                             {
00121   return dist.get(is);
00122 }

std::ostream& CLHEP::operator<< ( std::ostream &  os,
const HepRandomEngine &  e 
)

Definition at line 98 of file RandomEngine.cc.

00098                                                                      {
00099   return e.put(os);
00100 }

std::istream& CLHEP::operator>> ( std::istream &  is,
HepRandomEngine &  e 
)

Definition at line 102 of file RandomEngine.cc.

00102                                                                {
00103   return e.get(is);
00104 }

double CLHEP::HepStat::gammln ( double  xx  ) 

Definition at line 54 of file RandPoisson.cc.

00054                          {
00055 
00056 // Returns the value ln(Gamma(xx) for xx > 0.  Full accuracy is obtained for 
00057 // xx > 1. For 0 < xx < 1. the reflection formula (6.1.4) can be used first.
00058 // (Adapted from Numerical Recipes in C)
00059 
00060   static double cof[6] = {76.18009172947146,-86.50532032941677,
00061                              24.01409824083091, -1.231739572450155,
00062                              0.1208650973866179e-2, -0.5395239384953e-5};
00063   int j;
00064   double x = xx - 1.0;
00065   double tmp = x + 5.5;
00066   tmp -= (x + 0.5) * std::log(tmp);
00067   double ser = 1.000000000190015;
00068 
00069   for ( j = 0; j <= 5; j++ ) {
00070     x += 1.0;
00071     ser += cof[j]/x;
00072   }
00073   return -tmp + std::log(2.5066282746310005*ser);
00074 }

Hep3Vector CLHEP::rotationOf ( const Hep3Vector &  vec,
const HepAxisAngle &  ax 
)

Definition at line 127 of file SpaceVectorR.cc.

00127                                                                         {
00128   Hep3Vector vv(vec);
00129   return vv.rotate (ax);
00130 }

Hep3Vector CLHEP::rotationOf ( const Hep3Vector &  vec,
const Hep3Vector &  axis,
double  ddelta 
)

Definition at line 132 of file SpaceVectorR.cc.

00133                                                                {
00134   Hep3Vector vv(vec);
00135   return vv.rotate(axis, ddelta);
00136 }

Hep3Vector CLHEP::rotationOf ( const Hep3Vector &  vec,
const HepEulerAngles &  ex 
)

Definition at line 138 of file SpaceVectorR.cc.

00138                                                                           {
00139   Hep3Vector vv(vec);
00140   return vv.rotate (ex);
00141 }

Hep3Vector CLHEP::rotationOf ( const Hep3Vector &  vec,
double  phi,
double  theta,
double  psi 
)

Definition at line 143 of file SpaceVectorR.cc.

00144                                                              {
00145   Hep3Vector vv(vec);
00146   return vv.rotate(phi, theta, psi);
00147 }

Hep3Vector CLHEP::rotationXOf ( const Hep3Vector &  vec,
double  ddelta 
)

Definition at line 149 of file SpaceVectorR.cc.

00149                                                                {
00150   Hep3Vector vv(vec);
00151   return vv.rotateX (ddelta);
00152 }

Hep3Vector CLHEP::rotationYOf ( const Hep3Vector &  vec,
double  ddelta 
)

Definition at line 154 of file SpaceVectorR.cc.

00154                                                                {
00155   Hep3Vector vv(vec);
00156   return vv.rotateY (ddelta);
00157 }

Hep3Vector CLHEP::rotationZOf ( const Hep3Vector &  vec,
double  ddelta 
)

Definition at line 159 of file SpaceVectorR.cc.

00159                                                                {
00160   Hep3Vector vv(vec);
00161   return vv.rotateZ (ddelta);
00162 }

std::ostream& CLHEP::operator<< ( std::ostream &  os,
const Hep3Vector &  v 
)

Definition at line 100 of file ThreeVector.cc.

00100                                                                 {
00101   return os << "(" << v.x() << "," << v.y() << "," << v.z() << ")";
00102 }

std::istream& CLHEP::operator>> ( std::istream &  is,
Hep3Vector &  v 
)

Definition at line 107 of file ThreeVector.cc.

References ZMinput3doubles().

00107                                                          {
00108   double x, y, z;
00109   ZMinput3doubles ( is, "Hep3Vector", x, y, z );
00110   v.set(x, y, z);
00111   return  is;
00112 }  // operator>>()

const Hep3Vector CLHEP::HepXHat ( 1.  0,
0.  0,
0.  0 
)

Referenced by G4SPSAngDistribution::G4SPSAngDistribution(), G4SPSPosDistribution::G4SPSPosDistribution(), and G4Axis2Placement3D::Init().

const Hep3Vector CLHEP::HepYHat ( 0.  0,
1.  0,
0.  0 
)

Referenced by G4SPSAngDistribution::G4SPSAngDistribution(), G4SPSPosDistribution::G4SPSPosDistribution(), and G4Axis2Placement3D::Init().

const Hep3Vector CLHEP::HepZHat ( 0.  0,
0.  0,
1.  0 
)

Referenced by G4SPSAngDistribution::G4SPSAngDistribution(), G4SPSPosDistribution::G4SPSPosDistribution(), and G4Axis2Placement3D::Init().

Hep3Vector CLHEP::operator/ ( const Hep3Vector &  v1,
double  c 
)

Definition at line 335 of file ThreeVector.cc.

00335                                                           {
00336 //  if (c == 0) {
00337 //    std::cerr << "Hep3Vector::operator/ () - "
00338 //      << "Attempt to divide vector by 0 -- "
00339 //      << "will produce infinities and/or NANs" << std::endl;
00340 //  } 
00341   double   oneOverC = 1.0/c;
00342   return Hep3Vector  (  v1.x() * oneOverC,
00343                         v1.y() * oneOverC,
00344                         v1.z() * oneOverC );
00345 } /* v / c */

Hep2Vector CLHEP::operator/ ( const Hep2Vector &  p,
double  a 
)

Definition at line 61 of file TwoVector.cc.

00061                                                       {
00062 //  if (a==0) {
00063 //    std::cerr << "Hep2Vector operator/ () - "
00064 //              << "Division of Hep2Vector by zero" << std::endl;
00065 //  }
00066   return Hep2Vector(p.x()/a, p.y()/a);
00067 }

std::ostream& CLHEP::operator<< ( std::ostream &  os,
const Hep2Vector &  q 
)

Definition at line 69 of file TwoVector.cc.

00069                                                                  {
00070   os << "(" << q.x() << ", " << q.y() << ")";
00071   return os;
00072 }

void CLHEP::ZMinput2doubles ( std::istream &  is,
const char *  type,
double &  x,
double &  y 
)

Definition at line 243 of file ZMinput.cc.

Referenced by operator>>().

00244                                                  {
00245 
00246 // Accepted formats are 
00247 // x y 
00248 // x, y (comma is optional, and whitespace ignored if comma present)
00249 // ( x, y ) (comma optional)
00250 
00251   char c;
00252   bool parenthesis = false;
00253 
00254   if ( !eatwhitespace(is) ) {
00255     std::cerr << "istream ended before trying to input " << type << "\n";
00256     return;
00257   }
00258 
00259   if ( !is.get(c) ) { fouledup(); return; }
00260   if ( c == '(' ) {
00261     parenthesis = true;
00262     if ( !eatwhitespace(is) ) {
00263       std::cerr << "istream ended after ( trying to input " << type << "\n";
00264       return;
00265     }
00266   } else {
00267     is.putback(c);
00268   }  
00269 
00270   // At this point, parenthesis or not, the next item read is supposed to
00271   // be the number x.
00272 
00273   if (!(is >> x)) {
00274     std::cerr << "Could not read first value in input of " << type << "\n";
00275     return;
00276   }
00277 
00278   if ( !eatwhitespace(is) ) {
00279     std::cerr << "istream ended before second value of " << type << "\n";
00280     return;
00281   } 
00282 
00283   if ( !is.get(c) ) { fouledup(); return; }
00284   if ( c == ',' ) {
00285     if ( !eatwhitespace(is) ) {
00286       std::cerr << "istream ended ater one value and comma in " 
00287                                                         << type << "\n";
00288       return;
00289     }
00290   } else {
00291     is.putback(c);
00292   }
00293 
00294   // At this point, comma or not, the next item read is supposed to
00295   // be the number y.
00296 
00297   if (!(is >> y)) {
00298     std::cerr << "Could not read second value in input of " << type << "\n";
00299     return;
00300   }
00301 
00302   // Finally, check for the closing parenthesis if there was an open paren.
00303 
00304   if (parenthesis) {
00305     if ( !eatwhitespace(is) ) {
00306       std::cerr << "No closing parenthesis in input of " << type << "\n";
00307       return;
00308     } 
00309     if ( !is.get(c) ) { fouledup(); return; }
00310     if ( c != ')' ) {
00311       std::cerr << "Missing closing parenthesis in input of " 
00312                                                         << type << "\n";
00313       // Now a trick to do (as nearly as we can) what 
00314       // is.putback(c); is.setstate(std::ios_base::failbit); 
00315       // would do (because using ios_base will confuse old CLHEP compilers):
00316       if ( isdigit(c) || (c=='-') || (c=='+') ) {
00317         is.putback('@');
00318       } else {
00319         is.putback('c');
00320       }
00321       int m;
00322       is >> m;  // This fails, leaving the state bad, and the istream
00323                 // otherwise unchanged, except if the next char might
00324                 // have started a valid int, it turns to @
00325       return;
00326     }
00327   }
00328 
00329   return;
00330 
00331 }

std::istream& CLHEP::operator>> ( std::istream &  is,
Hep2Vector &  p 
)

Definition at line 77 of file TwoVector.cc.

References ZMinput2doubles().

00077                                                          {
00078   double x, y;
00079   ZMinput2doubles ( is, "Hep2Vector", x, y );
00080   p.set(x, y);
00081   return  is;
00082 }  // operator>>()


Generated on Mon May 27 17:54:05 2013 for Geant4 by  doxygen 1.4.7