#include <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 |
Framework module that produces a collection of candidates with a CaloTowerCandidate compoment
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.
: mVerbose (p.getUntrackedParameter<int> ("verbose", 0)), mSource (p.getParameter<edm::InputTag> ("src")), mEtThreshold (p.getParameter<double> ("minimumEt")), mEThreshold (p.getParameter<double> ("minimumE")) { produces<CandidateCollection>(); }
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 trackerHits::c, HiRecoJets_cff::caloTowers, gather_cfg::cout, reco::LeafCandidate::energy(), CaloTower::et(), reco::LeafCandidate::eta(), edm::Event::getByLabel(), mEThreshold, mEtThreshold, mSource, mVerbose, AlCaHLTBitMon_ParallelJobs::p, reco::LeafCandidate::phi(), and edm::Event::put().
{ Handle<CaloTowerCollection> caloTowers; evt.getByLabel( mSource, caloTowers ); auto_ptr<CandidateCollection> cands( new CandidateCollection ); cands->reserve( caloTowers->size() ); unsigned idx = 0; for (; idx < caloTowers->size (); idx++) { const CaloTower* cal = &((*caloTowers) [idx]); if (mVerbose >= 2) { std::cout << "CaloTowerCandidateCreator::produce-> " << idx << " tower et/eta/phi/e: " << cal->et() << '/' << cal->eta() << '/' << cal->phi() << '/' << cal->energy() << " is..."; } if (cal->et() >= mEtThreshold && cal->energy() >= mEThreshold ) { math::PtEtaPhiMLorentzVector p( cal->et(), cal->eta(), cal->phi(), 0 ); RecoCaloTowerCandidate * c = new RecoCaloTowerCandidate( 0, Candidate::LorentzVector( p ) ); c->setCaloTower (CaloTowerRef( caloTowers, idx) ); cands->push_back( c ); if (mVerbose >= 2) std::cout << "accepted: pT/eta/phi:" << c->pt() << '/' << c->eta() << '/' << c->phi() <<std::endl; } else { if (mVerbose >= 2) std::cout << "rejected" << std::endl; } } if (mVerbose >= 1) { std::cout << "CaloTowerCandidateCreator::produce-> " << cands->size () << " candidates created" << std::endl; } evt.put( cands ); }
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] |