|
[Rivet-svn] rivet: 2 new changesetsRivet Mercurial rivet at projects.hepforge.orgTue Jun 14 13:00:02 BST 2016
details: https://rivet.hepforge.org/hg/rivet/rev/5819ee47434f branches: changeset: 5256:5819ee47434f user: Andy Buckley <andy at insectnation.org> date: Tue Jun 14 12:51:24 2016 +0100 description: Add and rename 4-vector boost calculation methods: new methods beta, betaVec, gamma & gammaVec are now preferred to the deprecated boostVector method. details: https://rivet.hepforge.org/hg/rivet/rev/7814ff1af043 branches: changeset: 5257:7814ff1af043 user: Andy Buckley <andy at insectnation.org> date: Tue Jun 14 12:54:37 2016 +0100 description: Use betaVec rather than boostVector diffs (truncated from 337 to 50 lines): --- a/ChangeLog Mon Jun 13 21:29:26 2016 +0100 +++ b/ChangeLog Tue Jun 14 12:54:37 2016 +0100 @@ -1,3 +1,9 @@ +2016-06-14 Andy Buckley <andy.buckley at cern.ch> + + * Add and rename 4-vector boost calculation methods: new methods + beta, betaVec, gamma & gammaVec are now preferred to the + deprecated boostVector method. + 2016-06-13 Andy Buckley <andy.buckley at cern.ch> * Add and use projection handling methods declare(proj, pname) and --- a/include/Rivet/Math/Vector4.hh Mon Jun 13 21:29:26 2016 +0100 +++ b/include/Rivet/Math/Vector4.hh Tue Jun 14 12:54:37 2016 +0100 @@ -614,23 +614,41 @@ return E() * sin(polarAngle()); } + //@} - /// Calculate the boost vector (in units of \f$ \beta \f$). - Vector3 boostVector() const { - // const Vector3 p3 = vector3(); - // const double m2 = mass2(); - // if (Rivet::isZero(m2)) return p3.unit(); - // else { - // // Could also do this via beta = tanh(rapidity), but that's - // // probably more messy from a numerical hygiene point of view. - // const double p2 = p3.mod2(); - // const double beta = sqrt( p2 / (m2 + p2) ); - // return beta * p3.unit(); - // } - /// @todo Be careful about c=1 convention... - return Vector3(px()/E(), py()/E(), pz()/E()); + + /// @name Lorentz boost factors and vectors + //@{ + + /// Calculate the boost factor \f$ \gamma \f$. + /// @note \f$ \gamma = E/mc^2 \f$ so we rely on the c=1 convention + double gamma() const { + return sqrt(E2()/mass2()); } + /// Calculate the boost vector \f$ \vec{\gamma} \f$. + /// @note \f$ \gamma = E/mc^2 \f$ so we rely on the c=1 convention + Vector3 gammaVec() const { + return gamma() * p3().unit(); + } +
More information about the Rivet-svn mailing list |