12 #include "boost/lexical_cast.hpp" 22 <<
"[PedsFullNoiseTask::" << __func__ <<
"]" 23 <<
" Constructing object...";
40 <<
"[PedsFullNoiseTask::" << __func__ <<
"]" 41 <<
" Destructing object...";
118 <<
"[PedsFullNoiseTask::" << __func__ <<
"]" 119 <<
" " <<
nstrips_ <<
" digis expected, but got " << nbins <<
". Skipping.";
124 static int32_t firstev = summary.
event();
128 if (static_cast<int32_t>(summary.
event()) - firstev <
nskip_) {
133 <<
" Done skipping events. Now starting pedestals.";
141 for ( uint16_t istrip = 0; istrip <
nstrips_; ++istrip ) {
149 for ( uint16_t iapv = 0; iapv < 2; ++iapv ) {
150 for ( uint16_t ibin = 0; ibin < 128; ++ibin ) {
151 uint16_t istrip = (iapv*128)+ibin;
160 <<
" Rough pedestals done. Now starting noise measurements.";
167 std::vector<int32_t> cm; cm.resize(2, 0);
168 std::vector<uint16_t>
adc;
169 for ( uint16_t iapv = 0; iapv < 2; iapv++ ) {
170 adc.clear(); adc.reserve(128);
171 for ( uint16_t ibin = 0; ibin < 128; ibin++ ) {
172 if ( (iapv*128)+ibin < nbins ) {
173 adc.push_back( digis.
data.at((iapv*128)+ibin).adc() );
176 sort( adc.begin(), adc.end() );
178 uint16_t
index = adc.size()%2 ? adc.size()/2 : adc.size()/2-1;
179 cm[iapv] =
static_cast<int16_t
>(adc[
index]);
182 for ( uint16_t istrip = 0; istrip <
nstrips_; ++istrip ) {
184 int16_t noiseval =
static_cast<int16_t
>(digis.
data.at(istrip).adc()) - cm[istrip/128];
190 std::vector<int16_t> noisevals, noisevalssorted;
191 std::vector<float> noisevalsfl, noisevalssortedfl;
192 for ( uint16_t iapv = 0; iapv < 2; ++iapv ) {
194 noisevals.clear(); noisevalsfl.clear();
195 noisevalssorted.clear(); noisevalssortedfl.clear();
196 for ( uint16_t ibin = 0; ibin < 128; ++ibin ) {
197 uint16_t istrip = (iapv*128)+ibin;
200 noisevalsfl.push_back( static_cast<float>(digis.
data.at(istrip).adc()) -
pedsfl_.at(istrip) );
203 totadc += noisevalsfl[ibin];
205 noisevalssortedfl.push_back( noisevalsfl[ibin] );
208 noisevals.push_back( static_cast<int16_t>(digis.
data.at(istrip).adc()) -
peds_.at(istrip) );
211 totadc += noisevals[ibin];
213 noisevalssorted.push_back( noisevals[ibin] );
221 cmshift = totadc/128;
223 cmshift =
static_cast<int16_t
>(totadc/128);
228 sort( noisevalssortedfl.begin(), noisevalssortedfl.end() );
229 uint16_t
index = noisevalssortedfl.size()%2 ? noisevalssortedfl.size()/2 : noisevalssortedfl.size()/2-1;
230 cmshift = noisevalssortedfl[
index];
233 sort( noisevalssorted.begin(), noisevalssorted.end() );
234 uint16_t
index = noisevalssorted.size()%2 ? noisevalssorted.size()/2 : noisevalssorted.size()/2-1;
235 cmshift = noisevalssorted[
index];
239 for ( uint16_t ibin = 0; ibin < 128; ++ibin ) {
240 uint16_t istrip = (iapv*128)+ibin;
242 float noiseval = (
usefloatpeds_ ? noisevalsfl[ibin] : noisevals[ibin]) - cmshift;
244 uint32_t binnr =
hist2d_->GetBin(static_cast<int>(noiseval+
nadcnoise_), istrip+1);
267 if ( entries > 0. ) {
int adc(sample_type sample)
get the ADC sample (12 bits)
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)
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)
void histo(MonitorElement *)
int extract(std::vector< int > *output, const std::string &dati)
DQMStore *const dqm() const
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_