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:
30  static float getVariableFromDoubleToken(edm::EDGetToken const& token, const edm::Event& iEvent) {
32  iEvent.getByToken(token, handle);
33  return *handle;
34  }
35 
36  const std::vector<edm::EDGetToken> tokens_;
37 };
38 
39 #endif
static float getVariableFromDoubleToken(edm::EDGetToken const &token, const edm::Event &iEvent)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
int getIndex(std::string const &name) const
int iEvent
Definition: GenABIO.cc:224
const std::unordered_map< std::string, int > indexMap_
const std::vector< edm::EDGetToken > tokens_