CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
CaloTowerCandidateCreator Class Reference
Inheritance diagram for CaloTowerCandidateCreator:
edm::stream::EDProducer<>

Public Member Functions

 CaloTowerCandidateCreator (const edm::ParameterSet &)
 constructor from parameter set More...
 
 ~CaloTowerCandidateCreator () override
 destructor More...
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Member Functions

void produce (edm::Event &e, const edm::EventSetup &) override
 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::stream::EDProducer<>
using CacheTypes = CacheContexts< T...>
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T...>
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

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

Author
Luca Lista, INFN modifyed by: F.Ratnikov UMd

Definition at line 22 of file CaloTowerCandidateCreator.cc.

Constructor & Destructor Documentation

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

constructor from parameter set

Definition at line 51 of file CaloTowerCandidateCreator.cc.

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

52  : mVerbose(p.getUntrackedParameter<int>("verbose", 0)),
53  mEtThreshold(p.getParameter<double>("minimumEt")),
54  mEThreshold(p.getParameter<double>("minimumE")) {
55  tok_src_ = consumes<CaloTowerCollection>(p.getParameter<edm::InputTag>("src"));
56 
57  produces<CandidateCollection>();
58 }
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< CaloTowerCollection > tok_src_
token of source collection
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
CaloTowerCandidateCreator::~CaloTowerCandidateCreator ( )
override

destructor

Definition at line 60 of file CaloTowerCandidateCreator.cc.

60 {}

Member Function Documentation

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

process one event

Definition at line 62 of file CaloTowerCandidateCreator.cc.

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

62  {
64  evt.getByToken(tok_src_, caloTowers);
65 
66  auto cands = std::make_unique<CandidateCollection>();
67  cands->reserve(caloTowers->size());
68  unsigned idx = 0;
69  for (; idx < caloTowers->size(); idx++) {
70  const CaloTower* cal = &((*caloTowers)[idx]);
71  if (mVerbose >= 2) {
72  std::cout << "CaloTowerCandidateCreator::produce-> " << idx << " tower et/eta/phi/e: " << cal->et() << '/'
73  << cal->eta() << '/' << cal->phi() << '/' << cal->energy() << " is...";
74  }
75  if (cal->et() >= mEtThreshold && cal->energy() >= mEThreshold) {
76  math::PtEtaPhiMLorentzVector p(cal->et(), cal->eta(), cal->phi(), 0);
78  c->setCaloTower(CaloTowerRef(caloTowers, idx));
79  cands->push_back(c);
80  if (mVerbose >= 2)
81  std::cout << "accepted: pT/eta/phi:" << c->pt() << '/' << c->eta() << '/' << c->phi() << std::endl;
82  } else {
83  if (mVerbose >= 2)
84  std::cout << "rejected" << std::endl;
85  }
86  }
87  if (mVerbose >= 1) {
88  std::cout << "CaloTowerCandidateCreator::produce-> " << cands->size() << " candidates created" << std::endl;
89  }
90  evt.put(std::move(cands));
91 }
const edm::EventSetup & c
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:25
edm::EDGetTokenT< CaloTowerCollection > tok_src_
token of source collection
def move
Definition: eostools.py:511
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36
tuple cout
Definition: gather_cfg.py:144
double et(double vtxZ) const
Definition: CaloTower.h:150
edm::Ref< CaloTowerCollection > CaloTowerRef
Definition: CaloTowerDefs.h:17
double phi() const final
momentum azimuthal angle
double energy() const final
energy
double eta() const final
momentum pseudorapidity

Member Data Documentation

double CaloTowerCandidateCreator::mEThreshold
private

E threshold.

Definition at line 39 of file CaloTowerCandidateCreator.cc.

Referenced by produce().

double CaloTowerCandidateCreator::mEtThreshold
private

ET threshold.

Definition at line 37 of file CaloTowerCandidateCreator.cc.

Referenced by produce().

int CaloTowerCandidateCreator::mVerbose
private

verbosity

Definition at line 33 of file CaloTowerCandidateCreator.cc.

Referenced by produce().

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

token of source collection

Definition at line 35 of file CaloTowerCandidateCreator.cc.

Referenced by CaloTowerCandidateCreator(), and produce().