CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/TopQuarkAnalysis/TopTools/interface/MEzCalculator.h

Go to the documentation of this file.
00001 #ifndef TopTools_MEzCalculator_h
00002 #define TopTools_MEzCalculator_h
00003 
00013 #include "DataFormats/PatCandidates/interface/Particle.h"
00014 #include "DataFormats/PatCandidates/interface/MET.h"
00015 
00016 #include "TLorentzVector.h"
00017 
00018 class MEzCalculator {
00019   
00020  public:
00022   MEzCalculator();
00024   ~MEzCalculator();
00026   void SetMET(const pat::MET& MET) { MET_ = MET; } ;
00027   void SetMET(TLorentzVector MET) {
00028           pat::Particle::LorentzVector p(MET.Px(),MET.Py(),MET.Pz(),MET.E());
00029           MET_.setP4(p);
00030   }
00032   void SetLepton(const pat::Particle& lepton, bool isMuon = true) {
00033           lepton_ = lepton;
00034           isMuon_ = isMuon;
00035   };
00036   void SetLepton(TLorentzVector lepton) {
00037           pat::Particle::LorentzVector p(lepton.Px(), lepton.Py(), lepton.Pz(), lepton.E() );
00038           lepton_.setP4(p);
00039   }
00050   double Calculate(int type = 1);
00052   bool IsComplex() const { return isComplex_; };
00054   void Print() {
00055           std::cout << " METzCalculator: pxmu = " << lepton_.px() << " pzmu= " << lepton_.pz() << std::endl;
00056           std::cout << " METzCalculator: pxnu = " << MET_.px() << " pynu= " << MET_.py() << std::endl;
00057   }
00058 
00059  private:
00060   
00061   bool isComplex_;
00062   pat::Particle lepton_;
00063   pat::MET MET_;
00064   bool isMuon_;
00065 };
00066 
00067 #endif