CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
PFMETAlgorithmMVA Class Reference

#include <PFMETAlgorithmMVA.h>

Public Member Functions

void evaluateMVA ()
 
double getCovU1 () const
 
double getCovU2 () const
 
double getDPhi () const
 
reco::Candidate::LorentzVector getMEt () const
 
const reco::METCovMatrixgetMEtCov () const
 
double getU () const
 
void initialize (const edm::EventSetup &)
 
 PFMETAlgorithmMVA (const edm::ParameterSet &cfg)
 
void print (std::ostream &) const
 
void setHasPhotons (bool hasPhotons)
 
void setInput (const std::vector< reco::PUSubMETCandInfo > &, const std::vector< reco::PUSubMETCandInfo > &, const std::vector< reco::PUSubMETCandInfo > &, const std::vector< reco::Vertex::Point > &)
 
 ~PFMETAlgorithmMVA ()
 

Private Member Functions

void evaluateCovU1 ()
 
void evaluateCovU2 ()
 
void evaluateDPhi ()
 
void evaluateU ()
 
void setInput (double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double)
 

Private Attributes

edm::ParameterSet cfg_
 
double chargedSumLeptonPx_
 
double chargedSumLeptonPy_
 
bool hasPhotons_
 
Float_t jet1Eta_
 
Float_t jet1Phi_
 
Float_t jet1Pt_
 
Float_t jet2Eta_
 
Float_t jet2Phi_
 
Float_t jet2Pt_
 
bool loadMVAfromDB_
 
Float_t * mvaInputCovU1_
 
Float_t * mvaInputCovU2_
 
Float_t * mvaInputDPhi_
 
Float_t * mvaInputU_
 
reco::Candidate::LorentzVector mvaMEt_
 
reco::METCovMatrix mvaMEtCov_
 
std::string mvaNameCovU1_
 
std::string mvaNameCovU2_
 
std::string mvaNameDPhi_
 
std::string mvaNameU_
 
Float_t mvaOutputCovU1_
 
Float_t mvaOutputCovU2_
 
Float_t mvaOutputDPhi_
 
Float_t mvaOutputU_
 
const GBRForestmvaReaderCovU1_
 
const GBRForestmvaReaderCovU2_
 
const GBRForestmvaReaderDPhi_
 
const GBRForestmvaReaderU_
 
int mvaType_
 
Float_t npuPhi_
 
Float_t npuSumEt_
 
Float_t npuU_
 
Float_t numJets_
 
Float_t numJetsPtGt30_
 
Float_t numVertices_
 
Float_t pfPhi_
 
Float_t pfSumEt_
 
Float_t pfU_
 
Float_t pucPhi_
 
Float_t pucSumEt_
 
Float_t pucU_
 
Float_t puMEt_
 
Float_t puPhi_
 
Float_t puSumEt_
 
double sumLeptonPx_
 
double sumLeptonPy_
 
Float_t tkPhi_
 
Float_t tkSumEt_
 
Float_t tkU_
 
MvaMEtUtilities utils_
 

Detailed Description

MVA based algorithm for computing the particle-flow missing Et

Authors
Phil Harris, CERN Christian Veelken, LLR

Definition at line 31 of file PFMETAlgorithmMVA.h.

Constructor & Destructor Documentation

PFMETAlgorithmMVA::PFMETAlgorithmMVA ( const edm::ParameterSet cfg)

Definition at line 47 of file PFMETAlgorithmMVA.cc.

References edm::ParameterSet::getParameter(), kBaseline, loadMVAfromDB_, mvaInputCovU1_, mvaInputCovU2_, mvaInputDPhi_, mvaInputU_, and mvaType_.

48  : utils_(cfg),
49  mvaInputU_(nullptr),
50  mvaInputDPhi_(nullptr),
51  mvaInputCovU1_(nullptr),
52  mvaInputCovU2_(nullptr),
53  mvaReaderU_(nullptr),
54  mvaReaderDPhi_(nullptr),
55  mvaReaderCovU1_(nullptr),
56  mvaReaderCovU2_(nullptr),
57  cfg_(cfg)
58 {
60 
61  loadMVAfromDB_ = cfg.getParameter<bool>("loadMVAfromDB");
62 
63  mvaInputU_ = new Float_t[25];
64  mvaInputDPhi_ = new Float_t[23];
65  mvaInputCovU1_ = new Float_t[26];
66  mvaInputCovU2_ = new Float_t[26];
67 }
T getParameter(std::string const &) const
MvaMEtUtilities utils_
const GBRForest * mvaReaderCovU1_
const GBRForest * mvaReaderCovU2_
edm::ParameterSet cfg_
const GBRForest * mvaReaderDPhi_
const GBRForest * mvaReaderU_
PFMETAlgorithmMVA::~PFMETAlgorithmMVA ( )

Definition at line 69 of file PFMETAlgorithmMVA.cc.

