CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
HGCalUncalibRecHitProducer Class Reference

#include <HGCalUncalibRecHitProducer.h>

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

Public Member Functions

 HGCalUncalibRecHitProducer (const edm::ParameterSet &ps)
 
virtual void produce (edm::Event &evt, const edm::EventSetup &es) override
 
 ~HGCalUncalibRecHitProducer ()
 
- 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

const edm::EDGetTokenT
< HGCEEDigiCollection
eeDigiCollection_
 
const std::string eeHitCollection_
 
const edm::EDGetTokenT
< HGCHEDigiCollection
hebDigiCollection_
 
const std::string hebHitCollection_
 
const edm::EDGetTokenT
< HGCHEDigiCollection
hefDigiCollection_
 
const std::string hefHitCollection_
 
std::unique_ptr
< HGCalUncalibRecHitWorkerBaseClass
worker_
 

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, 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
 
- 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 14 of file HGCalUncalibRecHitProducer.h.

Constructor & Destructor Documentation

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

Definition at line 12 of file HGCalUncalibRecHitProducer.cc.

References SurfaceDeformationFactory::create(), eeHitCollection_, reco::get(), edm::ParameterSet::getParameter(), hebHitCollection_, hefHitCollection_, AlCaHLTBitMon_QueryRunRegistry::string, and worker_.

12  :
13  eeDigiCollection_( consumes<HGCEEDigiCollection>( ps.getParameter<edm::InputTag>("HGCEEdigiCollection") ) ),
14  hefDigiCollection_( consumes<HGCHEDigiCollection>( ps.getParameter<edm::InputTag>("HGCHEFdigiCollection") ) ),
15  hebDigiCollection_( consumes<HGCHEDigiCollection>( ps.getParameter<edm::InputTag>("HGCHEBdigiCollection") ) ),
16  eeHitCollection_( ps.getParameter<std::string>("HGCEEhitCollection") ),
17  hefHitCollection_( ps.getParameter<std::string>("HGCHEFhitCollection") ),
18  hebHitCollection_( ps.getParameter<std::string>("HGCHEBhitCollection") ) {
19 
20  produces< HGCeeUncalibratedRecHitCollection >(eeHitCollection_);
21  produces< HGChefUncalibratedRecHitCollection >(hefHitCollection_);
22  produces< HGChebUncalibratedRecHitCollection >(hebHitCollection_);
23 
24  const std::string& componentType = ps.getParameter<std::string>("algo");
25  worker_.reset( HGCalUncalibRecHitWorkerFactory::get()->create(componentType, ps) );
26 }
T getParameter(std::string const &) const
const edm::EDGetTokenT< HGCHEDigiCollection > hefDigiCollection_
const edm::EDGetTokenT< HGCHEDigiCollection > hebDigiCollection_
std::unique_ptr< HGCalUncalibRecHitWorkerBaseClass > worker_
SurfaceDeformation * create(int type, const std::vector< double > &params)
T get(const Candidate &c)
Definition: component.h:55
const edm::EDGetTokenT< HGCEEDigiCollection > eeDigiCollection_
HGCalUncalibRecHitProducer::~HGCalUncalibRecHitProducer ( )

Definition at line 28 of file HGCalUncalibRecHitProducer.cc.

28  {
29 }

Member Function Documentation

void HGCalUncalibRecHitProducer::produce ( edm::Event evt,
const edm::EventSetup es 
)
overridevirtual

Implements edm::stream::EDProducerBase.

Definition at line 32 of file HGCalUncalibRecHitProducer.cc.

References eeDigiCollection_, eeHitCollection_, edm::Event::getByToken(), hebDigiCollection_, hebHitCollection_, hefDigiCollection_, hefHitCollection_, edm::Event::put(), and worker_.

