Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-05-12 09:05:02

0001 // -*- C++ -*-
0002 #ifndef RIVET_Hemispheres_HH
0003 #define RIVET_Hemispheres_HH
0004 
0005 #include "Rivet/Projections/FinalState.hh"
0006 #include "Rivet/Projections/AxesDefinition.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 { return _E2vis; }
0108     double Evis() const { return sqrt(_E2vis); }
0109 
0110     double M2high() const { return _M2high; }
0111     double Mhigh() const { return sqrt(M2high()); }
0112 
0113     double M2low() const { return _M2low; }
0114     double Mlow() const { return sqrt(M2low()); }
0115 
0116     double M2diff() const { return _M2high -_M2low; }
0117     double Mdiff() const { return sqrt(M2diff()); }
0118 
0119     double M2sum() const { return _M2high +_M2low; }
0120     double Msum() const { return sqrt(M2sum()); }
0121 
0122     double scaledM2high() const {
0123       if (isZero(_M2high)) return 0.0;
0124       if (!isZero(_E2vis)) return _M2high/_E2vis;
0125       else return std::numeric_limits<double>::max();
0126     }
0127     double scaledMhigh() const { return sqrt(scaledM2high()); }
0128 
0129     double scaledM2low() const {
0130       if (isZero(_M2low)) return 0.0;
0131       if (!isZero(_E2vis)) return _M2low/_E2vis;
0132       else return std::numeric_limits<double>::max();
0133     }
0134     double scaledMlow() const { return sqrt(scaledM2low()); }
0135 
0136     double scaledM2diff() const {
0137       if (M2diff() == 0.0) return 0.0;
0138       if (_E2vis != 0.0) return M2diff()/_E2vis;
0139       else return std::numeric_limits<double>::max();
0140     }
0141     double scaledMdiff() const { return sqrt(scaledM2diff()); }
0142     /// @}
0143 
0144 
0145     /// @name Hemisphere broadenings.
0146     /// @{
0147     double Bmax() const { return _Bmax; }
0148     double Bmin() const { return _Bmin; }
0149     double Bsum() const { return _Bmax + _Bmin; }
0150     double Bdiff() const { return fabs(_Bmax - _Bmin); } // <- fabs(), just in case...
0151     /// @}
0152 
0153 
0154     /// Is the hemisphere with the max mass the same as the one with the max broadening?
0155     bool massMatchesBroadening() const {
0156       return _highMassEqMaxBroad;
0157     }
0158 
0159     /// Is the hemisphere with the max mass the one in the direction of the axis
0160     bool highMassDirection() const  {
0161       return _highMassDirection;
0162     }
0163 
0164 
0165   protected:
0166 
0167     /// Visible energy-squared, \f$ E^2_\mathrm{vis} \f$.
0168     double _E2vis;
0169 
0170     /// Hemisphere mass variables.
0171     double _M2high, _M2low;
0172 
0173     /// Hemisphere broadening variables.
0174     double _Bmax, _Bmin;
0175 
0176     /// Is the hemisphere with the max mass the same as the one with the max broadening?
0177     bool _highMassEqMaxBroad;
0178 
0179     /// Is the hemisphere with the max mass the one in the direction of the axis;
0180     bool _highMassDirection;
0181   };
0182 
0183 
0184 }
0185 
0186 #endif