CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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, edm::ConsumesCollector iC)
 
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 computeMET ()
 
std::unique_ptr< float[]> createFloatVector (std::vector< std::string > variableNames)
 
const float evaluateCovU1 ()
 
const float evaluateCovU2 ()
 
const float evaluateDPhi ()
 
const float evaluateU ()
 
const float GetResponse (const GBRForest *Reader, std::vector< std::string > &variableNames)
 
const GBRForestloadMVAfromFile (const edm::FileInPath &inputFileName, const std::string &mvaName)
 
const std::string updateVariableNames (std::string input)
 

Private Attributes

edm::ParameterSet cfg_
 
double chargedSumLeptonPx_
 
double chargedSumLeptonPy_
 
double dZcut_
 
bool hasPhotons_
 
bool loadMVAfromDB_
 
float * mvaInputCovU1_
 
float * mvaInputCovU2_
 
float * mvaInputDPhi_
 
float * mvaInputU_
 
reco::Candidate::LorentzVector mvaMEt_
 
reco::METCovMatrix mvaMEtCov_
 
std::string mvaNameCovU1_
 
std::string mvaNameCovU2_
 
std::string mvaNameDPhi_
 
std::string mvaNameU_
 
float mvaOutputCovU1_
 
float mvaOutputCovU2_
 
float mvaOutputDPhi_
 
float mvaOutputU_
 
const GBRForestmvaReaderCovU1_
 
const GBRForestmvaReaderCovU2_
 
const GBRForestmvaReaderDPhi_
 
const GBRForestmvaReaderU_
 
edm::ESGetToken< GBRForest,
GBRWrapperRcd
mvaTokenCovU1_
 
edm::ESGetToken< GBRForest,
GBRWrapperRcd
mvaTokenCovU2_
 
edm::ESGetToken< GBRForest,
GBRWrapperRcd
mvaTokenDPhi_
 
edm::ESGetToken< GBRForest,
GBRWrapperRcd
mvaTokenU_
 
int mvaType_
 
double sumLeptonPx_
 
double sumLeptonPy_
 
MvaMEtUtilities utils_
 
std::map< std::string, float > var_
 
std::vector< std::string > varForCovU1_
 
std::vector< std::string > varForCovU2_
 
std::vector< std::string > varForDPhi_
 
std::vector< std::string > varForU_
 

Detailed Description

MVA based algorithm for computing the particle-flow missing Et

Authors
Phil Harris, CERN Christian Veelken, LLR

Definition at line 32 of file PFMETAlgorithmMVA.h.

Constructor & Destructor Documentation

PFMETAlgorithmMVA::PFMETAlgorithmMVA ( const edm::ParameterSet cfg,
edm::ConsumesCollector  iC 
)

Definition at line 111 of file PFMETAlgorithmMVA.cc.

References cfg_, edm::ConsumesCollector::esConsumes(), edm::ParameterSet::getParameter(), kBaseline, loadMVAfromDB_, mvaNameCovU1_, mvaNameCovU2_, mvaNameDPhi_, mvaNameU_, mvaTokenCovU1_, mvaTokenCovU2_, mvaTokenDPhi_, mvaTokenU_, mvaType_, and AlCaHLTBitMon_QueryRunRegistry::string.

