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 }
unsigned detId() const
rechit detId
Definition: PFRecHit.h:93
void update(const edm::EventSetup &) override
static std::string const input
Definition: EdmProvDump.cc:48
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
Definition: PFRecHit.h:31
void clean(const edm::Handle< reco::PFRecHitCollection > &input, std::vector< bool > &mask) override
edm::ESHandle< EcalPFSeedingThresholds > ths_
float energy() const
rechit energy
Definition: PFRecHit.h:99
ECALPFSeedCleaner(const edm::ParameterSet &conf)
T get() const
Definition: EventSetup.h:71