|
[Rivet-svn] r3550 - in trunk: include/Rivet/Projections src/Projectionsblackhole at projects.hepforge.org blackhole at projects.hepforge.orgThu Jan 26 14:29:38 GMT 2012
Author: dgrell Date: Thu Jan 26 14:29:37 2012 New Revision: 3550 Log: Fixed broken UnstableFS behaviour Modified: trunk/include/Rivet/Projections/UnstableFinalState.hh trunk/src/Projections/UnstableFinalState.cc Modified: trunk/include/Rivet/Projections/UnstableFinalState.hh ============================================================================== --- trunk/include/Rivet/Projections/UnstableFinalState.hh Wed Jan 25 13:35:32 2012 (r3549) +++ trunk/include/Rivet/Projections/UnstableFinalState.hh Thu Jan 26 14:29:37 2012 (r3550) @@ -32,12 +32,9 @@ UnstableFinalState(double mineta = -MAXRAPIDITY, double maxeta = MAXRAPIDITY, double minpt = 0.0*GeV) - : _etamin(mineta), _etamax(maxeta), _ptmin(minpt) + : FinalState(mineta,maxeta,minpt) { setName("UnstableFinalState"); - // addCut("eta", MORE_EQ, mineta); - // addCut("eta", LESS_EQ, maxeta); - // addCut("pT", MORE_EQ, minpt); } @@ -48,45 +45,11 @@ //@} - - /// @name Accessors - //@{ - - /// Access the projected final-state particles. - virtual const ParticleVector& particles() const { return _theParticles; } - - /// Is this final state empty? - virtual bool empty() const { return _theParticles.empty(); } - - /// @deprecated Is this final state empty? - virtual bool isEmpty() const { return _theParticles.empty(); } - - //@} - - protected: /// Apply the projection to the event. virtual void project(const Event& e); - /// Compare projections. - virtual int compare(const Projection& p) const; - - - protected: - - /// The minimum allowed pseudorapidity. - double _etamin; - - /// The maximum allowed pseudorapidity. - double _etamax; - - /// The minimum allowed transverse momentum. - double _ptmin; - - /// The final-state particles. - ParticleVector _theParticles; - }; Modified: trunk/src/Projections/UnstableFinalState.cc ============================================================================== --- trunk/src/Projections/UnstableFinalState.cc Wed Jan 25 13:35:32 2012 (r3549) +++ trunk/src/Projections/UnstableFinalState.cc Thu Jan 26 14:29:37 2012 (r3550) @@ -8,25 +8,28 @@ namespace Rivet { - - int UnstableFinalState::compare(const Projection& p) const { - const UnstableFinalState& other = dynamic_cast<const UnstableFinalState&>(p); - return \ - cmp(_etamin, other._etamin) || - cmp(_etamax, other._etamax) || - cmp(_ptmin, other._ptmin); - } - - void UnstableFinalState::project(const Event& e) { _theParticles.clear(); + // \todo We should really implement the FinalState algorithm here instead + double etamin, etamax; + if ( _etaRanges.empty() ) { + etamin = -MAXRAPIDITY; + etamax = MAXRAPIDITY; + } + else { + // with our current constructor choice, we can only ever have one entry + assert( _etaRanges.size() == 1 ); + etamin = _etaRanges[0].first; + etamax = _etaRanges[0].second; + } + foreach (GenParticle* p, Rivet::particles(e.genEvent())) { const int st = p->status(); bool passed = \ ( st == 1 || (st == 2 && abs(p->pdg_id()) != 22) ) && !isZero(p->momentum().perp()) && p->momentum().perp() >= _ptmin && - p->momentum().eta() > _etamin && p->momentum().eta() < _etamax && + p->momentum().eta() > etamin && p->momentum().eta() < etamax && !IS_PARTON_PDGID(p->pdg_id()); // Avoid double counting by re-marking as unpassed if particle ID == parent ID @@ -68,7 +71,7 @@ } } } - MSG_DEBUG("Number of final-state particles = " << _theParticles.size()); + MSG_DEBUG("Number of unstable final-state particles = " << _theParticles.size()); }
More information about the Rivet-svn mailing list |