CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Functions
EGPfIsolationModifier.cc File Reference
#include "CommonTools/CandAlgos/interface/ModifyObjectValueBase.h"
#include "FWCore/Utilities/interface/InputTag.h"
#include "FWCore/Utilities/interface/EDGetToken.h"
#include "DataFormats/Common/interface/ValueMap.h"
#include "DataFormats/EgammaCandidates/interface/GsfElectron.h"
#include "DataFormats/EgammaCandidates/interface/Photon.h"
#include <tuple>
#include <array>
#include <unordered_map>

Go to the source code of this file.

Classes

class  EGPfIsolationModifierFromValueMaps
 
struct  EGPfIsolationModifierFromValueMaps::electron_config
 
struct  EGPfIsolationModifierFromValueMaps::photon_config
 

Functions

template<typename T , typename U , typename V >
void assignValue (const T &ptr, const U &input_map, const std::string &name, const V &map, float &value)
 
void get_product (const edm::Event &evt, const edm::EDGetTokenT< edm::ValueMap< float > > &tok, std::unordered_map< unsigned, edm::Handle< edm::ValueMap< float > > > &map)
 
template<typename T , typename U , typename V >
void make_consumes (T &tag, U &tok, V &sume)
 
static const
ModifyObjectValueFactory::PMaker
< EGPfIsolationModifierFromValueMaps
s_maker__LINE__ ("EGPfIsolationModifierFromValueMaps")
 

Function Documentation

template<typename T , typename U , typename V >
void assignValue ( const T ptr,
const U &  input_map,
const std::string &  name,
const V &  map,
float &  value 
)
inline

Definition at line 182 of file EGPfIsolationModifier.cc.

References edm::second(), and results_mgr::tok.

182  {
183  auto itr = input_map.find(name);
184  if( itr == input_map.end() ) return;
185  const auto& tok = std::get<1>(itr->second);
186  if( !tok.isUninitialized() ) value = map.find(tok.index())->second->get(ptr.id(),ptr.key());
187 }
U second(std::pair< T, U > const &p)
void get_product ( const edm::Event evt,
const edm::EDGetTokenT< edm::ValueMap< float > > &  tok,
std::unordered_map< unsigned, edm::Handle< edm::ValueMap< float > > > &  map 
)
inline

Definition at line 103 of file EGPfIsolationModifier.cc.

References edm::Event::getByToken(), python.multivaluedict::map(), and results_mgr::tok.

105  {
106  if( !tok.isUninitialized() ) evt.getByToken(tok,map[tok.index()]);
107 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
unsigned int index() const
Definition: EDGetToken.h:70
bool isUninitialized() const
Definition: EDGetToken.h:71
template<typename T , typename U , typename V >
void make_consumes ( T tag,
U &  tok,
V &  sume 
)
inline

Definition at line 156 of file EGPfIsolationModifier.cc.

References GlobalPosition_Frontier_DevDB_cff::tag.

156 { if( !(empty_tag == tag) ) tok = sume.template consumes<edm::ValueMap<float> >(tag); }
static const ModifyObjectValueFactory ::PMaker< EGPfIsolationModifierFromValueMaps > s_maker__LINE__ ( "EGPfIsolationModifierFromValueMaps"  )
static