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 ECALPFSeedCleaner &)=delete
 
 ECALPFSeedCleaner (const edm::ParameterSet &conf, edm::ConsumesCollector &cc)
 
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.

◆ 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.

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 }

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

◆ operator=()

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

◆ update()

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

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

mps_fire.i
i
Definition: mps_fire.py:428
input
static const std::string input
Definition: EdmProvDump.cc:48
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
reco::PFRecHit::energy
float energy() const
rechit energy
Definition: PFRecHit.h:99
RecHitTopologicalCleanerBase::RecHitTopologicalCleanerBase
RecHitTopologicalCleanerBase(const edm::ParameterSet &conf, edm::ConsumesCollector &cc)
Definition: RecHitTopologicalCleanerBase.h:15
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
ECALPFSeedCleaner::ths_
edm::ESHandle< EcalPFSeedingThresholds > ths_
Definition: ECALPFSeedCleaner.cc:16
edm::Transition::BeginLuminosityBlock
ECALPFSeedCleaner::thsToken_
edm::ESGetToken< EcalPFSeedingThresholds, EcalPFSeedingThresholdsRcd > thsToken_
Definition: ECALPFSeedCleaner.cc:17
jetUpdater_cfi.sort
sort
Definition: jetUpdater_cfi.py:29
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:155
cc
reco::PFRecHit::detId
unsigned detId() const
rechit detId
Definition: PFRecHit.h:93
reco::PFRecHit
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
Definition: PFRecHit.h:31
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
remoteMonitoring_LED_IterMethod_cfg.threshold
threshold
Definition: remoteMonitoring_LED_IterMethod_cfg.py:430