2 #ifndef RIVET_JetAlg_HH
3 #define RIVET_JetAlg_HH
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"
14 inline bool cmpMomByPt(
const FourMomentum& a,
const FourMomentum& b) {
15 return a.pT() > b.pT();
17 inline bool cmpMomByAscPt(
const FourMomentum& a,
const FourMomentum& b) {
18 return a.pT() < b.pT();
20 inline bool cmpMomByP(
const FourMomentum& a,
const FourMomentum& b) {
21 return a.vector3().mod() > b.vector3().mod();
23 inline bool cmpMomByAscP(
const FourMomentum& a,
const FourMomentum& b) {
24 return a.vector3().mod() < b.vector3().mod();
26 inline bool cmpMomByEt(
const FourMomentum& a,
const FourMomentum& b) {
27 return a.Et() > b.Et();
29 inline bool cmpMomByAscEt(
const FourMomentum& a,
const FourMomentum& b) {
30 return a.Et() < b.Et();
32 inline bool cmpMomByE(
const FourMomentum& a,
const FourMomentum& b) {
35 inline bool cmpMomByAscE(
const FourMomentum& a,
const FourMomentum& b) {
38 inline bool cmpMomByDescPseudorapidity(
const FourMomentum& a,
const FourMomentum& b) {
39 return a.pseudorapidity() > b.pseudorapidity();
41 inline bool cmpMomByAscPseudorapidity(
const FourMomentum& a,
const FourMomentum& b) {
42 return a.pseudorapidity() < b.pseudorapidity();
44 inline bool cmpMomByDescAbsPseudorapidity(
const FourMomentum& a,
const FourMomentum& b) {
45 return fabs(a.pseudorapidity()) > fabs(b.pseudorapidity());
47 inline bool cmpMomByAscAbsPseudorapidity(
const FourMomentum& a,
const FourMomentum& b) {
48 return fabs(a.pseudorapidity()) < fabs(b.pseudorapidity());
50 inline bool cmpMomByDescRapidity(
const FourMomentum& a,
const FourMomentum& b) {
51 return a.rapidity() > b.rapidity();
53 inline bool cmpMomByAscRapidity(
const FourMomentum& a,
const FourMomentum& b) {
54 return a.rapidity() < b.rapidity();
56 inline bool cmpMomByDescAbsRapidity(
const FourMomentum& a,
const FourMomentum& b) {
57 return fabs(a.rapidity()) > fabs(b.rapidity());
59 inline bool cmpMomByAscAbsRapidity(
const FourMomentum& a,
const FourMomentum& b) {
60 return fabs(a.rapidity()) < fabs(b.rapidity());
86 _useInvisibles = useinvis;
91 virtual Jets jets(
double ptmin=0.0,
double ptmax=MAXDOUBLE,
92 double rapmin=-MAXDOUBLE,
double rapmax=MAXDOUBLE,
93 RapScheme rapscheme=PSEUDORAPIDITY)
const {
94 const Jets rawjets = _jets(ptmin);
96 MSG_DEBUG(
"Raw jet size (with pTmin cut = " << ptmin/GeV <<
"GeV) = " << rawjets.size());
97 foreach (
const Jet& j, rawjets) {
99 if (!
inRange(pj.
pT(), ptmin, ptmax))
continue;
100 if (rapscheme == PSEUDORAPIDITY && !
inRange(pj.
eta(), rapmin, rapmax))
continue;
101 if (rapscheme == RAPIDITY && !
inRange(pj.
rapidity(), rapmin, rapmax))
continue;
109 template <
typename F>
111 double rapmin,
double rapmax,
113 Jets js =
jets(ptmin, ptmax, rapmin, rapmax, rapscheme);
115 std::sort(js.begin(), js.end(), sorter);
123 double rapmin=-MAXDOUBLE,
double rapmax=MAXDOUBLE,
124 RapScheme rapscheme=PSEUDORAPIDITY)
const {
131 double rapmin=-MAXDOUBLE,
double rapmax=MAXDOUBLE,
132 RapScheme rapscheme=PSEUDORAPIDITY)
const {
139 double rapmin=-MAXDOUBLE,
double rapmax=MAXDOUBLE,
140 RapScheme rapscheme=PSEUDORAPIDITY)
const {
147 double rapmin=-MAXDOUBLE,
double rapmax=MAXDOUBLE,
148 RapScheme rapscheme=PSEUDORAPIDITY)
const {
159 virtual Jets _jets(
double ptmin)
const = 0;
165 virtual size_t size()
const = 0;
168 virtual void reset() = 0;
170 typedef Jet entity_type;
171 typedef Jets collection_type;