CMS 3D CMS Logo

List of all members | Public Member Functions | Static Private Member Functions | Private Attributes
MVAVariableHelper Class Reference

#include <MVAVariableHelper.h>

Public Member Functions

const std::vector< float > getAuxVariables (const edm::Event &iEvent) const
 
 MVAVariableHelper (edm::ConsumesCollector &&cc)
 

Static Private Member Functions

static float getVariableFromDoubleToken (edm::EDGetToken const &token, const edm::Event &iEvent)
 

Private Attributes

const std::vector< edm::EDGetTokentokens_
 

Detailed Description

Definition at line 23 of file MVAVariableHelper.h.

Constructor & Destructor Documentation

MVAVariableHelper::MVAVariableHelper ( edm::ConsumesCollector &&  cc)

Definition at line 3 of file MVAVariableHelper.cc.

References HLT_2018_cff::InputTag.

4  : tokens_({cc.consumes<double>(edm::InputTag("fixedGridRhoFastjetAll")),
5  cc.consumes<double>(edm::InputTag("fixedGridRhoAll"))}) {}
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const std::vector< edm::EDGetToken > tokens_

Member Function Documentation

const std::vector< float > MVAVariableHelper::getAuxVariables ( const edm::Event iEvent) const

Definition at line 7 of file MVAVariableHelper.cc.

References getVariableFromDoubleToken(), and tokens_.

Referenced by PhotonMVANtuplizer::analyze(), ElectronMVANtuplizer::analyze(), and MVAValueMapProducer< ParticleType >::produce().

7  {
8  return std::vector<float>{getVariableFromDoubleToken(tokens_[0], iEvent),
10 }
static float getVariableFromDoubleToken(edm::EDGetToken const &token, const edm::Event &iEvent)
const std::vector< edm::EDGetToken > tokens_
static float MVAVariableHelper::getVariableFromDoubleToken ( edm::EDGetToken const &  token,
const edm::Event iEvent 
)
inlinestaticprivate

Definition at line 30 of file MVAVariableHelper.h.

References edm::Event::getByToken(), and patZpeak::handle.

Referenced by getAuxVariables().

30  {
32  iEvent.getByToken(token, handle);
33  return *handle;
34  }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525

Member Data Documentation

const std::vector<edm::EDGetToken> MVAVariableHelper::tokens_
private

Definition at line 36 of file MVAVariableHelper.h.

Referenced by getAuxVariables().