Rivet  1.8.3
LeadingParticlesFinalState.hh
1 // -*- C++ -*-
2 #ifndef RIVET_LeadingParticlesFinalState_HH
3 #define RIVET_LeadingParticlesFinalState_HH
4 
5 #include "Rivet/Event.hh"
6 #include "Rivet/Projection.hh"
7 #include "Rivet/Projections/FinalState.hh"
8 
9 namespace Rivet {
10 
11  class Particle;
12 
15 
16  public:
17 
20  : FinalState(), _leading_only(false)
21  {
22  setName("LeadingParticlesFinalState");
23  addProjection(fsp, "FS");
24  }
25 
27  virtual const Projection *clone() const {
28  return new LeadingParticlesFinalState(*this);
29  }
30 
33  _ids.insert(id);
34  return *this;
35  }
36 
39  _ids.insert(id);
40  _ids.insert(-id);
41  return *this;
42  }
43 
47  void setLeadingOnly(const bool& leadingonly) {
48  _leading_only = leadingonly;
49  }
50 
51  // /// Check if a particle of a particular ID was found in the current event
52  // bool hasParticleId(const PdgId pid) const;
53 
54  // /// Get a particle of a particular ID (check it exists first)
55  // bool get(const PdgId pid) const;
56 
57 
58  protected:
59 
61  void project(const Event& e);
62 
64  int compare(const Projection& p) const;
65 
67  bool inList(const Particle& particle) const;
68 
69  private:
70 
72  std::set<long>_ids;
73  bool _leading_only;
74 
75  };
76 
77 }
78 
79 #endif
void setName(const std::string &name)
Used by derived classes to set their name.
Definition: Projection.hh:120
Definition: MC_JetAnalysis.hh:9
void setLeadingOnly(const bool &leadingonly)
Definition: LeadingParticlesFinalState.hh:47
virtual const Projection * clone() const
Clone on the heap.
Definition: LeadingParticlesFinalState.hh:27
void project(const Event &e)
Apply the projection on the supplied event.
Definition: LeadingParticlesFinalState.cc:27
Representation of particles from a HepMC::GenEvent.
Definition: Particle.hh:16
Definition: Event.hh:22
bool inList(const Particle &particle) const
Check if the particle's ID is in the list.
Definition: LeadingParticlesFinalState.cc:78
int compare(const Projection &p) const
Compare projections.
Definition: LeadingParticlesFinalState.cc:7
LeadingParticlesFinalState & addParticleId(long id)
Add a particle ID to the list of leading particles selected.
Definition: LeadingParticlesFinalState.hh:32
Project out all final-state particles in an event. Probably the most important projection in Rivet! ...
Definition: FinalState.hh:14
LeadingParticlesFinalState & addParticleIdPair(long id)
Add a particle ID to the list of leading particles selected.
Definition: LeadingParticlesFinalState.hh:38
const PROJ & addProjection(const PROJ &proj, const std::string &name)
Definition: ProjectionApplier.hh:113
Get the highest-pT occurrences of FS particles with the specified PDG IDs.
Definition: LeadingParticlesFinalState.hh:14
Base class for all Rivet projections.
Definition: Projection.hh:28
LeadingParticlesFinalState(const FinalState &fsp)
Constructor: the supplied FinalState projection is assumed to live through the run.
Definition: LeadingParticlesFinalState.hh:19