12 #include "boost/lexical_cast.hpp" 19 <<
" Constructing object...";
35 <<
" Destructing object...";
104 <<
" " <<
nstrips_ <<
" digis expected, but got " << nbins <<
". Skipping.";
109 static int32_t firstev = summary.
event();
113 if (static_cast<int32_t>(summary.
event()) - firstev <
nskip_) {
119 <<
" Done skipping events. Now starting pedestals.";
127 for (uint16_t istrip = 0; istrip <
nstrips_; ++istrip) {
136 for (uint16_t iapv = 0; iapv < 2; ++iapv) {
137 for (uint16_t ibin = 0; ibin < 128; ++ibin) {
138 uint16_t istrip = (iapv * 128) + ibin;
148 <<
" Rough pedestals done. Now starting noise measurements.";
155 std::vector<int32_t> cm;
157 std::vector<uint16_t>
adc;
158 for (uint16_t iapv = 0; iapv < 2; iapv++) {
161 for (uint16_t ibin = 0; ibin < 128; ibin++) {
162 if ((iapv * 128) + ibin < nbins) {
163 adc.push_back(digis.
data.at((iapv * 128) + ibin).adc());
166 sort(adc.begin(), adc.end());
168 uint16_t
index = adc.size() % 2 ? adc.size() / 2 : adc.size() / 2 - 1;
169 cm[iapv] =
static_cast<int16_t
>(adc[
index]);
172 for (uint16_t istrip = 0; istrip <
nstrips_; ++istrip) {
174 int16_t noiseval =
static_cast<int16_t
>(digis.
data.at(istrip).adc()) - cm[istrip / 128];
180 std::vector<int16_t> noisevals, noisevalssorted;
181 std::vector<float> noisevalsfl, noisevalssortedfl;
182 for (uint16_t iapv = 0; iapv < 2; ++iapv) {
186 noisevalssorted.clear();
187 noisevalssortedfl.clear();
188 for (uint16_t ibin = 0; ibin < 128; ++ibin) {
189 uint16_t istrip = (iapv * 128) + ibin;
192 noisevalsfl.push_back(static_cast<float>(digis.
data.at(istrip).adc()) -
pedsfl_.at(istrip));
195 totadc += noisevalsfl[ibin];
197 noisevalssortedfl.push_back(noisevalsfl[ibin]);
200 noisevals.push_back(static_cast<int16_t>(digis.
data.at(istrip).adc()) -
peds_.at(istrip));
203 totadc += noisevals[ibin];
205 noisevalssorted.push_back(noisevals[ibin]);
213 cmshift = totadc / 128;
215 cmshift =
static_cast<int16_t
>(totadc / 128);
220 sort(noisevalssortedfl.begin(), noisevalssortedfl.end());
221 uint16_t
index = noisevalssortedfl.size() % 2 ? noisevalssortedfl.size() / 2 : noisevalssortedfl.size() / 2 - 1;
222 cmshift = noisevalssortedfl[
index];
225 sort(noisevalssorted.begin(), noisevalssorted.end());
226 uint16_t
index = noisevalssorted.size() % 2 ? noisevalssorted.size() / 2 : noisevalssorted.size() / 2 - 1;
227 cmshift = noisevalssorted[
index];
231 for (uint16_t ibin = 0; ibin < 128; ++ibin) {
232 uint16_t istrip = (iapv * 128) + ibin;
234 float noiseval = (
usefloatpeds_ ? noisevalsfl[ibin] : noisevals[ibin]) - cmshift;
236 uint32_t binnr =
hist2d_->GetBin(static_cast<int>(noiseval +
nadcnoise_), istrip + 1);
T getParameter(std::string const &) const
std::vector< float > vNumOfEntries_
Utility class that holds histogram title.
const std::string & title() const
static const char mlDqmSource_[]
std::vector< float > vSumOfContents_
void updateHistoSet(HistoSet &, const uint32_t &bin, const float &value)
DQMStore *const dqm() const
Class containning control, module, detector and connection information, at the level of a FED channel...
const uint32_t & event() const
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)
void histo(MonitorElement *)
int extract(std::vector< int > *output, const std::string &dati)
CompactHistoSet noisehist_
std::vector< int16_t > peds_
PedsFullNoiseTask(DQMStore *dqm, const FedChannelConnection &conn, const edm::ParameterSet &pset)
void histo(MonitorElement *)
~PedsFullNoiseTask() override
const uint32_t & fedKey() const
std::vector< double > vSumOfSquares_
const FedChannelConnection & connection() const
std::vector< short > vNumOfEntries_
void fill(const SiStripEventSummary &, const edm::DetSet< SiStripRawDigi > &) override
std::vector< float > pedsfl_