CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

reco::modules::CaloRecHitCandidateProducer< HitCollection > Class Template Reference

Inheritance diagram for reco::modules::CaloRecHitCandidateProducer< HitCollection >:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

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

Detailed Description

template<typename HitCollection>
class reco::modules::CaloRecHitCandidateProducer< HitCollection >

Definition at line 9 of file CaloRecHitCandidateProducer.cc.


Constructor & Destructor Documentation

template<typename HitCollection >
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" ) ) { }
template<typename HitCollection >
reco::modules::CaloRecHitCandidateProducer< HitCollection >::~CaloRecHitCandidateProducer ( ) [inline]

destructor

Definition at line 15 of file CaloRecHitCandidateProducer.cc.

{ }

Member Function Documentation

template<typename HitCollection >
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 );
    }

Member Data Documentation

template<typename HitCollection >
edm::InputTag reco::modules::CaloRecHitCandidateProducer< HitCollection >::src_ [private]

source collection tag

Definition at line 21 of file CaloRecHitCandidateProducer.cc.