CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions
EGXtraModFromVMObjFiller< OutputType > Class Template Reference

#include <EGExtraInfoModifierFromValueMaps.h>

Public Member Functions

template<>
void addValueToObject (ObjType &obj, const edm::Ptr< reco::Candidate > &ptr, const std::unordered_map< unsigned, edm::Handle< edm::ValueMap< MapType > > > &vmaps, const std::pair< const std::string, edm::EDGetTokenT< edm::ValueMap< MapType > > > &val_map)
 
template<>
void addValueToObject (ObjType &obj, const edm::Ptr< reco::Candidate > &ptr, const std::unordered_map< unsigned, edm::Handle< edm::ValueMap< MapType > > > &vmaps, const std::pair< const std::string, edm::EDGetTokenT< edm::ValueMap< MapType > > > &val_map)
 
 EGXtraModFromVMObjFiller ()=delete
 
 ~EGXtraModFromVMObjFiller ()=delete
 

Static Public Member Functions

template<typename ObjType , typename MapType >
static void addValueToObject (ObjType &obj, const edm::Ptr< reco::Candidate > &ptr, const std::unordered_map< unsigned, edm::Handle< edm::ValueMap< MapType > > > &vmaps, const std::pair< const std::string, edm::EDGetTokenT< edm::ValueMap< MapType > > > &val_map)
 

Detailed Description

template<typename OutputType>
class EGXtraModFromVMObjFiller< OutputType >

Definition at line 45 of file EGExtraInfoModifierFromValueMaps.h.

Constructor & Destructor Documentation

template<typename OutputType >
EGXtraModFromVMObjFiller< OutputType >::EGXtraModFromVMObjFiller ( )
delete
template<typename OutputType >
EGXtraModFromVMObjFiller< OutputType >::~EGXtraModFromVMObjFiller ( )
delete

Member Function Documentation

template<typename OutputType >
template<typename ObjType , typename MapType >
void EGXtraModFromVMObjFiller< OutputType >::addValueToObject ( ObjType &  obj,
const edm::Ptr< reco::Candidate > &  ptr,
const std::unordered_map< unsigned, edm::Handle< edm::ValueMap< MapType > > > &  vmaps,
const std::pair< const std::string, edm::EDGetTokenT< edm::ValueMap< MapType > > > &  val_map 
)
static

Definition at line 270 of file EGExtraInfoModifierFromValueMaps.h.

References Exception.

Referenced by EGXtraModFromVMObjFiller< OutputType >::addValueToObject(), and EGExtraInfoModifierFromValueMaps< MapType, OutputType >::modifyObject().

274 {
275  MapType value{};
276  assignValue(ptr,val_map.second,vmaps,value);
277  if( !obj.hasUserData(val_map.first) ) {
278  obj.addUserData(val_map.first,value);
279  } else {
280  throw cms::Exception("ValueNameAlreadyExists")
281  << "Trying to add new UserData = " << val_map.first
282  << " failed because it already exists!";
283  }
284 }
Definition: value.py:1
template<>
void EGXtraModFromVMObjFiller< float >::addValueToObject ( ObjType &  obj,
const edm::Ptr< reco::Candidate > &  ptr,
const std::unordered_map< unsigned, edm::Handle< edm::ValueMap< MapType > > > &  vmaps,
const std::pair< const std::string, edm::EDGetTokenT< edm::ValueMap< MapType > > > &  val_map 
)

Definition at line 289 of file EGExtraInfoModifierFromValueMaps.h.

References EGXtraModFromVMObjFiller< OutputType >::addValueToObject(), Exception, and relativeConstraints::value.

293 {
294  float value(0.0);
295  assignValue(ptr,val_map.second,vmaps,value);
296  if( !obj.hasUserFloat(val_map.first) ) {
297  obj.addUserFloat(val_map.first,value);
298  } else {
299  throw cms::Exception("ValueNameAlreadyExists")
300  << "Trying to add new UserFloat = " << val_map.first
301  << " failed because it already exists!";
302  }
303 }
Definition: value.py:1
template<>
void EGXtraModFromVMObjFiller< int >::addValueToObject ( ObjType &  obj,
const edm::Ptr< reco::Candidate > &  ptr,
const std::unordered_map< unsigned, edm::Handle< edm::ValueMap< MapType > > > &  vmaps,
const std::pair< const std::string, edm::EDGetTokenT< edm::ValueMap< MapType > > > &  val_map 
)

Definition at line 308 of file EGExtraInfoModifierFromValueMaps.h.

References Exception, and relativeConstraints::value.

312 {
313  int value(0);
314  assignValue(ptr,val_map.second,vmaps,value);
315  if( !obj.hasUserInt(val_map.first) ) {
316  obj.addUserInt(val_map.first,value);
317  } else {
318  throw cms::Exception("ValueNameAlreadyExists")
319  << "Trying to add new UserInt = " << val_map.first
320  << " failed because it already exists!";
321  }
322 }
Definition: value.py:1