rivet is hosted by Hepforge, IPPP Durham
Jet.hh
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #ifndef RIVET_Jet_HH
00003 #define RIVET_Jet_HH
00004 
00005 #include "Rivet/Config/RivetCommon.hh"
00006 #include "Rivet/Jet.fhh"
00007 #include "Rivet/Particle.hh"
00008 #include "fastjet/PseudoJet.hh"
00009 #include <numeric>
00010 
00011 namespace Rivet {
00012 
00013 
00014   /// @brief Representation of a clustered jet of particles.
00015   class Jet : public ParticleBase {
00016   public:
00017 
00018     /// @name Constructors
00019     //@{
00020 
00021     Jet() : ParticleBase() { clear(); }
00022 
00023     /// Set all the jet data, with full particle information.
00024     Jet(const vector<Particle>& particles, const FourMomentum& pjet)
00025       : ParticleBase() {
00026       setState(particles, pjet);
00027     }
00028 
00029     /// @todo Add a constructor from PseudoJet
00030     // operator Jet(const PseudoJet&) { ... }
00031 
00032     //@}
00033 
00034 
00035     /// @name Access jet constituents
00036     //@{
00037 
00038     /// Number of particles in this jet.
00039     size_t size() const { return _particles.size(); }
00040 
00041     /// Get the particles in this jet.
00042     vector<Particle>& particles() { return _particles; }
00043 
00044     /// Get the particles in this jet (const version)
00045     const vector<Particle>& particles() const { return _particles; }
00046 
00047     /// Check whether this jet contains a particular particle.
00048     bool containsParticle(const Particle& particle) const;
00049 
00050     /// Check whether this jet contains a certain particle type.
00051     bool containsParticleId(PdgId pid) const;
00052 
00053     /// Check whether this jet contains at least one of certain particle types.
00054     bool containsParticleId(const vector<PdgId>& pids) const;
00055 
00056     /// Check whether this jet contains a charm-flavoured hadron (or decay products from one).
00057     bool containsCharm() const;
00058 
00059     /// Check whether this jet contains a bottom-flavoured hadron (or decay products from one).
00060     bool containsBottom() const;
00061 
00062     //@}
00063 
00064 
00065     /// @name Access additional effective jet 4-vector properties
00066     //@{
00067 
00068     /// Get equivalent single momentum four-vector.
00069     const FourMomentum& momentum() const { return _momentum; }
00070 
00071     /// Get the total energy of this jet.
00072     double totalEnergy() const { return momentum().E(); }
00073 
00074     /// Get the energy carried in this jet by neutral particles.
00075     double neutralEnergy() const;
00076 
00077     /// Get the energy carried in this jet by hadrons.
00078     double hadronicEnergy() const;
00079 
00080     //@}
00081 
00082 
00083     // /// @name Interaction with FastJet
00084     // //@{
00085 
00086     // /// @todo Add a cast operator to FJ3 PseudoJet
00087     // operator const PseudoJet& () const { return pseudojet(); }
00088 
00089     // /// @todo Add a cast operator to FJ3 PseudoJet
00090     // const PseudoJet& pseudojet() const { return _pseudojet; }
00091 
00092     // //@}
00093 
00094 
00095     /// @name Set the jet constituents and properties
00096     //@{
00097 
00098     /// Set all the jet data, with full particle information.
00099     Jet& setState(const vector<Particle>& particles, const FourMomentum& pjet);
00100 
00101     /// Set the effective 4-momentum of the jet.
00102     Jet& setMomentum(const FourMomentum& momentum);
00103 
00104     /// Set the particles collection with full particle information.
00105     Jet& setParticles(const vector<Particle>& particles);
00106 
00107     /// Reset this jet as empty.
00108     Jet& clear();
00109 
00110     //@}
00111 
00112 
00113   private:
00114 
00115     /// @todo Add a FJ3 PseudoJet member to unify PseudoJet and Jet
00116     // PseudoJet _pseudojet;
00117 
00118     /// Full particle information including tracks, ID etc. (caching PseudoJet properties)
00119     Particles _particles;
00120 
00121     /// Effective jet 4-vector (caching PseudoJet properties)
00122     FourMomentum _momentum;
00123 
00124   };
00125 
00126 
00127 }
00128 
00129 #endif