|
[Rivet-svn] r1651 - in trunk: . include/Rivet srcblackhole at projects.hepforge.org blackhole at projects.hepforge.orgThu Jul 2 11:08:31 BST 2009
Author: buckley Date: Thu Jul 2 11:08:30 2009 New Revision: 1651 Log: Adding Jet::neutralEnergy() for use in STAR UE analysis (among others) Modified: trunk/ChangeLog trunk/include/Rivet/Jet.hh trunk/src/Jet.cc Modified: trunk/ChangeLog ============================================================================== --- trunk/ChangeLog Thu Jul 2 11:06:45 2009 (r1650) +++ trunk/ChangeLog Thu Jul 2 11:08:30 2009 (r1651) @@ -1,3 +1,8 @@ +2009-07-02 Andy Buckley <andy at insectnation.org> + + * Adding Jet::neutralEnergy() (and Jet::totalEnergy() for + convenience/symmetry). + 2009-06-25 Andy Buckley <andy at insectnation.org> * Tidying and small efficiency improvements in CDF_2008_S7541902 Modified: trunk/include/Rivet/Jet.hh ============================================================================== --- trunk/include/Rivet/Jet.hh Thu Jul 2 11:06:45 2009 (r1650) +++ trunk/include/Rivet/Jet.hh Thu Jul 2 11:08:30 2009 (r1651) @@ -114,7 +114,14 @@ FourMomentum& momentum(); + public: + + /// Get the total energy of this jet. + double totalEnergy() const; + + /// Get the energy carried in this jet by neutral particles. + double neutralEnergy() 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 Thu Jul 2 11:06:45 2009 (r1650) +++ trunk/src/Jet.cc Thu Jul 2 11:08:30 2009 (r1651) @@ -64,6 +64,23 @@ /// @todo Jet::containsMatch(Matcher m) { ... if m(pid) return true; ... } + double Jet::totalEnergy() const { + return momentum().E(); + } + + + double Jet::neutralEnergy() const { + double e_neutral = 0.0; + foreach (const Particle& p, particles()) { + const PdgId pid = p.pdgId(); + if (PID::threeCharge(pid) == 0) { + e_neutral += p.momentum().E(); + } + } + return e_neutral; + } + + bool Jet::containsCharm() const { foreach (const Particle& p, particles()) { HepMC::GenVertex* gv = p.genParticle().production_vertex();
More information about the Rivet-svn mailing list |