1 #ifndef RecoTracker_PixelLowPtUtilities_SlidingPeakFinder_h 2 #define RecoTracker_PixelLowPtUtilities_SlidingPeakFinder_h 15 template <
typename Test>
22 const uint8_t *ileft = (
x != begin) ? std::min_element(
x - 1,
x +
half_) : begin - 1;
24 uint8_t left = (ileft < begin ? 0 : *ileft);
25 uint8_t right = (iright >=
end ? 0 : *iright);
27 uint8_t maxmin =
std::max(left, right);
28 if (maxmin < center) {
29 bool ret =
test(center, maxmin);
39 template <
typename V,
typename Test>
41 const uint8_t *begin = &*ampls.begin();
42 const uint8_t *
end = &*ampls.end();
43 for (
const uint8_t *
x = begin;
x <
end - (
half_ - 1); ++
x) {
68 noises_(theNoise->getRange(detid)),
76 bool operator()(
const uint8_t *left,
const uint8_t *right,
const uint8_t *begin,
const uint8_t *
end)
const {
77 int yleft = (left < begin ? 0 : *left);
78 int yright = (right >=
end ? 0 : *right);
82 for (
const uint8_t *
x = left + 1;
x < right; ++
x) {
83 int baseline = (yleft *
int(right -
x) + yright *
int(
x - left)) /
int(right - left);
84 sum +=
int(*
x) - baseline;
86 maxval =
std::max(maxval,
int(*
x) - baseline);
ret
prodAgent to be discontinued
bool apply(const uint8_t *x, const uint8_t *begin, const uint8_t *end, const Test &test, bool verbose=false, int firststrip=0)
static float getNoise(uint16_t strip, const Range &range)
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t V
bool operator()(uint8_t max, uint8_t min) const
bool operator()(const uint8_t *left, const uint8_t *right, const uint8_t *begin, const uint8_t *end) const
PeakFinderTest(float mip, uint32_t detid, uint32_t firstStrip, const SiStripNoises *theNoise, float seedCutMIPs, float seedCutSN, float subclusterCutMIPs, float subclusterCutSN)
SlidingPeakFinder(unsigned int size)
const SiStripNoises * noiseObj_
SiStripNoises::Range noises_
bool apply(const V &ls, const Test &test, bool verbose=false, int firststrip=0)
std::pair< ContainerIterator, ContainerIterator > Range