CMS 3D CMS Logo

MVAVariableHelper.cc
Go to the documentation of this file.
2 
4 // Specializations for the Electrons
6 
11 
12 template<>
14  : tokens_({
15  cc.consumes<double>(edm::InputTag("fixedGridRhoFastjetAll"))
16  })
17 {}
18 
19 template<>
21  edm::Ptr<reco::GsfElectron> const& particlePtr, const edm::Event& iEvent) const
22 {
23  edm::Handle<double> rhoHandle;
24  iEvent.getByToken(tokens_[0], rhoHandle);
25 
26  //design made much more sense when it wasnt just rho...
27  return ElectronMVAEstimatorRun2::getExtraVars(*rhoHandle);
28 }
29 
30 template<>
32  : indexMap_({
33  {"fixedGridRhoFastjetAll" , 0}
34  })
35 {}
36 
38 // Specializations for the Photons
40 
42 
43 template<>
45  : tokens_({
46  cc.consumes<double>(edm::InputTag("fixedGridRhoFastjetAll")),
47  cc.consumes<double>(edm::InputTag("fixedGridRhoAll"))
48  })
49 {}
50 
51 template<>
53  edm::Ptr<reco::Photon> const& particlePtr, const edm::Event& iEvent) const
54 {
55  return std::vector<float> {
58  };
59 }
60 
61 template<>
63  : indexMap_({
64  {"fixedGridRhoFastjetAll" , 0},
65  {"fixedGridRhoAll" , 1}
66  })
67 {}
const std::vector< edm::EDGetToken > tokens_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
int iEvent
Definition: GenABIO.cc:224
MVAVariableHelper(edm::ConsumesCollector &&cc)
static float getVariableFromDoubleToken(edm::EDGetToken const &token, const edm::Event &iEvent)
std::vector< edm::EDGetTokenT< int > > tokens_
const std::vector< float > getAuxVariables(edm::Ptr< ParticleType > const &particlePtr, const edm::Event &iEvent) const
static std::vector< float > getExtraVars(double rho)