File indexing completed on 2024-04-06 12:31:25
0001 #ifndef TopTools_MEzCalculator_h
0002 #define TopTools_MEzCalculator_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #include "DataFormats/PatCandidates/interface/Particle.h"
0014 #include "DataFormats/PatCandidates/interface/MET.h"
0015
0016 #include "TLorentzVector.h"
0017
0018 class MEzCalculator {
0019 public:
0020
0021 MEzCalculator();
0022
0023 ~MEzCalculator();
0024
0025 void SetMET(const pat::MET& MET) { MET_ = MET; };
0026 void SetMET(const TLorentzVector& MET) {
0027 pat::Particle::LorentzVector p(MET.Px(), MET.Py(), MET.Pz(), MET.E());
0028 MET_.setP4(p);
0029 }
0030
0031 void SetLepton(const pat::Particle& lepton, bool isMuon = true) {
0032 lepton_ = lepton;
0033 isMuon_ = isMuon;
0034 };
0035 void SetLepton(const TLorentzVector& lepton) {
0036 pat::Particle::LorentzVector p(lepton.Px(), lepton.Py(), lepton.Pz(), lepton.E());
0037 lepton_.setP4(p);
0038 }
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049 double Calculate(int type = 1);
0050
0051 bool IsComplex() const { return isComplex_; };
0052
0053 void Print() {
0054 std::cout << " METzCalculator: pxmu = " << lepton_.px() << " pzmu= " << lepton_.pz() << std::endl;
0055 std::cout << " METzCalculator: pxnu = " << MET_.px() << " pynu= " << MET_.py() << std::endl;
0056 }
0057
0058 private:
0059 bool isComplex_;
0060 pat::Particle lepton_;
0061 pat::MET MET_;
0062 bool isMuon_;
0063 };
0064
0065 #endif