|
[Rivet-svn] r1666 - in trunk: . include/Rivet srcblackhole at projects.hepforge.org blackhole at projects.hepforge.orgTue Jul 7 18:15:18 BST 2009
Author: buckley Date: Tue Jul 7 18:15:18 2009 New Revision: 1666 Log: Adding Jet::hadronicEnergy() Modified: trunk/ChangeLog trunk/include/Rivet/Jet.hh trunk/src/Jet.cc Modified: trunk/ChangeLog ============================================================================== --- trunk/ChangeLog Tue Jul 7 16:40:02 2009 (r1665) +++ trunk/ChangeLog Tue Jul 7 18:15:18 2009 (r1666) @@ -1,5 +1,7 @@ 2009-07-07 Andy Buckley <andy at insectnation.org> + * Adding Jet::hadronicEnergy() + * Adding VisibleFinalState and automatically using it in JetAlg projections. Modified: trunk/include/Rivet/Jet.hh ============================================================================== --- trunk/include/Rivet/Jet.hh Tue Jul 7 16:40:02 2009 (r1665) +++ trunk/include/Rivet/Jet.hh Tue Jul 7 18:15:18 2009 (r1666) @@ -123,6 +123,9 @@ /// Get the energy carried in this jet by neutral particles. double neutralEnergy() const; + /// Get the energy carried in this jet by hadrons. + double hadronicEnergy() const; + /// Get the sum of the \f$ p_T \f$ values of the constituent tracks. (caches) double ptSum() const; Modified: trunk/src/Jet.cc ============================================================================== --- trunk/src/Jet.cc Tue Jul 7 16:40:02 2009 (r1665) +++ trunk/src/Jet.cc Tue Jul 7 18:15:18 2009 (r1666) @@ -81,6 +81,18 @@ } + double Jet::hadronicEnergy() const { + double e_hadr = 0.0; + foreach (const Particle& p, particles()) { + const PdgId pid = p.pdgId(); + if (PID::isHadron(pid)) { + e_hadr += p.momentum().E(); + } + } + return e_hadr; + } + + bool Jet::containsCharm() const { foreach (const Particle& p, particles()) { HepMC::GenVertex* gv = p.genParticle().production_vertex();
More information about the Rivet-svn mailing list |