105 auto cmp = [&](
int i,
int j) {
return energies[
i] < energies[
j]; };
106 std::priority_queue<int, DynArray<int>, decltype(
cmp)> ordered_hits(
cmp,
std::move(qst));
108 for (
unsigned i = 0;
i <
nhits; ++
i) {
111 auto const& maybeseed = (*input)[
i];
112 energies[
i] = maybeseed.energy();
113 int seedlayer = (
int)maybeseed.layer();
119 double thresholdE = 0.;
120 double thresholdPT2 = 0.;
122 for (
unsigned int j = 0; j < (std::get<2>(
thresholds)).size(); ++
j) {
132 if (hcalCuts !=
nullptr) {
136 thresholdE =
item->seedThreshold();
140 if (maybeseed.energy() < thresholdE || maybeseed.pt2() < thresholdPT2)
144 ordered_hits.push(
i);
147 while (!ordered_hits.empty()) {
148 auto idx = ordered_hits.top();
153 auto const& maybeseed = (*input)[
idx];
157 myNeighbours = maybeseed.neighbours();
160 myNeighbours = _noNeighbours;
163 myNeighbours = maybeseed.neighbours4();
166 myNeighbours = maybeseed.neighbours8();
169 throw cms::Exception(
"InvalidConfiguration") <<
"LocalMaximumSeedFinder only accepts nNeighbors = {-1,0,4,8}";
171 seedable[
idx] =
true;
172 for (
auto neighbour : myNeighbours) {
173 if (!
mask[neighbour])
175 if (energies[neighbour] > energies[
idx]) {
177 seedable[
idx] =
false;
182 for (
auto neighbour : myNeighbours) {
187 int seedlayer = (
int)maybeseed.layer();
195 auto const& nei = (*input)[neighbour];
196 if (maybeseed.depth() != nei.depth())
199 std::abs(maybeseed.positionREP().eta() - nei.positionREP().eta()) >
detacut)
204 usable[neighbour] =
false;
210 LogDebug(
"LocalMaximumSeedFinder") <<
" found " <<
std::count(seedable.begin(), seedable.end(),
true) <<
" seeds";
#define initDynArray(T, n, x, i)
const Item * getValues(DetId fId, bool throwOnFail=true) const
static std::string const input
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
constexpr uint32_t rawId() const
get the raw id
#define declareDynArray(T, n, x)