27 std::ostringstream
os;
45 return StatusCode::SUCCESS;
60 std::array<std::string, 2> gainName{
"_LG",
"_HG"};
76 std::array<std::string, 2> moduleName{
module+gainName[0],
module+gainName[1]};
80 for (
const TileDigits* tile_digits : *digitsCollectionLegacy) {
84 unsigned int nSamples = tile_digits->nsamples();
94 std::vector<float> digits_monitored;
96 auto end = tile_digits->samples().end();
100 fill(
"TileLegacyMonSamples", channelSample);
101 digits_monitored.push_back(
sample);
107 std::string channelName = moduleName[
gain] +
"_channel";
110 std::string monPedestal = moduleName[
gain] +
"_Pedestal";
112 fill(
"TileLegacyMonPed", monitoredChannel, pedestal);
116 double sampleSum =
std::accumulate( digits_monitored.begin(), digits_monitored.end(), 0.0);
118 double sampleRMS =
std::accumulate( digits_monitored.begin(), digits_monitored.end(), 0.0, [] (
double acc,
float sample) {
119 return acc + sample * sample;
121 sampleRMS -= sampleSum * sampleSum /
nSamples;
122 sampleRMS = (sampleRMS > 0.0) ? std::sqrt(sampleRMS / (
nSamples - 1)) : 0.0;
124 std::string monHFN = moduleName[
gain] +
"_HFN";
126 fill(
"TileLegacyMonHFN", monitoredChannel,
hfn);
130 digitsLegacy[
channel][
gain].swap(digits_monitored);
137 for (
const TileDigits* tile_digits : *digitsCollectionFlx) {
141 unsigned int nSamples = tile_digits->nsamples();
151 std::vector<float> digits_monitored;
153 auto end = tile_digits->samples().end();
158 fill(
"TileFlxMonSamples", channelSample);
159 digits_monitored.push_back(
sample);
165 std::string channelName = moduleName[
gain] +
"_channel";
168 std::string monPedestal = moduleName[
gain] +
"_Pedestal";
170 fill(
"TileFlxMonPed", monitoredChannel, pedestal);
174 double sampleSum =
std::accumulate( digits_monitored.begin(), digits_monitored.end(), 0.0);
176 double sampleRMS =
std::accumulate( digits_monitored.begin(), digits_monitored.end(), 0.0, [] (
double acc,
float sample) {
177 return acc + sample * sample;
179 sampleRMS -= sampleSum * sampleSum /
nSamples;
180 sampleRMS = (sampleRMS > 0.0) ? std::sqrt(sampleRMS / (
nSamples - 1)) : 0.0;
182 std::string monHFN = moduleName[
gain] +
"_HFN";
184 fill(
"TileFlxMonHFN", monitoredChannel,
hfn);
196 std::string channelName = moduleName[
gain] +
"_channel";
197 std::string moduleSampleName = moduleName[
gain] +
"_samples_diff";
215 channelSampleDiff =
diff;
216 moduleSampleDiff =
diff;
218 fill(
"TileChannelAllSamplesDiff", channelSampleDiff);
219 fill(
"TileModuleAllSamplesDiff", moduleSampleDiff);
220 fill(
"TileModuleSamplesDiff", monitoredChannel, moduleSampleDiff);
227 fill(
"TileDigitsFlxMonExecuteTime",
timer);
229 return StatusCode::SUCCESS;