CMS 3D CMS Logo

ESRecHitProducer.cc
Go to the documentation of this file.
2 
4 
10 
14 
16  digiToken_( consumes<ESDigiCollection>(ps.getParameter<edm::InputTag>("ESdigiCollection")) ),
17  rechitCollection_( ps.getParameter<std::string>("ESrechitCollection") ),
18  worker_{ESRecHitWorkerFactory::get()->create(ps.getParameter<std::string>("algo"), ps )}
19 {
20  produces<ESRecHitCollection>(rechitCollection_);
21 }
22 
24 
26 
28  const ESDigiCollection* digi=nullptr;
29  e.getByToken( digiToken_, digiHandle);
30 
31  digi = digiHandle.product();
32  LogDebug("ESRecHitInfo") << "total # ESdigis: " << digi->size();
33 
34  // Create empty output
35  auto rec = std::make_unique<ESRecHitCollection>();
36 
37  if ( digi ) {
38  rec->reserve(digi->size());
39 
40  worker_->set( es );
41 
42  // run the algorithm
44  i!=digi->end(); i++) {
45  worker_->run( i, *rec );
46  }
47  }
48 
50 }
51 
54 
#define LogDebug(id)
T getParameter(std::string const &) const
std::unique_ptr< ESRecHitWorkerBaseClass > worker_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
ESRecHitProducer(const edm::ParameterSet &ps)
~ESRecHitProducer() override
const_iterator begin() const
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
const std::string rechitCollection_
void produce(edm::Event &e, const edm::EventSetup &es) override
const edm::EDGetTokenT< ESDigiCollection > digiToken_
T const * product() const
Definition: Handle.h:74
const_iterator end() const
HLT enums.
def move(src, dest)
Definition: eostools.py:511
T get(const Candidate &c)
Definition: component.h:55