|
[Rivet-svn] r4065 - in branches/2012-06-aidarivet: . include/Rivet/Math include/Rivet/Projectionsblackhole at projects.hepforge.org blackhole at projects.hepforge.orgFri Dec 7 11:48:34 GMT 2012
Author: buckley Date: Fri Dec 7 11:48:31 2012 New Revision: 4065 Log: Adding particlesByRapidity and particlesByAbsRapidity to FinalState. Adding a note on FourVector and FourMomentum that operator- and operator-= invert both the space and time components: use of -= can result in a vector with negative energy. These changes force a full rebuild: sorry! Modified: branches/2012-06-aidarivet/ChangeLog branches/2012-06-aidarivet/include/Rivet/Math/Vector4.hh branches/2012-06-aidarivet/include/Rivet/Projections/FinalState.hh Modified: branches/2012-06-aidarivet/ChangeLog ============================================================================== --- branches/2012-06-aidarivet/ChangeLog Fri Dec 7 09:13:54 2012 (r4064) +++ branches/2012-06-aidarivet/ChangeLog Fri Dec 7 11:48:31 2012 (r4065) @@ -1,3 +1,11 @@ +2012-12-07 Andy Buckley <andy.buckley at cern.ch> + + * Adding a note on FourVector and FourMomentum that operator- and + operator-= invert both the space and time components: use of -= + can result in a vector with negative energy. + + * Adding particlesByRapidity and particlesByAbsRapidity to FinalState. + 2012-12-07 Hendrik Hoeth <hendrik.hoeth at cern.ch> * Added ALICE_2012_I1181770 analysis Modified: branches/2012-06-aidarivet/include/Rivet/Math/Vector4.hh ============================================================================== --- branches/2012-06-aidarivet/include/Rivet/Math/Vector4.hh Fri Dec 7 09:13:54 2012 (r4064) +++ branches/2012-06-aidarivet/include/Rivet/Math/Vector4.hh Fri Dec 7 11:48:31 2012 (r4065) @@ -159,28 +159,31 @@ return contract(v); } - /// Multiply by a scalar + /// Multiply by a scalar. FourVector& operator*=(double a) { _vec = multiply(a, *this)._vec; return *this; } - /// Divide by a scalar + /// Divide by a scalar. FourVector& operator/=(double a) { _vec = multiply(1.0/a, *this)._vec; return *this; } + /// Add to this 4-vector. FourVector& operator+=(const FourVector& v) { _vec = add(*this, v)._vec; return *this; } + /// Subtract from this 4-vector. NB time as well as space components are subtracted. FourVector& operator-=(const FourVector& v) { _vec = add(*this, -v)._vec; return *this; } + /// Multiply all components (space and time) by -1. FourVector operator-() const { FourVector result; result._vec = -_vec; @@ -471,16 +474,19 @@ return *this; } + /// Subtract from this 4-vector. NB time as well as space components are subtracted. FourMomentum& operator+=(const FourMomentum& v) { _vec = add(*this, v)._vec; return *this; } + /// Subtract from this 4-vector. NB time as well as space components are subtracted. FourMomentum& operator-=(const FourMomentum& v) { _vec = add(*this, -v)._vec; return *this; } + /// Multiply all components (time and space) by -1. FourMomentum operator-() const { FourMomentum result; result._vec = -_vec; Modified: branches/2012-06-aidarivet/include/Rivet/Projections/FinalState.hh ============================================================================== --- branches/2012-06-aidarivet/include/Rivet/Projections/FinalState.hh Fri Dec 7 09:13:54 2012 (r4064) +++ branches/2012-06-aidarivet/include/Rivet/Projections/FinalState.hh Fri Dec 7 11:48:31 2012 (r4065) @@ -75,6 +75,16 @@ return particles(cmpParticleByAscAbsPseudorapidity); } + /// Get the final-state particles, ordered by increasing \f$ y \f$. + const ParticleVector& particlesByRapidity() const { + return particles(cmpParticleByAscRapidity); + } + + /// Get the final-state particles, ordered by increasing \f$ |y| \f$. + const ParticleVector& particlesByModRapidity() const { + return particles(cmpParticleByAscAbsRapidity); + } + /// Access the projected final-state particles. virtual size_t size() const { return _theParticles.size(); }
More information about the Rivet-svn mailing list |