References loadMVAfromDB_, mvaInputCovU1_, mvaInputCovU2_, mvaInputDPhi_, mvaInputU_, mvaReaderCovU1_, mvaReaderCovU2_, mvaReaderDPhi_, and mvaReaderU_.

70 {
71  delete mvaInputU_;
72  delete mvaInputDPhi_;
73  delete mvaInputCovU1_;
74  delete mvaInputCovU2_;
75 
76  if ( !loadMVAfromDB_ ) {
77  delete mvaReaderU_;
78  delete mvaReaderDPhi_;
79  delete mvaReaderCovU1_;
80  delete mvaReaderCovU2_;
81  }
82 }
const GBRForest * mvaReaderCovU1_
const GBRForest * mvaReaderCovU2_
const GBRForest * mvaReaderDPhi_
const GBRForest * mvaReaderU_

Member Function Documentation

void PFMETAlgorithmMVA::evaluateCovU1 ( )
private

Definition at line 314 of file PFMETAlgorithmMVA.cc.

References GBRForest::GetResponse(), jet1Eta_, jet1Phi_, jet1Pt_, jet2Eta_, jet2Phi_, jet2Pt_, mvaInputCovU1_, mvaOutputCovU1_, mvaOutputDPhi_, mvaOutputU_, mvaReaderCovU1_, npuPhi_, npuSumEt_, npuU_, numJets_, numJetsPtGt30_, numVertices_, pfPhi_, pfSumEt_, pfU_, pucPhi_, pucSumEt_, pucU_, puMEt_, puPhi_, puSumEt_, tkPhi_, tkSumEt_, and tkU_.

Referenced by evaluateMVA().

315 {
316  mvaInputCovU1_[0] = pfSumEt_; // PH: helps flattens response vs. Nvtx
318  mvaInputCovU1_[2] = pfU_;
319  mvaInputCovU1_[3] = pfPhi_;
321  mvaInputCovU1_[5] = tkU_;
322  mvaInputCovU1_[6] = tkPhi_;
324  mvaInputCovU1_[8] = npuU_;
325  mvaInputCovU1_[9] = npuPhi_;
326  mvaInputCovU1_[10] = puSumEt_;
327  mvaInputCovU1_[11] = puMEt_;
328  mvaInputCovU1_[12] = puPhi_;
330  mvaInputCovU1_[14] = pucU_;
331  mvaInputCovU1_[15] = pucPhi_;
332  mvaInputCovU1_[16] = jet1Pt_;
333  mvaInputCovU1_[17] = jet1Eta_;
334  mvaInputCovU1_[18] = jet1Phi_;
335  mvaInputCovU1_[19] = jet2Pt_;
336  mvaInputCovU1_[20] = jet2Eta_;
337  mvaInputCovU1_[21] = jet2Phi_;
338  mvaInputCovU1_[22] = numJets_;
343 }
double GetResponse(const float *vector) const
Definition: GBRForest.h:55
const GBRForest * mvaReaderCovU1_
void PFMETAlgorithmMVA::evaluateCovU2 ( )
private

Definition at line 345 of file PFMETAlgorithmMVA.cc.

References GBRForest::GetResponse(), jet1Eta_, jet1Phi_, jet1Pt_, jet2Eta_, jet2Phi_, jet2Pt_, mvaInputCovU2_, mvaOutputCovU2_, mvaOutputDPhi_, mvaOutputU_, mvaReaderCovU2_, npuPhi_, npuSumEt_, npuU_, numJets_, numJetsPtGt30_, numVertices_, pfPhi_, pfSumEt_, pfU_, pucPhi_, pucSumEt_, pucU_, puMEt_, puPhi_, puSumEt_, tkPhi_, tkSumEt_, and tkU_.

Referenced by evaluateMVA().

346 {
347  mvaInputCovU2_[0] = pfSumEt_; // PH: helps flattens response vs. Nvtx
349  mvaInputCovU2_[2] = pfU_;
350  mvaInputCovU2_[3] = pfPhi_;
352  mvaInputCovU2_[5] = tkU_;
353  mvaInputCovU2_[6] = tkPhi_;
355  mvaInputCovU2_[8] = npuU_;
356  mvaInputCovU2_[9] = npuPhi_;
357  mvaInputCovU2_[10] = puSumEt_;
358  mvaInputCovU2_[11] = puMEt_;
359  mvaInputCovU2_[12] = puPhi_;
361  mvaInputCovU2_[14] = pucU_;
362  mvaInputCovU2_[15] = pucPhi_;
363  mvaInputCovU2_[16] = jet1Pt_;
364  mvaInputCovU2_[17] = jet1Eta_;
365  mvaInputCovU2_[18] = jet1Phi_;
366  mvaInputCovU2_[19] = jet2Pt_;
367  mvaInputCovU2_[20] = jet2Eta_;
368  mvaInputCovU2_[21] = jet2Phi_;
369  mvaInputCovU2_[22] = numJets_;
374 }
double GetResponse(const float *vector) const
Definition: GBRForest.h:55
const GBRForest * mvaReaderCovU2_
void PFMETAlgorithmMVA::evaluateDPhi ( )
private

