16 const std::vector<bool>&,
17 const std::vector<bool>&,
23 const std::vector<bool>&,
32 #define LOGVERB(x) edm::LogVerbatim(x) 33 #define LOGWARN(x) edm::LogWarning(x) 34 #define LOGERR(x) edm::LogError(x) 35 #define LOGDRESSED(x) edm::LogInfo(x) 37 #define LOGVERB(x) LogTrace(x) 38 #define LOGWARN(x) edm::LogWarning(x) 39 #define LOGERR(x) edm::LogError(x) 40 #define LOGDRESSED(x) LogDebug(x) 44 const std::vector<bool>& rechitMask,
45 const std::vector<bool>& seedable,
48 std::vector<bool> used(
hits.size(),
false);
49 std::vector<unsigned int>
seeds;
53 for (
unsigned int i = 0;
i <
hits.size(); ++
i) {
54 if (!rechitMask[
i] || !seedable[
i] || used[
i])
60 seeds.begin(),
seeds.end(), [&](
unsigned int i,
unsigned int j) {
return hits[
i].energy() >
hits[
j].energy(); });
68 if (!
temp.recHitFractions().empty())
74 const std::vector<bool>& rechitMask,
76 std::vector<bool>& used,
78 auto const& cell = (*input)[kcell];
79 int cell_layer = (
int)cell.layer();
85 double thresholdE = 0.;
86 double thresholdPT2 = 0.;
88 for (
unsigned int j = 0; j < (std::get<1>(
thresholds)).size(); ++
j) {
99 if (cell.energy() < thresholdE || cell.pt2() < thresholdPT2) {
100 LOGDRESSED(
"GenericTopoCluster::buildTopoCluster()")
101 <<
"RecHit " << cell.detId() <<
" with enegy " << cell.energy() <<
" GeV was rejected!." << std::endl;
110 auto const& neighbours = (
_useCornerCells ? cell.neighbours8() : cell.neighbours4());
112 for (
auto nb : neighbours) {
113 if (used[nb] || !rechitMask[nb]) {
114 LOGDRESSED(
"GenericTopoCluster::buildTopoCluster()")
115 <<
" RecHit " << cell.detId() <<
"\'s" 116 <<
" neighbor RecHit " <<
input->at(nb).detId() <<
" with enegy " <<
input->at(nb).energy()
117 <<
" GeV was rejected!" 118 <<
" Reasons : " << used[nb] <<
" (used) " << !rechitMask[nb] <<
" (masked)." << std::endl;
reco::PFRecHitRef makeRefhit(const edm::Handle< reco::PFRecHitCollection > &h, const unsigned i) const
~Basic2DGenericTopoClusterizer() override=default
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
void buildClusters(const edm::Handle< reco::PFRecHitCollection > &, const std::vector< bool > &, const std::vector< bool > &, reco::PFClusterCollection &) override
void buildTopoCluster(const edm::Handle< reco::PFRecHitCollection > &, const std::vector< bool > &, unsigned int, std::vector< bool > &, reco::PFCluster &)
Fraction of a PFRecHit (rechits can be shared between several PFCluster's)
Basic2DGenericTopoClusterizer B2DGT
static std::string const input
const bool _useCornerCells
Abs< T >::type abs(const T &t)
Basic2DGenericTopoClusterizer(const edm::ParameterSet &conf, edm::ConsumesCollector &cc)
void addRecHitFraction(const reco::PFRecHitFraction &frac)
add a given fraction of the rechit
std::vector< PFCluster > PFClusterCollection
collection of PFCluster objects
#define DEFINE_EDM_PLUGIN(factory, type, name)
B2DGT & operator=(const B2DGT &)=delete
std::unordered_map< int, I3tuple > _thresholds