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   /// @brief Use LeptonClustersConstituents projection to cluster all photons to
00043   /// leptons. This projection here makes the clustered objects available
00044   /// in a FinalState manner, i.e. as particles(). The given pT and eta cuts are
00045   /// applied to those objects. The underlying (original) leptons and photons
00046   /// are available by means of the constituentsFinalState() method.
00047   class LeptonClusters : public FinalState {
00048 
00049   public:
00050 
00051     LeptonClusters(const FinalState& photons, const FinalState& signal,
00052                    double dRmax, bool cluster,
00053                    const std::vector<std::pair<double, double> >& etaRanges,
00054                    double pTmin);
00055 
00056     virtual const Projection* clone() const {
00057       return new LeptonClusters(*this);
00058     }
00059 
00060     const vector<ClusteredLepton>& clusteredLeptons() const { return _clusteredLeptons; }
00061 
00062   protected:
00063 
00064     /// Apply the projection on the supplied event.
00065     void project(const Event& e);
00066 
00067     /// Compare projections.
00068     int compare(const Projection& p) const;
00069 
00070   private:
00071 
00072     /// Maximum cone radius to find photons in
00073     double _dRmax;
00074     /// Whether to actually add the photon momenta to clusteredLeptons
00075     bool _cluster;
00076 
00077     /// Container which stores the clustered lepton objects
00078     vector<ClusteredLepton> _clusteredLeptons;
00079   };
00080 
00081 
00082 
00083 
00084 }
00085 
00086 
00087 #endif