CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
reco::tautools::CastedRefProducer< DerivedCollection, BaseType > Class Template Reference

#include <CastedRefProducer.h>

Inheritance diagram for reco::tautools::CastedRefProducer< DerivedCollection, BaseType >:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Types

typedef base_ref_vector::value_type base_ref
 
typedef edm::RefToBaseVector< BaseType > base_ref_vector
 
typedef edm::Ref< DerivedCollection > derived_ref
 
typedef edm::RefVector< DerivedCollection > OutputCollection
 
- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Public Member Functions

 CastedRefProducer (const edm::ParameterSet &pset)
 constructor from parameter set More...
 
void produce (edm::Event &evt, const edm::EventSetup &es) override
 process an event More...
 
 ~CastedRefProducer () override
 destructor More...
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

edm::InputTag src_
 labels of the collection to be converted More...
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- 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<typename DerivedCollection, typename BaseType>
class reco::tautools::CastedRefProducer< DerivedCollection, BaseType >

Definition at line 25 of file CastedRefProducer.h.

Member Typedef Documentation

template<typename DerivedCollection , typename BaseType >
typedef base_ref_vector::value_type reco::tautools::CastedRefProducer< DerivedCollection, BaseType >::base_ref

Definition at line 28 of file CastedRefProducer.h.

template<typename DerivedCollection , typename BaseType >
typedef edm::RefToBaseVector<BaseType> reco::tautools::CastedRefProducer< DerivedCollection, BaseType >::base_ref_vector

Definition at line 27 of file CastedRefProducer.h.

template<typename DerivedCollection , typename BaseType >
typedef edm::Ref<DerivedCollection> reco::tautools::CastedRefProducer< DerivedCollection, BaseType >::derived_ref

Definition at line 29 of file CastedRefProducer.h.

template<typename DerivedCollection , typename BaseType >
typedef edm::RefVector<DerivedCollection> reco::tautools::CastedRefProducer< DerivedCollection, BaseType >::OutputCollection

Definition at line 30 of file CastedRefProducer.h.

Constructor & Destructor Documentation

template<typename DerivedCollection , typename BaseType >
reco::tautools::CastedRefProducer< DerivedCollection, BaseType >::CastedRefProducer ( const edm::ParameterSet pset)
inlineexplicit

constructor from parameter set

Definition at line 32 of file CastedRefProducer.h.

33  :src_(pset.template getParameter<edm::InputTag>("src")) {
34  produces<OutputCollection>();
35  }
edm::InputTag src_
labels of the collection to be converted
template<typename DerivedCollection , typename BaseType >
reco::tautools::CastedRefProducer< DerivedCollection, BaseType >::~CastedRefProducer ( )
inlineoverride

destructor

Definition at line 37 of file CastedRefProducer.h.

37 {};

Member Function Documentation

template<typename DerivedCollection , typename BaseType >
void reco::tautools::CastedRefProducer< DerivedCollection, BaseType >::produce ( edm::Event evt,
const edm::EventSetup es 
)
inlineoverride

process an event

Definition at line 39 of file CastedRefProducer.h.

References runEdmFileComparison::base, coll, edm::Event::getByLabel(), mps_fire::i, input, eostools::move(), JetCorrectorParametersCollection::push_back(), edm::Event::put(), and reco::tautools::CastedRefProducer< DerivedCollection, BaseType >::src_.

39  {
40  // Output collection
41  auto coll = std::make_unique<OutputCollection>();
42  // Get input
44  evt.getByLabel(src_, input);
45  // Get references to the base
46  for(size_t i = 0; i < input->size(); ++i) {
47  // Cast the base class to the derived class
48  base_ref base = input->refAt(i);
49  derived_ref derived = base.template castTo<derived_ref>();
50  coll->push_back(derived);
51  }
52  evt.put(std::move(coll));
53  }
edm::Ref< DerivedCollection > derived_ref
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:136
void push_back(key_type i, value_type const &j, label_type const &flav="")
static std::string const input
Definition: EdmProvDump.cc:44
base
Make Sure CMSSW is Setup ##.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:475
base_ref_vector::value_type base_ref
JetCorrectorParametersCollection coll
Definition: classes.h:10
edm::InputTag src_
labels of the collection to be converted
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

template<typename DerivedCollection , typename BaseType >
edm::InputTag reco::tautools::CastedRefProducer< DerivedCollection, BaseType >::src_
private

labels of the collection to be converted

Definition at line 56 of file CastedRefProducer.h.

Referenced by reco::tautools::CastedRefProducer< DerivedCollection, BaseType >::produce().