11 Registry::iterator
p =
13 if (p !=
indexes.end() && p->detid == DetId) {
14 edm::LogError(
"SiStripThreshold") <<
"[" << __PRETTY_FUNCTION__ <<
"] SiStripThreshold for DetID " << DetId
15 <<
" is already stored. Skippig this put" << std::endl;
19 SiStripThreshold::Container::iterator new_end =
compact(vect);
21 size_t sd = new_end - vect.begin();
23 detregistry.
detid = DetId;
34 std::stable_sort(input.begin(), input.end());
42 if (p ==
indexes.end() || p->detid != DetId)
53 DetIds_.push_back(
p->detid);
64 const uint16_t&
strip,
const float& lTh,
const float& hTh,
const float& cTh,
Container& vthr) {
66 a.
encode(strip, lTh, hTh, cTh);
74 if (p != range.first) {
77 throw cms::Exception(
"CorruptedData") <<
"[SiStripThreshold::getData] asking for data for a strip " << strip
78 <<
" lower then the first stored strip " << p->getFirstStrip();
83 std::vector<float>& highThs,
86 size_t strips = lowThs.size();
87 assert(strips == highThs.size());
88 while (it != range.second) {
89 size_t firstStrip = it->getFirstStrip();
91 float high = it->getHth(), low = it->getLth();
94 size_t lastStrip = (it == range.second ? strips : it->getFirstStrip());
96 if (lastStrip > strips) {
100 std::fill(&lowThs[firstStrip], &lowThs[lastStrip], low);
101 std::fill(&highThs[firstStrip], &highThs[lastStrip], high);
108 for (; rit != erit; ++rit) {
111 ss <<
"\ndetid: " << rit->detid <<
" \t ";
112 for (; it != eit; ++it) {
122 float meanLth, meanHth, meanCth;
123 float rmsLth, rmsHth, rmsCth;
124 float maxLth, maxHth, maxCth;
125 float minLth, minHth, minCth;
127 uint16_t firstStrip, stripRange;
128 for (; rit != erit; ++rit) {
131 ss <<
"\ndetid: " << rit->detid <<
" \t ";
147 for (; it != eit; ++it) {
149 firstStrip = it->getFirstStrip();
151 stripRange = (itp->getFirstStrip() - firstStrip);
159 addToStat(it->getLth(), stripRange, meanLth, rmsLth, minLth, maxLth);
160 addToStat(it->getHth(), stripRange, meanHth, rmsHth, minHth, maxHth);
161 addToStat(it->getClusth(), stripRange, meanCth, rmsCth, minCth, maxCth);
167 rmsLth =
sqrt(rmsLth / n - meanLth * meanLth);
168 rmsHth =
sqrt(rmsHth / n - meanHth * meanHth);
169 rmsCth =
sqrt(rmsCth / n - meanCth * meanCth);
170 ss <<
"\nn " << n <<
" \tmeanLth " << meanLth <<
" \t rmsLth " << rmsLth <<
" \t minLth " << minLth <<
" \t maxLth "
172 ss <<
"\n\tmeanHth " << meanHth <<
" \t rmsHth " << rmsHth <<
" \t minHth " << minHth <<
" \t maxHth " << maxHth;
173 ss <<
"\n\tmeanCth " << meanCth <<
" \t rmsCth " << rmsCth <<
" \t minCth " << minCth <<
" \t maxCth " << maxCth;
178 sum += value *
range;
179 sum2 += value * value *
range;
static const uint32_t FirstThStripShift_
bool put(const uint32_t &detID, const InputVector &vect)
Container::iterator compact(Container &input)
ContainerIterator getDataVectorBegin() const
__host__ __device__ constexpr RandomIt upper_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})
void allThresholds(std::vector< float > &lowThs, std::vector< float > &highThs, const Range &range) const
Log< level::Error, false > LogError
static std::string const input
void printDebug(std::stringstream &ss, const TrackerTopology *trackerTopo) const
Prints all the thresholds for all DetIds.
const uint16_t range(const Frame &aFrame)
std::vector< Data > Container
tuple strips
#turn off noise in all subdetectors simHcalUnsuppressedDigis.doNoise = False mix.digitizers.hcal.doNoise = False simEcalUnsuppressedDigis.doNoise = False mix.digitizers.ecal.doNoise = False simEcalUnsuppressedDigis.doESNoise = False simSiPixelDigis.AddNoise = False mix.digitizers.pixel.AddNoise = False simSiStripDigis.Noise = False mix.digitizers.strip.AddNoise = False
SiStripThreshold::Data getData(const uint16_t &strip, const Range &range) const
void printSummary(std::stringstream &ss, const TrackerTopology *trackerTopo) const
Prints mean, rms, min and max threshold values for each DetId.
RegistryIterator getRegistryVectorBegin() const
void encode(const uint16_t &strip, const float &lTh, const float &hTh)
void fill(std::map< std::string, TH1 * > &h, const std::string &s, double x)
std::pair< ContainerIterator, ContainerIterator > Range
static const uint32_t HighThStripMask_
void getDetIds(std::vector< uint32_t > &DetIds_) const
void setData(const uint16_t &strip, const float &lTh, const float &hTh, Container &vthr)
static const uint32_t FirstThStripMask_
__host__ __device__ constexpr RandomIt lower_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})
Registry::const_iterator RegistryIterator
void addToStat(float value, uint16_t &range, float &sum, float &sum2, float &min, float &max) const
const Range getRange(const uint32_t &detID) const
RegistryIterator getRegistryVectorEnd() const
Container::const_iterator ContainerIterator