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 class ClusteredLepton : public Particle { 00016 00017 public: 00018 ClusteredLepton(Particle lepton) : 00019 Particle(lepton.pdgId(), lepton.momentum()), 00020 _constituentLepton(lepton) {} 00021 00022 void addPhoton(const Particle& p, bool cluster) { 00023 _constituentPhotons.push_back(p); 00024 if (cluster) setMomentum(momentum()+p.momentum()); 00025 } 00026 00027 const Particle& constituentLepton() const { return _constituentLepton; } 00028 const ParticleVector& constituentPhotons() const { return _constituentPhotons; } 00029 00030 private: 00031 ParticleVector _constituentPhotons; 00032 Particle _constituentLepton; 00033 }; 00034 00035 00036 /// @brief Cluster photons from a given FS to all charged particles (typically 00037 /// leptons) from signal and store the original charged particles and photons 00038 /// as particles() while the newly created clustered lepton objects are 00039 /// accessible as clusteredLeptons() 00040 /// @brief Use LeptonClustersConstituents projection to cluster all photons to 00041 /// leptons. This projection here makes the clustered objects available 00042 /// in a FinalState manner, i.e. as particles(). The given pT and eta cuts are 00043 /// applied to those objects. The underlying (original) leptons and photons 00044 /// are available by means of the constituentsFinalState() method. 00045 class LeptonClusters : public FinalState { 00046 00047 public: 00048 00049 LeptonClusters(const FinalState& photons, const FinalState& signal, 00050 double dRmax, bool cluster, 00051 const std::vector<std::pair<double, double> >& etaRanges, 00052 double pTmin); 00053 00054 virtual const Projection* clone() const { 00055 return new LeptonClusters(*this); 00056 } 00057 00058 const vector<ClusteredLepton>& clusteredLeptons() const { return _clusteredLeptons; } 00059 00060 protected: 00061 00062 /// Apply the projection on the supplied event. 00063 void project(const Event& e); 00064 00065 /// Compare projections. 00066 int compare(const Projection& p) const; 00067 00068 private: 00069 00070 /// maximum cone radius to find photons in 00071 double _dRmax; 00072 /// whether to actually add the photon momenta to clusteredLeptons 00073 bool _cluster; 00074 00075 /// container which stores the clustered lepton objects 00076 vector<ClusteredLepton> _clusteredLeptons; 00077 }; 00078 00079 00080 00081 00082 } 00083 00084 00085 #endif