CMS 3D CMS Logo

ECALPFSeedCleaner.cc
Go to the documentation of this file.
4 
6 public:
8  ECALPFSeedCleaner(const ECALPFSeedCleaner&) = delete;
10 
11  void update(const edm::EventSetup&) override;
12 
13  void clean(const edm::Handle<reco::PFRecHitCollection>& input, std::vector<bool>& mask) override;
14 
15 private:
18 };
19 
21 
23  : RecHitTopologicalCleanerBase(conf, cc), thsToken_(cc.esConsumes<edm::Transition::BeginLuminosityBlock>()) {}
24 
26 
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 }
ECALPFSeedCleaner::ECALPFSeedCleaner
ECALPFSeedCleaner(const edm::ParameterSet &conf, edm::ConsumesCollector &cc)
Definition: ECALPFSeedCleaner.cc:22
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
ECALPFSeedCleaner::update
void update(const edm::EventSetup &) override
Definition: ECALPFSeedCleaner.cc:25
edm
HLT enums.
Definition: AlignableModifier.h:19
EcalPFSeedingThresholdsRcd.h
edm::Handle< reco::PFRecHitCollection >
ECALPFSeedCleaner
Definition: ECALPFSeedCleaner.cc:5
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
EcalPFSeedingThresholds.h
ECALPFSeedCleaner::ths_
edm::ESHandle< EcalPFSeedingThresholds > ths_
Definition: ECALPFSeedCleaner.cc:16
edm::ESHandle
Definition: DTSurvey.h:22
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition: PluginFactory.h:124
RecHitTopologicalCleanerBase.h
ECALPFSeedCleaner::thsToken_
edm::ESGetToken< EcalPFSeedingThresholds, EcalPFSeedingThresholdsRcd > thsToken_
Definition: ECALPFSeedCleaner.cc:17
edm::ParameterSet
Definition: ParameterSet.h:47
edm::Transition
Transition
Definition: Transition.h:12
ECALPFSeedCleaner::clean
void clean(const edm::Handle< reco::PFRecHitCollection > &input, std::vector< bool > &mask) override
Definition: ECALPFSeedCleaner.cc:27
jetUpdater_cfi.sort
sort
Definition: jetUpdater_cfi.py:29
edmplugin::PluginFactory
Definition: PluginFactory.h:34
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:155
edm::EventSetup
Definition: EventSetup.h:58
cc
edm::ESGetToken
Definition: EventSetup.h:48
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
RecHitTopologicalCleanerBase
Definition: RecHitTopologicalCleanerBase.h:13
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
remoteMonitoring_LED_IterMethod_cfg.threshold
threshold
Definition: remoteMonitoring_LED_IterMethod_cfg.py:430
DeDxTools::esConsumes
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
ECALPFSeedCleaner::operator=
ECALPFSeedCleaner & operator=(const ECALPFSeedCleaner &)=delete
edm::ConsumesCollector
Definition: ConsumesCollector.h:45