Definition at line 286 of file PFMETAlgorithmMVA.cc.

References GBRForest::GetResponse(), jet1Eta_, jet1Phi_, jet1Pt_, jet2Eta_, jet2Phi_, jet2Pt_, mvaInputDPhi_, mvaOutputDPhi_, mvaReaderDPhi_, npuPhi_, npuSumEt_, npuU_, numJets_, numJetsPtGt30_, numVertices_, pfPhi_, pfU_, pucPhi_, pucSumEt_, pucU_, puMEt_, puPhi_, puSumEt_, tkPhi_, tkSumEt_, and tkU_.

Referenced by evaluateMVA().

287 {
289  mvaInputDPhi_[1] = pfU_;
290  mvaInputDPhi_[2] = pfPhi_;
291  mvaInputDPhi_[3] = tkSumEt_;
292  mvaInputDPhi_[4] = tkU_;
293  mvaInputDPhi_[5] = tkPhi_;
295  mvaInputDPhi_[7] = npuU_;
296  mvaInputDPhi_[8] = npuPhi_;
297  mvaInputDPhi_[9] = puSumEt_;
298  mvaInputDPhi_[10] = puMEt_;
299  mvaInputDPhi_[11] = puPhi_;
300  mvaInputDPhi_[12] = pucSumEt_;
301  mvaInputDPhi_[13] = pucU_;
302  mvaInputDPhi_[14] = pucPhi_;
303  mvaInputDPhi_[15] = jet1Pt_;
304  mvaInputDPhi_[16] = jet1Eta_;
305  mvaInputDPhi_[17] = jet1Phi_;
306  mvaInputDPhi_[18] = jet2Pt_;
307  mvaInputDPhi_[19] = jet2Eta_;
308  mvaInputDPhi_[20] = jet2Phi_;
309  mvaInputDPhi_[21] = numJets_;
312 }
double GetResponse(const float *vector) const
Definition: GBRForest.h:55
const GBRForest * mvaReaderDPhi_
void PFMETAlgorithmMVA::evaluateMVA ( )

Definition at line 220 of file PFMETAlgorithmMVA.cc.

References funct::cos(), evaluateCovU1(), evaluateCovU2(), evaluateDPhi(), evaluateU(), hasPhotons_, bookConverter::max, mvaMEt_, mvaMEtCov_, mvaOutputCovU1_, mvaOutputCovU2_, mvaOutputDPhi_, mvaOutputU_, npuU_, pfPhi_, pfU_, colinearityKinematic::Phi, Pi, funct::sin(), mathSSE::sqrt(), sumLeptonPx_, sumLeptonPy_, and tkU_.

Referenced by reco::PFMETProducerMVA::produce().

221 {
222  // CV: MVAs needs to be evaluated in order { DPhi, U1, CovU1, CovU2 }
223  // as MVA for U1 (CovU1, CovU2) uses output of DPhi (DPhi and U1) MVA
224  evaluateDPhi();
225  evaluateU();
226  evaluateCovU1();
227  evaluateCovU2();
228 
229  // compute MET(Photon check)
230  if(hasPhotons_) {
231  //Fix events with unphysical properties
233  if(tkU_/sumLeptonPt < 0.1 || npuU_/sumLeptonPt < 0.1 ) mvaOutputU_ = 1.;
234  if(tkU_/sumLeptonPt < 0.1 || npuU_/sumLeptonPt < 0.1 ) mvaOutputDPhi_ = 0.;
235  }
236  double U = pfU_*mvaOutputU_;
237  double Phi = pfPhi_ + mvaOutputDPhi_;
238  if ( U < 0. ) Phi += Pi;
239  double cosPhi = cos(Phi);
240  double sinPhi = sin(Phi);
241  double metPx = U*cosPhi - sumLeptonPx_;
242  double metPy = U*sinPhi - sumLeptonPy_;
243  double metPt = sqrt(metPx*metPx + metPy*metPy);
244  mvaMEt_.SetCoordinates(metPx, metPy, 0., metPt);
245 
246  // compute MET uncertainties in dirrections parallel and perpendicular to hadronic recoil
247  // (neglecting uncertainties on lepton momenta)
248  mvaMEtCov_(0, 0) = mvaOutputCovU1_*cosPhi*cosPhi + mvaOutputCovU2_*sinPhi*sinPhi;
249  mvaMEtCov_(0, 1) = -mvaOutputCovU1_*sinPhi*cosPhi + mvaOutputCovU2_*sinPhi*cosPhi;
250  mvaMEtCov_(1, 0) = mvaMEtCov_(0, 1);
251  mvaMEtCov_(1, 1) = mvaOutputCovU1_*sinPhi*sinPhi + mvaOutputCovU2_*cosPhi*cosPhi;
252 }
const double Pi
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
T sqrt(T t)
Definition: SSEVec.h:48
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
reco::METCovMatrix mvaMEtCov_
reco::Candidate::LorentzVector mvaMEt_
void PFMETAlgorithmMVA::evaluateU ( )
private

