CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
ESRecHitProducer Class Reference

#include <ESRecHitProducer.h>

Inheritance diagram for ESRecHitProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 ESRecHitProducer (const edm::ParameterSet &ps)
 
virtual void produce (edm::Event &e, const edm::EventSetup &es) override
 
virtual ~ESRecHitProducer ()
 
- 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)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
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, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 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
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

const edm::EDGetTokenT< ESDigiCollectiondigiToken_
 
const std::string rechitCollection_
 
ESRecHitWorkerBaseClassworker_
 

Additional Inherited Members

- 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 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
 
- 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

Definition at line 17 of file ESRecHitProducer.h.

Constructor & Destructor Documentation

ESRecHitProducer::ESRecHitProducer ( const edm::ParameterSet ps)
explicit

Definition at line 15 of file ESRecHitProducer.cc.

References reco::get(), edm::ParameterSet::getParameter(), rechitCollection_, AlCaHLTBitMon_QueryRunRegistry::string, and worker_.

15  :
16  digiToken_( consumes<ESDigiCollection>(ps.getParameter<edm::InputTag>("ESdigiCollection")) ),
17  rechitCollection_( ps.getParameter<std::string>("ESrechitCollection") )
18 {
19  produces<ESRecHitCollection>(rechitCollection_);
20 
21  std::string const & componentType = ps.getParameter<std::string>("algo");
22  worker_ = ESRecHitWorkerFactory::get()->create( componentType, ps );
23 }
T getParameter(std::string const &) const
const std::string rechitCollection_
ESRecHitWorkerBaseClass * worker_
const edm::EDGetTokenT< ESDigiCollection > digiToken_
T get(const Candidate &c)
Definition: component.h:55
ESRecHitProducer::~ESRecHitProducer ( )
virtual

Definition at line 25 of file ESRecHitProducer.cc.

References worker_.

25  {
26 
27  delete worker_;
28 }
ESRecHitWorkerBaseClass * worker_

Member Function Documentation

void ESRecHitProducer::produce ( edm::Event e,
const edm::EventSetup es 
)
overridevirtual

Definition at line 30 of file ESRecHitProducer.cc.

References edm::DataFrameContainer::begin(), DEFINE_FWK_MODULE, digiToken_, edm::DataFrameContainer::end(), edm::Event::getByToken(), mps_fire::i, LogDebug, eostools::move(), edm::Handle< T >::product(), edm::Event::put(), rechitCollection_, ESRecHitWorkerBaseClass::run(), ESRecHitWorkerBaseClass::set(), edm::DataFrameContainer::size(), and worker_.

30  {
31 
33  const ESDigiCollection* digi=0;
34  e.getByToken( digiToken_, digiHandle);
35 
36  digi = digiHandle.product();
37  LogDebug("ESRecHitInfo") << "total # ESdigis: " << digi->size();
38 
39  // Create empty output
40  auto rec = std::make_unique<ESRecHitCollection>();
41 
42  if ( digi ) {
43  rec->reserve(digi->size());
44 
45  worker_->set( es );
46 
47  // run the algorithm
49  i!=digi->end(); i++) {
50  worker_->run( i, *rec );
51  }
52  }
53 
55 }
#define LogDebug(id)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
virtual void set(const edm::EventSetup &es)=0
const_iterator begin() const
const std::string rechitCollection_
ESRecHitWorkerBaseClass * worker_
const edm::EDGetTokenT< ESDigiCollection > digiToken_
T const * product() const
Definition: Handle.h:81
const_iterator end() const
virtual bool run(const ESDigiCollection::const_iterator &digi, ESRecHitCollection &result)=0
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

const edm::EDGetTokenT<ESDigiCollection> ESRecHitProducer::digiToken_
private

Definition at line 27 of file ESRecHitProducer.h.

Referenced by produce().

const std::string ESRecHitProducer::rechitCollection_
private

Definition at line 28 of file ESRecHitProducer.h.

Referenced by ESRecHitProducer(), and produce().

ESRecHitWorkerBaseClass* ESRecHitProducer::worker_
private

Definition at line 30 of file ESRecHitProducer.h.

Referenced by ESRecHitProducer(), produce(), and ~ESRecHitProducer().