18 const std::vector<bool>&,
19 const std::vector<bool>&,
26 const std::vector<bool>&,
36 #define LOGVERB(x) edm::LogVerbatim(x) 37 #define LOGWARN(x) edm::LogWarning(x) 38 #define LOGERR(x) edm::LogError(x) 39 #define LOGDRESSED(x) edm::LogInfo(x) 41 #define LOGVERB(x) LogTrace(x) 42 #define LOGWARN(x) edm::LogWarning(x) 43 #define LOGERR(x) edm::LogError(x) 44 #define LOGDRESSED(x) LogDebug(x) 48 const std::vector<bool>& rechitMask,
49 const std::vector<bool>& seedable,
53 std::vector<bool> used(
hits.size(),
false);
54 std::vector<unsigned int>
seeds;
58 for (
unsigned int i = 0;
i <
hits.size(); ++
i) {
59 if (!rechitMask[
i] || !seedable[
i] || used[
i])
65 seeds.begin(),
seeds.end(), [&](
unsigned int i,
unsigned int j) {
return hits[
i].energy() >
hits[
j].energy(); });
73 if (!
temp.recHitFractions().empty())
79 const std::vector<bool>& rechitMask,
81 std::vector<bool>& used,
84 auto const& cell = (*input)[kcell];
85 int cell_layer = (
int)cell.layer();
91 double thresholdE = 0.;
92 double thresholdPT2 = 0.;
94 for (
unsigned int j = 0; j < (std::get<1>(
thresholds)).size(); ++
j) {
105 if (hcalCuts !=
nullptr) {
109 thresholdE =
item->noiseThreshold();
113 if (cell.energy() < thresholdE || cell.pt2() < thresholdPT2) {
114 LOGDRESSED(
"GenericTopoCluster::buildTopoCluster()")
115 <<
"RecHit " << cell.detId() <<
" with enegy " << cell.energy() <<
" GeV was rejected!." << std::endl;
124 auto const& neighbours = (
_useCornerCells ? cell.neighbours8() : cell.neighbours4());
126 for (
auto nb : neighbours) {
127 if (used[nb] || !rechitMask[nb]) {
128 LOGDRESSED(
"GenericTopoCluster::buildTopoCluster()")
129 <<
" RecHit " << cell.detId() <<
"\'s" 130 <<
" neighbor RecHit " <<
input->at(nb).detId() <<
" with enegy " <<
input->at(nb).energy()
131 <<
" GeV was rejected!" 132 <<
" 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.
uint32_t cc[maxCellsPerHit]
Fraction of a PFRecHit (rechits can be shared between several PFCluster's)
Basic2DGenericTopoClusterizer B2DGT
void buildTopoCluster(const edm::Handle< reco::PFRecHitCollection > &, const std::vector< bool > &, unsigned int, std::vector< bool > &, reco::PFCluster &, const HcalPFCuts *)
const Item * getValues(DetId fId, bool throwOnFail=true) const
static std::string const input
const bool _useCornerCells
Abs< T >::type abs(const T &t)
Basic2DGenericTopoClusterizer(const edm::ParameterSet &conf, edm::ConsumesCollector &cc)
void buildClusters(const edm::Handle< reco::PFRecHitCollection > &, const std::vector< bool > &, const std::vector< bool > &, reco::PFClusterCollection &, const HcalPFCuts *) override
constexpr uint32_t rawId() const
get the raw id
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