ParticleBase.hh
#ifndef RIVET_ParticleBase_HH
#define RIVET_ParticleBase_HH
#include "Rivet/Rivet.hh"
#include "Rivet/Math/Vectors.hh"
namespace Rivet {
class ParticleBase {
public:
ParticleBase() { }
virtual ~ParticleBase() { }
// virtual FourMomentum& momentum() = 0;
virtual const FourMomentum& momentum() const = 0;
struct byPTAscending {
bool operator()(const ParticleBase& left, const ParticleBase& right) const {
double pt2left = left.momentum().pT2();
double pt2right = right.momentum().pT2();
return pt2left < pt2right;
}
bool operator()(const ParticleBase* left, const ParticleBase* right) const {
return (*this)(*left, *right);
}
};
struct byPTDescending {
bool operator()(const ParticleBase& left, const ParticleBase& right) const {
return byPTAscending()(right, left);
}
bool operator()(const ParticleBase* left, const ParticleBase* right) const {
return (*this)(*left, *right);
}
};
struct byETAscending {
bool operator()(const ParticleBase& left, const ParticleBase& right) const {
double pt2left = left.momentum().Et2();
double pt2right = right.momentum().Et2();
return pt2left < pt2right;
}
bool operator()(const ParticleBase* left, const ParticleBase* right) const {
return (*this)(*left, *right);
}
};
struct byETDescending {
bool operator()(const ParticleBase& left, const ParticleBase& right) const {
return byETAscending()(right, left);
}
bool operator()(const ParticleBase* left, const ParticleBase* right) const {
return (*this)(*left, *right);
}
};
struct byEAscending {
bool operator()(const ParticleBase& left, const ParticleBase& right) const {
double pt2left = left.momentum().E();
double pt2right = right.momentum().E();
return pt2left < pt2right;
}
bool operator()(const ParticleBase* left, const ParticleBase* right) const {
return (*this)(*left, *right);
}
};
struct byEDescending {
bool operator()(const ParticleBase& left, const ParticleBase& right) const {
return byEAscending()(right, left);
}
bool operator()(const ParticleBase* left, const ParticleBase* right) const {
return (*this)(*left, *right);
}
};
};
}
#endif
Rivet
Definition: MC_JetAnalysis.hh:9
Rivet::ParticleBase::byETAscending
Struct for sorting by increasing transverse energy.
Definition: ParticleBase.hh:50
Rivet::ParticleBase::byPTDescending
Struct for sorting by decreasing transverse momentum in STL set, sort etc.
Definition: ParticleBase.hh:38
Rivet::ParticleBase::byPTAscending
Struct for sorting by increasing transverse momentum in STL set, sort, etc.
Definition: ParticleBase.hh:24
Rivet::ParticleBase::byEDescending
Struct for sorting by decreasing energy.
Definition: ParticleBase.hh:90
Rivet::ParticleBase::byEAscending
Struct for sorting by increasing energy.
Definition: ParticleBase.hh:76
Rivet::ParticleBase
Base class for particle-like things like Particle and Jet.
Definition: ParticleBase.hh:11
Rivet::FourMomentum::E
double E() const
Get energy (time component of momentum).
Definition: Vector4.hh:355
Rivet::ParticleBase::byETDescending
Struct for sorting by decreasing transverse energy.
Definition: ParticleBase.hh:64
Rivet::FourMomentum
Specialized version of the FourVector with momentum/energy functionality.
Definition: Vector4.hh:324
Rivet::FourMomentum::Et2
double Et2() const
Calculate the transverse energy .
Definition: Vector4.hh:415
Rivet::FourMomentum::pT2
double pT2() const
Calculate the squared transverse momentum .
Definition: Vector4.hh:405