Definition at line 256 of file PFMETAlgorithmMVA.cc.

References GBRForest::GetResponse(), jet1Eta_, jet1Phi_, jet1Pt_, jet2Eta_, jet2Phi_, jet2Pt_, mvaInputU_, mvaOutputDPhi_, mvaOutputU_, mvaReaderU_, npuPhi_, npuSumEt_, npuU_, numJets_, numJetsPtGt30_, numVertices_, pfPhi_, pfSumEt_, pfU_, pucPhi_, pucSumEt_, pucU_, puMEt_, puPhi_, puSumEt_, tkPhi_, tkSumEt_, and tkU_.

Referenced by evaluateMVA().

257 {
258  mvaInputU_[0] = pfSumEt_; // PH: helps flattens response vs. Nvtx
260  mvaInputU_[2] = pfU_;
261  mvaInputU_[3] = pfPhi_;
262  mvaInputU_[4] = tkSumEt_;
263  mvaInputU_[5] = tkU_;
264  mvaInputU_[6] = tkPhi_;
265  mvaInputU_[7] = npuSumEt_;
266  mvaInputU_[8] = npuU_;
267  mvaInputU_[9] = npuPhi_;
268  mvaInputU_[10] = puSumEt_;
269  mvaInputU_[11] = puMEt_;
270  mvaInputU_[12] = puPhi_;
271  mvaInputU_[13] = pucSumEt_;
272  mvaInputU_[14] = pucU_;
273  mvaInputU_[15] = pucPhi_;
274  mvaInputU_[16] = jet1Pt_;
275  mvaInputU_[17] = jet1Eta_;
276  mvaInputU_[18] = jet1Phi_;
277  mvaInputU_[19] = jet2Pt_;
278  mvaInputU_[20] = jet2Eta_;
279  mvaInputU_[21] = jet2Phi_;
280  mvaInputU_[22] = numJets_;
284 }
double GetResponse(const float *vector) const
Definition: GBRForest.h:55
const GBRForest * mvaReaderU_
double PFMETAlgorithmMVA::getCovU1 ( ) const
inline

Definition at line 55 of file PFMETAlgorithmMVA.h.

References mvaOutputCovU1_.

55 { return mvaOutputCovU1_; }
double PFMETAlgorithmMVA::getCovU2 ( ) const
inline

Definition at line 56 of file PFMETAlgorithmMVA.h.

References mvaOutputCovU2_.

56 { return mvaOutputCovU2_; }
double PFMETAlgorithmMVA::getDPhi ( ) const
inline

Definition at line 54 of file PFMETAlgorithmMVA.h.

References mvaOutputDPhi_.

54 { return mvaOutputDPhi_; }
reco::Candidate::LorentzVector PFMETAlgorithmMVA::getMEt ( ) const
inline

Definition at line 50 of file PFMETAlgorithmMVA.h.

References mvaMEt_.

Referenced by reco::PFMETProducerMVA::produce().

50 { return mvaMEt_; }
reco::Candidate::LorentzVector mvaMEt_
const reco::METCovMatrix& PFMETAlgorithmMVA::getMEtCov ( ) const
inline

Definition at line 51 of file PFMETAlgorithmMVA.h.

References mvaMEtCov_.

Referenced by reco::PFMETProducerMVA::produce().

51 { return mvaMEtCov_; }
reco::METCovMatrix mvaMEtCov_
double PFMETAlgorithmMVA::getU ( ) const
inline

Definition at line 53 of file PFMETAlgorithmMVA.h.

References mvaOutputU_.

53 { return mvaOutputU_; }
void PFMETAlgorithmMVA::initialize ( const edm::EventSetup es)

Definition at line 84 of file PFMETAlgorithmMVA.cc.

References cfg_, edm::ParameterSet::getParameter(), mvaPFMET_cff::loadMVAfromDB, loadMVAfromDB_, mvaNameCovU1_, mvaNameCovU2_, mvaNameDPhi_, mvaNameU_, mvaReaderCovU1_, mvaReaderCovU2_, mvaReaderDPhi_, mvaReaderU_, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by reco::PFMETProducerMVA::produce().