112  : utils_(cfg),
113  mvaReaderU_(nullptr),
114  mvaReaderDPhi_(nullptr),
115  mvaReaderCovU1_(nullptr),
116  mvaReaderCovU2_(nullptr),
117  cfg_(cfg) {
119 
120  edm::ParameterSet cfgInputRecords = cfg_.getParameter<edm::ParameterSet>("inputRecords");
121  mvaNameU_ = cfgInputRecords.getParameter<std::string>("U");
122  mvaNameDPhi_ = cfgInputRecords.getParameter<std::string>("DPhi");
123  mvaNameCovU1_ = cfgInputRecords.getParameter<std::string>("CovU1");
124  mvaNameCovU2_ = cfgInputRecords.getParameter<std::string>("CovU2");
125 
126  loadMVAfromDB_ = cfg.getParameter<bool>("loadMVAfromDB");
127  if (loadMVAfromDB_) {
128  mvaTokenU_ = iC.esConsumes(edm::ESInputTag("", mvaNameU_));
129  mvaTokenDPhi_ = iC.esConsumes(edm::ESInputTag("", mvaNameDPhi_));
130  mvaTokenCovU1_ = iC.esConsumes(edm::ESInputTag("", mvaNameCovU1_));
131  mvaTokenCovU2_ = iC.esConsumes(edm::ESInputTag("", mvaNameCovU2_));
132  }
133 }
MvaMEtUtilities utils_
const GBRForest * mvaReaderCovU1_
const GBRForest * mvaReaderCovU2_
edm::ParameterSet cfg_
std::string mvaNameCovU1_
const GBRForest * mvaReaderDPhi_
const GBRForest * mvaReaderU_
edm::ESGetToken< GBRForest, GBRWrapperRcd > mvaTokenCovU1_
edm::ESGetToken< GBRForest, GBRWrapperRcd > mvaTokenCovU2_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::string mvaNameDPhi_
edm::ESGetToken< GBRForest, GBRWrapperRcd > mvaTokenDPhi_
edm::ESGetToken< GBRForest, GBRWrapperRcd > mvaTokenU_
std::string mvaNameCovU2_
PFMETAlgorithmMVA::~PFMETAlgorithmMVA ( )

Definition at line 135 of file PFMETAlgorithmMVA.cc.

References loadMVAfromDB_, mvaReaderCovU1_, mvaReaderCovU2_, mvaReaderDPhi_, and mvaReaderU_.

135  {
136  if (!loadMVAfromDB_) {
137  delete mvaReaderU_;
138  delete mvaReaderDPhi_;
139  delete mvaReaderCovU1_;
140  delete mvaReaderCovU2_;
141  }
142 }
const GBRForest * mvaReaderCovU1_
const GBRForest * mvaReaderCovU2_
const GBRForest * mvaReaderDPhi_
const GBRForest * mvaReaderU_

Member Function Documentation

void PFMETAlgorithmMVA::computeMET ( )
private

Definition at line 256 of file PFMETAlgorithmMVA.cc.

References funct::cos(), Phase1L1TJetProducer_cfi::cosPhi, mvaMEt_, mvaMEtCov_, mvaOutputCovU1_, mvaOutputCovU2_, colinearityKinematic::Phi, Pi, funct::sin(), Phase1L1TJetProducer_cfi::sinPhi, mathSSE::sqrt(), sumLeptonPx_, sumLeptonPy_, and var_.

Referenced by evaluateMVA().

256  {
257  double U = var_["RecoilCor_U"];
258  double Phi = var_["PhiCor_UPhi"];
259  if (U < 0.)
260  Phi += Pi; //RF: No sign flip for U necessary in that case?
261  double cosPhi = std::cos(Phi);
262  double sinPhi = std::sin(Phi);
263  double metPx = U * cosPhi - sumLeptonPx_;
264  double metPy = U * sinPhi - sumLeptonPy_;
265  double metPt = sqrt(metPx * metPx + metPy * metPy);
266  mvaMEt_.SetCoordinates(metPx, metPy, 0., metPt);
267  // compute MET uncertainties in dirrections parallel and perpendicular to hadronic recoil
268  // (neglecting uncertainties on lepton momenta)
269  mvaMEtCov_(0, 0) = mvaOutputCovU1_ * cosPhi * cosPhi + mvaOutputCovU2_ * sinPhi * sinPhi;
270  mvaMEtCov_(0, 1) = -mvaOutputCovU1_ * sinPhi * cosPhi + mvaOutputCovU2_ * sinPhi * cosPhi;
271  mvaMEtCov_(1, 0) = mvaMEtCov_(0, 1);
272  mvaMEtCov_(1, 1) = mvaOutputCovU1_ * sinPhi * sinPhi + mvaOutputCovU2_ * cosPhi * cosPhi;
273 }
const double Pi
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
T sqrt(T t)
Definition: SSEVec.h:19
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
reco::METCovMatrix mvaMEtCov_
std::map< std::string, float > var_
reco::Candidate::LorentzVector mvaMEt_
std::unique_ptr< float[]> PFMETAlgorithmMVA::createFloatVector ( std::vector< std::string >  variableNames)
private

