Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-04-19 09:06:56

0001 // -*- C++ -*-
0002 #ifndef RIVET_DressedLepton_HH
0003 #define RIVET_DressedLepton_HH
0004 
0005 #include "Rivet/Particle.hh"
0006 #include "Rivet/Config/RivetCommon.hh"
0007 
0008 namespace Rivet {
0009 
0010 
0011   /// Accepted classes of lepton origin
0012   enum class LeptonOrigin { PROMPT=1, NODECAY=1, ALL };
0013 
0014   /// Reconstruction/dressing mode for leptons
0015   enum class LeptonReco { ALL=0, ALL_BARE=0,
0016               ALL_DRESSED=1,
0017               DIRECT_BARE=2, PROMPT_BARE=2,
0018               DIRECT_DRESSED=3, PROMPT_DRESSED=3 };
0019 
0020   /// The approach taken to photon dressing of leptons
0021   enum class DressingType { DR=0, CONE=0, CLUSTER=1, AKT=1 };
0022 
0023   /// Accepted classes of lepton origin
0024   enum class PhotonOrigin { NONE=0, PROMPT=1, NODECAY=1, ALL };
0025 
0026 
0027   /// @brief A charged lepton meta-particle created by clustering photons close to the bare lepton
0028   ///
0029   /// @deprecated Prefer to use Particle.constituents()
0030   class DressedLepton : public Particle {
0031   public:
0032 
0033     /// Copy constructor (from Particle)
0034     DressedLepton(const Particle& dlepton);
0035 
0036     /// @brief Components constructor
0037     ///
0038     /// @note This is not a copy constructor, hence the explicit second argument even if empty
0039     DressedLepton(const Particle& lepton, const Particles& photons, bool momsum=true);
0040 
0041     /// @brief Add a photon to the dressed lepton
0042     ///
0043     /// @todo Deprecate and override add/setConstituents instead?
0044     void addPhoton(const Particle& p, bool momsum=true);
0045 
0046     /// Retrieve the bare lepton
0047     const Particle& bareLepton() const;
0048 
0049     /// Retrieve the clustered photons
0050     const Particles photons() const { return slice(constituents(), 1); }
0051 
0052   };
0053 
0054 
0055   /// Alias for a list of dressed leptons, cf. Particles and Jets
0056   using DressedLeptons = vector<DressedLepton>;
0057 
0058   /// Generic sum function, adding @a fn(@c x) for all @c x in container @a c, starting with @a start
0059   template <typename T, typename FN = T(const ParticleBase&)>
0060   inline T sum(const DressedLeptons& c, FN&& fn, const T& start=T()) {
0061     auto f = std::function(std::forward<FN>(fn));
0062     T rtn = start;
0063     for (const auto& x : c) rtn += fn(x);
0064     return rtn;
0065   }
0066 
0067 
0068 
0069 }
0070 
0071 #endif