97 auto nhits = input->size();
102 auto cmp = [&](
int i,
int j) {
return energies[
i] < energies[
j]; };
103 std::priority_queue<int, DynArray<int>, decltype(cmp)> ordered_hits(cmp,
std::move(qst));
105 for (
unsigned i = 0; i <
nhits; ++
i) {
108 auto const& maybeseed = (*input)[
i];
109 energies[
i] = maybeseed.energy();
110 int seedlayer = (int)maybeseed.layer();
116 double thresholdE = 0.;
117 double thresholdPT2 = 0.;
119 for (
unsigned int j = 0; j < (std::get<2>(
thresholds)).size(); ++
j) {
129 if (maybeseed.energy() < thresholdE || maybeseed.pt2() < thresholdPT2)
133 ordered_hits.push(i);
136 while (!ordered_hits.empty()) {
137 auto idx = ordered_hits.top();
142 auto const& maybeseed = (*input)[idx];
146 myNeighbours = maybeseed.neighbours();
149 myNeighbours = _noNeighbours;
152 myNeighbours = maybeseed.neighbours4();
155 myNeighbours = maybeseed.neighbours8();
158 throw cms::Exception(
"InvalidConfiguration") <<
"LocalMaximumSeedFinder only accepts nNeighbors = {-1,0,4,8}";
160 seedable[idx] =
true;
161 for (
auto neighbour : myNeighbours) {
162 if (!mask[neighbour])
164 if (energies[neighbour] > energies[idx]) {
166 seedable[idx] =
false;
171 for (
auto neighbour : myNeighbours) {
176 int seedlayer = (int)maybeseed.layer();
184 auto const& nei = (*input)[neighbour];
185 if (maybeseed.depth() != nei.depth())
188 std::abs(maybeseed.positionREP().eta() - nei.positionREP().eta()) >
detacut)
193 usable[neighbour] =
false;
199 LogDebug(
"LocalMaximumSeedFinder") <<
" found " <<
std::count(seedable.begin(), seedable.end(),
true) <<
" seeds";
#define initDynArray(T, n, x, i)
std::array< I3tuple, 35 > _thresholds
#define unInitDynArray(T, n, x)
Abs< T >::type abs(const T &t)
static constexpr int layerOffset
static constexpr double detacut
static constexpr double dphicut
#define declareDynArray(T, n, x)