70 std::vector<int> drawers[Tile::MAX_ROS - 1];
71 std::vector<int> channels[Tile::MAX_ROS - 1];
72 std::vector<float> pedestals[Tile::MAX_ROS - 1];
73 std::vector<float> amplitudes[Tile::MAX_ROS - 1];
74 std::vector<float> hfns[Tile::MAX_ROS - 1];
75 static constexpr int TMDB_MAX_CHANNEL = 8;
76 std::vector<float> cellPedestals[Tile::MAX_ROS - 1][TMDB_MAX_CHANNEL];
77 std::vector<float> cellHFNs[Tile::MAX_ROS - 1][TMDB_MAX_CHANNEL];
78 std::vector<float> cellAmplitudes[Tile::MAX_ROS - 1][TMDB_MAX_CHANNEL];
83 for (
IdentifierHash hash : digitsContainer->GetAllCurrentHashes()) {
86 int fragId = digitsCollection->
identify();
87 unsigned int drawer = (fragId & 0x3F);
88 unsigned int ros = fragId >> 8;
89 unsigned int partition = ros - 1;
91 for (
const TileDigits* tile_digits : *digitsCollection) {
95 std::vector<float> digits = tile_digits->samples();
97 double mean_samp = 0.0;
98 double rms_samp = 0.0;
99 unsigned int n_digits = digits.size();
101 for (
double digit : digits) {
103 rms_samp += digit * digit;
107 drawers[partition].push_back(drawer);
108 channels[partition].push_back(channel);
110 double ped = digits[0];
111 pedestals[partition].push_back(ped);
113 mean_samp /= n_digits;
114 rms_samp = rms_samp / n_digits - mean_samp * mean_samp;
115 rms_samp = (rms_samp > 0.0) ? sqrt(rms_samp * n_digits / (n_digits - 1)) : 0.0;
116 hfns[partition].push_back(rms_samp);
120 auto min_max = std::minmax_element(digits.begin(), digits.end());
121 float min_digit = *min_max.first;
122 float max_digit = *min_max.second;
123 float amplitude = max_digit - min_digit;
124 amplitudes[partition].push_back(amplitude);
129 cellPedestals[partition][channel].push_back(ped);
130 cellHFNs[partition][channel].push_back(rms_samp);
131 cellAmplitudes[partition][channel].push_back(amplitude);
139 for (
unsigned int partition = 0; partition < Tile::MAX_ROS - 1; ++partition) {
140 if (!pedestals[partition].
empty()) {
152 for (
int channel = 0; channel < int(
m_nChannels[partition]); ++channel) {
153 if (!cellPedestals[partition][channel].
empty()) {
157 if (!cellHFNs[partition][channel].
empty()) {
161 if (!cellAmplitudes[partition][channel].
empty()) {
170 return StatusCode::SUCCESS;