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 bool greaterByEnergy(
const std::pair<unsigned,double>&
a,
18 const std::pair<unsigned,double>&
b) {
19 return a.second > b.second;
25 const std::vector<bool>& rechitMask,
26 const std::vector<bool>& seedable,
28 std::vector<bool> used(input->size(),
false);
29 std::vector<std::pair<unsigned,double> > seeds;
32 seeds.reserve(input->size());
33 for(
unsigned i = 0;
i < input->size(); ++
i ) {
34 if( !rechitMask[
i] || !seedable[
i] || used[
i] )
continue;
35 std::pair<unsigned,double> val = std::make_pair(i,input->at(i).energy());
36 auto pos = std::upper_bound(seeds.begin(),seeds.end(),val,greaterByEnergy);
37 seeds.insert(pos,val);
41 for(
const auto& idx_e : seeds ) {
42 const int seed = idx_e.first;
43 if( !rechitMask[seed] || !seedable[seed] || used[seed] )
continue;
52 const std::vector<bool>& rechitMask,
54 std::vector<bool>& used,
56 int cell_layer = (int)cell->layer();
58 std::abs(cell->positionREP().eta()) > 0.34 ) {
61 const std::pair<double,double>& thresholds =
63 if( cell->energy() < thresholds.first ||
64 cell->pt2() < thresholds.second ) {
65 LOGDRESSED(
"GenericTopoCluster::buildTopoCluster()")
66 <<
"RecHit " << cell->detId() <<
" with enegy "
67 << cell->energy() <<
" GeV was rejected!." << std::endl;
71 used[cell.
key()] =
true;
78 if( used[nb.key()] || !rechitMask[nb.key()] ) {
79 LOGDRESSED(
"GenericTopoCluster::buildTopoCluster()")
80 <<
" RecHit " << cell->detId() <<
"\'s"
81 <<
" neighbor RecHit " << input->at(nb.key()).detId()
83 << input->at(nb.key()).
energy() <<
" GeV was rejected!"
84 <<
" Reasons : " << used[nb.key()] <<
" (used) "
85 << !rechitMask[nb.key()] <<
" (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 &)
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 buildTopoCluster(const edm::Handle< reco::PFRecHitCollection > &, const std::vector< bool > &, const reco::PFRecHitRef &, std::vector< bool > &, reco::PFCluster &)
void reset()
resets clusters parameters
key_type key() const
Accessor for product key.
void addRecHitFraction(const reco::PFRecHitFraction &frac)
add a given fraction of the rechit
std::vector< PFCluster > PFClusterCollection
collection of PFCluster objects
const std::vector< reco::PFRecHitFraction > & recHitFractions() const
vector of rechit fractions
std::unordered_map< int, std::pair< double, double > > _thresholds