Definition at line 222 of file PFMETAlgorithmMVA.cc.

References mps_fire::i, and var_.

Referenced by GetResponse().

222  {
223  std::unique_ptr<float[]> floatVector(new float[variableNames.size()]);
224  int i = 0;
225  for (const auto& variableName : variableNames) {
226  floatVector[i++] = var_[variableName];
227  }
228  return floatVector;
229 }
std::map< std::string, float > var_
const float PFMETAlgorithmMVA::evaluateCovU1 ( )
private
const float PFMETAlgorithmMVA::evaluateCovU2 ( )
private
const float PFMETAlgorithmMVA::evaluateDPhi ( )
private
void PFMETAlgorithmMVA::evaluateMVA ( )

Definition at line 232 of file PFMETAlgorithmMVA.cc.

References computeMET(), GetResponse(), hasPhotons_, SiStripPI::max, mvaOutputCovU1_, mvaOutputCovU2_, mvaOutputDPhi_, mvaOutputU_, mvaReaderCovU1_, mvaReaderCovU2_, mvaReaderDPhi_, mvaReaderU_, funct::pow(), mathSSE::sqrt(), sumLeptonPx_, sumLeptonPy_, var_, varForCovU1_, varForCovU2_, varForDPhi_, and varForU_.

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

232  {
233  // CV: MVAs needs to be evaluated in order { DPhi, U1, CovU1, CovU2 }
234  // as MVA for U1 (CovU1, CovU2) uses output of DPhi (DPhi and U1) MVA
236  var_["PhiCor_UPhi"] = var_["particleFlow_UPhi"] + mvaOutputDPhi_;
238  var_["RecoilCor_U"] = var_["particleFlow_U"] * mvaOutputU_;
239  var_["RecoilCor_UPhi"] = var_["PhiCor_UPhi"];
240  mvaOutputCovU1_ = std::pow(GetResponse(mvaReaderCovU1_, varForCovU1_) * mvaOutputU_ * var_["particleFlow_U"], 2);
241  mvaOutputCovU2_ = std::pow(GetResponse(mvaReaderCovU2_, varForCovU2_) * mvaOutputU_ * var_["particleFlow_U"], 2);
242 
243  // compute MET(Photon check)
244  if (hasPhotons_) {
245  //Fix events with unphysical properties
246  double sumLeptonPt = std::max(sqrt(sumLeptonPx_ * sumLeptonPx_ + sumLeptonPy_ * sumLeptonPy_), 1.);
247  if (var_["track_U"] / sumLeptonPt < 0.1 || var_["noPileUp_U"] / sumLeptonPt < 0.1) {
248  mvaOutputU_ = 1.;
249  mvaOutputDPhi_ = 0.;
250  }
251  }
252  computeMET();
253 }
std::vector< std::string > varForCovU2_
std::vector< std::string > varForU_
const GBRForest * mvaReaderCovU1_
const float GetResponse(const GBRForest *Reader, std::vector< std::string > &variableNames)
const GBRForest * mvaReaderCovU2_
const GBRForest * mvaReaderDPhi_
const GBRForest * mvaReaderU_
T sqrt(T t)
Definition: SSEVec.h:19
std::vector< std::string > varForCovU1_
std::vector< std::string > varForDPhi_
std::map< std::string, float > var_
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
const float PFMETAlgorithmMVA::evaluateU ( )
private
double PFMETAlgorithmMVA::getCovU1 ( ) const
inline

Definition at line 53 of file PFMETAlgorithmMVA.h.

