CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
ECALPFSeedCleaner Class Reference
Inheritance diagram for ECALPFSeedCleaner:
RecHitTopologicalCleanerBase

Public Member Functions

void clean (const edm::Handle< reco::PFRecHitCollection > &input, std::vector< bool > &mask) override
 
 ECALPFSeedCleaner (const edm::ParameterSet &conf, edm::ConsumesCollector &cc)
 
 ECALPFSeedCleaner (const ECALPFSeedCleaner &)=delete
 
ECALPFSeedCleaneroperator= (const ECALPFSeedCleaner &)=delete
 
void update (const edm::EventSetup &) override
 
- Public Member Functions inherited from RecHitTopologicalCleanerBase
const std::string & name () const
 
RecHitTopologicalCleanerBaseoperator= (const RecHitTopologicalCleanerBase &)=delete
 
 RecHitTopologicalCleanerBase (const edm::ParameterSet &conf, edm::ConsumesCollector &cc)
 
 RecHitTopologicalCleanerBase (const RecHitTopologicalCleanerBase &)=delete
 
virtual ~RecHitTopologicalCleanerBase ()=default
 

Private Attributes

edm::ESHandle< EcalPFSeedingThresholdsths_
 
edm::ESGetToken< EcalPFSeedingThresholds, EcalPFSeedingThresholdsRcdthsToken_
 

Detailed Description

Definition at line 5 of file ECALPFSeedCleaner.cc.

Constructor & Destructor Documentation

◆ ECALPFSeedCleaner() [1/2]

ECALPFSeedCleaner::ECALPFSeedCleaner ( const edm::ParameterSet conf,
edm::ConsumesCollector cc 
)

Definition at line 22 of file ECALPFSeedCleaner.cc.

edm::ESGetToken< EcalPFSeedingThresholds, EcalPFSeedingThresholdsRcd > thsToken_
RecHitTopologicalCleanerBase(const edm::ParameterSet &conf, edm::ConsumesCollector &cc)

◆ ECALPFSeedCleaner() [2/2]

ECALPFSeedCleaner::ECALPFSeedCleaner ( const ECALPFSeedCleaner )
delete

Member Function Documentation

◆ clean()

void ECALPFSeedCleaner::clean ( const edm::Handle< reco::PFRecHitCollection > &  input,
std::vector< bool > &  mask 
)
overridevirtual

Implements RecHitTopologicalCleanerBase.

Definition at line 27 of file ECALPFSeedCleaner.cc.

References reco::PFRecHit::detId(), reco::PFRecHit::energy(), hfClusterShapes_cfi::hits, mps_fire::i, heavyIonCSV_trainingSettings::idx, input, dqmiolumiharvest::j, jetUpdater_cfi::sort, and remoteMonitoring_LASER_era2018_cfg::threshold.

27  {
28  //need to run over energy sorted rechits, as this is order used in seeding step
29  // this can cause ambiguity, isn't it better to index by detid ?
30  auto const& hits = *input;
31  std::vector<unsigned> ordered_hits(hits.size());
32  for (unsigned i = 0; i < hits.size(); ++i)
33  ordered_hits[i] = i;
34 
35  std::sort(ordered_hits.begin(), ordered_hits.end(), [&](unsigned i, unsigned j) {
36  return hits[i].energy() > hits[j].energy();
37  });
38 
39  for (const auto& idx : ordered_hits) {
40  if (!mask[idx])
41  continue; // is it useful ?
42  const reco::PFRecHit& rechit = hits[idx];
43 
44  float threshold = (*ths_)[rechit.detId()];
45  if (rechit.energy() < threshold)
46  mask[idx] = false;
47 
48  } // rechit loop
49 }
static std::string const input
Definition: EdmProvDump.cc:47
unsigned detId() const
rechit detId
Definition: PFRecHit.h:93
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
Definition: PFRecHit.h:31
float energy() const
rechit energy
Definition: PFRecHit.h:99

◆ operator=()

ECALPFSeedCleaner& ECALPFSeedCleaner::operator= ( const ECALPFSeedCleaner )
delete

◆ update()

void ECALPFSeedCleaner::update ( const edm::EventSetup iSetup)
overridevirtual

Reimplemented from RecHitTopologicalCleanerBase.

Definition at line 25 of file ECALPFSeedCleaner.cc.

References edm::EventSetup::getHandle(), ths_, and thsToken_.

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), progressbar.ProgressBar::finish(), and MatrixUtil.Steps::overwrite().

25 { ths_ = iSetup.getHandle(thsToken_); }
edm::ESGetToken< EcalPFSeedingThresholds, EcalPFSeedingThresholdsRcd > thsToken_
edm::ESHandle< EcalPFSeedingThresholds > ths_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:151

Member Data Documentation

◆ ths_

edm::ESHandle<EcalPFSeedingThresholds> ECALPFSeedCleaner::ths_
private

Definition at line 16 of file ECALPFSeedCleaner.cc.

Referenced by update().

◆ thsToken_

edm::ESGetToken<EcalPFSeedingThresholds, EcalPFSeedingThresholdsRcd> ECALPFSeedCleaner::thsToken_
private

Definition at line 17 of file ECALPFSeedCleaner.cc.

Referenced by update().