Hemispheres.hh
// -*- C++ -*-
#ifndef RIVET_Hemispheres_HH
#define RIVET_Hemispheres_HH
#include "Rivet/Projection.hh"
#include "Rivet/Projections/FinalState.hh"
#include "Rivet/Projections/AxesDefinition.hh"
#include "Rivet/Event.hh"
namespace Rivet {
class Hemispheres : public Projection {
public:
Hemispheres(const AxesDefinition& ax) {
setName("Hemispheres");
addProjection(ax, "Axes");
clear();
}
virtual const Projection* clone() const {
return new Hemispheres(*this);
}
// Reset the projection
void clear() {
_E2vis = -1;
_M2high = -1;
_M2low = -1;
_Bmax = -1;
_Bmin = -1;
_highMassEqMaxBroad = true;
}
protected:
void project(const Event& e);
int compare(const Projection& p) const {
return mkNamedPCmp(p, "Axes");
}
public:
double E2vis() const { return _E2vis; }
double Evis() const { return sqrt(_E2vis); }
double M2high() const { return _M2high; }
double Mhigh() const { return sqrt(M2high()); }
double M2low() const { return _M2low; }
double Mlow() const { return sqrt(M2low()); }
double M2diff() const { return _M2high -_M2low; }
double Mdiff() const { return sqrt(M2diff()); }
double scaledM2high() const {
if (isZero(_M2high)) return 0.0;
if (!isZero(_E2vis)) return _M2high/_E2vis;
else return std::numeric_limits<double>::max();
}
double scaledMhigh() const { return sqrt(scaledM2high()); }
double scaledM2low() const {
if (isZero(_M2low)) return 0.0;
if (!isZero(_E2vis)) return _M2low/_E2vis;
else return std::numeric_limits<double>::max();
}
double scaledMlow() const { return sqrt(scaledM2low()); }
double scaledM2diff() const {
if (M2diff() == 0.0) return 0.0;
if (_E2vis != 0.0) return M2diff()/_E2vis;
else return std::numeric_limits<double>::max();
}
double scaledMdiff() const { return sqrt(scaledM2diff()); }
double Bmax() const { return _Bmax; }
double Bmin() const { return _Bmin; }
double Bsum() const { return _Bmax + _Bmin; }
double Bdiff() const { return fabs(_Bmax - _Bmin); } // <- fabs(), just in case...
bool massMatchesBroadening() {
return _highMassEqMaxBroad;
}
private:
double _E2vis;
double _M2high, _M2low;
double _Bmax, _Bmin;
bool _highMassEqMaxBroad;
};
}
#endif
Rivet::Hemispheres::compare
int compare(const Projection &p) const
Compare with other projections.
Definition: Hemispheres.hh:90
Rivet::Projection::setName
void setName(const std::string &name)
Used by derived classes to set their name.
Definition: Projection.hh:120
Rivet
Definition: MC_JetAnalysis.hh:9
Rivet::AxesDefinition
Base class for projections which define a spatial basis.
Definition: AxesDefinition.hh:20
Rivet::Hemispheres::clone
virtual const Projection * clone() const
Clone on the heap.
Definition: Hemispheres.hh:69
Rivet::Event
Definition: Event.hh:22
Rivet::Hemispheres::Hemispheres
Hemispheres(const AxesDefinition &ax)
Constructor.
Definition: Hemispheres.hh:62
Rivet::Hemispheres
Calculate the hemisphere masses and broadenings.
Definition: Hemispheres.hh:58
Rivet::Projection::mkNamedPCmp
Cmp< Projection > mkNamedPCmp(const Projection &otherparent, const std::string &pname) const
Definition: Projection.cc:51
Rivet::isZero
bool isZero(double val, double tolerance=1E-8)
Definition: MathUtils.hh:17
Rivet::Hemispheres::project
void project(const Event &e)
Perform the projection on the Event.
Definition: Hemispheres.cc:7
Rivet::Hemispheres::massMatchesBroadening
bool massMatchesBroadening()
Is the hemisphere with the max mass the same as the one with the max broadening?
Definition: Hemispheres.hh:145
Rivet::ProjectionApplier::addProjection
const PROJ & addProjection(const PROJ &proj, const std::string &name)
Definition: ProjectionApplier.hh:113
Rivet::Projection
Base class for all Rivet projections.
Definition: Projection.hh:28