References mvaOutputCovU1_.

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

Definition at line 54 of file PFMETAlgorithmMVA.h.

References mvaOutputCovU2_.

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

Definition at line 52 of file PFMETAlgorithmMVA.h.

References mvaOutputDPhi_.

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

Definition at line 48 of file PFMETAlgorithmMVA.h.

References mvaMEt_.

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

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

Definition at line 49 of file PFMETAlgorithmMVA.h.

References mvaMEtCov_.

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

49 { return mvaMEtCov_; }
reco::METCovMatrix mvaMEtCov_
const float PFMETAlgorithmMVA::GetResponse ( const GBRForest Reader,
std::vector< std::string > &  variableNames 
)
private

Definition at line 276 of file PFMETAlgorithmMVA.cc.

References createFloatVector(), GBRForest::GetResponse(), and mps_fire::result.

Referenced by evaluateMVA().

276  {
277  std::unique_ptr<float[]> mvaInputVector = createFloatVector(variableNames);
278  double result = Reader->GetResponse(mvaInputVector.get());
279  return result;
280 }
double GetResponse(const float *vector) const
Definition: GBRForest.h:48
tuple result
Definition: mps_fire.py:311
std::unique_ptr< float[]> createFloatVector(std::vector< std::string > variableNames)
double PFMETAlgorithmMVA::getU ( ) const
inline

Definition at line 51 of file PFMETAlgorithmMVA.h.

References mvaOutputU_.

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

Definition at line 145 of file PFMETAlgorithmMVA.cc.

References cfg_, edm::EventSetup::getData(), edm::ParameterSet::getParameter(), loadMVAfromDB_, loadMVAfromFile(), mvaNameCovU1_, mvaNameCovU2_, mvaNameDPhi_, mvaNameU_, mvaReaderCovU1_, mvaReaderCovU2_, mvaReaderDPhi_, mvaReaderU_, mvaTokenCovU1_, mvaTokenCovU2_, mvaTokenDPhi_, and mvaTokenU_.

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

145  {
146  if (loadMVAfromDB_) {
151  } else {
152  edm::ParameterSet cfgInputFileNames = cfg_.getParameter<edm::ParameterSet>("inputFileNames");
153 
154  edm::FileInPath inputFileNameU = cfgInputFileNames.getParameter<edm::FileInPath>("U");
155  mvaReaderU_ = loadMVAfromFile(inputFileNameU, mvaNameU_);
156  edm::FileInPath inputFileNameDPhi = cfgInputFileNames.getParameter<edm::FileInPath>("DPhi");
157  mvaReaderDPhi_ = loadMVAfromFile(inputFileNameDPhi, mvaNameDPhi_);
158  edm::FileInPath inputFileNameCovU1 = cfgInputFileNames.getParameter<edm::FileInPath>("CovU1");
159  mvaReaderCovU1_ = loadMVAfromFile(inputFileNameCovU1, mvaNameCovU1_);
160  edm::FileInPath inputFileNameCovU2 = cfgInputFileNames.getParameter<edm::FileInPath>("CovU2");
161  mvaReaderCovU2_ = loadMVAfromFile(inputFileNameCovU2, mvaNameCovU2_);
162  }
163 }
const GBRForest * loadMVAfromFile(const edm::FileInPath &inputFileName, const std::string &mvaName)
const GBRForest * mvaReaderCovU1_
const GBRForest * mvaReaderCovU2_
edm::ParameterSet cfg_
std::string mvaNameCovU1_
const GBRForest * mvaReaderDPhi_
bool getData(T &iHolder) const
Definition: EventSetup.h:122
const GBRForest * mvaReaderU_
edm::ESGetToken< GBRForest, GBRWrapperRcd > mvaTokenCovU1_
edm::ESGetToken< GBRForest, GBRWrapperRcd > mvaTokenCovU2_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::string mvaNameDPhi_
edm::ESGetToken< GBRForest, GBRWrapperRcd > mvaTokenDPhi_
edm::ESGetToken< GBRForest, GBRWrapperRcd > mvaTokenU_
std::string mvaNameCovU2_
const GBRForest * PFMETAlgorithmMVA::loadMVAfromFile ( const edm::FileInPath inputFileName,
const std::string &  mvaName 
)
private

