Rivet: /Users/chrisg/software/rivet/include/Rivet/Projections/LeadingParticlesFinalState.hh Source File

| Rivet 3.1.9

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