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

| Rivet 3.1.9

JetFinder.hh
1// -*- C++ -*-
2#ifndef RIVET_JetFinder_HH
3#define RIVET_JetFinder_HH
4
5#include "Rivet/Projection.hh"
6#include "Rivet/Projections/FinalState.hh"
7#include "Rivet/Projections/VisibleFinalState.hh"
8#include "Rivet/Particle.hh"
9#include "Rivet/Jet.hh"
10
11namespace Rivet {
12
13
15 class JetFinder : public Projection {
16 public:
17
19 enum class Muons { NONE, DECAY, ALL };
20
22 enum class Invisibles { NONE, DECAY, ALL };
23
24
25
27 JetFinder(const FinalState& fs,
28 Muons usemuons = Muons::ALL,
29 Invisibles useinvis = Invisibles::NONE);
30
32 JetFinder() = default;
33
35 virtual unique_ptr<Projection> clone() const = 0;
36
38 virtual ~JetFinder() = default;
39
41 using Projection::operator =;
42
43
48
49
56 void useMuons(Muons usemuons = Muons::ALL) {
57 _useMuons = usemuons;
58 }
59
66 void useInvisibles(Invisibles useinvis = Invisibles::DECAY) {
67 _useInvisibles = useinvis;
68 }
69
71 DEPRECATED("make an explicit choice from Invisibles::{NONE,DECAY,ALL}. This boolean call does not allow for ALL")
72 void useInvisibles(bool useinvis) {
73 _useInvisibles = useinvis ? Invisibles::DECAY : Invisibles::NONE;
74 }
75
77
78
80
81
84 virtual Jets jets(const Cut& c=Cuts::open()) const {
85 return filter_select(_jets(), c);
86 }
87
90 virtual Jets jets(const JetSelector& selector) const {
91 return filter_select(_jets(), selector);
92 }
93
94
97 Jets jets(const Cut& c, const JetSorter& sorter) const {
99 return sortBy(jets(c), sorter);
100 }
101
104 Jets jets(const JetSorter& sorter, const Cut& c=Cuts::open()) const {
106 return jets(c, sorter);
107 }
108
111 Jets jets(const JetSelector& selector, const JetSorter& sorter) const {
113 return sortBy(jets(selector), sorter);
114 }
115
118 Jets jets(const JetSorter& sorter, const JetSelector selector) const {
119 return jets(selector, sorter);
120 }
121
122
128 Jets jetsByPt(const Cut& c=Cuts::open()) const {
129 return jets(c, cmpMomByPt);
130 }
131
137 Jets jetsByPt(const JetSelector& selector) const {
138 return jets(selector, cmpMomByPt);
139 }
140
147 Jets jetsByPt(double ptmin) const {
148 return jets(Cuts::pT >= ptmin, cmpMomByPt);
149 }
150
152
153
154 protected:
155
157 virtual Jets _jets() const = 0;
158
159
160 public:
161
163 size_t size() const { return jets().size(); }
165 size_t size(const Cut& c) const { return jets(c).size(); }
167 size_t size(const JetSelector& s) const { return jets(s).size(); }
168
170 bool empty() const { return size() == 0; }
172 bool empty(const Cut& c) const { return size(c) == 0; }
174 bool empty(const JetSelector& s) const { return size(s) == 0; }
175
177 virtual void reset() = 0;
178
179 typedef Jet entity_type;
180 typedef Jets collection_type;
181
183 collection_type entities() const { return jets(); }
184
185 // /// Do the calculation locally (no caching).
186 // virtual void calc(const Particles& constituents, const Particles& tagparticles=Particles()) = 0;
187
188
189 protected:
190
192 virtual void project(const Event& e) = 0;
193
195 virtual CmpState compare(const Projection& p) const = 0;
196
197
198 protected:
199
201 Muons _useMuons;
202
204 Invisibles _useInvisibles;
205
206
207 };
208
209
210}
211
212#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::JetFinder
Abstract base class for projections which can return a set of Jets.
Definition JetFinder.hh:15
Rivet::JetFinder::jetsByPt
Jets jetsByPt(const Cut &c=Cuts::open()) const
Definition JetFinder.hh:128
Rivet::JetFinder::Muons
Muons
Enum for the treatment of muons: whether to include all, some, or none in jet-finding.
Definition JetFinder.hh:19
Rivet::JetFinder::size
size_t size(const Cut &c) const
Count the jets after a Cut is applied.
Definition JetFinder.hh:165
Rivet::JetFinder::compare
virtual CmpState compare(const Projection &p) const =0
Compare projections.
Rivet::JetFinder::project
virtual void project(const Event &e)=0
Perform the projection on the Event.
Rivet::JetFinder::size
size_t size() const
Count the jets.
Definition JetFinder.hh:163
Rivet::JetFinder::size
size_t size(const JetSelector &s) const
Count the jets after a selection functor is applied.
Definition JetFinder.hh:167
Rivet::JetFinder::jets
Jets jets(const JetSelector &selector, const JetSorter &sorter) const
Definition JetFinder.hh:111
Rivet::JetFinder::jets
Jets jets(const Cut &c, const JetSorter &sorter) const
Definition JetFinder.hh:97
Rivet::JetFinder::jetsByPt
Jets jetsByPt(double ptmin) const
Definition JetFinder.hh:147
Rivet::JetFinder::jets
virtual Jets jets(const Cut &c=Cuts::open()) const
Definition JetFinder.hh:84
Rivet::JetFinder::jets
virtual Jets jets(const JetSelector &selector) const
Definition JetFinder.hh:90
Rivet::JetFinder::clone
virtual unique_ptr< Projection > clone() const =0
Clone on the heap.
Rivet::JetFinder::Invisibles
Invisibles
Enum for the treatment of invisible particles: whether to include all, some, or none in jet-finding.
Definition JetFinder.hh:22
Rivet::JetFinder::empty
bool empty(const JetSelector &s) const
Is this jet finder empty after a selection functor is applied?
Definition JetFinder.hh:174
Rivet::JetFinder::jets
Jets jets(const JetSorter &sorter, const JetSelector selector) const
Definition JetFinder.hh:118
Rivet::JetFinder::jetsByPt
Jets jetsByPt(const JetSelector &selector) const
Definition JetFinder.hh:137
Rivet::JetFinder::useInvisibles
void useInvisibles(Invisibles useinvis=Invisibles::DECAY)
Include (some) invisible particles in jet construction.
Definition JetFinder.hh:66
Rivet::JetFinder::jets
Jets jets(const JetSorter &sorter, const Cut &c=Cuts::open()) const
Definition JetFinder.hh:104
Rivet::JetFinder::~JetFinder
virtual ~JetFinder()=default
Destructor.
Rivet::JetFinder::reset
virtual void reset()=0
Clear the projection.
Rivet::JetFinder::empty
bool empty(const Cut &c) const
Is this jet finder empty after a Cut is applied?
Definition JetFinder.hh:172
Rivet::JetFinder::JetFinder
JetFinder(const FinalState &fs, Muons usemuons=Muons::ALL, Invisibles useinvis=Invisibles::NONE)
Constructor.
Rivet::JetFinder::entities
collection_type entities() const
Template-usable interface common to FinalState.
Definition JetFinder.hh:183
Rivet::JetFinder::useMuons
void useMuons(Muons usemuons=Muons::ALL)
Include (some) muons in jet construction.
Definition JetFinder.hh:56
Rivet::JetFinder::empty
bool empty() const
Is this jet finder empty?
Definition JetFinder.hh:170
Rivet::JetFinder::JetFinder
JetFinder()=default
Default constructor.
Rivet::Jet
Representation of a clustered jet of particles.
Definition Jet.hh:48
Rivet::Jets
Specialised vector of Jet objects.
Definition Jet.hh:23
Rivet::Projection
Base class for all Rivet projections.
Definition Projection.hh:29
Rivet::filter_select
Jets filter_select(const Jets &jets, const Cut &c)
Filter a jet collection in-place to the subset that passes the supplied Cut.
Definition JetUtils.hh:157
Rivet::JetSelector
function< bool(const Jet &)> JetSelector
std::function instantiation for functors taking a Jet and returning a bool
Definition JetUtils.hh:41
Rivet::JetSorter
function< bool(const Jet &, const Jet &)> JetSorter
std::function instantiation for functors taking two Jets and returning a bool
Definition JetUtils.hh:43
Rivet::sortBy
MOMS sortBy(const MOMS &pbs, const CMP &cmp)
Sort a container of momenta by cmp and return by value for const inputs.
Definition Vector4.hh:1451
Rivet::cmpMomByPt
bool cmpMomByPt(const FourMomentum &a, const FourMomentum &b)
Comparison to give a sorting by decreasing pT.
Definition Vector4.hh:1356
Rivet::Kin::p
double p(const ParticleBase &p)
Unbound function access to p.
Definition ParticleBaseUtils.hh:684
Rivet::Cuts::open
const Cut & open()
Fully open cut singleton, accepts everything.
Rivet
Definition MC_Cent_pPb.hh:10