18 <<
" Constructing object...";
25 <<
" Destructing object...";
41 peds_[0].isProfile_ =
true;
52 peds_[0].histo(
dqm()->bookProfile(title, title, nbins, -0.5, nbins * 1. - 0.5, 1025, 0., 1025.));
54 peds_[0].vNumOfEntries_.resize(nbins, 0);
55 peds_[0].vSumOfContents_.resize(nbins, 0);
56 peds_[0].vSumOfSquares_.resize(nbins, 0);
60 peds_[1].isProfile_ =
true;
71 peds_[1].histo(
dqm()->bookProfile(title, title, nbins, -0.5, nbins * 1. - 0.5, 1025, 0., 1025.));
73 peds_[1].vNumOfEntries_.resize(nbins, 0);
74 peds_[1].vSumOfContents_.resize(nbins, 0);
75 peds_[1].vSumOfSquares_.resize(nbins, 0);
80 for (uint16_t iapv = 0; iapv < 2; iapv++) {
90 cm_[iapv].histo(
dqm()->book1D(title, title, nbins, -0.5, nbins * 1. - 0.5));
91 cm_[iapv].isProfile_ =
false;
93 cm_[iapv].vNumOfEntries_.resize(nbins, 0);
94 cm_[iapv].vNumOfEntries_.resize(nbins, 0);
101 if (digis.
data.size() !=
peds_[0].vNumOfEntries_.size()) {
103 <<
" Unexpected number of digis: " << digis.
data.size();
108 uint16_t
nbins =
peds_[0].vNumOfEntries_.size();
110 nbins = digis.
data.size();
114 uint16_t napvs = nbins / 128;
115 std::vector<uint32_t> cm;
119 std::vector<uint16_t>
adc;
120 for (uint16_t iapv = 0; iapv < napvs; iapv++) {
123 for (uint16_t ibin = 0; ibin < 128; ibin++) {
124 if ((iapv * 128) + ibin < nbins) {
125 adc.push_back(digis.
data[(iapv * 128) + ibin].adc());
128 sort(adc.begin(), adc.end());
129 uint16_t
index = adc.size() % 2 ? adc.size() / 2 : adc.size() / 2 - 1;
131 cm[iapv] =
static_cast<uint32_t
>(adc[
index]);
135 for (uint16_t ibin = 0; ibin <
nbins; ibin++) {
137 float diff =
static_cast<float>(digis.
data[ibin].adc()) - static_cast<float>(cm[ibin / 128]);
141 if (cm.size() <
cm_.size()) {
143 <<
" Fewer CM values than expected: " << cm.size();
158 for (uint16_t
ii = 0;
ii <
peds_[1].vNumOfEntries_.size(); ++
ii) {
161 float entries =
peds_[1].vNumOfEntries_[
ii];
163 mean =
peds_[1].vSumOfContents_[
ii] / entries;
164 spread =
sqrt(
peds_[1].vSumOfSquares_[
ii] / entries - mean * mean);
167 float noise = spread;
void fill(const SiStripEventSummary &, const edm::DetSet< SiStripRawDigi > &) override
Utility class that holds histogram title.
const std::string & title() const
static const char mlDqmSource_[]
void updateHistoSet(HistoSet &, const uint32_t &bin, const float &value)
PedestalsTask(DQMStore *, const FedChannelConnection &)
DQMStore *const dqm() const
Class containning control, module, detector and connection information, at the level of a FED channel...
std::vector< HistoSet > peds_
static void setBinContent(TProfile *const profile, const uint32_t &bin, const double &entries, const double &mean, const double &spread)
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
std::vector< HistoSet > cm_
int extract(std::vector< int > *output, const std::string &dati)
const uint32_t & fedKey() const
const FedChannelConnection & connection() const
~PedestalsTask() override