#include <RecoLocalCalo/CaloTowersCreator/src/CaloTowerCandidateCreator.h>
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 |
Definition at line 21 of file CaloTowerCandidateCreator.h.
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 | ( | ) |
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 }
double CaloTowerCandidateCreator::mEThreshold [private] |
double CaloTowerCandidateCreator::mEtThreshold [private] |
label of source collection
Definition at line 34 of file CaloTowerCandidateCreator.h.
Referenced by produce().
int CaloTowerCandidateCreator::mVerbose [private] |