24 return std::make_pair(accumulate(
begin, max, uint16_t(0)), accumulate(max + 1,
end, uint16_t(0)));
28 float q(0), x1(0), x2(0);
32 x1 += (*it) * (i + 0.5);
33 x2 += (*it) * (i * i + i + 1. / 3);
35 return (x2 - x1 * x1 /
q) /
q;
43 results.reserve(
width());
54 std::vector<float> noises;
55 noises.reserve(
width());
56 for (
size_t i = 0;
i <
width();
i++) {
65 std::vector<float> gains;
66 gains.reserve(
width());
67 for (
size_t i = 0;
i <
width();
i++) {
74 std::vector<bool> isBad;
75 isBad.reserve(
width());
83 float noiseSumInQuadrature = 0;
84 int numberStripsOverThreshold = 0;
87 noiseSumInQuadrature += noise.at(
i) * noise.at(
i);
88 numberStripsOverThreshold++;
91 return std::sqrt(noiseSumInQuadrature / numberStripsOverThreshold);
97 accumulate(stripBad.begin(), stripBad.end(),
false, std::logical_or<bool>());
bool IsFiberBad(const uint32_t &detid, const short &fiberNb) const
bool IsApvBad(const uint32_t &detid, const short &apvNb) const
uint16_t firstStrip() const
void setCluster(const SiStripCluster &cluster, int detId)
std::vector< float > stripGains() const
bool IsAnythingBad() const
std::pair< uint16_t, uint16_t > chargeLR() const
edm::ESGetToken< SiStripQuality, SiStripQualityRcd > siStripQualityToken_
bool IsStripBad(const uint32_t &detid, const short &strip) const
std::vector< bool > stripQualitiesBad() const
float calculate_noise(const std::vector< float > &) const
auto stripCharges() const -> decltype(cluster() ->amplitudes())
const SiStripCluster * cluster() const
bool getData(T &iHolder) const
static float getNoise(uint16_t strip, const Range &range)
bool IsModuleUsable(const uint32_t &detid) const
static float getStripGain(const uint16_t &strip, const SiStripApvGain::Range &range)
std::pair< ContainerIterator, ContainerIterator > Range
SiStripClusterInfo(edm::ConsumesCollector &&, const std::string &qualityLabel="")
bool IsModuleBad(const uint32_t &detid) const
const SiStripNoises * siStripNoises_
edm::ESGetToken< SiStripNoises, SiStripNoisesRcd > siStripNoisesToken_
const SiStripCluster * cluster_ptr
const SiStripGain * siStripGain_
const SiStripQuality * siStripQuality_
bool IsModuleUsable() const
edm::ESGetToken< SiStripGain, SiStripGainRcd > siStripGainToken_
std::vector< float > stripNoises() const
const Range getRange(const uint32_t detID) const
std::pair< ContainerIterator, ContainerIterator > Range
void initEvent(const edm::EventSetup &iSetup)
std::vector< float > stripNoisesRescaledByGain() const
const SiStripApvGain::Range getRange(uint32_t detID) const