CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
PeakFinderTest Struct Reference

#include <SlidingPeakFinder.h>

Public Member Functions

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)
 

Private Attributes

uint8_t cut_
 
unsigned int detid_
 
int firstStrip_
 
float mip_
 
const SiStripNoisesnoiseObj_
 
SiStripNoises::Range noises_
 
float subclusterCutMIPs_
 
float subclusterCutSN2_
 
float sumCut_
 

Detailed Description

Definition at line 55 of file SlidingPeakFinder.h.

Constructor & Destructor Documentation

◆ PeakFinderTest()

PeakFinderTest::PeakFinderTest ( float  mip,
uint32_t  detid,
uint32_t  firstStrip,
const SiStripNoises theNoise,
float  seedCutMIPs,
float  seedCutSN,
float  subclusterCutMIPs,
float  subclusterCutSN 
)
inline

Definition at line 56 of file SlidingPeakFinder.h.

References cut_, SiStripNoises::getNoise(), noiseObj_, noises_, HLT_2023v12_cff::seedCutMIPs, and HLT_2023v12_cff::seedCutSN.

64  : mip_(mip),
65  detid_(detid),
66  firstStrip_(firstStrip),
67  noiseObj_(theNoise),
68  noises_(theNoise->getRange(detid)),
72  cut_ = std::min<float>(seedCutMIPs * mip, seedCutSN * noiseObj_->getNoise(firstStrip + 1, noises_));
73  }
unsigned int detid_
static float getNoise(uint16_t strip, const Range &range)
Definition: SiStripNoises.h:72
const SiStripNoises * noiseObj_
SiStripNoises::Range noises_
const Range getRange(const uint32_t detID) const

Member Function Documentation

◆ operator()() [1/2]

bool PeakFinderTest::operator() ( uint8_t  max,
uint8_t  min 
) const
inline

◆ operator()() [2/2]

bool PeakFinderTest::operator() ( const uint8_t *  left,
const uint8_t *  right,
const uint8_t *  begin,
const uint8_t *  end 
) const
inline

Definition at line 76 of file SlidingPeakFinder.h.

References mps_fire::end, firstStrip_, SiStripNoises::getNoise(), createfilelist::int, SiStripPI::max, hgchebackDigitizer_cfi::noise, noiseObj_, noises_, funct::pow(), subclusterCutSN2_, sumCut_, and x.

76  {
77  int yleft = (left < begin ? 0 : *left);
78  int yright = (right >= end ? 0 : *right);
79  float sum = 0.0;
80  int maxval = 0;
81  float noise = 0;
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;
85  noise += std::pow(noiseObj_->getNoise(firstStrip_ + int(x - begin), noises_), 2);
86  maxval = std::max(maxval, int(*x) - baseline);
87  }
88  if (sum > sumCut_ && sum * sum > noise * subclusterCutSN2_)
89  return true;
90  return false;
91  }
static float getNoise(uint16_t strip, const Range &range)
Definition: SiStripNoises.h:72
const SiStripNoises * noiseObj_
SiStripNoises::Range noises_
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29

Member Data Documentation

◆ cut_

uint8_t PeakFinderTest::cut_
private

Definition at line 99 of file SlidingPeakFinder.h.

Referenced by operator()(), and PeakFinderTest().

◆ detid_

unsigned int PeakFinderTest::detid_
private

Definition at line 95 of file SlidingPeakFinder.h.

◆ firstStrip_

int PeakFinderTest::firstStrip_
private

Definition at line 96 of file SlidingPeakFinder.h.

Referenced by operator()().

◆ mip_

float PeakFinderTest::mip_
private

Definition at line 94 of file SlidingPeakFinder.h.

◆ noiseObj_

const SiStripNoises* PeakFinderTest::noiseObj_
private

Definition at line 97 of file SlidingPeakFinder.h.

Referenced by operator()(), and PeakFinderTest().

◆ noises_

SiStripNoises::Range PeakFinderTest::noises_
private

Definition at line 98 of file SlidingPeakFinder.h.

Referenced by operator()(), and PeakFinderTest().

◆ subclusterCutMIPs_

float PeakFinderTest::subclusterCutMIPs_
private

Definition at line 100 of file SlidingPeakFinder.h.

◆ subclusterCutSN2_

float PeakFinderTest::subclusterCutSN2_
private

Definition at line 100 of file SlidingPeakFinder.h.

Referenced by operator()().

◆ sumCut_

float PeakFinderTest::sumCut_
private

Definition at line 100 of file SlidingPeakFinder.h.

Referenced by operator()().