12 using namespace sistrip;
31 for (uint16_t igain = 0; igain <
opto_.size(); igain++) {
32 opto_[igain].resize(3);
35 for (uint16_t igain = 0; igain <
opto_.size(); igain++) {
36 for (uint16_t ihisto = 0; ihisto < 3; ihisto++) {
38 std::stringstream extra_info;
40 if (ihisto == 0 || ihisto == 1) {
57 opto_[igain][ihisto].histo(
dqm()->bookProfile(title,
66 opto_[igain][ihisto].vNumOfEntries_.resize(nbins, 0);
67 opto_[igain][ihisto].vSumOfContents_.resize(nbins, 0);
68 opto_[igain][ihisto].vSumOfSquares_.resize(nbins, 0);
79 if (digis.
data.empty()) {
81 <<
" Unexpected number of digis! " << digis.
data.size();
84 uint16_t gain = summary.
lldGain();
85 uint16_t bias = summary.
lldBias();
87 if (gain >=
opto_.size()) {
89 for (uint16_t igain = 0; igain <
opto_.size(); igain++) {
91 opto_[gain].resize(3);
95 <<
" Unexpected gain value! " << gain;
103 std::vector<float> baseline;
104 std::pair<float, float> digital_range;
109 locateTicks(digis, digital_range, baseline, baseline_rms);
111 uint16_t
bin = bias - 1;
133 for (uint16_t igain = 0; igain <
opto_.size(); igain++) {
134 for (uint16_t ihisto = 0; ihisto <
opto_[igain].size(); ihisto++) {
143 std::pair<float, float>&
range,
144 std::vector<float>& baseline,
145 float& baseline_rms) {
147 std::vector<uint16_t>
adc;
148 adc.reserve(digis.
data.size());
149 for (uint16_t iadc = 0; iadc < digis.
data.size(); iadc++) {
153 adc.push_back(digis.
data[iadc].adc());
156 sort(adc.begin(), adc.end());
162 if (adc.size() > 70) {
164 range.second = adc.back();
167 std::vector<uint16_t> truncated;
168 std::vector<uint16_t>::const_iterator
ii = adc.begin();
170 std::vector<uint16_t>::const_iterator
jj = adc.end() - 4 * ((adc.size() / 70) + 1);
171 truncated.resize(jj - ii);
173 if (truncated.empty()) {
179 std::vector<uint16_t>::const_iterator iii = truncated.begin();
180 std::vector<uint16_t>::const_iterator jjj = truncated.end();
181 for (; iii != jjj; ++iii) {
184 b_mean /= (1. * truncated.size());
185 range.first = b_mean;
189 std::vector<uint16_t>::const_iterator iiii = truncated.begin();
190 std::vector<uint16_t>::const_iterator jjjj = truncated.end();
191 for (; iiii != jjjj; ++iiii) {
192 b_rms += fabs(*iiii - b_mean);
195 baseline_rms =
sqrt(b_rms / (1. * truncated.size()));
199 <<
" Insufficient ADC values: " << adc.size();
Utility class that holds histogram title.
static const char mlDqmSource_[]
static const uint16_t valid_
const uint32_t & lldGain() const
const uint16_t range(const Frame &aFrame)
const uint32_t & lldBias() const
void updateHistoSet(HistoSet &, const uint32_t &bin, const float &value)
std::vector< std::vector< HistoSet > > opto_
DQMStore *const dqm() const
Class containning control, module, detector and connection information, at the level of a FED channel...
void fill(const SiStripEventSummary &summary, const edm::DetSet< SiStripRawDigi > &digis) override
OptoScanTask(DQMStore *dqm, const FedChannelConnection &conn)
static const uint16_t invalid_
const uint32_t & fedKey() const
const FedChannelConnection & connection() const
Log< level::Warning, false > LogWarning
tuple size
Write out results.
uint16_t *__restrict__ uint16_t const *__restrict__ adc
void locateTicks(const edm::DetSet< SiStripRawDigi > &scope_mode_data, std::pair< float, float > &digital_range, std::vector< float > &baseline, float &baseline_rms)