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) {
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();
85 uint16_t bias =
summary.lldBias();
89 for (uint16_t igain = 0; igain <
opto_.size(); igain++) {
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) {
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();