RecoParticleFlow
PFClusterProducer
plugins
FlagsCleanerECAL.cc
Go to the documentation of this file.
1
#include "
FlagsCleanerECAL.h
"
2
#include "
CommonTools/Utils/interface/StringToEnumValue.h
"
3
#include "
DataFormats/EcalRecHit/interface/EcalRecHit.h
"
4
5
FlagsCleanerECAL::FlagsCleanerECAL
(
const
edm::ParameterSet
& conf) :
RecHitTopologicalCleanerBase
(conf) {
6
const
std::vector<std::string> flagnames = conf.
getParameter
<std::vector<std::string> >(
"RecHitFlagsToBeExcluded"
);
7
v_chstatus_excl_
= StringToEnumValue<EcalRecHit::Flags>(flagnames);
8
}
9
10
void
FlagsCleanerECAL::clean
(
const
edm::Handle<reco::PFRecHitCollection>
&
input
, std::vector<bool>& mask) {
11
auto
const
&
hits
= *
input
;
12
13
for
(uint16_t
idx
= 0;
idx
<
hits
.size(); ++
idx
) {
14
if
(!mask[
idx
])
15
continue
;
// don't need to re-mask things :-)
16
const
reco::PFRecHit
& rechit =
hits
[
idx
];
17
if
(
checkFlags
(rechit))
18
mask[
idx
] =
false
;
19
}
20
}
21
22
// returns true if one of the flags in the exclusion list is up
23
bool
FlagsCleanerECAL::checkFlags
(
const
reco::PFRecHit
&
hit
) {
24
for
(
auto
flag
:
v_chstatus_excl_
) {
// check if one of the flags is up
25
if
(
hit
.flags() & (0x1 <<
flag
))
26
return
true
;
27
}
28
return
false
;
29
}
input
static const std::string input
Definition:
EdmProvDump.cc:48
hfClusterShapes_cfi.hits
hits
Definition:
hfClusterShapes_cfi.py:5
edm::Handle< reco::PFRecHitCollection >
heavyIonCSV_trainingSettings.idx
idx
Definition:
heavyIonCSV_trainingSettings.py:5
EcalRecHit.h
StringToEnumValue.h
FlagsCleanerECAL.h
edm::ParameterSet
Definition:
ParameterSet.h:47
FlagsCleanerECAL::FlagsCleanerECAL
FlagsCleanerECAL(const edm::ParameterSet &conf)
Definition:
FlagsCleanerECAL.cc:5
FlagsCleanerECAL::v_chstatus_excl_
std::vector< int > v_chstatus_excl_
Definition:
FlagsCleanerECAL.h:16
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition:
ParameterSet.h:303
FlagsCleanerECAL::clean
void clean(const edm::Handle< reco::PFRecHitCollection > &input, std::vector< bool > &mask) override
Definition:
FlagsCleanerECAL.cc:10
reco::PFRecHit
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
Definition:
PFRecHit.h:31
RecHitTopologicalCleanerBase
Definition:
RecHitTopologicalCleanerBase.h:12
hit
Definition:
SiStripHitEffFromCalibTree.cc:88
FlagsCleanerECAL::checkFlags
bool checkFlags(const reco::PFRecHit &hit)
Definition:
FlagsCleanerECAL.cc:23
RemoveAddSevLevel.flag
flag
Definition:
RemoveAddSevLevel.py:116
Generated for CMSSW Reference Manual by
1.8.16