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 {
19  produces<ESRecHitCollection>(rechitCollection_);
20 
21  std::string const & componentType = ps.getParameter<std::string>("algo");
22  worker_ = ESRecHitWorkerFactory::get()->create( componentType, ps );
23 }
24 
26 
27  delete worker_;
28 }
29 
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 }
56 
59 
#define LogDebug(id)
T getParameter(std::string const &) const
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
ESRecHitProducer(const edm::ParameterSet &ps)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
virtual void set(const edm::EventSetup &es)=0
const_iterator begin() const
virtual ~ESRecHitProducer()
const std::string rechitCollection_
virtual void produce(edm::Event &e, const edm::EventSetup &es) override
ESRecHitWorkerBaseClass * worker_
const edm::EDGetTokenT< ESDigiCollection > digiToken_
T const * product() const
Definition: Handle.h:81
const_iterator end() const
HLT enums.
virtual bool run(const ESDigiCollection::const_iterator &digi, ESRecHitCollection &result)=0
def move(src, dest)
Definition: eostools.py:510
T get(const Candidate &c)
Definition: component.h:55