1#ifndef RIVET_JETUTILS_HH
2#define RIVET_JETUTILS_HH
5#include "Rivet/Tools/ParticleBaseUtils.hh"
16 inline PseudoJets mkPseudoJets(
const Particles& ps) {
18 for (
const Particle&
p : ps) rtn.push_back(
p.pseudojet());
22 inline PseudoJets mkPseudoJets(
const Jets& js) {
24 for (
const Jet& j : js) rtn.push_back(j.pseudojet());
29 Jets rtn; rtn.reserve(pjs.size());
30 for (
const PseudoJet& pj : pjs) rtn.push_back(pj);
48 virtual bool operator()(
const Jet&
p)
const = 0;
55 BoolJetAND(
const std::vector<JetSelector>& sels) : selectors(sels) {}
58 bool operator()(
const Jet& j)
const {
59 for (
const JetSelector& sel : selectors)
if (!sel(j))
return false;
62 std::vector<JetSelector> selectors;
72 BoolJetOR(
const std::vector<JetSelector>& sels) : selectors(sels) {}
75 bool operator()(
const Jet& j)
const {
76 for (
const JetSelector& sel : selectors)
if (sel(j))
return true;
79 std::vector<JetSelector> selectors;
90 bool operator()(
const Jet& j)
const {
return !selector(j); }
104 bool operator() (
const Jet& j)
const {
return j.
bTagged(cut); }
114 bool operator() (
const Jet& j)
const {
return j.
cTagged(cut); }
124 bool operator() (
const Jet& j)
const {
return j.
tauTagged(cut); }
132 HasNoTag(
const Cut& c=
Cuts::open(),
bool quarktagsonly=
false) : cut(c), qtagsonly(quarktagsonly) {}
213 inline double sumPt(
const Jets& js) {
214 return sum(js,
pT, 0.0);
217 inline FourMomentum sumP4(
const Jets& js) {
218 return sum(js,
p4, FourMomentum());
221 inline Vector3 sumP3(
const Jets& js) {
222 return sum(js,
p3, Vector3());
Representation of a clustered jet of particles.
Definition Jet.hh:48
bool cTagged(const Cut &c=Cuts::open()) const
Does this jet have at least one c-tag (that passes an optional Cut)?
Definition Jet.hh:153
bool bTagged(const Cut &c=Cuts::open()) const
Does this jet have at least one b-tag (that passes an optional Cut)?
Definition Jet.hh:140
bool tauTagged(const Cut &c=Cuts::open()) const
Does this jet have at least one tau-tag (that passes an optional Cut)?
Definition Jet.hh:166
Specialised vector of Jet objects.
Definition Jet.hh:23
CONTAINER::value_type sum(const CONTAINER &c)
Generic sum function, adding x for all x in container c.
Definition Utils.hh:436
Jets & idiscard(Jets &jets, const Cut &c)
New alias for ifilter_discard.
Definition JetUtils.hh:184
Jets select(const Jets &jets, const Cut &c)
New alias for filter_select.
Definition JetUtils.hh:165
Jets & iselect(Jets &jets, const Cut &c)
New alias for ifilter_select.
Definition JetUtils.hh:153
Jets filterBy(const Jets &jets, const Cut &c)
Definition JetUtils.hh:163
Jets filter_discard(const Jets &jets, const Cut &c)
Filter a jet collection in-place to the subset that fails the supplied Cut.
Definition JetUtils.hh:188
Jets discard(const Jets &jets, const Cut &c)
New alias for filter_discard.
Definition JetUtils.hh:193
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
Jets & ifilter_select(Jets &jets, const Cut &c)
Filter a jet collection in-place to the subset that passes the supplied Cut.
Jets & ifilter_discard(Jets &jets, const Cut &c)
Filter a jet collection in-place to the subset that fails the supplied Cut.
Jets & ifilterBy(Jets &jets, const Cut &c)
Definition JetUtils.hh:151
function< bool(const Jet &)> JetSelector
std::function instantiation for functors taking a Jet and returning a bool
Definition JetUtils.hh:41
function< bool(const Jet &, const Jet &)> JetSorter
std::function instantiation for functors taking two Jets and returning a bool
Definition JetUtils.hh:43
double pT(const ParticleBase &p)
Unbound function access to pT.
Definition ParticleBaseUtils.hh:687
FourMomentum p4(const ParticleBase &p)
Unbound function access to momentum.
Definition ParticleBaseUtils.hh:675
Vector3 p3(const ParticleBase &p)
Unbound function access to p3.
Definition ParticleBaseUtils.hh:678
double p(const ParticleBase &p)
Unbound function access to p.
Definition ParticleBaseUtils.hh:684
const Cut & open()
Fully open cut singleton, accepts everything.
Definition MC_Cent_pPb.hh:10
Cut operator!(const Cut &cptr)
Logical NOT operation on a cut.
Cut operator&&(const Cut &aptr, const Cut &bptr)
std::vector< PseudoJet > PseudoJets
Definition RivetFastJet.hh:30
Cut operator||(const Cut &aptr, const Cut &bptr)
Functor for and-combination of selector logic.
Definition JetUtils.hh:54
Base type for Jet -> bool functors.
Definition JetUtils.hh:47
Functor for inverting selector logic.
Definition JetUtils.hh:88
Functor for or-combination of selector logic.
Definition JetUtils.hh:71
B-tagging functor, with a tag selection cut as the stored state.
Definition JetUtils.hh:101
C-tagging functor, with a tag selection cut as the stored state.
Definition JetUtils.hh:111
Anti-B/C-tagging functor, with a tag selection cut as the stored state.
Definition JetUtils.hh:131
Tau-tagging functor, with a tag selection cut as the stored state.
Definition JetUtils.hh:121