Definition at line 74 of file PFMETAlgorithmMVA.cc.

References Exception, edm::FileInPath::fullPath(), mps_fire::i, writeEcalDQMStatus::inputFile, edm::FileInPath::location(), beam_dqm_sourceclient-live_cfg::mva, mvaNameCovU1_, mvaNameCovU2_, mvaNameDPhi_, mvaNameU_, edm::FileInPath::Unknown, updateVariableNames(), varForCovU1_, varForCovU2_, varForDPhi_, and varForU_.

Referenced by initialize().

74  {
75  if (inputFileName.location() == edm::FileInPath::Unknown)
76  throw cms::Exception("PFMETAlgorithmMVA::loadMVA") << " Failed to find File = " << inputFileName << " !!\n";
77  std::unique_ptr<TFile> inputFile(new TFile(inputFileName.fullPath().data()));
78 
79  std::vector<std::string>* lVec = (std::vector<std::string>*)inputFile->Get("varlist");
80 
81  if (lVec == nullptr) {
82  throw cms::Exception("PFMETAlgorithmMVA::loadMVA")
83  << " Failed to load mva file : " << inputFileName.fullPath().data() << " is not a proper file !!\n";
84  }
85 
86  std::vector<std::string> variableNames;
87  for (unsigned int i = 0; i < lVec->size(); ++i) {
88  variableNames.push_back(updateVariableNames(lVec->at(i)));
89  }
90 
91  if (mvaName.find(mvaNameU_) != std::string::npos)
92  varForU_ = variableNames;
93  else if (mvaName.find(mvaNameDPhi_) != std::string::npos)
94  varForDPhi_ = variableNames;
95  else if (mvaName.find(mvaNameCovU1_) != std::string::npos)
96  varForCovU1_ = variableNames;
97  else if (mvaName.find(mvaNameCovU2_) != std::string::npos)
98  varForCovU2_ = variableNames;
99  else
100  throw cms::Exception("PFMETAlgorithmMVA::loadMVA")
101  << "MVA MET weight file tree names do not match specified inputs" << std::endl;
102 
103  const GBRForest* mva = (GBRForest*)inputFile->Get(mvaName.data());
104  if (!mva)
105  throw cms::Exception("PFMETAlgorithmMVA::loadMVA")
106  << " Failed to load MVA = " << mvaName.data() << " from file = " << inputFileName.fullPath().data() << " !!\n";
107 
108  return mva;
109 }
std::vector< std::string > varForCovU2_
std::vector< std::string > varForU_
const std::string updateVariableNames(std::string input)
std::string mvaNameCovU1_
LocationCode location() const
Where was the file found?
Definition: FileInPath.cc:159
std::vector< std::string > varForCovU1_
std::vector< std::string > varForDPhi_
std::string mvaNameDPhi_
std::string fullPath() const
Definition: FileInPath.cc:161
std::string mvaNameCovU2_
void PFMETAlgorithmMVA::print ( std::ostream &  stream) const

Definition at line 283 of file PFMETAlgorithmMVA.cc.

References mps_splice::entry, mvaOutputCovU1_, mvaOutputCovU2_, mvaOutputDPhi_, mvaOutputU_, mathSSE::sqrt(), sumLeptonPx_, sumLeptonPy_, and var_.

