rivet is hosted by Hepforge, IPPP Durham
LeptonClusters.hh
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #ifndef RIVET_LeptonClusters_HH
00003 #define RIVET_LeptonClusters_HH
00004 
00005 #include "Rivet/Tools/Logging.hh"
00006 #include "Rivet/Rivet.hh"
00007 #include "Rivet/Particle.hh"
00008 #include "Rivet/Event.hh"
00009 #include "Rivet/Projection.hh"
00010 #include "Rivet/Projections/FinalState.hh"
00011 #include "Rivet/Projections/IdentifiedFinalState.hh"
00012 
00013 namespace Rivet {
00014 
00015 
00016   class ClusteredLepton : public Particle {
00017   public:
00018 
00019     ClusteredLepton(Particle lepton) :
00020       Particle(lepton.pdgId(), lepton.momentum()),
00021       _constituentLepton(lepton) {}
00022 
00023     void addPhoton(const Particle& p, bool cluster) {
00024       _constituentPhotons.push_back(p);
00025       if (cluster) setMomentum(momentum() + p.momentum());
00026     }
00027 
00028     const Particle& constituentLepton() const { return _constituentLepton; }
00029     const ParticleVector& constituentPhotons() const { return _constituentPhotons; }
00030 
00031   private:
00032 
00033     ParticleVector _constituentPhotons;
00034     Particle _constituentLepton;
00035   };
00036 
00037 
00038   /// @brief Cluster photons from a given FS to all charged particles (typically
00039   /// leptons) from signal and store the original charged particles and photons
00040   /// as particles() while the newly created clustered lepton objects are
00041   /// accessible as clusteredLeptons()
00042   class LeptonClusters : public FinalState {
00043 
00044   public:
00045 
00046     LeptonClusters(const FinalState& photons, const FinalState& signal,
00047                    double dRmax, bool cluster,
00048                    const std::vector<std::pair<double, double> >& etaRanges,
00049                    double pTmin);
00050 
00051     virtual const Projection* clone() const {
00052       return new LeptonClusters(*this);
00053     }
00054 
00055     const vector<ClusteredLepton>& clusteredLeptons() const { return _clusteredLeptons; }
00056 
00057   protected:
00058 
00059     /// Apply the projection on the supplied event.
00060     void project(const Event& e);
00061 
00062     /// Compare projections.
00063     int compare(const Projection& p) const;
00064 
00065   private:
00066 
00067     /// Maximum cone radius to find photons in
00068     double _dRmax;
00069     /// Whether to actually add the photon momenta to clusteredLeptons
00070     bool _cluster;
00071 
00072     /// Container which stores the clustered lepton objects
00073     vector<ClusteredLepton> _clusteredLeptons;
00074   };
00075 
00076 
00077 
00078 
00079 }
00080 
00081 
00082 #endif