CMS 3D CMS Logo

CaloTowerCandidateCreator Class Reference

Framework module that produces a collection of candidates with a CaloTowerCandidate compoment. More...

#include <RecoLocalCalo/CaloTowersCreator/src/CaloTowerCandidateCreator.h>

Inheritance diagram for CaloTowerCandidateCreator:

edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 CaloTowerCandidateCreator (const edm::ParameterSet &)
 constructor from parameter set
 ~CaloTowerCandidateCreator ()
 destructor

Private Member Functions

void produce (edm::Event &e, const edm::EventSetup &)
 process one event

Private Attributes

double mEThreshold
 E threshold.
double mEtThreshold
 ET threshold.
edm::InputTag mSource
 label of source collection
int mVerbose
 verbosity


Detailed Description

Framework module that produces a collection of candidates with a CaloTowerCandidate compoment.

Author:
Luca Lista, INFN
Version:
Revision
1.1

Id
CaloTowerCandidateCreator.h,v 1.1 2007/03/07 19:54:50 mansj Exp

Definition at line 21 of file CaloTowerCandidateCreator.h.


Constructor & Destructor Documentation

CaloTowerCandidateCreator::CaloTowerCandidateCreator ( const edm::ParameterSet p  ) 

constructor from parameter set

Definition at line 16 of file CaloTowerCandidateCreator.cc.

00017   :
00018   mVerbose (p.getUntrackedParameter<int> ("verbose", 0)),
00019   mSource (p.getParameter<edm::InputTag> ("src")),
00020   mEtThreshold (p.getParameter<double> ("minimumEt")),
00021   mEThreshold (p.getParameter<double> ("minimumE"))
00022 {
00023   produces<CandidateCollection>();
00024 }

CaloTowerCandidateCreator::~CaloTowerCandidateCreator (  ) 

destructor

Definition at line 26 of file CaloTowerCandidateCreator.cc.

00026                                                       {
00027 }


Member Function Documentation

void CaloTowerCandidateCreator::produce ( edm::Event e,
const edm::EventSetup  
) [private, virtual]

process one event

Implements edm::EDProducer.

Definition at line 29 of file CaloTowerCandidateCreator.cc.

References c, IterativeConePu5Jets_PbPb_cff::caloTowers, GenMuonPlsPt100GeV_cfg::cout, lat::endl(), reco::Particle::energy(), reco::Particle::et(), reco::Particle::eta(), edm::Event::getByLabel(), mEThreshold, mEtThreshold, mSource, mVerbose, p, reco::Particle::phi(), and edm::Event::put().

00029                                                                        {
00030   Handle<CaloTowerCollection> caloTowers;
00031   evt.getByLabel( mSource, caloTowers );
00032   
00033   auto_ptr<CandidateCollection> cands( new CandidateCollection );
00034   cands->reserve( caloTowers->size() );
00035   unsigned idx = 0;
00036   for (; idx < caloTowers->size (); idx++) {
00037     const CaloTower* cal = &((*caloTowers) [idx]);
00038     if (mVerbose >= 2) {
00039       std::cout << "CaloTowerCandidateCreator::produce-> " << idx << " tower et/eta/phi/e: " 
00040                 << cal->et() << '/' << cal->eta() << '/' << cal->phi() << '/' << cal->energy() << " is...";
00041     }
00042     if (cal->et() >= mEtThreshold && cal->energy() >= mEThreshold ) {
00043       math::PtEtaPhiMLorentzVector p( cal->et(), cal->eta(), cal->phi(), 0 );
00044       RecoCaloTowerCandidate * c = 
00045         new RecoCaloTowerCandidate( 0, Candidate::LorentzVector( p ) );
00046       c->setCaloTower (CaloTowerRef( caloTowers, idx) );
00047       cands->push_back( c );
00048       if (mVerbose >= 2) std::cout << "accepted: pT/eta/phi:" << c->pt() << '/' << c->eta() <<  '/' << c->phi() <<std::endl;
00049     }
00050     else {
00051       if (mVerbose >= 2) std::cout << "rejected" << std::endl;
00052     }
00053   }
00054   if (mVerbose >= 1) {
00055     std::cout << "CaloTowerCandidateCreator::produce-> " << cands->size () << " candidates created" << std::endl;
00056   }
00057   evt.put( cands );
00058 }


Member Data Documentation

double CaloTowerCandidateCreator::mEThreshold [private]

E threshold.

Definition at line 38 of file CaloTowerCandidateCreator.h.

Referenced by produce().

double CaloTowerCandidateCreator::mEtThreshold [private]

ET threshold.

Definition at line 36 of file CaloTowerCandidateCreator.h.

Referenced by produce().

edm::InputTag CaloTowerCandidateCreator::mSource [private]

label of source collection

Definition at line 34 of file CaloTowerCandidateCreator.h.

Referenced by produce().

int CaloTowerCandidateCreator::mVerbose [private]

verbosity

Definition at line 32 of file CaloTowerCandidateCreator.h.

Referenced by produce().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:15:59 2009 for CMSSW by  doxygen 1.5.4