Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:04:45

0001 // -*- C++ -*-
0002 
0003 // Package:    METReco
0004 // Class:      MET
0005 //
0006 /**\class MET
0007 
0008  Description: This is the fundemental class for missing transverse
0009  momentum (a.k.a MET). The class inherits from RecoCandidate, and so
0010  is stored in the event as a candidate. The actual MET information is
0011  contained in the RecoCandidate LorentzVector while supplimentary
0012  information is stored as varibles in the MET class itself (such as
0013  SumET). As there may have been more than one correction applied to
0014  the missing transverse momentum, a vector of corrections to the
0015  missing px and the missing py is maintained so that one can always
0016  recover the uncorrected MET by applying the negative of each
0017  correction.
0018 
0019 */
0020 // Original authors: Michael Schmitt, Richard Cavanaugh The University of Florida
0021 // changes by: Freya Blekman, Cornell University
0022 //
0023 
0024 //____________________________________________________________________________||
0025 #ifndef METRECO_MET_H
0026 #define METRECO_MET_H
0027 
0028 //____________________________________________________________________________||
0029 #include "DataFormats/RecoCandidate/interface/RecoCandidate.h"
0030 #include "DataFormats/METReco/interface/CorrMETData.h"
0031 #include <cmath>
0032 #include <vector>
0033 #include <cstring>
0034 #include <Math/SMatrix.h>
0035 #include <Math/SVector.h>
0036 
0037 //____________________________________________________________________________||
0038 namespace reco {
0039   typedef ROOT::Math::SMatrix<double, 2> METCovMatrix;
0040 
0041   class MET : public RecoCandidate {
0042   public:
0043     MET();
0044     MET(const LorentzVector& p4_, const Point& vtx_, bool isWeighted = false);
0045     MET(double sumet_, const LorentzVector& p4_, const Point& vtx_, bool isWeighted = false);
0046     MET(double sumet_,
0047         const std::vector<CorrMETData>& corr_,
0048         const LorentzVector& p4_,
0049         const Point& vtx_,
0050         bool isWeighted = false);
0051 
0052     MET* clone() const override;
0053 
0054     //________________________________________________________________________||
0055     //scalar sum of transverse energy over all objects
0056     double sumEt() const { return sumet; }
0057     //MET Significance = MET / std::sqrt(SumET)
0058     double mEtSig() const { return (sumet ? (this->et() / std::sqrt(sumet)) : (0.0)); }
0059     //real MET significance
0060     double significance() const;
0061     //longitudinal component of the vector sum of energy over all object
0062     //(useful for data quality monitoring)
0063     double e_longitudinal() const { return elongit; }
0064 
0065     //________________________________________________________________________||
0066     //Define different methods for the corrections to individual MET elements
0067     std::vector<double> dmEx() const;
0068     std::vector<double> dmEy() const;
0069     std::vector<double> dsumEt() const;
0070     std::vector<CorrMETData> mEtCorr() const { return corr; }
0071 
0072     //________________________________________________________________________||
0073     void setSignificanceMatrix(const reco::METCovMatrix& matrix);
0074     reco::METCovMatrix getSignificanceMatrix(void) const;
0075 
0076     ///  Set boolean if weights were applied by algorithm (e.g. PUPPI weights)
0077     void setIsWeighted(bool isWeighted) { mIsWeighted = isWeighted; }
0078     ///  boolean if weights were applied by algorithm (e.g. PUPPI weights)
0079     int isWeighted() const { return mIsWeighted; }
0080 
0081   private:
0082     bool overlap(const Candidate&) const override;
0083     double sumet;
0084     double elongit;
0085     // bookkeeping for the significance
0086     double signif_dxx;
0087     double signif_dyy;
0088     double signif_dyx;
0089     double signif_dxy;
0090     std::vector<CorrMETData> corr;
0091     bool mIsWeighted;
0092   };
0093 }  // namespace reco
0094 
0095 //____________________________________________________________________________||
0096 #endif  // METRECO_MET_H