283  {
284  stream << "<PFMETAlgorithmMVA::print>:" << std::endl;
285  for (const auto& entry : var_)
286  stream << entry.first << " = " << entry.second << std::endl;
287  stream << " covU1 = " << mvaOutputCovU1_ << ", covU2 = " << mvaOutputCovU2_ << std::endl;
288  stream << " sum(leptons): Pt = " << sqrt(sumLeptonPx_ * sumLeptonPx_ + sumLeptonPy_ * sumLeptonPy_) << ","
289  << " phi = " << atan2(sumLeptonPy_, sumLeptonPx_) << " "
290  << "(Px = " << sumLeptonPx_ << ", Py = " << sumLeptonPy_ << ")";
291  stream << " MVA output: U = " << mvaOutputU_ << ", dPhi = " << mvaOutputDPhi_ << ","
292  << " covU1 = " << mvaOutputCovU1_ << ", covU2 = " << mvaOutputCovU2_ << std::endl;
293  stream << std::endl;
294 }
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
T sqrt(T t)
Definition: SSEVec.h:19
std::map< std::string, float > var_
list entry
Definition: mps_splice.py:68
void PFMETAlgorithmMVA::setHasPhotons ( bool  hasPhotons)
inline

Definition at line 39 of file PFMETAlgorithmMVA.h.

References hasPhotons_.

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

39 { 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 166 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_, utils_, and var_.

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

169  {
171 
174 
177 
178  const std::vector<reco::PUSubMETCandInfo> jets_cleaned = utils_.getCleanedJets();
179 
185 
186  reco::Candidate::LorentzVector jet1P4 = utils_.leadJetP4(jets_cleaned);
187  reco::Candidate::LorentzVector jet2P4 = utils_.subleadJetP4(jets_cleaned);
188 
189  var_["particleFlow_U"] = pfRecoil_data.met;
190  var_["particleFlow_SumET"] = pfRecoil_data.sumet;
191  var_["particleFlow_UPhi"] = pfRecoil_data.phi;
192 
193  var_["track_SumET"] = chHSRecoil_data.sumet / var_["particleFlow_SumET"];
194  var_["track_U"] = chHSRecoil_data.met;
195  var_["track_UPhi"] = chHSRecoil_data.phi;
196 
197  var_["noPileUp_SumET"] = hsRecoil_data.sumet / var_["particleFlow_SumET"];
198  var_["noPileUp_U"] = hsRecoil_data.met;
199  var_["noPileUp_UPhi"] = hsRecoil_data.phi;
200 
201  var_["pileUp_SumET"] = puRecoil_data.sumet / var_["particleFlow_SumET"];
202  var_["pileUp_MET"] = puRecoil_data.met;
203  var_["pileUp_METPhi"] = puRecoil_data.phi;
204 
205  var_["pileUpCorrected_SumET"] = hsMinusNeutralPUMEt_data.sumet / var_["particleFlow_SumET"];
206  var_["pileUpCorrected_U"] = hsMinusNeutralPUMEt_data.met;
207  var_["pileUpCorrected_UPhi"] = hsMinusNeutralPUMEt_data.phi;
208 
209  var_["jet1_pT"] = jet1P4.pt();
210  var_["jet1_eta"] = jet1P4.eta();
211  var_["jet1_Phi"] = jet1P4.phi();
212  var_["jet2_pT"] = jet2P4.pt();
213  var_["jet2_eta"] = jet2P4.eta();
214  var_["jet2_Phi"] = jet2P4.phi();
215 
216  var_["numJetsPtGt30"] = utils_.numJetsAboveThreshold(jets_cleaned, 30.);
217  var_["nJets"] = jets_cleaned.size();
218  var_["nPV"] = vertices.size();
219 }
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 > &)
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)
std::map< std::string, float > var_
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36
const std::string PFMETAlgorithmMVA::updateVariableNames ( std::string  input)
private

Definition at line 16 of file PFMETAlgorithmMVA.cc.

References input.

Referenced by loadMVAfromFile().

