Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-12-03 11:04:26

0001 // -*- C++ -*-
0002 #ifndef RIVET_Hemispheres_HH
0003 #define RIVET_Hemispheres_HH
0004 
0005 #include "Rivet/Projections/AxesDefinition.hh"
0006 #include "Rivet/Projections/FinalState.hh"
0007 
0008 namespace Rivet {
0009 
0010 
0011   /// @brief Calculate the hemisphere masses and broadenings.
0012   ///
0013   /// Calculate the hemisphere masses and broadenings, with event hemispheres
0014   /// defined by the plane normal to the thrust vector, \f$ \vec{n}_\mathrm{T} \f$.
0015   ///
0016   /// The "high" hemisphere mass,
0017   /// \f$ M^2_\mathrm{high} / E^2_\mathrm{vis} \f$, is defined as
0018   /// \f[
0019   /// \frac{M^2_\mathrm{high}}{E^2_\mathrm{vis}} =
0020   /// \frac{1}{E^2_\mathrm{vis}} \max
0021   /// \left(
0022   /// \left| \sum_{\vec{p}_k \cdot \vec{n}_\mathrm{T} > 0} p_k \right|^2 ,
0023   /// \left| \sum_{\vec{p}_k \cdot \vec{n}_\mathrm{T} < 0} p_k \right|^2
0024   /// \right)
0025   /// \f]
0026   /// and the corresponding "low" hemisphere mass,
0027   /// \f$ M^2_\mathrm{low} / E^2_\mathrm{vis} \f$,
0028   /// is the sum of momentum vectors in the opposite hemisphere, i.e.
0029   /// \f$ \max \rightarrow \min \f$ in the formula above.
0030   ///
0031   /// Finally, we define a hemisphere mass difference:
0032   /// \f[
0033   /// \frac{M^2_\mathrm{diff} }{ E^2_\mathrm{vis}} =
0034   /// \frac{ M^2_\mathrm{high} - M^2_\mathrm{low} }{ E^2_\mathrm{vis}} .
0035   /// \f]
0036   ///
0037   /// Similarly to the masses, we also define hemisphere broadenings, using the
0038   /// momenta transverse to the thrust axis:
0039   /// \f[
0040   /// B_\pm =
0041   /// \frac{
0042   ///   \sum{\pm \vec{p}_i \cdot \vec{n}_\mathrm{T} > 0}
0043   ///   |\vec{p}_i \times \vec{n}_\mathrm{T} |
0044   /// }{
0045   ///   2 \sum_i | \vec{p}_i |
0046   /// }
0047   /// \f]
0048   /// and then a set of the broadening maximum, minimum, sum and difference as follows:
0049   /// \f[ B_\mathrm{max}  = \max(B_+, B_-) \f]
0050   /// \f[ B_\mathrm{min}  = \min(B_+, B_-) \f]
0051   /// \f[ B_\mathrm{sum}  = B_+ + B_- \f]
0052   /// \f[ B_\mathrm{diff} = |B_+ - B_-| \f]
0053   ///
0054   /// Internally, this projection uses a Thrust or Sphericity projection to
0055   /// determine the hemisphere orientation.
0056   class Hemispheres : public Projection {
0057   public:
0058 
0059     /// Constructor.
0060     Hemispheres(const AxesDefinition& ax) {
0061       setName("Hemispheres");
0062       declare(ax, "Axes");
0063       clear();
0064     }
0065 
0066     /// Clone on the heap.
0067     RIVET_DEFAULT_PROJ_CLONE(Hemispheres);
0068 
0069     /// Import to avoid warnings about overload-hiding
0070     using Projection::operator=;
0071 
0072 
0073     /// Reset the projection
0074     void clear() {
0075       _E2vis = -1;
0076       _M2high = -1;
0077       _M2low = -1;
0078       _Bmax = -1;
0079       _Bmin = -1;
0080       _highMassEqMaxBroad = true;
0081     }
0082 
0083     /// Use the projection manually (i.e. outside the projection mechanism) with raw 4-momentum inputs.
0084     void calc(const Vector3& n, const std::vector<FourMomentum>& p4s);
0085     /// Use the projection manually (i.e. outside the projection mechanism) with particle inputs.
0086     void calc(const Vector3& n, const Particles& particles);
0087     /// Use the projection manually (i.e. outside the projection mechanism) with jet inputs.
0088     void calc(const Vector3& n, const Jets& jets);
0089 
0090 
0091   protected:
0092 
0093     /// Perform the projection on the Event.
0094     void project(const Event& e);
0095 
0096     /// Compare with other projections.
0097     CmpState compare(const Projection& p) const {
0098       return mkNamedPCmp(p, "Axes");
0099     }
0100 
0101 
0102   public:
0103 
0104     /// @name Hemisphere masses (scaled by \f$ 1 / E^2_\mathrm{vis} \f$).
0105     /// @{
0106 
0107     double E2vis() const {
0108       return _E2vis;
0109     }
0110     double Evis() const {
0111       return sqrt(_E2vis);
0112     }
0113 
0114     double M2high() const {
0115       return _M2high;
0116     }
0117     double Mhigh() const {
0118       return sqrt(M2high());
0119     }
0120 
0121     double M2low() const {
0122       return _M2low;
0123     }
0124     double Mlow() const {
0125       return sqrt(M2low());
0126     }
0127 
0128     double M2diff() const {
0129       return _M2high - _M2low;
0130     }
0131     double Mdiff() const {
0132       return sqrt(M2diff());
0133     }
0134 
0135     double M2sum() const {
0136       return _M2high + _M2low;
0137     }
0138     double Msum() const {
0139       return sqrt(M2sum());
0140     }
0141 
0142     double scaledM2high() const {
0143       if (isZero(_M2high)) return 0.0;
0144       if (!isZero(_E2vis))
0145         return _M2high / _E2vis;
0146       else
0147         return std::numeric_limits<double>::max();
0148     }
0149     double scaledMhigh() const {
0150       return sqrt(scaledM2high());
0151     }
0152 
0153     double scaledM2low() const {
0154       if (isZero(_M2low)) return 0.0;
0155       if (!isZero(_E2vis))
0156         return _M2low / _E2vis;
0157       else
0158         return std::numeric_limits<double>::max();
0159     }
0160     double scaledMlow() const {
0161       return sqrt(scaledM2low());
0162     }
0163 
0164     double scaledM2diff() const {
0165       if (M2diff() == 0.0) return 0.0;
0166       if (_E2vis != 0.0)
0167         return M2diff() / _E2vis;
0168       else
0169         return std::numeric_limits<double>::max();
0170     }
0171     double scaledMdiff() const {
0172       return sqrt(scaledM2diff());
0173     }
0174     /// @}
0175 
0176 
0177     /// @name Hemisphere broadenings.
0178     /// @{
0179     double Bmax() const {
0180       return _Bmax;
0181     }
0182     double Bmin() const {
0183       return _Bmin;
0184     }
0185     double Bsum() const {
0186       return _Bmax + _Bmin;
0187     }
0188     double Bdiff() const {
0189       return fabs(_Bmax - _Bmin);
0190     } // <- fabs(), just in case...
0191     /// @}
0192 
0193 
0194     /// Is the hemisphere with the max mass the same as the one with the max broadening?
0195     bool massMatchesBroadening() const {
0196       return _highMassEqMaxBroad;
0197     }
0198 
0199     /// Is the hemisphere with the max mass the one in the direction of the axis
0200     bool highMassDirection() const {
0201       return _highMassDirection;
0202     }
0203 
0204 
0205   protected:
0206 
0207     /// Visible energy-squared, \f$ E^2_\mathrm{vis} \f$.
0208     double _E2vis;
0209 
0210     /// Hemisphere mass variables.
0211     double _M2high, _M2low;
0212 
0213     /// Hemisphere broadening variables.
0214     double _Bmax, _Bmin;
0215 
0216     /// Is the hemisphere with the max mass the same as the one with the max broadening?
0217     bool _highMassEqMaxBroad;
0218 
0219     /// Is the hemisphere with the max mass the one in the direction of the axis;
0220     bool _highMassDirection;
0221   };
0222 
0223 
0224 }
0225 
0226 #endif