Rivet  1.8.3
LeptonClusters.hh
1 // -*- C++ -*-
2 #ifndef RIVET_LeptonClusters_HH
3 #define RIVET_LeptonClusters_HH
4 
5 #include "Rivet/Tools/Logging.hh"
6 #include "Rivet/Rivet.hh"
7 #include "Rivet/Particle.hh"
8 #include "Rivet/Event.hh"
9 #include "Rivet/Projection.hh"
10 #include "Rivet/Projections/FinalState.hh"
11 #include "Rivet/Projections/IdentifiedFinalState.hh"
12 
13 namespace Rivet {
14 
15 
16  class ClusteredLepton : public Particle {
17  public:
18 
19  ClusteredLepton(Particle lepton) :
20  Particle(lepton.pdgId(), lepton.momentum()),
21  _constituentLepton(lepton) {}
22 
23  void addPhoton(const Particle& p, bool cluster) {
24  _constituentPhotons.push_back(p);
25  if (cluster) setMomentum(momentum() + p.momentum());
26  }
27 
28  const Particle& constituentLepton() const { return _constituentLepton; }
29  const ParticleVector& constituentPhotons() const { return _constituentPhotons; }
30 
31  private:
32 
33  ParticleVector _constituentPhotons;
34  Particle _constituentLepton;
35  };
36 
37 
42  class LeptonClusters : public FinalState {
43 
44  public:
45 
46  LeptonClusters(const FinalState& photons, const FinalState& signal,
47  double dRmax, bool cluster,
48  const std::vector<std::pair<double, double> >& etaRanges,
49  double pTmin);
50 
51  virtual const Projection* clone() const {
52  return new LeptonClusters(*this);
53  }
54 
55  const vector<ClusteredLepton>& clusteredLeptons() const { return _clusteredLeptons; }
56 
57  protected:
58 
60  void project(const Event& e);
61 
63  int compare(const Projection& p) const;
64 
65  private:
66 
68  double _dRmax;
70  bool _cluster;
71 
73  vector<ClusteredLepton> _clusteredLeptons;
74  };
75 
76 
77 
78 
79 }
80 
81 
82 #endif
const FourMomentum & momentum() const
The momentum of this Particle.
Definition: Particle.hh:68
Projection()
The default constructor.
Definition: Projection.cc:10
int compare(const Projection &p) const
Compare projections.
Definition: LeptonClusters.cc:26
Definition: LeptonClusters.hh:16
virtual const Projection * clone() const
Clone on the heap.
Definition: LeptonClusters.hh:51
Representation of particles from a HepMC::GenEvent.
Definition: Particle.hh:16
Cluster photons from a given FS to all charged particles (typically leptons) from signal and store th...
Definition: LeptonClusters.hh:42
PdgId pdgId() const
The PDG ID code for this Particle.
Definition: Particle.hh:56
friend class Event
Event is a friend.
Definition: Projection.hh:33
Project out all final-state particles in an event. Probably the most important projection in Rivet! ...
Definition: FinalState.hh:14
Particle()
Definition: Particle.hh:21
std::vector< Particle > ParticleVector
Typedef for a vector of Particle objects.
Definition: Particle.fhh:14
Particle & setMomentum(const FourMomentum &momentum)
Set the momentum of this Particle.
Definition: Particle.hh:62
Base class for all Rivet projections.
Definition: Projection.hh:28
void project(const Event &e)
Apply the projection on the supplied event.
Definition: LeptonClusters.cc:42