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
EcalUncalibRecHitProducer Class Reference

#include <EcalUncalibRecHitProducer.h>

Inheritance diagram for EcalUncalibRecHitProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 EcalUncalibRecHitProducer (const edm::ParameterSet &ps)
 
virtual void produce (edm::Event &evt, const edm::EventSetup &es) override
 
 ~EcalUncalibRecHitProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 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
 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
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

edm::EDGetTokenT
< EBDigiCollection
ebDigiCollectionToken_
 
std::string ebHitCollection_
 
edm::EDGetTokenT
< EEDigiCollection
eeDigiCollectionToken_
 
std::string eeHitCollection_
 
EcalUncalibRecHitWorkerBaseClassworker_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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 18 of file EcalUncalibRecHitProducer.h.

Constructor & Destructor Documentation

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

Definition at line 13 of file EcalUncalibRecHitProducer.cc.

References trackerHits::c, edm::EDConsumerBase::consumesCollector(), ebDigiCollectionToken_, ebHitCollection_, eeDigiCollectionToken_, eeHitCollection_, reco::get(), edm::ParameterSet::getParameter(), AlCaHLTBitMon_QueryRunRegistry::string, and worker_.

14 {
15  ebHitCollection_ = ps.getParameter<std::string>("EBhitCollection");
16  eeHitCollection_ = ps.getParameter<std::string>("EEhitCollection");
17  produces< EBUncalibratedRecHitCollection >(ebHitCollection_);
18  produces< EEUncalibratedRecHitCollection >(eeHitCollection_);
19 
20  ebDigiCollectionToken_ = consumes<EBDigiCollection>(ps.getParameter<edm::InputTag>("EBdigiCollection"));
21 
22  eeDigiCollectionToken_ = consumes<EEDigiCollection>(ps.getParameter<edm::InputTag>("EEdigiCollection"));
23 
24  std::string componentType = ps.getParameter<std::string>("algo");
26  worker_ = EcalUncalibRecHitWorkerFactory::get()->create(componentType, ps, c);
27 }
T getParameter(std::string const &) const
edm::EDGetTokenT< EEDigiCollection > eeDigiCollectionToken_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
EcalUncalibRecHitWorkerBaseClass * worker_
edm::EDGetTokenT< EBDigiCollection > ebDigiCollectionToken_
T get(const Candidate &c)
Definition: component.h:55
EcalUncalibRecHitProducer::~EcalUncalibRecHitProducer ( )

Definition at line 29 of file EcalUncalibRecHitProducer.cc.

References worker_.

30 {
31  delete worker_;
32 }
EcalUncalibRecHitWorkerBaseClass * worker_

Member Function Documentation

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

Implements edm::EDProducer.

Definition at line 35 of file EcalUncalibRecHitProducer.cc.

References ebDigiCollectionToken_, ebHitCollection_, eeDigiCollectionToken_, eeHitCollection_, edm::Event::getByToken(), edm::Event::put(), EcalUncalibRecHitWorkerBaseClass::run(), EcalUncalibRecHitWorkerBaseClass::set(), and worker_.

35  {
36 
37  using namespace edm;
38 
41 
42  const EBDigiCollection* ebDigis =0;
43  const EEDigiCollection* eeDigis =0;
44 
45 
46  evt.getByToken( ebDigiCollectionToken_, pEBDigis);
47  ebDigis = pEBDigis.product(); // get a ptr to the produc
48  edm::LogInfo("EcalUncalibRecHitInfo") << "total # ebDigis: " << ebDigis->size() ;
49 
50  evt.getByToken( eeDigiCollectionToken_, pEEDigis);
51  eeDigis = pEEDigis.product(); // get a ptr to the product
52  edm::LogInfo("EcalUncalibRecHitInfo") << "total # eeDigis: " << eeDigis->size() ;
53 
54 
55  // tranparently get things from event setup
56  worker_->set(es);
57 
58  // prepare output
59  std::auto_ptr< EBUncalibratedRecHitCollection > ebUncalibRechits( new EBUncalibratedRecHitCollection );
60  std::auto_ptr< EEUncalibratedRecHitCollection > eeUncalibRechits( new EEUncalibratedRecHitCollection );
61 
62  // loop over EB digis
63  if (ebDigis)
64  {
65  ebUncalibRechits->reserve(ebDigis->size());
66  for(EBDigiCollection::const_iterator itdg = ebDigis->begin(); itdg != ebDigis->end(); ++itdg) {
67  worker_->run(evt, itdg, *ebUncalibRechits);
68  }
69  }
70 
71  // loop over EB digis
72  if (eeDigis)
73  {
74  eeUncalibRechits->reserve(eeDigis->size());
75  for(EEDigiCollection::const_iterator itdg = eeDigis->begin(); itdg != eeDigis->end(); ++itdg) {
76  worker_->run(evt, itdg, *eeUncalibRechits);
77  }
78  }
79 
80  // put the collection of recunstructed hits in the event
81  evt.put( ebUncalibRechits, ebHitCollection_ );
82  evt.put( eeUncalibRechits, eeHitCollection_ );
83 }
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
virtual void set(const edm::EventSetup &es)=0
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
edm::EDGetTokenT< EEDigiCollection > eeDigiCollectionToken_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
EcalUncalibRecHitWorkerBaseClass * worker_
virtual bool run(const edm::Event &evt, const EcalDigiCollection::const_iterator &digi, EcalUncalibratedRecHitCollection &result)=0
edm::EDGetTokenT< EBDigiCollection > ebDigiCollectionToken_

Member Data Documentation

edm::EDGetTokenT<EBDigiCollection> EcalUncalibRecHitProducer::ebDigiCollectionToken_
private

Definition at line 27 of file EcalUncalibRecHitProducer.h.

Referenced by EcalUncalibRecHitProducer(), and produce().

std::string EcalUncalibRecHitProducer::ebHitCollection_
private

Definition at line 30 of file EcalUncalibRecHitProducer.h.

Referenced by EcalUncalibRecHitProducer(), and produce().

edm::EDGetTokenT<EEDigiCollection> EcalUncalibRecHitProducer::eeDigiCollectionToken_
private

Definition at line 28 of file EcalUncalibRecHitProducer.h.

Referenced by EcalUncalibRecHitProducer(), and produce().

std::string EcalUncalibRecHitProducer::eeHitCollection_
private

Definition at line 31 of file EcalUncalibRecHitProducer.h.

Referenced by EcalUncalibRecHitProducer(), and produce().

EcalUncalibRecHitWorkerBaseClass* EcalUncalibRecHitProducer::worker_
private