Main Page
Namespaces
Classes
Package Documentation
RecoParticleFlow
PFClusterProducer
plugins
ECALPFSeedCleaner.cc
Go to the documentation of this file.
1
#include "
ECALPFSeedCleaner.h
"
2
3
ECALPFSeedCleaner::ECALPFSeedCleaner
(
const
edm::ParameterSet
& conf) :
RecHitTopologicalCleanerBase
(conf) {}
4
5
void
ECALPFSeedCleaner::update
(
const
edm::EventSetup
& iSetup) { iSetup.
get
<
EcalPFSeedingThresholdsRcd
>().
get
(
ths_
); }
6
7
void
ECALPFSeedCleaner::clean
(
const
edm::Handle<reco::PFRecHitCollection>
&
input
, std::vector<bool>&
mask
) {
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
}
ECALPFSeedCleaner.h
mps_fire.i
i
Definition:
mps_fire.py:338
reco::PFRecHit::detId
unsigned detId() const
rechit detId
Definition:
PFRecHit.h:93
ECALPFSeedCleaner::update
void update(const edm::EventSetup &) override
Definition:
ECALPFSeedCleaner.cc:5
hfClusterShapes_cfi.hits
hits
Definition:
hfClusterShapes_cfi.py:5
edm::Handle
Definition:
AssociativeIterator.h:47
input
static std::string const input
Definition:
EdmProvDump.cc:48
electronIdCutBased_cfi.threshold
threshold
Definition:
electronIdCutBased_cfi.py:6
reco::PFRecHit
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
Definition:
PFRecHit.h:31
EcalPFSeedingThresholdsRcd
Definition:
EcalPFSeedingThresholdsRcd.h:5
ECALPFSeedCleaner::clean
void clean(const edm::Handle< reco::PFRecHitCollection > &input, std::vector< bool > &mask) override
Definition:
ECALPFSeedCleaner.cc:7
RecoTauDiscriminantConfiguration.mask
mask
Definition:
RecoTauDiscriminantConfiguration.py:73
edm::EventSetup
Definition:
EventSetup.h:57
ECALPFSeedCleaner::ths_
edm::ESHandle< EcalPFSeedingThresholds > ths_
Definition:
ECALPFSeedCleaner.h:19
reco::PFRecHit::energy
float energy() const
rechit energy
Definition:
PFRecHit.h:99
RecHitTopologicalCleanerBase
Definition:
RecHitTopologicalCleanerBase.h:12
ECALPFSeedCleaner::ECALPFSeedCleaner
ECALPFSeedCleaner(const edm::ParameterSet &conf)
Definition:
ECALPFSeedCleaner.cc:3
training_settings.idx
idx
Definition:
training_settings.py:16
edm::EventSetup::get
T get() const
Definition:
EventSetup.h:71
edm::ParameterSet
Definition:
ParameterSet.h:36
Generated for CMSSW Reference Manual by
1.8.11