1 #ifndef RIVET_JETUTILS_HH 2 #define RIVET_JETUTILS_HH 4 #include "Rivet/Jet.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);
43 using JetSorter = function<bool(const Jet&, const Jet&)>;
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);
221 inline Vector3 sumP3(
const Jets& js) {
Definition: MC_Cent_pPb.hh:10
Functor for or-combination of selector logic.
Definition: JetUtils.hh:71
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:110
Cut operator!(const Cut &cptr)
Logical NOT operation on a cut.
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
function< bool(const Jet &)> JetSelector
std::function instantiation for functors taking a Jet and returning a bool
Definition: JetUtils.hh:41
C-tagging functor, with a tag selection cut as the stored state.
Definition: JetUtils.hh:111
const Cut & open()
Fully open cut singleton, accepts everything.
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:136
B-tagging functor, with a tag selection cut as the stored state.
Definition: JetUtils.hh:101
Cut operator||(const Cut &aptr, const Cut &bptr)
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
Cut operator&&(const Cut &aptr, const Cut &bptr)
Anti-B/C-tagging functor, with a tag selection cut as the stored state.
Definition: JetUtils.hh:131
Jets & ifilterBy(Jets &jets, const Cut &c)
Definition: JetUtils.hh:151
Jets discard(const Jets &jets, const Cut &c)
New alias for filter_discard.
Definition: JetUtils.hh:193
CONTAINER::value_type sum(const CONTAINER &c)
Generic sum function, adding x for all x in container c.
Definition: Utils.hh:434
Jets select(const Jets &jets, const Cut &c)
New alias for filter_select.
Definition: JetUtils.hh:165
function< bool(const Jet &, const Jet &)> JetSorter
std::function instantiation for functors taking two Jets and returning a bool
Definition: JetUtils.hh:43
Functor for and-combination of selector logic.
Definition: JetUtils.hh:54
std::vector< PseudoJet > PseudoJets
Definition: RivetFastJet.hh:29
Base type for Jet -> bool functors.
Definition: JetUtils.hh:47
Jets & ifilter_select(Jets &jets, const Cut &c)
Filter a jet collection in-place to the subset that passes the supplied Cut.
Tau-tagging functor, with a tag selection cut as the stored state.
Definition: JetUtils.hh:121
Representation of a clustered jet of particles.
Definition: Jet.hh:18
Three-dimensional specialisation of Vector.
Definition: Vector3.hh:28
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
Specialized version of the FourVector with momentum/energy functionality.
Definition: Vector4.hh:306
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:123
Jets & ifilter_discard(Jets &jets, const Cut &c)
Filter a jet collection in-place to the subset that fails the supplied Cut.
Jets & idiscard(Jets &jets, const Cut &c)
New alias for ifilter_discard.
Definition: JetUtils.hh:184
Functor for inverting selector logic.
Definition: JetUtils.hh:88