CMS 3D CMS Logo

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, GBRWrapperRcdmvaTokenCovU1_
 
edm::ESGetToken< GBRForest, GBRWrapperRcdmvaTokenCovU2_
 
edm::ESGetToken< GBRForest, GBRWrapperRcdmvaTokenDPhi_
 
edm::ESGetToken< GBRForest, GBRWrapperRcdmvaTokenU_
 
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::PFMETAlgorithmMVA ( const edm::ParameterSet cfg,
edm::ConsumesCollector  iC 
)

Definition at line 111 of file PFMETAlgorithmMVA.cc.

References looper::cfg, 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_) {
132  }
133 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
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_
std::string mvaNameDPhi_
edm::ESGetToken< GBRForest, GBRWrapperRcd > mvaTokenDPhi_
edm::ESGetToken< GBRForest, GBRWrapperRcd > mvaTokenU_
std::string mvaNameCovU2_

◆ ~PFMETAlgorithmMVA()

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

◆ computeMET()

void PFMETAlgorithmMVA::computeMET ( )
private

Definition at line 256 of file PFMETAlgorithmMVA.cc.

References funct::cos(), l1tSlwPFPuppiJets_cfi::cosPhi, mvaMEt_, mvaMEtCov_, mvaOutputCovU1_, mvaOutputCovU2_, VtxSmearedParameters_cfi::Phi, Pi, funct::sin(), l1tSlwPFPuppiJets_cfi::sinPhi, mathSSE::sqrt(), sumLeptonPx_, sumLeptonPy_, mitigatedMETSequence_cff::U, 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)
271  mvaMEtCov_(1, 0) = mvaMEtCov_(0, 1);
273 }
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_
const double Pi
std::map< std::string, float > var_
reco::Candidate::LorentzVector mvaMEt_

◆ createFloatVector()

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_

◆ evaluateCovU1()

const float PFMETAlgorithmMVA::evaluateCovU1 ( )
private

◆ evaluateCovU2()

const float PFMETAlgorithmMVA::evaluateCovU2 ( )
private

◆ evaluateDPhi()

const float PFMETAlgorithmMVA::evaluateDPhi ( )
private

◆ evaluateMVA()

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"];
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

◆ evaluateU()

const float PFMETAlgorithmMVA::evaluateU ( )
private

◆ getCovU1()

double PFMETAlgorithmMVA::getCovU1 ( ) const
inline

Definition at line 53 of file PFMETAlgorithmMVA.h.

References mvaOutputCovU1_.

53 { return mvaOutputCovU1_; }

◆ getCovU2()

double PFMETAlgorithmMVA::getCovU2 ( ) const
inline

Definition at line 54 of file PFMETAlgorithmMVA.h.

References mvaOutputCovU2_.

54 { return mvaOutputCovU2_; }

◆ getDPhi()

double PFMETAlgorithmMVA::getDPhi ( ) const
inline

Definition at line 52 of file PFMETAlgorithmMVA.h.

References mvaOutputDPhi_.

52 { return mvaOutputDPhi_; }

◆ getMEt()

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_

◆ getMEtCov()

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_

◆ GetResponse()

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 }
std::unique_ptr< float[]> createFloatVector(std::vector< std::string > variableNames)
double GetResponse(const float *vector) const
Definition: GBRForest.h:48

◆ getU()

double PFMETAlgorithmMVA::getU ( ) const
inline

Definition at line 51 of file PFMETAlgorithmMVA.h.

References mvaOutputU_.

51 { return mvaOutputU_; }

◆ initialize()

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 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
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_
const GBRForest * mvaReaderU_
edm::ESGetToken< GBRForest, GBRWrapperRcd > mvaTokenCovU1_
edm::ESGetToken< GBRForest, GBRWrapperRcd > mvaTokenCovU2_
std::string mvaNameDPhi_
edm::ESGetToken< GBRForest, GBRWrapperRcd > mvaTokenDPhi_
edm::ESGetToken< GBRForest, GBRWrapperRcd > mvaTokenU_
std::string mvaNameCovU2_

◆ loadMVAfromFile()

const GBRForest * PFMETAlgorithmMVA::loadMVAfromFile ( const edm::FileInPath inputFileName,
const std::string &  mvaName 
)
private

Definition at line 74 of file PFMETAlgorithmMVA.cc.

