CMS 3D CMS Logo

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

#include <ModifiedObjectProducer.h>

Inheritance diagram for pat::ModifiedObjectProducer< T >:
edm::stream::EDProducer<>

Public Types

typedef std::vector< TCollection
 
typedef pat::ObjectModifier< TModifier
 
- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Public Member Functions

void beginLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &evs) final
 
 ModifiedObjectProducer (const edm::ParameterSet &conf)
 
void produce (edm::Event &evt, const edm::EventSetup &evs) final
 
 ~ModifiedObjectProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Attributes

std::unique_ptr< Modifiermodifier_
 
edm::EDGetTokenT< edm::View< T > > src_
 

Detailed Description

template<class T>
class pat::ModifiedObjectProducer< T >

Definition at line 17 of file ModifiedObjectProducer.h.

Member Typedef Documentation

◆ Collection

template<class T >
typedef std::vector<T> pat::ModifiedObjectProducer< T >::Collection

Definition at line 19 of file ModifiedObjectProducer.h.

◆ Modifier

template<class T >
typedef pat::ObjectModifier<T> pat::ModifiedObjectProducer< T >::Modifier

Definition at line 20 of file ModifiedObjectProducer.h.

Constructor & Destructor Documentation

◆ ModifiedObjectProducer()

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

Definition at line 22 of file ModifiedObjectProducer.h.

22  {
23  //set our input source
24  src_ = consumes<edm::View<T> >(conf.getParameter<edm::InputTag>("src"));
25  //setup modifier
26  const edm::ParameterSet& mod_config = conf.getParameter<edm::ParameterSet>("modifierConfig");
27  modifier_ = std::make_unique<Modifier>(mod_config, consumesCollector());
28  //declare products
29  produces<Collection>();
30  }

References edm::ParameterSet::getParameter(), pat::ModifiedObjectProducer< T >::modifier_, and pat::ModifiedObjectProducer< T >::src_.

◆ ~ModifiedObjectProducer()

template<class T >
pat::ModifiedObjectProducer< T >::~ModifiedObjectProducer ( )
inlineoverride

Definition at line 31 of file ModifiedObjectProducer.h.

31 {}

Member Function Documentation

◆ beginLuminosityBlock()

template<class T >
void pat::ModifiedObjectProducer< T >::beginLuminosityBlock ( const edm::LuminosityBlock ,
const edm::EventSetup evs 
)
inlinefinal

Definition at line 33 of file ModifiedObjectProducer.h.

33  {
34  modifier_->setEventContent(evs);
35  }

References pat::ModifiedObjectProducer< T >::modifier_.

◆ produce()

template<class T >
void pat::ModifiedObjectProducer< T >::produce ( edm::Event evt,
const edm::EventSetup evs 
)
inlinefinal

Definition at line 37 of file ModifiedObjectProducer.h.

37  {
39  auto output = std::make_unique<Collection>();
40 
41  evt.getByToken(src_, input);
42  output->reserve(input->size());
43 
44  modifier_->setEvent(evt);
45 
46  for (auto itr = input->begin(); itr != input->end(); ++itr) {
47  output->push_back(*itr);
48  T& obj = output->back();
49  modifier_->modify(obj);
50  }
51 
52  evt.put(std::move(output));
53  }

References input, pat::ModifiedObjectProducer< T >::modifier_, eostools::move(), getGTfromDQMFile::obj, convertSQLitetoXML_cfg::output, and pat::ModifiedObjectProducer< T >::src_.

Member Data Documentation

◆ modifier_

template<class T >
std::unique_ptr<Modifier> pat::ModifiedObjectProducer< T >::modifier_
private

◆ src_

template<class T >
edm::EDGetTokenT<edm::View<T> > pat::ModifiedObjectProducer< T >::src_
private
input
static const std::string input
Definition: EdmProvDump.cc:48
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:32
edm::Handle
Definition: AssociativeIterator.h:50
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:528
getGTfromDQMFile.obj
obj
Definition: getGTfromDQMFile.py:32
edm::ParameterSet
Definition: ParameterSet.h:36
pat::ModifiedObjectProducer::src_
edm::EDGetTokenT< edm::View< T > > src_
Definition: ModifiedObjectProducer.h:56
edm::Event::put
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:132
itr
std::vector< std::pair< float, float > >::iterator itr
Definition: HGCDigitizer.cc:28
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
T
long double T
Definition: Basic3DVectorLD.h:48
pat::ModifiedObjectProducer::modifier_
std::unique_ptr< Modifier > modifier_
Definition: ModifiedObjectProducer.h:57
edm::InputTag
Definition: InputTag.h:15