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)
18 const std::vector<bool>& rechitMask,
19 const std::vector<bool>& seedable,
21 auto const & hits = *
input;
22 std::vector<bool> used(hits.size(),
false);
23 std::vector<unsigned int> seeds;
26 seeds.reserve(hits.size());
27 for(
unsigned int i = 0;
i < hits.size(); ++
i ) {
28 if( !rechitMask[
i] || !seedable[
i] || used[
i] )
continue;
29 seeds.emplace_back(i);
32 std::sort(seeds.begin(),seeds.end(),
33 [&](
unsigned int i,
unsigned int j) {
return hits[
i].energy()>hits[
j].energy();});
36 for(
auto seed : seeds ) {
37 if( !rechitMask[
seed] || !seedable[
seed] || used[
seed] )
continue;
40 if( temp.recHitFractions().size() ) output.push_back(temp);
46 const std::vector<bool>& rechitMask,
48 std::vector<bool>& used,
50 auto const & cell = (*input)[kcell];
51 int cell_layer = (int)cell.layer();
53 std::abs(cell.positionREP().eta()) > 0.34 ) {
56 const std::pair<double,double>& thresholds =
58 if( cell.energy() < thresholds.first ||
59 cell.pt2() < thresholds.second ) {
60 LOGDRESSED(
"GenericTopoCluster::buildTopoCluster()")
61 <<
"RecHit " << cell.detId() <<
" with enegy "
62 << cell.energy() <<
" GeV was rejected!." << std::endl;
70 auto const & neighbours =
73 for(
auto nb : neighbours ) {
74 if( used[nb] || !rechitMask[nb] ) {
75 LOGDRESSED(
"GenericTopoCluster::buildTopoCluster()")
76 <<
" RecHit " << cell.detId() <<
"\'s"
77 <<
" neighbor RecHit " << input->at(nb).detId()
79 << input->at(nb).energy() <<
" GeV was rejected!"
80 <<
" Reasons : " << used[nb] <<
" (used) "
81 << !rechitMask[nb] <<
" (masked)." << std::endl;
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
void buildTopoCluster(const edm::Handle< reco::PFRecHitCollection > &, const std::vector< bool > &, unsigned int, std::vector< bool > &, reco::PFCluster &)
void buildClusters(const edm::Handle< reco::PFRecHitCollection > &, const std::vector< bool > &, const std::vector< bool > &, reco::PFClusterCollection &)
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, std::pair< double, double > > _thresholds