85 {
86  if ( loadMVAfromDB_ ) {
87  edm::ParameterSet cfgInputRecords = cfg_.getParameter<edm::ParameterSet>("inputRecords");
88  mvaNameU_ = cfgInputRecords.getParameter<std::string>("U");
89  mvaReaderU_ = loadMVAfromDB(es, mvaNameU_);
90  mvaNameDPhi_ = cfgInputRecords.getParameter<std::string>("DPhi");
92  mvaNameCovU1_ = cfgInputRecords.getParameter<std::string>("CovU1");
94  mvaNameCovU2_ = cfgInputRecords.getParameter<std::string>("CovU2");
96  } else {
97  edm::ParameterSet cfgInputFileNames = cfg_.getParameter<edm::ParameterSet>("inputFileNames");
98 
99  mvaNameU_ = "U1Correction";
100  mvaNameDPhi_ = "PhiCorrection";
101  mvaNameCovU1_ = "CovU1";
102  mvaNameCovU2_ = "CovU2";
103 
104  edm::FileInPath inputFileNameU = cfgInputFileNames.getParameter<edm::FileInPath>("U");
105  mvaReaderU_ = loadMVAfromFile(inputFileNameU, mvaNameU_);
106  edm::FileInPath inputFileNameDPhi = cfgInputFileNames.getParameter<edm::FileInPath>("DPhi");
107  mvaReaderDPhi_ = loadMVAfromFile(inputFileNameDPhi, mvaNameDPhi_);
108  edm::FileInPath inputFileNameCovU1 = cfgInputFileNames.getParameter<edm::FileInPath>("CovU1");
109  mvaReaderCovU1_ = loadMVAfromFile(inputFileNameCovU1, mvaNameCovU1_);
110  edm::FileInPath inputFileNameCovU2 = cfgInputFileNames.getParameter<edm::FileInPath>("CovU2");
111  mvaReaderCovU2_ = loadMVAfromFile(inputFileNameCovU2, mvaNameCovU2_);
112  }
113 }
T getParameter(std::string const &) const
const GBRForest * mvaReaderCovU1_
const GBRForest * mvaReaderCovU2_
edm::ParameterSet cfg_
std::string mvaNameCovU1_
const GBRForest * mvaReaderDPhi_
const GBRForest * mvaReaderU_
std::string mvaNameDPhi_
std::string mvaNameCovU2_
tuple loadMVAfromDB
Definition: mvaPFMET_cff.py:80
void PFMETAlgorithmMVA::print ( std::ostream &  stream) const

Definition at line 375 of file PFMETAlgorithmMVA.cc.

References jet1Eta_, jet1Phi_, jet1Pt_, jet2Eta_, jet2Phi_, jet2Pt_, mvaOutputCovU1_, mvaOutputCovU2_, mvaOutputDPhi_, mvaOutputU_, npuPhi_, npuSumEt_, npuU_, numJets_, numJetsPtGt30_, numVertices_, pfPhi_, pfSumEt_, pfU_, pucPhi_, pucSumEt_, pucU_, puMEt_, puPhi_, puSumEt_, mathSSE::sqrt(), sumLeptonPx_, sumLeptonPy_, tkPhi_, tkSumEt_, and tkU_.

376 {
377  stream << "<PFMETAlgorithmMVA::print>:" << std::endl;
378  stream << " PF: sumEt = " << pfSumEt_ << ", U = " << pfU_ << ", phi = " << pfPhi_ << std::endl;
379  stream << " TK: sumEt = " << tkSumEt_ << ", U = " << tkU_ << ", phi = " << tkPhi_ << std::endl;
380  stream << " NPU: sumEt = " << npuSumEt_ << ", U = " << npuU_ << ", phi = " << npuPhi_ << std::endl;
381  stream << " PU: sumEt = " << puSumEt_ << ", MEt = " << puMEt_ << ", phi = " << puPhi_ << std::endl;
382  stream << " PUC: sumEt = " << pucSumEt_ << ", U = " << pucU_ << ", phi = " << pucPhi_ << std::endl;
383  stream << " jet1: Pt = " << jet1Pt_ << ", eta = " << jet1Eta_ << ", phi = " << jet1Phi_ << std::endl;
384  stream << " jet2: Pt = " << jet2Pt_ << ", eta = " << jet2Eta_ << ", phi = " << jet2Phi_ << std::endl;
385  stream << " num. jets = " << numJets_ << " (" << numJetsPtGt30_ << " with Pt > 30 GeV)" << std::endl;
386  stream << " num. vertices = " << numVertices_ << std::endl;
387  stream << " MVA output: U = " << mvaOutputU_ << ", dPhi = " << mvaOutputDPhi_ << ","
388  << " covU1 = " << mvaOutputCovU1_ << ", covU2 = " << mvaOutputCovU2_ << std::endl;
389  stream << " sum(leptons): Pt = " << sqrt(sumLeptonPx_*sumLeptonPx_ + sumLeptonPy_*sumLeptonPy_) << ","
390  << " phi = " << atan2(sumLeptonPy_, sumLeptonPx_) << " "
391  << "(Px = " << sumLeptonPx_ << ", Py = " << sumLeptonPy_ << ")" << std::endl;
392 }
T sqrt(T t)
Definition: SSEVec.h:48
void PFMETAlgorithmMVA::setHasPhotons ( bool  hasPhotons)
inline

Definition at line 41 of file PFMETAlgorithmMVA.h.

References hasPhotons_.

Referenced by reco::PFMETProducerMVA::produce().

