CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
pat::ObjectModifier< T > Class Template Reference

#include <ObjectModifier.h>

Public Types

typedef std::unique_ptr< ModifyObjectValueBaseModifierPointer
 

Public Member Functions

void modify (T &obj) const
 
 ObjectModifier (const edm::ParameterSet &conf)
 
void setConsumes (edm::ConsumesCollector &sumes)
 
void setEvent (const edm::Event &event)
 
void setEventContent (const edm::EventSetup &setup)
 
 ~ObjectModifier ()
 

Private Attributes

std::vector< ModifierPointermodifiers_
 

Detailed Description

template<class T>
class pat::ObjectModifier< T >

Definition at line 9 of file ObjectModifier.h.

Member Typedef Documentation

template<class T >
typedef std::unique_ptr<ModifyObjectValueBase> pat::ObjectModifier< T >::ModifierPointer

Definition at line 11 of file ObjectModifier.h.

Constructor & Destructor Documentation

template<class T >
pat::ObjectModifier< T >::ObjectModifier ( const edm::ParameterSet conf)

Definition at line 41 of file ObjectModifier.h.

References Exception, reco::get(), edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterSetVector(), mps_fire::i, pat::ObjectModifier< T >::modifiers_, mps_splice::mods, fwrapper::plugin, and AlCaHLTBitMon_QueryRunRegistry::string.

41  {
42  const std::vector<edm::ParameterSet>& mods =
43  conf.getParameterSetVector("modifications");
44  for(unsigned i = 0; i < mods.size(); ++i ) {
45  const edm::ParameterSet& iconf = mods[i];
46  const std::string& mname = iconf.getParameter<std::string>("modifierName");
48  ModifyObjectValueFactory::get()->create(mname,iconf);
49  if( nullptr != plugin ) {
50  modifiers_.push_back(ModifierPointer(plugin));
51  } else {
52  throw cms::Exception("BadPluginName")
53  << "The requested modifier: " << mname << " is not available!";
54  }
55  }
56  }
T getParameter(std::string const &) const
VParameterSet const & getParameterSetVector(std::string const &name) const
auto_ptr< JetDefinition::Plugin > plugin
std::vector< ModifierPointer > modifiers_
std::unique_ptr< ModifyObjectValueBase > ModifierPointer
T get(const Candidate &c)
Definition: component.h:55
template<class T >
pat::ObjectModifier< T >::~ObjectModifier ( )
inline

Definition at line 14 of file ObjectModifier.h.

14 {}

Member Function Documentation

template<class T >
void pat::ObjectModifier< T >::modify ( T obj) const
inline

Definition at line 31 of file ObjectModifier.h.

References mps_fire::i, and pat::ObjectModifier< T >::modifiers_.

31  {
32  for( unsigned i = 0; i < modifiers_.size(); ++i )
33  modifiers_[i]->modifyObject(obj);
34  }
std::vector< ModifierPointer > modifiers_
template<class T >
void pat::ObjectModifier< T >::setConsumes ( edm::ConsumesCollector sumes)
inline

Definition at line 26 of file ObjectModifier.h.

References mps_fire::i, and pat::ObjectModifier< T >::modifiers_.

26  {
27  for( unsigned i = 0; i < modifiers_.size(); ++i )
28  modifiers_[i]->setConsumes(sumes);
29  }
std::vector< ModifierPointer > modifiers_
void setConsumes(edm::ConsumesCollector &sumes)
template<class T >
void pat::ObjectModifier< T >::setEvent ( const edm::Event event)
inline

Definition at line 16 of file ObjectModifier.h.

References mps_fire::i, and pat::ObjectModifier< T >::modifiers_.

16  {
17  for( unsigned i = 0; i < modifiers_.size(); ++i )
18  modifiers_[i]->setEvent(event);
19  }
std::vector< ModifierPointer > modifiers_
void setEvent(const edm::Event &event)
template<class T >
void pat::ObjectModifier< T >::setEventContent ( const edm::EventSetup setup)
inline

Definition at line 21 of file ObjectModifier.h.

References mps_fire::i, and pat::ObjectModifier< T >::modifiers_.

21  {
22  for( unsigned i = 0; i < modifiers_.size(); ++i )
23  modifiers_[i]->setEventContent(setup);
24  }
std::vector< ModifierPointer > modifiers_
void setEventContent(const edm::EventSetup &setup)

Member Data Documentation

template<class T >
std::vector<ModifierPointer> pat::ObjectModifier< T >::modifiers_
private