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 
7 
8 #include <unordered_map>
9 #include <vector>
10 #include <string>
11 
13 public:
15  : tokens_({cc.consumes<double>(edm::InputTag("fixedGridRhoFastjetAll")),
16  cc.consumes<double>(edm::InputTag("fixedGridRhoAll"))}) {}
17 
18  const std::vector<float> getAuxVariables(const edm::Event& iEvent) const {
19  return std::vector<float>{static_cast<float>(iEvent.get(tokens_[0])), static_cast<float>(iEvent.get(tokens_[1]))};
20  }
21 
22  static std::unordered_map<std::string, int> indexMap() {
23  return {{"fixedGridRhoFastjetAll", 0}, {"fixedGridRhoAll", 1}};
24  }
25 
26 private:
27  const std::vector<edm::EDGetTokenT<double>> tokens_;
28 };
29 
30 #endif
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
static std::unordered_map< std::string, int > indexMap()
int iEvent
Definition: GenABIO.cc:224
MVAVariableHelper(edm::ConsumesCollector &&cc)
const std::vector< edm::EDGetTokenT< double > > tokens_
const std::vector< float > getAuxVariables(const edm::Event &iEvent) const