41 { hasPhotons_ = hasPhotons; }
void PFMETAlgorithmMVA::setInput ( const std::vector< reco::PUSubMETCandInfo > &  leptons,
const std::vector< reco::PUSubMETCandInfo > &  jets,
const std::vector< reco::PUSubMETCandInfo > &  pfCandidates,
const std::vector< reco::Vertex::Point > &  vertices 
)

Definition at line 116 of file PFMETAlgorithmMVA.cc.

References chargedSumLeptonPx_, chargedSumLeptonPy_, MvaMEtUtilities::computeAllSums(), MvaMEtUtilities::computeRecoil(), MvaMEtUtilities::getCleanedJets(), MvaMEtUtilities::getLeptonsChSumMEX(), MvaMEtUtilities::getLeptonsChSumMEY(), MvaMEtUtilities::getLeptonsSumMEX(), MvaMEtUtilities::getLeptonsSumMEY(), MvaMEtUtilities::kChHS, MvaMEtUtilities::kHS, MvaMEtUtilities::kHSMinusNeutralPU, MvaMEtUtilities::kPF, MvaMEtUtilities::kPU, MvaMEtUtilities::leadJetP4(), CommonMETData::met, MvaMEtUtilities::numJetsAboveThreshold(), CommonMETData::phi, MvaMEtUtilities::subleadJetP4(), CommonMETData::sumet, sumLeptonPx_, sumLeptonPy_, and utils_.

Referenced by reco::PFMETProducerMVA::produce().

120 {
121 
122 
124 
127 
130 
131  const std::vector<reco::PUSubMETCandInfo> jets_cleaned = utils_.getCleanedJets();
132 
138 
139  reco::Candidate::LorentzVector jet1P4 = utils_.leadJetP4(jets_cleaned);
140  reco::Candidate::LorentzVector jet2P4 = utils_.subleadJetP4(jets_cleaned);
141 
142  double pfSumEt = pfRecoil_data.sumet;
143  double pfU = pfRecoil_data.met;
144  double pfPhi = pfRecoil_data.phi;
145  double tkSumEt = chHSRecoil_data.sumet;
146  double tkU = chHSRecoil_data.met;
147  double tkPhi = chHSRecoil_data.phi;
148  double npuSumEt = hsRecoil_data.sumet;
149  double npuU = hsRecoil_data.met;
150  double npuPhi = hsRecoil_data.phi;
151  double puSumEt = puRecoil_data.sumet;
152  double puMEt = puRecoil_data.met;
153  double puPhi = puRecoil_data.phi;
154  double pucSumEt = hsMinusNeutralPUMEt_data.sumet;
155  double pucU = hsMinusNeutralPUMEt_data.met;
156  double pucPhi = hsMinusNeutralPUMEt_data.phi;
157  double jet1Pt = jet1P4.pt();
158  double jet1Eta = jet1P4.eta();
159  double jet1Phi = jet1P4.phi();
160  double jet2Pt = jet2P4.pt();
161  double jet2Eta = jet2P4.eta();
162  double jet2Phi = jet2P4.phi();
163  double numJetsPtGt30 = utils_.numJetsAboveThreshold(jets_cleaned, 30.);
164  double numJets = jets_cleaned.size();
165  double numVertices = vertices.size();
166 
167  setInput(pfSumEt, pfU, pfPhi,
168  tkSumEt, tkU, tkPhi,
169  npuSumEt, npuU, npuPhi,
170  puSumEt, puMEt, puPhi,
171  pucSumEt, pucU, pucPhi,
172  jet1Pt, jet1Eta, jet1Phi,
173  jet2Pt, jet2Eta, jet2Phi,
174  numJetsPtGt30, numJets,
175  numVertices);
176 
177 }
const std::vector< reco::PUSubMETCandInfo > & getCleanedJets() const
double getLeptonsChSumMEX() const
double getLeptonsChSumMEY() const
unsigned numJetsAboveThreshold(const std::vector< reco::PUSubMETCandInfo > &, double)
MvaMEtUtilities utils_
reco::Candidate::LorentzVector subleadJetP4(const std::vector< reco::PUSubMETCandInfo > &)
void setInput(const std::vector< reco::PUSubMETCandInfo > &, const std::vector< reco::PUSubMETCandInfo > &, const std::vector< reco::PUSubMETCandInfo > &, const std::vector< reco::Vertex::Point > &)
std::vector< PFCandidatePtr > pfCandidates(const PFJet &jet, int particleId, bool sort=true)
double getLeptonsSumMEX() const
vector< PseudoJet > jets
Structure containing data common to all types of MET.
Definition: CommonMETData.h:12
void computeAllSums(const std::vector< reco::PUSubMETCandInfo > &jets, const std::vector< reco::PUSubMETCandInfo > &leptons, const std::vector< reco::PUSubMETCandInfo > &pfCandidates)
reco::Candidate::LorentzVector leadJetP4(const std::vector< reco::PUSubMETCandInfo > &)
double getLeptonsSumMEY() const
CommonMETData computeRecoil(int metType)
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:37
void PFMETAlgorithmMVA::setInput ( double  pfSumEt,
double  pfU,
double  pfPhi,
double  tkSumEt,
double  tkU,
double  tkPhi,
double  npuSumEt,
double  npuU,
double  npuPhi,
double  puSumEt,
double  puMEt,
double  puPhi,
double  pucSumEt,
double  pucU,
double  pucPhi,
double  jet1Pt,
double  jet1Eta,
double  jet1Phi,
double  jet2Pt,
double  jet2Eta,
double  jet2Phi,
double  numJetsPtGt30,
double  numJets,
double  numVertices 
)
private

