Rivet: /Users/chrisg/software/rivet/include/Rivet/Projections/Hemispheres.hh Source File

| Rivet 3.1.9

Hemispheres.hh
1// -*- C++ -*-
2#ifndef RIVET_Hemispheres_HH
3#define RIVET_Hemispheres_HH
4
5#include "Rivet/Projections/FinalState.hh"
6#include "Rivet/Projections/AxesDefinition.hh"
7
8namespace Rivet {
9
10
56 class Hemispheres : public Projection {
57 public:
58
60 Hemispheres(const AxesDefinition& ax) {
61 setName("Hemispheres");
62 declare(ax, "Axes");
63 clear();
64 }
65
67 DEFAULT_RIVET_PROJ_CLONE(Hemispheres);
68
70 using Projection::operator =;
71
72
74 void clear() {
75 _E2vis = -1;
76 _M2high = -1;
77 _M2low = -1;
78 _Bmax = -1;
79 _Bmin = -1;
80 _highMassEqMaxBroad = true;
81 }
82
84 void calc(const Vector3& n, const std::vector<FourMomentum>& p4s);
86 void calc(const Vector3& n, const Particles& particles);
88 void calc(const Vector3& n, const Jets& jets);
89
90
91 protected:
92
94 void project(const Event& e);
95
97 CmpState compare(const Projection& p) const {
98 return mkNamedPCmp(p, "Axes");
99 }
100
101
102 public:
103
105
106
107 double E2vis() const { return _E2vis; }
108 double Evis() const { return sqrt(_E2vis); }
109
110 double M2high() const { return _M2high; }
111 double Mhigh() const { return sqrt(M2high()); }
112
113 double M2low() const { return _M2low; }
114 double Mlow() const { return sqrt(M2low()); }
115
116 double M2diff() const { return _M2high -_M2low; }
117 double Mdiff() const { return sqrt(M2diff()); }
118
119 double M2sum() const { return _M2high +_M2low; }
120 double Msum() const { return sqrt(M2sum()); }
121
122 double scaledM2high() const {
123 if (isZero(_M2high)) return 0.0;
124 if (!isZero(_E2vis)) return _M2high/_E2vis;
125 else return std::numeric_limits<double>::max();
126 }
127 double scaledMhigh() const { return sqrt(scaledM2high()); }
128
129 double scaledM2low() const {
130 if (isZero(_M2low)) return 0.0;
131 if (!isZero(_E2vis)) return _M2low/_E2vis;
132 else return std::numeric_limits<double>::max();
133 }
134 double scaledMlow() const { return sqrt(scaledM2low()); }
135
136 double scaledM2diff() const {
137 if (M2diff() == 0.0) return 0.0;
138 if (_E2vis != 0.0) return M2diff()/_E2vis;
139 else return std::numeric_limits<double>::max();
140 }
141 double scaledMdiff() const { return sqrt(scaledM2diff()); }
143
144
146
147 double Bmax() const { return _Bmax; }
148 double Bmin() const { return _Bmin; }
149 double Bsum() const { return _Bmax + _Bmin; }
150 double Bdiff() const { return fabs(_Bmax - _Bmin); } // <- fabs(), just in case...
152
153
155 bool massMatchesBroadening() const {
156 return _highMassEqMaxBroad;
157 }
158
160 bool highMassDirection() const {
161 return _highMassDirection;
162 }
163
164
165 protected:
166
168 double _E2vis;
169
171 double _M2high, _M2low;
172
174 double _Bmax, _Bmin;
175
177 bool _highMassEqMaxBroad;
178
180 bool _highMassDirection;
181 };
182
183
184}
185
186#endif
Rivet::AxesDefinition
Base class for projections which define a spatial basis.
Definition AxesDefinition.hh:19
Rivet::Event
Representation of a HepMC event, and enabler of Projection caching.
Definition Event.hh:22
Rivet::Hemispheres
Calculate the hemisphere masses and broadenings.
Definition Hemispheres.hh:56
Rivet::Hemispheres::DEFAULT_RIVET_PROJ_CLONE
DEFAULT_RIVET_PROJ_CLONE(Hemispheres)
Clone on the heap.
Rivet::Hemispheres::project
void project(const Event &e)
Perform the projection on the Event.
Rivet::Hemispheres::calc
void calc(const Vector3 &n, const Jets &jets)
Use the projection manually (i.e. outside the projection mechanism) with jet inputs.
Rivet::Hemispheres::calc
void calc(const Vector3 &n, const std::vector< FourMomentum > &p4s)
Use the projection manually (i.e. outside the projection mechanism) with raw 4-momentum inputs.
Rivet::Hemispheres::Hemispheres
Hemispheres(const AxesDefinition &ax)
Constructor.
Definition Hemispheres.hh:60
Rivet::Hemispheres::clear
void clear()
Reset the projection.
Definition Hemispheres.hh:74
Rivet::Hemispheres::massMatchesBroadening
bool massMatchesBroadening() const
Is the hemisphere with the max mass the same as the one with the max broadening?
Definition Hemispheres.hh:155
Rivet::Hemispheres::compare
CmpState compare(const Projection &p) const
Compare with other projections.
Definition Hemispheres.hh:97
Rivet::Hemispheres::calc
void calc(const Vector3 &n, const Particles &particles)
Use the projection manually (i.e. outside the projection mechanism) with particle inputs.
Rivet::Hemispheres::highMassDirection
bool highMassDirection() const
Is the hemisphere with the max mass the one in the direction of the axis.
Definition Hemispheres.hh:160
Rivet::Jets
Specialised vector of Jet objects.
Definition Jet.hh:23
Rivet::Particles
Specialised vector of Particle objects.
Definition Particle.hh:25
Rivet::ProjectionApplier::declare
const PROJ & declare(const PROJ &proj, const std::string &name)
Register a contained projection (user-facing version)
Definition ProjectionApplier.hh:170
Rivet::Projection
Base class for all Rivet projections.
Definition Projection.hh:29
Rivet::Projection::setName
void setName(const std::string &name)
Used by derived classes to set their name.
Definition Projection.hh:142
Rivet::Projection::mkNamedPCmp
Cmp< Projection > mkNamedPCmp(const Projection &otherparent, const std::string &pname) const
Rivet::Vector3
Three-dimensional specialisation of Vector.
Definition Vector3.hh:40
Rivet::Kin::p
double p(const ParticleBase &p)
Unbound function access to p.
Definition ParticleBaseUtils.hh:684
Rivet
Definition MC_Cent_pPb.hh:10
Rivet::isZero
std::enable_if< std::is_floating_point< NUM >::value, bool >::type isZero(NUM val, double tolerance=1e-8)
Compare a number to zero.
Definition MathUtils.hh:24