test
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::EDConsumerBase 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 ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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...
 
int mVerbose
 verbosity More...
 
edm::EDGetTokenT
< CaloTowerCollection
tok_src_
 token of source collection More...
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- 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)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

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

Author
Luca Lista, INFN

Definition at line 20 of file CaloTowerCandidateCreator.h.

Constructor & Destructor Documentation

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

constructor from parameter set

Definition at line 14 of file CaloTowerCandidateCreator.cc.

References edm::ParameterSet::getParameter(), and tok_src_.

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

destructor

Definition at line 25 of file CaloTowerCandidateCreator.cc.

25  {
26 }

Member Function Documentation

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

process one event

Implements edm::EDProducer.

Definition at line 28 of file CaloTowerCandidateCreator.cc.

References trackerHits::c, HiRecoJets_cff::caloTowers, gather_cfg::cout, reco::LeafCandidate::energy(), CaloTower::et(), reco::LeafCandidate::eta(), edm::Event::getByToken(), customizeTrackingMonitorSeedNumber::idx, mEThreshold, mEtThreshold, mVerbose, AlCaHLTBitMon_ParallelJobs::p, reco::LeafCandidate::phi(), edm::Event::put(), and tok_src_.

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

Member Data Documentation

double CaloTowerCandidateCreator::mEThreshold
private

E threshold.

Definition at line 37 of file CaloTowerCandidateCreator.h.

Referenced by produce().

double CaloTowerCandidateCreator::mEtThreshold
private

ET threshold.

Definition at line 35 of file CaloTowerCandidateCreator.h.

Referenced by produce().

int CaloTowerCandidateCreator::mVerbose
private

verbosity

Definition at line 31 of file CaloTowerCandidateCreator.h.

Referenced by produce().

edm::EDGetTokenT<CaloTowerCollection> CaloTowerCandidateCreator::tok_src_
private

token of source collection

Definition at line 33 of file CaloTowerCandidateCreator.h.

Referenced by CaloTowerCandidateCreator(), and produce().