32  {
33  using namespace edm;
34 
36  Handle< HGCHEDigiCollection > pHGCHEFDigis;
37  Handle< HGCHEDigiCollection > pHGCHEBDigis;
38 
39  evt.getByToken( eeDigiCollection_, pHGCEEDigis);
40  const HGCEEDigiCollection* eeDigis =
41  pHGCEEDigis.product(); // get a ptr to the product
42 
43  evt.getByToken( hefDigiCollection_, pHGCHEFDigis);
44  const HGCHEDigiCollection* hefDigis =
45  pHGCHEFDigis.product(); // get a ptr to the product
46 
47  evt.getByToken( hebDigiCollection_, pHGCHEBDigis);
48  const HGCHEDigiCollection* hebDigis =
49  pHGCHEBDigis.product(); // get a ptr to the product
50 
51  // tranparently get things from event setup
52  worker_->set(es);
53 
54  // prepare output
55  std::auto_ptr< HGCeeUncalibratedRecHitCollection > eeUncalibRechits( new HGCeeUncalibratedRecHitCollection );
56  std::auto_ptr< HGChefUncalibratedRecHitCollection > hefUncalibRechits( new HGChefUncalibratedRecHitCollection );
57  std::auto_ptr< HGChefUncalibratedRecHitCollection > hebUncalibRechits( new HGChebUncalibratedRecHitCollection );
58 
59  // loop over HGCEE digis
60  eeUncalibRechits->reserve(eeDigis->size());
61  for(auto itdg = eeDigis->begin(); itdg != eeDigis->end(); ++itdg) {
62  worker_->run1(evt, itdg, *eeUncalibRechits);
63  }
64 
65  hefUncalibRechits->reserve(hefDigis->size());
66  for(auto itdg = hefDigis->begin(); itdg != hefDigis->end(); ++itdg) {
67  worker_->run2(evt, itdg, *hefUncalibRechits);
68  }
69 
70  hebUncalibRechits->reserve(hebDigis->size());
71  for(auto itdg = hebDigis->begin(); itdg != hebDigis->end(); ++itdg) {
72  worker_->run3(evt, itdg, *hebUncalibRechits);
73  }
74 
75  // put the collection of recunstructed hits in the event
76  evt.put( eeUncalibRechits, eeHitCollection_ );
77  evt.put( hefUncalibRechits, hefHitCollection_ );
78  evt.put( hebUncalibRechits, hebHitCollection_ );
79 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:464
const edm::EDGetTokenT< HGCHEDigiCollection > hefDigiCollection_
const edm::EDGetTokenT< HGCHEDigiCollection > hebDigiCollection_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:120
std::unique_ptr< HGCalUncalibRecHitWorkerBaseClass > worker_
const edm::EDGetTokenT< HGCEEDigiCollection > eeDigiCollection_

Member Data Documentation

const edm::EDGetTokenT<HGCEEDigiCollection> HGCalUncalibRecHitProducer::eeDigiCollection_
private

Definition at line 23 of file HGCalUncalibRecHitProducer.h.

Referenced by produce().

const std::string HGCalUncalibRecHitProducer::eeHitCollection_
private

Definition at line 27 of file HGCalUncalibRecHitProducer.h.

Referenced by HGCalUncalibRecHitProducer(), and produce().

const edm::EDGetTokenT<HGCHEDigiCollection> HGCalUncalibRecHitProducer::hebDigiCollection_
private

Definition at line 25 of file HGCalUncalibRecHitProducer.h.

Referenced by produce().

const std::string HGCalUncalibRecHitProducer::hebHitCollection_
private

Definition at line 29 of file HGCalUncalibRecHitProducer.h.

Referenced by HGCalUncalibRecHitProducer(), and produce().

const edm::EDGetTokenT<HGCHEDigiCollection> HGCalUncalibRecHitProducer::hefDigiCollection_
private

Definition at line 24 of file HGCalUncalibRecHitProducer.h.

Referenced by produce().

const std::string HGCalUncalibRecHitProducer::hefHitCollection_
private

Definition at line 28 of file HGCalUncalibRecHitProducer.h.

Referenced by HGCalUncalibRecHitProducer(), and produce().

std::unique_ptr<HGCalUncalibRecHitWorkerBaseClass> HGCalUncalibRecHitProducer::worker_
private

Definition at line 31 of file HGCalUncalibRecHitProducer.h.

Referenced by HGCalUncalibRecHitProducer(), and produce().