Definition at line 179 of file PFMETAlgorithmMVA.cc.

References jet1Eta_, jet1Phi_, jet1Pt_, jet2Eta_, jet2Phi_, jet2Pt_, npuPhi_, npuSumEt_, npuU_, numJets_, numJetsPtGt30_, numVertices_, pfPhi_, pfSumEt_, pfU_, pucPhi_, pucSumEt_, pucU_, puMEt_, puPhi_, puSumEt_, tkPhi_, tkSumEt_, and tkU_.

188 {
189  // protection against "empty events"
190  if ( pfSumEt < 1. ) pfSumEt = 1.;
191 
192  pfSumEt_ = pfSumEt;
193  pfU_ = pfU;
194  pfPhi_ = pfPhi;
195  tkSumEt_ = tkSumEt/pfSumEt_;
196  tkU_ = tkU;
197  tkPhi_ = tkPhi;
198  npuSumEt_ = npuSumEt/pfSumEt_;
199  npuU_ = npuU;
200  npuPhi_ = npuPhi;
201  puSumEt_ = puSumEt/pfSumEt_;
202  puMEt_ = puMEt;
203  puPhi_ = puPhi;
204  pucSumEt_ = pucSumEt/pfSumEt_;
205  pucU_ = pucU;
206  pucPhi_ = pucPhi;
207  jet1Pt_ = jet1Pt;
208  jet1Eta_ = jet1Eta;
209  jet1Phi_ = jet1Phi;
210  jet2Pt_ = jet2Pt;
211  jet2Eta_ = jet2Eta;
212  jet2Phi_ = jet2Phi;
213  numJetsPtGt30_ = numJetsPtGt30;
214  numJets_ = numJets;
215  numVertices_ = numVertices;
216 }

Member Data Documentation

edm::ParameterSet PFMETAlgorithmMVA::cfg_
private

Definition at line 138 of file PFMETAlgorithmMVA.h.

Referenced by initialize().

double PFMETAlgorithmMVA::chargedSumLeptonPx_
private

Definition at line 124 of file PFMETAlgorithmMVA.h.

Referenced by setInput().

double PFMETAlgorithmMVA::chargedSumLeptonPy_
private

Definition at line 125 of file PFMETAlgorithmMVA.h.

Referenced by setInput().

bool PFMETAlgorithmMVA::hasPhotons_
private

Definition at line 85 of file PFMETAlgorithmMVA.h.

Referenced by evaluateMVA(), and setHasPhotons().

Float_t PFMETAlgorithmMVA::jet1Eta_
private
Float_t PFMETAlgorithmMVA::jet1Phi_
private
Float_t PFMETAlgorithmMVA::jet1Pt_
private
Float_t PFMETAlgorithmMVA::jet2Eta_
private
Float_t PFMETAlgorithmMVA::jet2Phi_
private
Float_t PFMETAlgorithmMVA::jet2Pt_
private
bool PFMETAlgorithmMVA::loadMVAfromDB_
private

Definition at line 136 of file PFMETAlgorithmMVA.h.

Referenced by initialize(), PFMETAlgorithmMVA(), and ~PFMETAlgorithmMVA().

Float_t* PFMETAlgorithmMVA::mvaInputCovU1_
private

Definition at line 114 of file PFMETAlgorithmMVA.h.

Referenced by evaluateCovU1(), PFMETAlgorithmMVA(), and ~PFMETAlgorithmMVA().

Float_t* PFMETAlgorithmMVA::mvaInputCovU2_
private

Definition at line 115 of file PFMETAlgorithmMVA.h.

Referenced by evaluateCovU2(), PFMETAlgorithmMVA(), and ~PFMETAlgorithmMVA().

Float_t* PFMETAlgorithmMVA::mvaInputDPhi_
private

Definition at line 113 of file PFMETAlgorithmMVA.h.

Referenced by evaluateDPhi(), PFMETAlgorithmMVA(), and ~PFMETAlgorithmMVA().

Float_t* PFMETAlgorithmMVA::mvaInputU_
private

Definition at line 112 of file PFMETAlgorithmMVA.h.

Referenced by evaluateU(), PFMETAlgorithmMVA(), and ~PFMETAlgorithmMVA().

reco::Candidate::LorentzVector PFMETAlgorithmMVA::mvaMEt_
private

