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)
23 inline PseudoJets mkPseudoJets(
const Jets& js) {
25 for (
const Jet& j : js)
31 Jets rtn; rtn.reserve(pjs.size());
32 for (
const PseudoJet& pj : pjs)
46 using JetSorter = function<bool(const Jet&, const Jet&)>;
51 virtual bool operator()(
const Jet& p)
const = 0;
58 BoolJetAND(
const std::vector<JetSelector>& sels) : selectors(sels) {}
61 bool operator()(
const Jet& j)
const {
62 for (
const JetSelector& sel : selectors)
if (!sel(j))
return false;
65 std::vector<JetSelector> selectors;
75 BoolJetOR(
const std::vector<JetSelector>& sels) : selectors(sels) {}
78 bool operator()(
const Jet& j)
const {
79 for (
const JetSelector& sel : selectors)
if (sel(j))
return true;
82 std::vector<JetSelector> selectors;
93 bool operator()(
const Jet& j)
const {
return !selector(j); }
107 bool operator() (
const Jet& j)
const {
return j.
bTagged(cut); }
117 bool operator() (
const Jet& j)
const {
return j.
cTagged(cut); }
127 bool operator() (
const Jet& j)
const {
return j.
tauTagged(cut); }
135 HasNoTag(
const Cut& c=
Cuts::open(),
bool quarktagsonly=
false) : cut(c), qtagsonly(quarktagsonly) {}
216 inline double sumPt(
const Jets& js) {
217 return sum(js, pT, 0.0);
224 inline Vector3 sumP3(
const Jets& js) {
Definition: MC_Cent_pPb.hh:10
Functor for or-combination of selector logic.
Definition: JetUtils.hh:74
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:160
function< bool(const Jet &)> JetSelector
std::function instantiation for functors taking a Jet and returning a bool
Definition: JetUtils.hh:44
C-tagging functor, with a tag selection cut as the stored state.
Definition: JetUtils.hh:114
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:104
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:191
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:134
Jets & ifilterBy(Jets &jets, const Cut &c)
Definition: JetUtils.hh:154
Jets discard(const Jets &jets, const Cut &c)
New alias for filter_discard.
Definition: JetUtils.hh:196
CONTAINER::value_type sum(const CONTAINER &c)
Generic sum function, adding x for all x in container c.
Definition: Utils.hh:422
Jets select(const Jets &jets, const Cut &c)
New alias for filter_select.
Definition: JetUtils.hh:168
function< bool(const Jet &, const Jet &)> JetSorter
std::function instantiation for functors taking two Jets and returning a bool
Definition: JetUtils.hh:46
Functor for and-combination of selector logic.
Definition: JetUtils.hh:57
std::vector< PseudoJet > PseudoJets
Definition: RivetFastJet.hh:29
Base type for Jet -> bool functors.
Definition: JetUtils.hh:50
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:124
Representation of a clustered jet of particles.
Definition: Jet.hh:18
Three-dimensional specialisation of Vector.
Definition: Vector3.hh:26
Jets & iselect(Jets &jets, const Cut &c)
New alias for ifilter_select.
Definition: JetUtils.hh:156
Jets filterBy(const Jets &jets, const Cut &c)
Definition: JetUtils.hh:166
Specialized version of the FourVector with momentum/energy functionality.
Definition: Vector4.hh:301
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:187
Functor for inverting selector logic.
Definition: JetUtils.hh:91