5 #define LOGVERB(x) edm::LogVerbatim(x) 6 #define LOGWARN(x) edm::LogWarning(x) 7 #define LOGERR(x) edm::LogError(x) 8 #define LOGDRESSED(x) edm::LogInfo(x) 10 #define LOGVERB(x) LogTrace(x) 11 #define LOGWARN(x) edm::LogWarning(x) 12 #define LOGERR(x) edm::LogError(x) 13 #define LOGDRESSED(x) LogDebug(x) 17 const std::vector<bool>& rechitMask,
18 const std::vector<bool>& seedable,
21 std::vector<bool> used(
hits.size(),
false);
22 std::vector<unsigned int> seeds;
25 seeds.reserve(
hits.size());
26 for (
unsigned int i = 0;
i <
hits.size(); ++
i) {
27 if (!rechitMask[
i] || !seedable[
i] || used[
i])
29 seeds.emplace_back(i);
33 seeds.begin(), seeds.end(), [&](
unsigned int i,
unsigned int j) {
return hits[
i].energy() >
hits[
j].energy(); });
36 for (
auto seed : seeds) {
41 if (!temp.recHitFractions().empty())
42 output.push_back(temp);
47 const std::vector<bool>& rechitMask,
49 std::vector<bool>& used,
51 auto const& cell = (*input)[kcell];
52 int cell_layer = (
int)cell.layer();
58 double thresholdE = 0.;
59 double thresholdPT2 = 0.;
61 for (
unsigned int j = 0; j < (std::get<1>(
thresholds)).size(); ++
j) {
72 if (cell.energy() < thresholdE || cell.pt2() < thresholdPT2) {
73 LOGDRESSED(
"GenericTopoCluster::buildTopoCluster()")
74 <<
"RecHit " << cell.detId() <<
" with enegy " << cell.energy() <<
" GeV was rejected!." << std::endl;
83 auto const& neighbours = (
_useCornerCells ? cell.neighbours8() : cell.neighbours4());
85 for (
auto nb : neighbours) {
86 if (used[nb] || !rechitMask[nb]) {
87 LOGDRESSED(
"GenericTopoCluster::buildTopoCluster()")
88 <<
" RecHit " << cell.detId() <<
"\'s" 89 <<
" neighbor RecHit " << input->at(nb).detId() <<
" with enegy " << input->at(nb).energy()
90 <<
" GeV was rejected!" 91 <<
" Reasons : " << used[nb] <<
" (used) " << !rechitMask[nb] <<
" (masked)." << std::endl;
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)
static std::string const input
reco::PFRecHitRef makeRefhit(const edm::Handle< reco::PFRecHitCollection > &h, const unsigned i) const
const bool _useCornerCells
Abs< T >::type abs(const T &t)
void addRecHitFraction(const reco::PFRecHitFraction &frac)
add a given fraction of the rechit
std::vector< PFCluster > PFClusterCollection
collection of PFCluster objects
std::unordered_map< int, I3tuple > _thresholds