CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

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, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Public Member Functions

virtual void beginLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &evs) overridefinal
 
 ModifiedObjectProducer (const edm::ParameterSet &conf)
 
virtual void produce (edm::Event &evt, const edm::EventSetup &evs) overridefinal
 
 ~ModifiedObjectProducer ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

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

Additional Inherited Members

- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

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

Definition at line 17 of file ModifiedObjectProducer.h.

Member Typedef Documentation

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

Definition at line 19 of file ModifiedObjectProducer.h.

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

Definition at line 20 of file ModifiedObjectProducer.h.

Constructor & Destructor Documentation

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

Definition at line 22 of file ModifiedObjectProducer.h.

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

22  {
23  //set our input source
24  src_ = consumes<edm::View<T> >(conf.getParameter<edm::InputTag>("src"));
25  //setup modifier
27  const edm::ParameterSet& mod_config =
28  conf.getParameter<edm::ParameterSet>("modifierConfig");
29  modifier_.reset( new Modifier(mod_config) );
30  modifier_->setConsumes(sumes);
31  //declare products
32  produces<Collection>();
33  }
T getParameter(std::string const &) const
std::unique_ptr< Modifier > modifier_
edm::EDGetTokenT< edm::View< T > > src_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
pat::ObjectModifier< T > Modifier
template<class T >
pat::ModifiedObjectProducer< T >::~ModifiedObjectProducer ( )
inline

Definition at line 34 of file ModifiedObjectProducer.h.

34 {}

Member Function Documentation

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

Reimplemented from edm::stream::EDProducerBase.

Definition at line 36 of file ModifiedObjectProducer.h.

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

36  {
37  modifier_->setEventContent(evs);
38  }
std::unique_ptr< Modifier > modifier_
template<class T >
virtual void pat::ModifiedObjectProducer< T >::produce ( edm::Event evt,
const edm::EventSetup evs 
)
inlinefinaloverridevirtual

Implements edm::stream::EDProducerBase.

Definition at line 40 of file ModifiedObjectProducer.h.

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

40  {
42  std::auto_ptr<Collection> output(new Collection);
43 
44  evt.getByToken(src_,input);
45  output->reserve(input->size());
46 
47  modifier_->setEvent(evt);
48 
49  for( auto itr = input->begin(); itr != input->end(); ++itr ) {
50  output->push_back(*itr);
51  T& obj = output->back();
52  modifier_->modify(obj);
53  }
54 
55  evt.put(output);
56  }
std::unique_ptr< Modifier > modifier_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
static std::string const input
Definition: EdmProvDump.cc:43
edm::EDGetTokenT< edm::View< T > > src_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:115
long double T

Member Data Documentation

template<class T >
std::unique_ptr<Modifier> pat::ModifiedObjectProducer< T >::modifier_
private
template<class T >
edm::EDGetTokenT<edm::View<T> > pat::ModifiedObjectProducer< T >::src_
private