CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
CaloTowerCandidateCreator Class Reference

#include <CaloTowerCandidateCreator.h>

Inheritance diagram for CaloTowerCandidateCreator:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

 CaloTowerCandidateCreator (const edm::ParameterSet &)
 constructor from parameter set More...
 
 ~CaloTowerCandidateCreator ()
 destructor More...
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Member Functions

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

Private Attributes

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

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

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

Author
Luca Lista, INFN
Version
Revision:
1.4
Id:
CaloTowerCandidateCreator.h,v 1.4 2006/08/17 15:23:34 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.

17  :
18  mVerbose (p.getUntrackedParameter<int> ("verbose", 0)),
19  mSource (p.getParameter<edm::InputTag> ("src")),
20  mEtThreshold (p.getParameter<double> ("minimumEt")),
21  mEThreshold (p.getParameter<double> ("minimumE"))
22 {
23  produces<CandidateCollection>();
24 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::InputTag mSource
label of source collection
CaloTowerCandidateCreator::~CaloTowerCandidateCreator ( )

destructor

Definition at line 26 of file CaloTowerCandidateCreator.cc.

26  {
27 }

Member Function Documentation

void CaloTowerCandidateCreator::produce ( edm::Event e,
const edm::EventSetup  
)
privatevirtual

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, L1TEmulatorMonitor_cff::p, reco::LeafCandidate::phi(), and edm::Event::put().

29  {
31  evt.getByLabel( mSource, caloTowers );
32 
33  auto_ptr<CandidateCollection> cands( new CandidateCollection );
34  cands->reserve( caloTowers->size() );
35  unsigned idx = 0;
36  for (; idx < caloTowers->size (); idx++) {
37  const CaloTower* cal = &((*caloTowers) [idx]);
38  if (mVerbose >= 2) {
39  std::cout << "CaloTowerCandidateCreator::produce-> " << idx << " tower et/eta/phi/e: "
40  << cal->et() << '/' << cal->eta() << '/' << cal->phi() << '/' << cal->energy() << " is...";
41  }
42  if (cal->et() >= mEtThreshold && cal->energy() >= mEThreshold ) {
43  math::PtEtaPhiMLorentzVector p( cal->et(), cal->eta(), cal->phi(), 0 );
46  c->setCaloTower (CaloTowerRef( caloTowers, idx) );
47  cands->push_back( c );
48  if (mVerbose >= 2) std::cout << "accepted: pT/eta/phi:" << c->pt() << '/' << c->eta() << '/' << c->phi() <<std::endl;
49  }
50  else {
51  if (mVerbose >= 2) std::cout << "rejected" << std::endl;
52  }
53  }
54  if (mVerbose >= 1) {
55  std::cout << "CaloTowerCandidateCreator::produce-> " << cands->size () << " candidates created" << std::endl;
56  }
57  evt.put( cands );
58 }
virtual double eta() const
momentum pseudorapidity
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:26
virtual double energy() const
energy
edm::InputTag mSource
label of source collection
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:39
tuple cout
Definition: gather_cfg.py:41
double et(double vtxZ) const
Definition: CaloTower.h:101
edm::Ref< CaloTowerCollection > CaloTowerRef
Definition: CaloTowerFwd.h:16
virtual double phi() const
momentum azimuthal angle

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