rivet is hosted by Hepforge, IPPP Durham
Rivet 3.1.6
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
9namespace Rivet {
10
11
14 public:
15
18 : FinalState(), _leading_only(false)
19 {
20 setName("LeadingParticlesFinalState");
21 declare(fsp, "FS");
22 }
23
26
27
30 _ids.insert(id);
31 return *this;
32 }
33
36 for (PdgId id : ids) _ids.insert(id);
37 return *this;
38 }
39
42 _ids.insert(id);
43 _ids.insert(-id);
44 return *this;
45 }
46
50 void setLeadingOnly(bool leadingonly) {
51 _leading_only = leadingonly;
52 }
53
54 // /// Check if a particle of a particular ID was found in the current event
55 // bool hasParticleId(const PdgId pid) const;
56
57 // /// Get a particle of a particular ID (check it exists first)
58 // bool get(const PdgId pid) const;
59
60
62 void project(const Event& e);
63
65 CmpState compare(const Projection& p) const;
66
67 private:
68
70 std::set<long>_ids;
71 bool _leading_only;
72
73 };
74
75
76}
77
78#endif
Representation of a HepMC event, and enabler of Projection caching.
Definition: Event.hh:22
Project out all final-state particles in an event. Probably the most important projection in Rivet!
Definition: FinalState.hh:12
Get the highest-pT occurrences of FS particles with the specified PDG IDs.
Definition: LeadingParticlesFinalState.hh:13
LeadingParticlesFinalState(const FinalState &fsp)
Constructor: the supplied FinalState projection is assumed to live through the run.
Definition: LeadingParticlesFinalState.hh:17
DEFAULT_RIVET_PROJ_CLONE(LeadingParticlesFinalState)
Clone on the heap.
CmpState compare(const Projection &p) const
Compare projections.
LeadingParticlesFinalState & addParticleId(PdgId id)
Add a particle ID to the list of leading particles selected.
Definition: LeadingParticlesFinalState.hh:29
LeadingParticlesFinalState & addParticleIdPair(PdgId id)
Add a particle ID to the list of leading particles selected.
Definition: LeadingParticlesFinalState.hh:41
LeadingParticlesFinalState & addParticleIds(vector< PdgId > ids)
Add a particle ID to the list of leading particles selected.
Definition: LeadingParticlesFinalState.hh:35
void setLeadingOnly(bool leadingonly)
Definition: LeadingParticlesFinalState.hh:50
void project(const Event &e)
Apply the projection on the supplied event.
const PROJ & declare(const PROJ &proj, const std::string &name)
Register a contained projection (user-facing version)
Definition: ProjectionApplier.hh:170
Base class for all Rivet projections.
Definition: Projection.hh:29
void setName(const std::string &name)
Used by derived classes to set their name.
Definition: Projection.hh:142
double p(const ParticleBase &p)
Unbound function access to p.
Definition: ParticleBaseUtils.hh:653
Definition: MC_Cent_pPb.hh:10