CMS 3D CMS Logo

ECALPFSeedCleaner.cc
Go to the documentation of this file.
1 #include "ECALPFSeedCleaner.h"
2 
4 
6 
8  //need to run over energy sorted rechits, as this is order used in seeding step
9  // this can cause ambiguity, isn't it better to index by detid ?
10  auto const& hits = *input;
11  std::vector<unsigned> ordered_hits(hits.size());
12  for (unsigned i = 0; i < hits.size(); ++i)
13  ordered_hits[i] = i;
14 
15  std::sort(ordered_hits.begin(), ordered_hits.end(), [&](unsigned i, unsigned j) {
16  return hits[i].energy() > hits[j].energy();
17  });
18 
19  for (const auto& idx : ordered_hits) {
20  if (!mask[idx])
21  continue; // is it useful ?
22  const reco::PFRecHit& rechit = hits[idx];
23 
24  float threshold = (*ths_)[rechit.detId()];
25  if (rechit.energy() < threshold)
26  mask[idx] = false;
27 
28  } // rechit loop
29 }
mps_fire.i
i
Definition: mps_fire.py:355
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
ECALPFSeedCleaner::update
void update(const edm::EventSetup &) override
Definition: ECALPFSeedCleaner.cc:5
ECALPFSeedCleaner.h
edm::Handle
Definition: AssociativeIterator.h:50
training_settings.idx
idx
Definition: training_settings.py:16
EcalPFSeedingThresholdsRcd
Definition: EcalPFSeedingThresholdsRcd.h:5
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
ECALPFSeedCleaner::ths_
edm::ESHandle< EcalPFSeedingThresholds > ths_
Definition: ECALPFSeedCleaner.h:19
edm::ParameterSet
Definition: ParameterSet.h:36
ECALPFSeedCleaner::clean
void clean(const edm::Handle< reco::PFRecHitCollection > &input, std::vector< bool > &mask) override
Definition: ECALPFSeedCleaner.cc:7
edm::EventSetup
Definition: EventSetup.h:57
get
#define get
reco::PFRecHit::detId
unsigned detId() const
rechit detId
Definition: PFRecHit.h:93
ECALPFSeedCleaner::ECALPFSeedCleaner
ECALPFSeedCleaner(const edm::ParameterSet &conf)
Definition: ECALPFSeedCleaner.cc:3
reco::PFRecHit
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
Definition: PFRecHit.h:31
RecHitTopologicalCleanerBase
Definition: RecHitTopologicalCleanerBase.h:12
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
remoteMonitoring_LED_IterMethod_cfg.threshold
threshold
Definition: remoteMonitoring_LED_IterMethod_cfg.py:426