CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
CaloTowerCandidateCreator Class Reference

#include <CaloTowerCandidateCreator.h>

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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

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< CaloTowerCollectiontok_src_
 token of source collection More...
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

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::CaloTowerCandidateCreator ( const edm::ParameterSet p)

constructor from parameter set

Definition at line 14 of file CaloTowerCandidateCreator.cc.

15  : mVerbose(p.getUntrackedParameter<int>("verbose", 0)),
16  mEtThreshold(p.getParameter<double>("minimumEt")),
17  mEThreshold(p.getParameter<double>("minimumE")) {
18  tok_src_ = consumes<CaloTowerCollection>(p.getParameter<edm::InputTag>("src"));
19 
20  produces<CandidateCollection>();
21 }

References AlCaHLTBitMon_ParallelJobs::p, and tok_src_.

◆ ~CaloTowerCandidateCreator()

CaloTowerCandidateCreator::~CaloTowerCandidateCreator ( )
override

destructor

Definition at line 23 of file CaloTowerCandidateCreator.cc.

23 {}

Member Function Documentation

◆ produce()

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

process one event

Definition at line 25 of file CaloTowerCandidateCreator.cc.

25  {
27  evt.getByToken(tok_src_, caloTowers);
28 
29  auto cands = std::make_unique<CandidateCollection>();
30  cands->reserve(caloTowers->size());
31  unsigned idx = 0;
32  for (; idx < caloTowers->size(); idx++) {
33  const CaloTower* cal = &((*caloTowers)[idx]);
34  if (mVerbose >= 2) {
35  std::cout << "CaloTowerCandidateCreator::produce-> " << idx << " tower et/eta/phi/e: " << cal->et() << '/'
36  << cal->eta() << '/' << cal->phi() << '/' << cal->energy() << " is...";
37  }
38  if (cal->et() >= mEtThreshold && cal->energy() >= mEThreshold) {
39  math::PtEtaPhiMLorentzVector p(cal->et(), cal->eta(), cal->phi(), 0);
41  c->setCaloTower(CaloTowerRef(caloTowers, idx));
42  cands->push_back(c);
43  if (mVerbose >= 2)
44  std::cout << "accepted: pT/eta/phi:" << c->pt() << '/' << c->eta() << '/' << c->phi() << std::endl;
45  } else {
46  if (mVerbose >= 2)
47  std::cout << "rejected" << std::endl;
48  }
49  }
50  if (mVerbose >= 1) {
51  std::cout << "CaloTowerCandidateCreator::produce-> " << cands->size() << " candidates created" << std::endl;
52  }
53  evt.put(std::move(cands));
54 }

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

Member Data Documentation

◆ mEThreshold

double CaloTowerCandidateCreator::mEThreshold
private

E threshold.

Definition at line 37 of file CaloTowerCandidateCreator.h.

Referenced by produce().

◆ mEtThreshold

double CaloTowerCandidateCreator::mEtThreshold
private

ET threshold.

Definition at line 35 of file CaloTowerCandidateCreator.h.

Referenced by produce().

◆ mVerbose

int CaloTowerCandidateCreator::mVerbose
private

verbosity

Definition at line 31 of file CaloTowerCandidateCreator.h.

Referenced by produce().

◆ tok_src_

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

token of source collection

Definition at line 33 of file CaloTowerCandidateCreator.h.

Referenced by CaloTowerCandidateCreator(), and produce().

AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
gather_cfg.cout
cout
Definition: gather_cfg.py:144
reco::RecoCaloTowerCandidate
Definition: RecoCaloTowerCandidate.h:15
CaloTowerCandidateCreator::mEtThreshold
double mEtThreshold
ET threshold.
Definition: CaloTowerCandidateCreator.h:35
edm::Handle
Definition: AssociativeIterator.h:50
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
CaloTowerCandidateCreator::mVerbose
int mVerbose
verbosity
Definition: CaloTowerCandidateCreator.h:31
HLT_FULL_cff.cands
cands
Definition: HLT_FULL_cff.py:15142
reco::LeafCandidate::eta
double eta() const final
momentum pseudorapidity
Definition: LeafCandidate.h:152
eleHcalExtractorBlocks_cff.caloTowers
caloTowers
Definition: eleHcalExtractorBlocks_cff.py:15
CaloTower
Definition: CaloTower.h:26
CaloTower::et
double et(double vtxZ) const
Definition: CaloTower.h:150
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
eostools.move
def move(src, dest)
Definition: eostools.py:511
reco::LeafCandidate::phi
double phi() const final
momentum azimuthal angle
Definition: LeafCandidate.h:148
CaloTowerRef
edm::Ref< CaloTowerCollection > CaloTowerRef
Definition: CaloTowerDefs.h:17
reco::LeafCandidate::energy
double energy() const final
energy
Definition: LeafCandidate.h:125
CaloTowerCandidateCreator::mEThreshold
double mEThreshold
E threshold.
Definition: CaloTowerCandidateCreator.h:37
math::PtEtaPhiMLorentzVector
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:25
reco::Candidate::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36
edm::InputTag
Definition: InputTag.h:15
CaloTowerCandidateCreator::tok_src_
edm::EDGetTokenT< CaloTowerCollection > tok_src_
token of source collection
Definition: CaloTowerCandidateCreator.h:33