Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-19 08:34:19

0001 // -*- C++ -*-
0002 #ifndef RIVET_MissingMomentum_HH
0003 #define RIVET_MissingMomentum_HH
0004 
0005 #include "Rivet/Config/RivetCommon.hh"
0006 #include "Rivet/Projection.hh"
0007 #include "Rivet/Projections/METFinder.hh"
0008 #include "Rivet/Projections/VisibleFinalState.hh"
0009 #include "Rivet/Particle.hh"
0010 #include "Rivet/Event.hh"
0011 
0012 namespace Rivet {
0013 
0014 
0015   /// @brief Calculate missing \f$ E \f$, \f$ E_\perp \f$ etc. as complements to the total visible momentum
0016   ///
0017   /// Project out the total visible energy vector, allowing missing \f$ E \f$,
0018   /// \f$ E_\perp \f$ etc. to be calculated. Final-state particle visibility
0019   /// restrictions are automatic, and the resulting visible/missing momentum
0020   /// vectors are over the whole event rather than over hard objects (jets +
0021   /// leptons) or specific to prompt invisibles.
0022   class MissingMomentum : public METFinder {
0023   public:
0024 
0025     using METFinder::operator=;
0026 
0027     /// Canonical constructor taking a FinalState as argument
0028     MissingMomentum(const FinalState& fs) {
0029       setName("MissingMomentum");
0030       declare(fs, "FS");
0031       declare(VisibleFinalState(fs), "VisibleFS");
0032     }
0033 
0034     /// Default constructor with optional cut
0035     MissingMomentum(const Cut& c=Cuts::open())
0036       : MissingMomentum(FinalState(c))
0037     {    }
0038 
0039 
0040     /// Clone on the heap
0041     RIVET_DEFAULT_PROJ_CLONE(MissingMomentum);
0042 
0043     /// Import to avoid warnings about overload-hiding
0044     using Projection::operator =;
0045 
0046 
0047     /// @name Visible/missing four-momentum functions
0048     /// @{
0049 
0050     /// @brief The vector-summed visible four-momentum in the event
0051     ///
0052     /// @note Reverse this vector with .reverse() to get the missing momentum vector.
0053     ///
0054     /// @note The optional @a mass argument is used to set a mass on the 4-vector. By
0055     ///   default it is zero (since missing momentum is really a 3-momentum quantity:
0056     ///   adding the E components of visible momenta just gives a huge mass)
0057     ///
0058     /// @todo Change to return a 3-vector with no argument, a 4-vector if a mass arg given
0059     const FourMomentum visibleMomentum(double mass=0*GeV) const;
0060     /// Alias for visibleMomentum
0061     const FourMomentum visibleMom(double mass=0*GeV) const { return visibleMomentum(mass); }
0062 
0063     /// @brief The missing four-momentum in the event, required to balance the final state.
0064     ///
0065     /// @note The optional @a mass argument is used to set a mass on the 4-vector. By
0066     ///   default it is zero (since missing momentum is really a 3-momentum quantity:
0067     ///   adding the E components of visible momenta just gives a huge mass)
0068     ///
0069     /// @todo Change to return a 3-vector with no argument, a 4-vector if a mass arg given
0070     const FourMomentum missingMomentum(double mass=0*GeV) const { return visibleMomentum(mass).reverse(); }
0071     /// Alias for missingMomentum
0072     const FourMomentum missingMom(double mass=0*GeV) const { return missingMomentum(mass); }
0073 
0074     /// @}
0075 
0076 
0077     /// @name Transverse momentum functions
0078     ///
0079     /// @note This may be what you want, even if the paper calls it "missing Et"!
0080     ///
0081     /// @note All other MPT functions are implemented in METFinder via the two above.
0082     ///
0083     /// @{
0084 
0085     /// @brief The vector-summed visible transverse momentum in the event, as a 3-vector with z=0
0086     ///
0087     /// @note Reverse this vector with operator- to get the missing pT vector.
0088     const ThreeMomentum& vectorSumPt() const { return _vpt; }
0089 
0090     /// The scalar-summed visible transverse momentum in the event.
0091     double scalarSumPt() const { return _spt; }
0092 
0093     /// @}
0094 
0095 
0096     /// @name Transverse energy functions
0097     ///
0098     /// @warning Despite the common names "MET" and "SET", what's often meant is the pT functions above!
0099     ///
0100     /// @note All other MPT functions are implemented in METFinder via the two above.
0101     ///
0102     /// @{
0103 
0104     /// @brief The vector-summed visible transverse energy in the event, as a 3-vector with z=0
0105     ///
0106     /// @note Reverse this vector with operator- to get the missing ET vector.
0107     const Vector3& vectorSumEt() const { return _vet; }
0108 
0109     /// The scalar-summed visible transverse energy in the event.
0110     double scalarSumEt() const { return _set; }
0111 
0112     /// @}
0113 
0114 
0115     /// Clear the projection results.
0116     void clear();
0117 
0118 
0119   protected:
0120 
0121     /// Apply the projection to the event.
0122     void project(const Event& e);
0123 
0124     /// Compare projections.
0125     CmpState compare(const Projection& p) const;
0126 
0127 
0128   protected:
0129 
0130     /// The total visible momentum
0131     FourMomentum _momentum;
0132 
0133     /// Scalar transverse energy
0134     double _set, _spt;
0135 
0136     /// Vector transverse energy
0137     Vector3 _vet;
0138     ThreeMomentum _vpt;
0139 
0140   };
0141 
0142 
0143 
0144   /// A slightly more convenient name, following other Rivet shortening-conventions
0145   using MissingMom = MissingMomentum;
0146 
0147 
0148 }
0149 
0150 #endif