16  {
17  if (input == "sumet")
18  return "particleFlow_SumET";
19  if (input == "npv")
20  return "nPV";
21  if (input == "pfu")
22  return "particleFlow_U";
23  if (input == "pfuphi")
24  return "particleFlow_UPhi";
25  if (input == "tksumet")
26  return "track_SumET";
27  if (input == "tku")
28  return "track_U";
29  if (input == "tkuphi")
30  return "track_UPhi";
31  if (input == "nopusumet")
32  return "noPileUp_SumET";
33  if (input == "nopuu")
34  return "noPileUp_U";
35  if (input == "nopuuphi")
36  return "noPileUp_UPhi";
37  if (input == "pusumet")
38  return "pileUp_SumET";
39  if (input == "pumet")
40  return "pileUp_MET";
41  if (input == "pumetphi")
42  return "pileUp_METPhi";
43  if (input == "pucsumet")
44  return "pileUpCorrected_SumET";
45  if (input == "pucu")
46  return "pileUpCorrected_U";
47  if (input == "pucuphi")
48  return "pileUpCorrected_UPhi";
49  if (input == "jetpt1")
50  return "jet1_pT";
51  if (input == "jeteta1")
52  return "jet1_eta";
53  if (input == "jetphi1")
54  return "jet1_Phi";
55  if (input == "jetpt2")
56  return "jet2_pT";
57  if (input == "jeteta2")
58  return "jet2_eta";
59  if (input == "jetphi2")
60  return "jet2_Phi";
61  if (input == "nalljet")
62  return "nJets";
63  if (input == "njet")
64  return "numJetsPtGt30";
65  if (input == "uphi_mva")
66  return "PhiCor_UPhi";
67  if (input == "uphix_mva")
68  return "PhiCor_UPhi";
69  if (input == "ux_mva")
70  return "RecoilCor_U";
71  return input;
72 }
static std::string const input
Definition: EdmProvDump.cc:47

Member Data Documentation

edm::ParameterSet PFMETAlgorithmMVA::cfg_
private

Definition at line 119 of file PFMETAlgorithmMVA.h.

Referenced by initialize(), and PFMETAlgorithmMVA().

double PFMETAlgorithmMVA::chargedSumLeptonPx_
private

Definition at line 105 of file PFMETAlgorithmMVA.h.

Referenced by setInput().

double PFMETAlgorithmMVA::chargedSumLeptonPy_
private

Definition at line 106 of file PFMETAlgorithmMVA.h.

Referenced by setInput().

double PFMETAlgorithmMVA::dZcut_
private

Definition at line 82 of file PFMETAlgorithmMVA.h.

bool PFMETAlgorithmMVA::hasPhotons_
private

Definition at line 80 of file PFMETAlgorithmMVA.h.

Referenced by evaluateMVA(), and setHasPhotons().

bool PFMETAlgorithmMVA::loadMVAfromDB_
private

Definition at line 117 of file PFMETAlgorithmMVA.h.

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

float* PFMETAlgorithmMVA::mvaInputCovU1_
private

Definition at line 90 of file PFMETAlgorithmMVA.h.

float* PFMETAlgorithmMVA::mvaInputCovU2_
private

Definition at line 91 of file PFMETAlgorithmMVA.h.

float* PFMETAlgorithmMVA::mvaInputDPhi_
private

Definition at line 89 of file PFMETAlgorithmMVA.h.

float* PFMETAlgorithmMVA::mvaInputU_
private

Definition at line 88 of file PFMETAlgorithmMVA.h.

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

Definition at line 108 of file PFMETAlgorithmMVA.h.

Referenced by computeMET(), and getMEt().

reco::METCovMatrix PFMETAlgorithmMVA::mvaMEtCov_
private

Definition at line 110 of file PFMETAlgorithmMVA.h.

Referenced by computeMET(), and getMEtCov().

std::string PFMETAlgorithmMVA::mvaNameCovU1_
private

Definition at line 71 of file PFMETAlgorithmMVA.h.

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

std::string PFMETAlgorithmMVA::mvaNameCovU2_
private

Definition at line 72 of file PFMETAlgorithmMVA.h.

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

std::string PFMETAlgorithmMVA::mvaNameDPhi_
private

Definition at line 70 of file PFMETAlgorithmMVA.h.

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

std::string PFMETAlgorithmMVA::mvaNameU_
private

