rivet is hosted by Hepforge, IPPP Durham
Rivet  2.7.0
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 
14  public:
15 
18  : FinalState(), _leading_only(false)
19  {
20  setName("LeadingParticlesFinalState");
21  addProjection(fsp, "FS");
22  }
23 
26 
29  _ids.insert(id);
30  return *this;
31  }
32 
35  _ids.insert(id);
36  _ids.insert(-id);
37  return *this;
38  }
39 
43  void setLeadingOnly(const bool& leadingonly) {
44  _leading_only = leadingonly;
45  }
46 
47  // /// Check if a particle of a particular ID was found in the current event
48  // bool hasParticleId(const PdgId pid) const;
49 
50  // /// Get a particle of a particular ID (check it exists first)
51  // bool get(const PdgId pid) const;
52 
53 
55  void project(const Event& e);
56 
58  int compare(const Projection& p) const;
59 
60 
61  private:
62 
64  bool inList(const Particle& particle) const;
65 
67  std::set<long>_ids;
68  bool _leading_only;
69 
70  };
71 
72 
73 }
74 
75 #endif
void setName(const std::string &name)
Used by derived classes to set their name.
Definition: Projection.hh:133
Definition: ALICE_2010_I880049.cc:13
void setLeadingOnly(const bool &leadingonly)
Definition: LeadingParticlesFinalState.hh:43
DEFAULT_RIVET_PROJ_CLONE(LeadingParticlesFinalState)
Clone on the heap.
void project(const Event &e)
Apply the projection on the supplied event.
Definition: LeadingParticlesFinalState.cc:27
Particle representation, either from a HepMC::GenEvent or reconstructed.
Definition: Particle.hh:18
Definition: Event.hh:22
LeadingParticlesFinalState & addParticleId(long id)
Add a particle ID to the list of leading particles selected.
Definition: LeadingParticlesFinalState.hh:28
Project out all final-state particles in an event. Probably the most important projection in Rivet! ...
Definition: FinalState.hh:12
LeadingParticlesFinalState & addParticleIdPair(long id)
Add a particle ID to the list of leading particles selected.
Definition: LeadingParticlesFinalState.hh:34
int compare(const Projection &p) const
Compare projections.
Definition: LeadingParticlesFinalState.cc:7
const PROJ & addProjection(const PROJ &proj, const std::string &name)
Register a contained projection (user-facing version)
Definition: ProjectionApplier.hh:170
Get the highest-pT occurrences of FS particles with the specified PDG IDs.
Definition: LeadingParticlesFinalState.hh:13
Base class for all Rivet projections.
Definition: Projection.hh:29
LeadingParticlesFinalState(const FinalState &fsp)
Constructor: the supplied FinalState projection is assumed to live through the run.
Definition: LeadingParticlesFinalState.hh:17