References Exception, mps_fire::i, makeListRunsInFiles::inputFile, InefficientDoubleROC::inputFileName, beam_dqm_sourceclient-live_cfg::mva, taus_updatedMVAIds_cff::mvaName, 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_
std::vector< std::string > varForCovU1_
std::vector< std::string > varForDPhi_
std::string mvaNameDPhi_
std::string mvaNameCovU2_

◆ print()

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(), cms::cuda::stream, 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_

◆ setHasPhotons()

void PFMETAlgorithmMVA::setHasPhotons ( bool  hasPhotons)
inline

Definition at line 39 of file PFMETAlgorithmMVA.h.

References hasPhotons_.

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

39 { hasPhotons_ = hasPhotons; }

◆ setInput()

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(), PDWG_EXODelayedJetMET_cff::jets, MvaMEtUtilities::kChHS, MvaMEtUtilities::kHS, MvaMEtUtilities::kHSMinusNeutralPU, MvaMEtUtilities::kPF, MvaMEtUtilities::kPU, MvaMEtUtilities::leadJetP4(), HLT_2023v12_cff::leptons, CommonMETData::met, MvaMEtUtilities::numJetsAboveThreshold(), zmumugammaAnalyzer_cfi::pfCandidates, CommonMETData::phi, MvaMEtUtilities::subleadJetP4(), CommonMETData::sumet, sumLeptonPx_, sumLeptonPy_, utils_, var_, and AlignmentTracksFromVertexSelector_cfi::vertices.

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 }
unsigned numJetsAboveThreshold(const std::vector< reco::PUSubMETCandInfo > &, double)
MvaMEtUtilities utils_
double getLeptonsChSumMEX() const
reco::Candidate::LorentzVector subleadJetP4(const std::vector< reco::PUSubMETCandInfo > &)
double getLeptonsSumMEY() const
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)
const std::vector< reco::PUSubMETCandInfo > & getCleanedJets() const
reco::Candidate::LorentzVector leadJetP4(const std::vector< reco::PUSubMETCandInfo > &)
double getLeptonsSumMEX() const
CommonMETData computeRecoil(int metType)
std::map< std::string, float > var_
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36
double getLeptonsChSumMEY() const

◆ updateVariableNames()

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:50

Member Data Documentation

◆ cfg_

edm::ParameterSet PFMETAlgorithmMVA::cfg_
private

Definition at line 119 of file PFMETAlgorithmMVA.h.

Referenced by initialize(), and PFMETAlgorithmMVA().

◆ chargedSumLeptonPx_

double PFMETAlgorithmMVA::chargedSumLeptonPx_
private

Definition at line 105 of file PFMETAlgorithmMVA.h.

Referenced by setInput().

◆ chargedSumLeptonPy_

double PFMETAlgorithmMVA::chargedSumLeptonPy_
private

Definition at line 106 of file PFMETAlgorithmMVA.h.

Referenced by setInput().

◆ dZcut_

double PFMETAlgorithmMVA::dZcut_
private

Definition at line 82 of file PFMETAlgorithmMVA.h.

◆ hasPhotons_

bool PFMETAlgorithmMVA::hasPhotons_
private

Definition at line 80 of file PFMETAlgorithmMVA.h.

Referenced by evaluateMVA(), and setHasPhotons().

◆ loadMVAfromDB_

bool PFMETAlgorithmMVA::loadMVAfromDB_
private

Definition at line 117 of file PFMETAlgorithmMVA.h.

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

◆ mvaInputCovU1_

float* PFMETAlgorithmMVA::mvaInputCovU1_
private

Definition at line 90 of file PFMETAlgorithmMVA.h.

◆ mvaInputCovU2_

float* PFMETAlgorithmMVA::mvaInputCovU2_
private

Definition at line 91 of file PFMETAlgorithmMVA.h.

◆ mvaInputDPhi_

float* PFMETAlgorithmMVA::mvaInputDPhi_
private

Definition at line 89 of file PFMETAlgorithmMVA.h.

◆ mvaInputU_

float* PFMETAlgorithmMVA::mvaInputU_
private

Definition at line 88 of file PFMETAlgorithmMVA.h.

◆ mvaMEt_

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

Definition at line 108 of file PFMETAlgorithmMVA.h.

Referenced by computeMET(), and getMEt().

◆ mvaMEtCov_

reco::METCovMatrix PFMETAlgorithmMVA::mvaMEtCov_
private

Definition at line 110 of file PFMETAlgorithmMVA.h.

Referenced by computeMET(), and getMEtCov().