Definition at line 127 of file PFMETAlgorithmMVA.h.

Referenced by evaluateMVA(), and getMEt().

reco::METCovMatrix PFMETAlgorithmMVA::mvaMEtCov_
private

Definition at line 129 of file PFMETAlgorithmMVA.h.

Referenced by evaluateMVA(), and getMEtCov().

std::string PFMETAlgorithmMVA::mvaNameCovU1_
private

Definition at line 81 of file PFMETAlgorithmMVA.h.

Referenced by initialize().

std::string PFMETAlgorithmMVA::mvaNameCovU2_
private

Definition at line 82 of file PFMETAlgorithmMVA.h.

Referenced by initialize().

std::string PFMETAlgorithmMVA::mvaNameDPhi_
private

Definition at line 80 of file PFMETAlgorithmMVA.h.

Referenced by initialize().

std::string PFMETAlgorithmMVA::mvaNameU_
private

Definition at line 79 of file PFMETAlgorithmMVA.h.

Referenced by initialize().

Float_t PFMETAlgorithmMVA::mvaOutputCovU1_
private

Definition at line 119 of file PFMETAlgorithmMVA.h.

Referenced by evaluateCovU1(), evaluateMVA(), getCovU1(), and print().

Float_t PFMETAlgorithmMVA::mvaOutputCovU2_
private

Definition at line 120 of file PFMETAlgorithmMVA.h.

Referenced by evaluateCovU2(), evaluateMVA(), getCovU2(), and print().

Float_t PFMETAlgorithmMVA::mvaOutputDPhi_
private
Float_t PFMETAlgorithmMVA::mvaOutputU_
private

Definition at line 117 of file PFMETAlgorithmMVA.h.

Referenced by evaluateCovU1(), evaluateCovU2(), evaluateMVA(), evaluateU(), getU(), and print().

const GBRForest* PFMETAlgorithmMVA::mvaReaderCovU1_
private

Definition at line 133 of file PFMETAlgorithmMVA.h.

Referenced by evaluateCovU1(), initialize(), and ~PFMETAlgorithmMVA().

const GBRForest* PFMETAlgorithmMVA::mvaReaderCovU2_
private

Definition at line 134 of file PFMETAlgorithmMVA.h.

Referenced by evaluateCovU2(), initialize(), and ~PFMETAlgorithmMVA().

const GBRForest* PFMETAlgorithmMVA::mvaReaderDPhi_
private

Definition at line 132 of file PFMETAlgorithmMVA.h.

Referenced by evaluateDPhi(), initialize(), and ~PFMETAlgorithmMVA().

const GBRForest* PFMETAlgorithmMVA::mvaReaderU_
private

Definition at line 131 of file PFMETAlgorithmMVA.h.

Referenced by evaluateU(), initialize(), and ~PFMETAlgorithmMVA().

int PFMETAlgorithmMVA::mvaType_
private

Definition at line 84 of file PFMETAlgorithmMVA.h.

Referenced by PFMETAlgorithmMVA().

Float_t PFMETAlgorithmMVA::npuPhi_
private
Float_t PFMETAlgorithmMVA::npuSumEt_
private
Float_t PFMETAlgorithmMVA::npuU_
private
Float_t PFMETAlgorithmMVA::numJets_
private
Float_t PFMETAlgorithmMVA::numJetsPtGt30_
private
Float_t PFMETAlgorithmMVA::numVertices_
private
Float_t PFMETAlgorithmMVA::pfPhi_
private
Float_t PFMETAlgorithmMVA::pfSumEt_
private

Definition at line 87 of file PFMETAlgorithmMVA.h.

Referenced by evaluateCovU1(), evaluateCovU2(), evaluateU(), print(), and setInput().

Float_t PFMETAlgorithmMVA::pfU_
private
Float_t PFMETAlgorithmMVA::pucPhi_
private
Float_t PFMETAlgorithmMVA::pucSumEt_
private
Float_t PFMETAlgorithmMVA::pucU_
private
Float_t PFMETAlgorithmMVA::puMEt_
private
Float_t PFMETAlgorithmMVA::puPhi_
private
Float_t PFMETAlgorithmMVA::puSumEt_
private
double PFMETAlgorithmMVA::sumLeptonPx_
private

Definition at line 122 of file PFMETAlgorithmMVA.h.

Referenced by evaluateMVA(), print(), and setInput().

double PFMETAlgorithmMVA::sumLeptonPy_
private

Definition at line 123 of file PFMETAlgorithmMVA.h.

Referenced by evaluateMVA(), print(), and setInput().

Float_t PFMETAlgorithmMVA::tkPhi_
private
Float_t PFMETAlgorithmMVA::tkSumEt_
private
Float_t PFMETAlgorithmMVA::tkU_
private
MvaMEtUtilities PFMETAlgorithmMVA::utils_
private

Definition at line 77 of file PFMETAlgorithmMVA.h.

Referenced by setInput().