CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ESRecHitProducer.cc
Go to the documentation of this file.
2 
4 
10 
14 
16 
17  digiCollection_ = ps.getParameter<edm::InputTag>("ESdigiCollection");
18  rechitCollection_ = ps.getParameter<std::string>("ESrechitCollection");
19  produces<ESRecHitCollection>(rechitCollection_);
20 
21  std::string 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.getByLabel( digiCollection_, digiHandle);
35  if ( digiHandle.isValid() ) {
36  digi = digiHandle.product();
37  LogDebug("ESRecHitInfo") << "total # ESdigis: " << digi->size();
38  } else {
39  edm::LogError("ESRecHitInfo") << "Error! can't get the product " << digiCollection_;
40  }
41 
42  // Create empty output
43  std::auto_ptr<ESRecHitCollection> rec(new ESRecHitCollection );
44 
45  if ( digi ) {
46  rec->reserve(digi->size());
47 
48  worker_->set( es );
49 
50  // run the algorithm
52  i!=digi->end(); i++) {
53  worker_->run( i, *rec );
54  }
55  }
56 
57  e.put(rec,rechitCollection_);
58 }
59 
62 
#define LogDebug(id)
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
edm::InputTag digiCollection_
std::string rechitCollection_
ESRecHitProducer(const edm::ParameterSet &ps)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
virtual void set(const edm::EventSetup &es)=0
virtual void produce(edm::Event &e, const edm::EventSetup &es)
const_iterator begin() const
virtual ~ESRecHitProducer()
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:94
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
ESRecHitWorkerBaseClass * worker_
T const * product() const
Definition: Handle.h:74
const_iterator end() const
virtual bool run(const ESDigiCollection::const_iterator &digi, ESRecHitCollection &result)=0
T get(const Candidate &c)
Definition: component.h:56