CMS 3D CMS Logo

MVAVariableHelper.h
Go to the documentation of this file.
1 #ifndef RecoEgamma_EgammaTools_MVAVariableHelper_H
2 #define RecoEgamma_EgammaTools_MVAVariableHelper_H
3 
8 
9 #include <unordered_map>
10 #include <vector>
11 #include <string>
12 
14 public:
16 
17  int getIndex(std::string const& name) const { return indexMap_.at(name); }
18 
19 private:
20  const std::unordered_map<std::string, int> indexMap_;
21 };
22 
24 public:
26 
27  const std::vector<float> getAuxVariables(const edm::Event& iEvent) const;
28 
29 private:
32  iEvent.getByToken(token, handle);
33  return *handle;
34  }
35 
36  const std::vector<edm::EDGetToken> tokens_;
37 };
38 
39 #endif
patZpeak.handle
handle
Definition: patZpeak.py:23
MVAVariableIndexMap::MVAVariableIndexMap
MVAVariableIndexMap()
Definition: MVAVariableHelper.cc:12
edm::Handle< double >
MVAVariableIndexMap
Definition: MVAVariableHelper.h:13
MVAVariableHelper::getAuxVariables
const std::vector< float > getAuxVariables(const edm::Event &iEvent) const
Definition: MVAVariableHelper.cc:7
MVAVariableHelper::MVAVariableHelper
MVAVariableHelper(edm::ConsumesCollector &&cc)
Definition: MVAVariableHelper.cc:3
EDGetToken.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
MVAVariableIndexMap::indexMap_
const std::unordered_map< std::string, int > indexMap_
Definition: MVAVariableHelper.h:20
Event.h
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EDGetToken
Definition: EDGetToken.h:35
cc
ValueMap.h
MVAVariableHelper::tokens_
const std::vector< edm::EDGetToken > tokens_
Definition: MVAVariableHelper.h:36
MVAVariableIndexMap::getIndex
int getIndex(std::string const &name) const
Definition: MVAVariableHelper.h:17
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
ConsumesCollector.h
MVAVariableHelper::getVariableFromDoubleToken
static float getVariableFromDoubleToken(edm::EDGetToken const &token, const edm::Event &iEvent)
Definition: MVAVariableHelper.h:30
edm::Event
Definition: Event.h:73
MVAVariableHelper
Definition: MVAVariableHelper.h:23
edm::ConsumesCollector
Definition: ConsumesCollector.h:39
unpackBuffers-CaloStage2.token
token
Definition: unpackBuffers-CaloStage2.py:316