Public Member Functions | |
CaloRecHitCandidateProducer (const edm::ParameterSet &cfg) | |
constructor | |
~CaloRecHitCandidateProducer () | |
destructor | |
Private Member Functions | |
void | produce (edm::Event &, const edm::EventSetup &) |
process one event | |
Private Attributes | |
edm::InputTag | src_ |
source collection tag |
Definition at line 9 of file CaloRecHitCandidateProducer.cc.
reco::modules::CaloRecHitCandidateProducer< HitCollection >::CaloRecHitCandidateProducer | ( | const edm::ParameterSet & | cfg | ) | [inline] |
constructor
Definition at line 12 of file CaloRecHitCandidateProducer.cc.
: src_( cfg.template getParameter<edm::InputTag>( "src" ) ) { }
reco::modules::CaloRecHitCandidateProducer< HitCollection >::~CaloRecHitCandidateProducer | ( | ) | [inline] |
void CaloRecHitCandidateProducer::produce | ( | edm::Event & | evt, |
const edm::EventSetup & | |||
) | [private, virtual] |
process one event
don't know how to set eta and phi
Implements edm::EDProducer.
Definition at line 34 of file CaloRecHitCandidateProducer.cc.
References trackerHits::c, CaloRecHit::energy(), relval_parameters_module::energy, eta(), edm::Event::getByLabel(), AlCaHLTBitMon_ParallelJobs::p, phi, edm::Event::put(), dt_dqm_sourceclient_common_cff::reco, reco::CaloRecHitCandidate::setCaloRecHit(), and findQualityFiles::size.
{ using namespace edm; using namespace reco; using namespace std; Handle<HitCollection> hits; evt.getByLabel( src_, hits ); auto_ptr<CandidateCollection> cands( new CandidateCollection ); size_t size = hits->size(); cands->reserve( size ); for( size_t idx = 0; idx != size; ++ idx ) { const CaloRecHit & hit = (*hits)[ idx ]; double eta = 0, phi = 0, energy = hit.energy(); math::RhoEtaPhiVector p( 1, eta, phi ); p *= ( energy / p.r() ); CaloRecHitCandidate * c = new CaloRecHitCandidate( Candidate::LorentzVector( p.x(), p.y(), p.z(), energy ) ); c->setCaloRecHit( RefToBase<CaloRecHit>( Ref<HitCollection>( hits, idx ) ) ); cands->push_back( c ); } evt.put( cands ); }
edm::InputTag reco::modules::CaloRecHitCandidateProducer< HitCollection >::src_ [private] |
source collection tag
Definition at line 21 of file CaloRecHitCandidateProducer.cc.