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;
171 typedef Jets collection_type;
177 virtual void calc(
const ParticleVector& ps) = 0;
bool cmpJetsByEt(const Jet &a, const Jet &b)
Use this so that highest is at the front of the list.
Definition: Jet.hh:205
Definition: MC_JetAnalysis.hh:9
double pT() const
Calculate the transverse momentum .
Definition: Vector4.hh:410
virtual void project(const Event &e)=0
Perform the projection on the Event.
double eta() const
Synonym for pseudorapidity.
Definition: Vector4.hh:134
bool inRange(NUM value, NUM low, NUM high, RangeBoundary lowbound=CLOSED, RangeBoundary highbound=OPEN)
Determine if value is in the range low to high, for floating point numbers.
Definition: MathUtils.hh:109
bool cmpJetsByE(const Jet &a, const Jet &b)
Compare jets by (descending - usual sorting for HEP) Use this so that highest is at the front of th...
Definition: Jet.hh:216
bool cmpJetsByP(const Jet &a, const Jet &b)
Compare jets by descending momentum, .
Definition: Jet.hh:195
Jets jets(F sorter, double ptmin, double ptmax, double rapmin, double rapmax, RapScheme rapscheme) const
Definition: JetAlg.hh:110
std::vector< Jet > Jets
Typedef for a collection of Jet objects.
Definition: Jet.hh:177
double rapidity() const
Calculate the rapidity.
Definition: Vector4.hh:400
virtual void reset()=0
Clear the projection.
void useInvisibles(bool useinvis=true)
Include invisible particles in jet construction. The default behaviour is that jets are only construc...
Definition: JetAlg.hh:85
bool cmpJetsByPt(const Jet &a, const Jet &b)
Compare jets by (descending - usual sorting for HEP) Use this so that highest is at the front of th...
Definition: Jet.hh:185
const FourMomentum & momentum() const
Get equivalent single momentum four-vector.
Definition: Jet.hh:105
collection_type entities() const
Template-usable interface common to FinalState.
Definition: JetAlg.hh:174
Jets jetsByEt(double ptmin=0.0, double ptmax=MAXDOUBLE, double rapmin=-MAXDOUBLE, double rapmax=MAXDOUBLE, RapScheme rapscheme=PSEUDORAPIDITY) const
Definition: JetAlg.hh:146
virtual ~JetAlg()
Destructor.
Definition: JetAlg.hh:77
Jets jetsByPt(double ptmin=0.0, double ptmax=MAXDOUBLE, double rapmin=-MAXDOUBLE, double rapmax=MAXDOUBLE, RapScheme rapscheme=PSEUDORAPIDITY) const
Definition: JetAlg.hh:122
virtual int compare(const Projection &p) const =0
Compare projections.
Project out all final-state particles in an event. Probably the most important projection in Rivet! ...
Definition: FinalState.hh:14
virtual Jets jets(double ptmin=0.0, double ptmax=MAXDOUBLE, double rapmin=-MAXDOUBLE, double rapmax=MAXDOUBLE, RapScheme rapscheme=PSEUDORAPIDITY) const
Definition: JetAlg.hh:91
RapScheme
Enum for rapidity variable to be used in calculating , applying rapidity cuts, etc.
Definition: MathHeader.hh:60
virtual size_t size() const =0
Number of jets.
Jets jetsByP(double ptmin=0.0, double ptmax=MAXDOUBLE, double rapmin=-MAXDOUBLE, double rapmax=MAXDOUBLE, RapScheme rapscheme=PSEUDORAPIDITY) const
Definition: JetAlg.hh:130
Jets jetsByE(double ptmin=0.0, double ptmax=MAXDOUBLE, double rapmin=-MAXDOUBLE, double rapmax=MAXDOUBLE, RapScheme rapscheme=PSEUDORAPIDITY) const
Definition: JetAlg.hh:138
virtual void calc(const ParticleVector &ps)=0
Do the calculation locally (no caching).
Representation of a clustered jet of particles.
Definition: Jet.hh:12
Base class for all Rivet projections.
Definition: Projection.hh:28
Specialized version of the FourVector with momentum/energy functionality.
Definition: Vector4.hh:324
Abstract base class for projections which can return a set of Jets.
Definition: JetAlg.hh:65
virtual const Projection * clone() const =0
Clone on the heap.