Definition at line 69 of file PFMETAlgorithmMVA.h.

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

float PFMETAlgorithmMVA::mvaOutputCovU1_
private

Definition at line 95 of file PFMETAlgorithmMVA.h.

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

float PFMETAlgorithmMVA::mvaOutputCovU2_
private

Definition at line 96 of file PFMETAlgorithmMVA.h.

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

float PFMETAlgorithmMVA::mvaOutputDPhi_
private

Definition at line 94 of file PFMETAlgorithmMVA.h.

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

float PFMETAlgorithmMVA::mvaOutputU_
private

Definition at line 93 of file PFMETAlgorithmMVA.h.

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

const GBRForest* PFMETAlgorithmMVA::mvaReaderCovU1_
private

Definition at line 114 of file PFMETAlgorithmMVA.h.

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

const GBRForest* PFMETAlgorithmMVA::mvaReaderCovU2_
private

Definition at line 115 of file PFMETAlgorithmMVA.h.

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

const GBRForest* PFMETAlgorithmMVA::mvaReaderDPhi_
private

Definition at line 113 of file PFMETAlgorithmMVA.h.

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

const GBRForest* PFMETAlgorithmMVA::mvaReaderU_
private

Definition at line 112 of file PFMETAlgorithmMVA.h.

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

edm::ESGetToken<GBRForest, GBRWrapperRcd> PFMETAlgorithmMVA::mvaTokenCovU1_
private

Definition at line 76 of file PFMETAlgorithmMVA.h.

Referenced by initialize(), and PFMETAlgorithmMVA().

edm::ESGetToken<GBRForest, GBRWrapperRcd> PFMETAlgorithmMVA::mvaTokenCovU2_
private

Definition at line 77 of file PFMETAlgorithmMVA.h.

Referenced by initialize(), and PFMETAlgorithmMVA().

edm::ESGetToken<GBRForest, GBRWrapperRcd> PFMETAlgorithmMVA::mvaTokenDPhi_
private

Definition at line 75 of file PFMETAlgorithmMVA.h.

Referenced by initialize(), and PFMETAlgorithmMVA().

edm::ESGetToken<GBRForest, GBRWrapperRcd> PFMETAlgorithmMVA::mvaTokenU_
private

Definition at line 74 of file PFMETAlgorithmMVA.h.

Referenced by initialize(), and PFMETAlgorithmMVA().

int PFMETAlgorithmMVA::mvaType_
private

Definition at line 79 of file PFMETAlgorithmMVA.h.

Referenced by PFMETAlgorithmMVA().

double PFMETAlgorithmMVA::sumLeptonPx_
private

Definition at line 103 of file PFMETAlgorithmMVA.h.

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

double PFMETAlgorithmMVA::sumLeptonPy_
private

Definition at line 104 of file PFMETAlgorithmMVA.h.

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

MvaMEtUtilities PFMETAlgorithmMVA::utils_
private

Definition at line 67 of file PFMETAlgorithmMVA.h.

Referenced by setInput().

std::map<std::string, float> PFMETAlgorithmMVA::var_
private

Definition at line 86 of file PFMETAlgorithmMVA.h.

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

std::vector<std::string> PFMETAlgorithmMVA::varForCovU1_
private

Definition at line 100 of file PFMETAlgorithmMVA.h.

Referenced by evaluateMVA(), and loadMVAfromFile().

std::vector<std::string> PFMETAlgorithmMVA::varForCovU2_
private

Definition at line 101 of file PFMETAlgorithmMVA.h.

Referenced by evaluateMVA(), and loadMVAfromFile().

std::vector<std::string> PFMETAlgorithmMVA::varForDPhi_
private

Definition at line 99 of file PFMETAlgorithmMVA.h.

Referenced by evaluateMVA(), and loadMVAfromFile().

std::vector<std::string> PFMETAlgorithmMVA::varForU_
private

Definition at line 98 of file PFMETAlgorithmMVA.h.

Referenced by evaluateMVA(), and loadMVAfromFile().