CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

CaloTowerCandidateCreator Class Reference

#include <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.

  :
  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 ( )

destructor

Definition at line 26 of file CaloTowerCandidateCreator.cc.

                                                      {
}

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 trackerHits::c, HiRecoJets_cff::caloTowers, gather_cfg::cout, reco::LeafCandidate::energy(), CaloTower::et(), reco::LeafCandidate::eta(), edm::Event::getByLabel(), UserOptions_cff::idx, 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 );
}

Member Data Documentation

E threshold.

Definition at line 38 of file CaloTowerCandidateCreator.h.

Referenced by produce().

ET threshold.

Definition at line 36 of file CaloTowerCandidateCreator.h.

Referenced by produce().

label of source collection

Definition at line 34 of file CaloTowerCandidateCreator.h.

Referenced by produce().

verbosity

Definition at line 32 of file CaloTowerCandidateCreator.h.

Referenced by produce().