Rivet API documentation

Rivet 4.1.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
9namespace Rivet {
10
11
14 public:
15
18 : FinalState(), _leading_only(false) {
19 setName("LeadingParticlesFinalState");
20 declare(fsp, "FS");
21 }
22
25
27 using Projection::operator=;
28
29
32 _ids.insert(id);
33 return *this;
34 }
35
38 for (PdgId id : ids) _ids.insert(id);
39 return *this;
40 }
41
44 _ids.insert(id);
45 _ids.insert(-id);
46 return *this;
47 }
48
52 void setLeadingOnly(bool leadingonly) {
53 _leading_only = leadingonly;
54 }
55
56 // /// Check if a particle of a particular ID was found in the current event
57 // bool hasParticleId(const PdgId pid) const;
58
59 // /// Get a particle of a particular ID (check it exists first)
60 // bool get(const PdgId pid) const;
61
62
64 void project(const Event& e);
65
67 CmpState compare(const Projection& p) const;
68
69
70 protected:
71
73 std::set<long> _ids;
74 bool _leading_only;
75 };
76
77
78}
79
80#endif
Representation of a HepMC event, and enabler of Projection caching.
Definition Event.hh:22
FinalState(const Cut &c=Cuts::OPEN)
Construction using Cuts object.
LeadingParticlesFinalState(const FinalState &fsp)
Constructor: the supplied FinalState projection is assumed to live through the run.
Definition LeadingParticlesFinalState.hh:17
RIVET_DEFAULT_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:31
LeadingParticlesFinalState & addParticleIdPair(PdgId id)
Add a particle ID to the list of leading particles selected.
Definition LeadingParticlesFinalState.hh:43
LeadingParticlesFinalState & addParticleIds(vector< PdgId > ids)
Add a particle ID to the list of leading particles selected.
Definition LeadingParticlesFinalState.hh:37
void setLeadingOnly(bool leadingonly)
Definition LeadingParticlesFinalState.hh:52
void project(const Event &e)
Apply the projection on the supplied event.
const PROJ & declare(const PROJ &proj, const std::string &name) const
Register a contained projection (user-facing version).
Definition ProjectionApplier.hh:205
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:146
double p(const ParticleBase &p)
Unbound function access to p.
Definition ParticleBaseUtils.hh:819
Definition LHCbCommon.hh:9