◆ mvaNameCovU1_

std::string PFMETAlgorithmMVA::mvaNameCovU1_
private

Definition at line 71 of file PFMETAlgorithmMVA.h.

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

◆ mvaNameCovU2_

std::string PFMETAlgorithmMVA::mvaNameCovU2_
private

Definition at line 72 of file PFMETAlgorithmMVA.h.

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

◆ mvaNameDPhi_

std::string PFMETAlgorithmMVA::mvaNameDPhi_
private

Definition at line 70 of file PFMETAlgorithmMVA.h.

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

◆ mvaNameU_

std::string PFMETAlgorithmMVA::mvaNameU_
private

Definition at line 69 of file PFMETAlgorithmMVA.h.

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

◆ mvaOutputCovU1_

float PFMETAlgorithmMVA::mvaOutputCovU1_
private

Definition at line 95 of file PFMETAlgorithmMVA.h.

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

◆ mvaOutputCovU2_

float PFMETAlgorithmMVA::mvaOutputCovU2_
private

Definition at line 96 of file PFMETAlgorithmMVA.h.

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

◆ mvaOutputDPhi_

float PFMETAlgorithmMVA::mvaOutputDPhi_
private

Definition at line 94 of file PFMETAlgorithmMVA.h.

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

◆ mvaOutputU_

float PFMETAlgorithmMVA::mvaOutputU_
private

Definition at line 93 of file PFMETAlgorithmMVA.h.

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

◆ mvaReaderCovU1_

const GBRForest* PFMETAlgorithmMVA::mvaReaderCovU1_
private

Definition at line 114 of file PFMETAlgorithmMVA.h.

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

◆ mvaReaderCovU2_

const GBRForest* PFMETAlgorithmMVA::mvaReaderCovU2_
private

Definition at line 115 of file PFMETAlgorithmMVA.h.

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

◆ mvaReaderDPhi_

const GBRForest* PFMETAlgorithmMVA::mvaReaderDPhi_
private

Definition at line 113 of file PFMETAlgorithmMVA.h.

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

◆ mvaReaderU_

const GBRForest* PFMETAlgorithmMVA::mvaReaderU_
private

Definition at line 112 of file PFMETAlgorithmMVA.h.

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

◆ mvaTokenCovU1_

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

Definition at line 76 of file PFMETAlgorithmMVA.h.

Referenced by initialize(), and PFMETAlgorithmMVA().

◆ mvaTokenCovU2_

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

Definition at line 77 of file PFMETAlgorithmMVA.h.

Referenced by initialize(), and PFMETAlgorithmMVA().

◆ mvaTokenDPhi_

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

Definition at line 75 of file PFMETAlgorithmMVA.h.

Referenced by initialize(), and PFMETAlgorithmMVA().

◆ mvaTokenU_

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

Definition at line 74 of file PFMETAlgorithmMVA.h.

Referenced by initialize(), and PFMETAlgorithmMVA().

◆ mvaType_

int PFMETAlgorithmMVA::mvaType_
private

Definition at line 79 of file PFMETAlgorithmMVA.h.

Referenced by PFMETAlgorithmMVA().

◆ sumLeptonPx_

double PFMETAlgorithmMVA::sumLeptonPx_
private

Definition at line 103 of file PFMETAlgorithmMVA.h.

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

◆ sumLeptonPy_

double PFMETAlgorithmMVA::sumLeptonPy_
private

Definition at line 104 of file PFMETAlgorithmMVA.h.

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

◆ utils_

MvaMEtUtilities PFMETAlgorithmMVA::utils_
private

Definition at line 67 of file PFMETAlgorithmMVA.h.

Referenced by setInput().

◆ var_

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

Definition at line 86 of file PFMETAlgorithmMVA.h.

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

◆ varForCovU1_

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

Definition at line 100 of file PFMETAlgorithmMVA.h.

Referenced by evaluateMVA(), and loadMVAfromFile().

◆ varForCovU2_

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

Definition at line 101 of file PFMETAlgorithmMVA.h.

Referenced by evaluateMVA(), and loadMVAfromFile().

◆ varForDPhi_

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

Definition at line 99 of file PFMETAlgorithmMVA.h.

Referenced by evaluateMVA(), and loadMVAfromFile().

◆ varForU_

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

Definition at line 98 of file PFMETAlgorithmMVA.h.

Referenced by evaluateMVA(), and loadMVAfromFile().