rivet is hosted by Hepforge, IPPP Durham
Rivet 3.1.6
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
61 setName("Hemispheres");
62 declare(ax, "Axes");
63 clear();
64 }
65
68
70 void clear() {
71 _E2vis = -1;
72 _M2high = -1;
73 _M2low = -1;
74 _Bmax = -1;
75 _Bmin = -1;
76 _highMassEqMaxBroad = true;
77 }
78
80 void calc(const Vector3& n, const std::vector<FourMomentum>& p4s);
82 void calc(const Vector3& n, const Particles& particles);
84 void calc(const Vector3& n, const Jets& jets);
85
86
87 protected:
88
90 void project(const Event& e);
91
93 CmpState compare(const Projection& p) const {
94 return mkNamedPCmp(p, "Axes");
95 }
96
97
98 public:
99
101
102
103 double E2vis() const { return _E2vis; }
104 double Evis() const { return sqrt(_E2vis); }
105
106 double M2high() const { return _M2high; }
107 double Mhigh() const { return sqrt(M2high()); }
108
109 double M2low() const { return _M2low; }
110 double Mlow() const { return sqrt(M2low()); }
111
112 double M2diff() const { return _M2high -_M2low; }
113 double Mdiff() const { return sqrt(M2diff()); }
114
115 double M2sum() const { return _M2high +_M2low; }
116 double Msum() const { return sqrt(M2sum()); }
117
118 double scaledM2high() const {
119 if (isZero(_M2high)) return 0.0;
120 if (!isZero(_E2vis)) return _M2high/_E2vis;
122 }
123 double scaledMhigh() const { return sqrt(scaledM2high()); }
124
125 double scaledM2low() const {
126 if (isZero(_M2low)) return 0.0;
127 if (!isZero(_E2vis)) return _M2low/_E2vis;
129 }
130 double scaledMlow() const { return sqrt(scaledM2low()); }
131
132 double scaledM2diff() const {
133 if (M2diff() == 0.0) return 0.0;
134 if (_E2vis != 0.0) return M2diff()/_E2vis;
136 }
137 double scaledMdiff() const { return sqrt(scaledM2diff()); }
139
140
142
143 double Bmax() const { return _Bmax; }
144 double Bmin() const { return _Bmin; }
145 double Bsum() const { return _Bmax + _Bmin; }
146 double Bdiff() const { return fabs(_Bmax - _Bmin); } // <- fabs(), just in case...
148
149
152 return _highMassEqMaxBroad;
153 }
154
156 bool highMassDirection() const {
157 return _highMassDirection;
158 }
159
160 private:
161
163 double _E2vis;
164
166 double _M2high, _M2low;
167
169 double _Bmax, _Bmin;
170
172 bool _highMassEqMaxBroad;
173
175 bool _highMassDirection;
176 };
177
178
179}
180
181#endif
Base class for projections which define a spatial basis.
Definition: AxesDefinition.hh:19
Representation of a HepMC event, and enabler of Projection caching.
Definition: Event.hh:22
Calculate the hemisphere masses and broadenings.
Definition: Hemispheres.hh:56
DEFAULT_RIVET_PROJ_CLONE(Hemispheres)
Clone on the heap.
void project(const Event &e)
Perform the projection on the Event.
void calc(const Vector3 &n, const Jets &jets)
Use the projection manually (i.e. outside the projection mechanism) with jet inputs.
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.
Hemispheres(const AxesDefinition &ax)
Constructor.
Definition: Hemispheres.hh:60
void clear()
Reset the projection.
Definition: Hemispheres.hh:70
bool massMatchesBroadening() const
Is the hemisphere with the max mass the same as the one with the max broadening?
Definition: Hemispheres.hh:151
CmpState compare(const Projection &p) const
Compare with other projections.
Definition: Hemispheres.hh:93
void calc(const Vector3 &n, const Particles &particles)
Use the projection manually (i.e. outside the projection mechanism) with particle inputs.
bool highMassDirection() const
Is the hemisphere with the max mass the one in the direction of the axis.
Definition: Hemispheres.hh:156
Specialised vector of Jet objects.
Definition: Jet.hh:23
Specialised vector of Particle objects.
Definition: Particle.hh:25
const PROJ & declare(const PROJ &proj, const std::string &name)
Register a contained projection (user-facing version)
Definition: ProjectionApplier.hh:170
Base class for all Rivet projections.
Definition: Projection.hh:29
void setName(const std::string &name)
Used by derived classes to set their name.
Definition: Projection.hh:142
Cmp< Projection > mkNamedPCmp(const Projection &otherparent, const std::string &pname) const
Three-dimensional specialisation of Vector.
Definition: Vector3.hh:40
double max(const vector< double > &in, double errval=DBL_NAN)
Find the maximum value in the vector.
Definition: Utils.hh:635
double p(const ParticleBase &p)
Unbound function access to p.
Definition: ParticleBaseUtils.hh:653
Definition: MC_Cent_pPb.hh:10
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