Rivet  3.1.4
DressedLeptons.hh
1 // -*- C++ -*-
2 #ifndef RIVET_DressedLeptons_HH
3 #define RIVET_DressedLeptons_HH
4 
5 #include "Rivet/Projection.hh"
6 #include "Rivet/Projections/FinalState.hh"
7 #include "Rivet/Projections/IdentifiedFinalState.hh"
8 #include "Rivet/Config/RivetCommon.hh"
9 
10 namespace Rivet {
11 
12 
17  class DressedLepton : public Particle {
18  public:
19 
21  DressedLepton(const Particle& dlepton);
22 
25  DressedLepton(const Particle& lepton, const Particles& photons, bool momsum=true);
26 
29  void addPhoton(const Particle& p, bool momsum=true);
30 
32  const Particle& bareLepton() const;
35  const Particle& constituentLepton() const { return bareLepton(); }
36 
38  const Particles photons() const { return slice(constituents(), 1); }
41  const Particles constituentPhotons() const { return photons(); }
42 
43  };
44 
45 
56  class DressedLeptons : public FinalState {
57  public:
58 
69  DressedLeptons(const FinalState& barefs,
70  double dRmax, const Cut& cut=Cuts::open(),
71  bool useDecayPhotons=false,
72  bool useJetClustering=false);
73 
84  DressedLeptons(double dRmax, const Cut& cut=Cuts::open(),
85  bool useDecayPhotons=false,
86  bool useJetClustering=false)
87  : DressedLeptons(FinalState(), dRmax, cut, useDecayPhotons, useJetClustering)
88  { }
89 
105  DressedLeptons(const FinalState& photons, const FinalState& bareleptons,
106  double dRmax, const Cut& cut=Cuts::open(),
107  bool useDecayPhotons=false,
108  bool useJetClustering=false);
109 
110 
112  DEFAULT_RIVET_PROJ_CLONE(DressedLeptons);
113 
114 
117  vector<DressedLepton> dressedLeptons() const {
118  vector<DressedLepton> rtn;
119  for (const Particle& p : particles(cmpMomByPt))
120  rtn += DressedLepton(p); //static_cast<const DressedLepton>(p);
121  return rtn;
122  }
123 
126  vector<DressedLepton> dressedLeptons(const ParticleSorter& sorter) const {
127  vector<DressedLepton> rtn;
128  for (const Particle& p : particles(sorter))
129  rtn += DressedLepton(p); //static_cast<const DressedLepton>(p);
130  return rtn;
131  }
132 
133 
134  protected:
135 
137  void project(const Event& e);
138 
140  CmpState compare(const Projection& p) const;
141 
142 
143  private:
144 
146  double _dRmax;
147 
149  bool _fromDecay;
150 
152  bool _useJetClustering;
153 
154 
155  };
156 
157 
158 
159 }
160 
161 
162 #endif
Definition: MC_Cent_pPb.hh:10
void addPhoton(const Particle &p, bool momsum=true)
A charged lepton meta-particle created by clustering photons close to the bare lepton.
Definition: DressedLeptons.hh:17
bool cmpMomByPt(const FourMomentum &a, const FourMomentum &b)
Comparison to give a sorting by decreasing pT.
Definition: Vector4.hh:1342
vector< DressedLepton > dressedLeptons() const
Retrieve the dressed leptons.
Definition: DressedLeptons.hh:117
const Cut & open()
Fully open cut singleton, accepts everything.
Particle representation, either from a HepMC::GenEvent or reconstructed.
Definition: Particle.hh:18
const Particle & constituentLepton() const
Definition: DressedLeptons.hh:35
Cluster photons from a given FS to all charged particles (typically leptons)
Definition: DressedLeptons.hh:56
DressedLepton(const Particle &dlepton)
Copy constructor (from Particle)
const Particles & constituents() const
Direct constituents of this particle, returned by reference.
Definition: Particle.hh:250
const Particle & bareLepton() const
Retrieve the bare lepton.
Representation of a HepMC event, and enabler of Projection caching.
Definition: Event.hh:22
vector< DressedLepton > dressedLeptons(const ParticleSorter &sorter) const
Retrieve the dressed leptons ordered by supplied sorting functor.
Definition: DressedLeptons.hh:126
DressedLeptons(double dRmax, const Cut &cut=Cuts::open(), bool useDecayPhotons=false, bool useJetClustering=false)
Constructor with default input FinalState.
Definition: DressedLeptons.hh:84
const Particles constituentPhotons() const
Definition: DressedLeptons.hh:41
Project out all final-state particles in an event. Probably the most important projection in Rivet! ...
Definition: FinalState.hh:12
CONTAINER slice(const CONTAINER &c, int i, int j)
Slice of the container elements cf. Python&#39;s [i:j] syntax.
Definition: Utils.hh:572
const Particles photons() const
Retrieve the clustered photons.
Definition: DressedLeptons.hh:38
Base class for all Rivet projections.
Definition: Projection.hh:29
double p() const
Get the 3-momentum magnitude directly.
Definition: ParticleBase.hh:110