59 peds_[0].isProfile_ =
true;
68 peds_[0].histo(
dqm()->bookProfile( title, title,
78 peds_[1].isProfile_ =
true;
88 peds_[1].histo(
dqm()->bookProfile( title, title,
100 for ( uint16_t iapv = 0; iapv < 2; iapv++ ) {
109 cm_[iapv].histo(
dqm()->book1D( title, title, nbins, -0.5, nbins*1.-0.5 ) );
110 cm_[iapv].isProfile_ =
false;
112 cm_[iapv].vNumOfEntries_.resize(nbins,0);
113 cm_[iapv].vNumOfEntries_.resize(nbins,0);
151 <<
"[DaqScopeModeTask::" << __func__ <<
"]" 152 <<
" Unexpected number of digis (" 154 <<
") wrt number of histogram bins (" 161 for ( uint16_t ibin = 0; ibin <
bins; ibin++ ) {
168 uint16_t
nbins =
peds_[0].vNumOfEntries_.size();
169 if ( digis.
data.size() <
nbins ) { nbins = digis.
data.size(); }
171 uint16_t napvs = nbins / 128;
172 std::vector<uint32_t> cm; cm.resize(napvs,0);
175 std::vector<uint16_t>
adc;
176 for ( uint16_t iapv = 0; iapv < napvs; iapv++ ) {
177 adc.clear(); adc.reserve(128);
179 for ( uint16_t ibin = 0; ibin < 128; ibin++ ) {
180 if ( (iapv*128)+ibin < nbins ) {
181 adc.push_back( digis.
data[(iapv*128)+ibin].adc() );
185 sort( adc.begin(), adc.end() );
186 uint16_t
index = adc.size()%2 ? adc.size()/2 : adc.size()/2-1;
187 if ( !adc.empty() ) { cm[iapv] =
static_cast<uint32_t
>( adc[
index] ); }
189 for ( uint16_t ibin = 0; ibin <
nbins; ibin++ ) {
190 float digiVal = digis.
data[ibin].adc();
192 float diff = digiVal -
static_cast<float>( cm[ibin/128] );
196 if ( cm.size() <
cm_.size() ) {
198 <<
"[PedestalsTask::" << __func__ <<
"]" 199 <<
" Fewer CM values than expected: " << cm.size();
221 <<
"[DaqScopeModeTask::" << __func__ <<
"]" 222 <<
" Unexpected number of digis (" 224 <<
") wrt number of histogram bins (" 230 for ( uint16_t ibin = 0; ibin <
bins; ibin++ ) {
237 uint16_t
nbins =
peds_[0].vNumOfEntries_.size();
238 if ( digis.
data.size() <
nbins ) { nbins = digis.
data.size(); }
240 uint16_t napvs = nbins / 128;
241 std::vector<uint32_t> cm; cm.resize(napvs,0);
244 std::vector<uint16_t>
adc;
245 for ( uint16_t iapv = 0; iapv < napvs; iapv++ ) {
246 adc.clear(); adc.reserve(128);
247 for ( uint16_t ibin = 0; ibin < 128; ibin++ ) {
248 if ( (iapv*128)+ibin < nbins ) {
249 adc.push_back( digis.
data[(iapv*128)+ibin].adc() );
252 sort( adc.begin(), adc.end() );
253 uint16_t
index = adc.size()%2 ? adc.size()/2 : adc.size()/2-1;
254 if ( !adc.empty() ) { cm[iapv] =
static_cast<uint32_t
>( adc[
index] ); }
258 for ( uint16_t ibin = 0; ibin <
nbins; ibin++ ) {
259 float digiVal = digis.
data[ibin].adc();
261 float diff = digiVal -
static_cast<float>( cm[ibin/128] );
265 if ( cm.size() <
cm_.size() ) {
267 <<
"[PedestalsTask::" << __func__ <<
"]" 268 <<
" Fewer CM values than expected: " << cm.size();
275 for ( uint16_t ibin = 0; ibin <
bins; ibin++ ) {
291 for ( uint16_t
ii = 0;
ii <
peds_[1].vNumOfEntries_.size(); ++
ii ) {
295 float entries =
peds_[1].vNumOfEntries_[
ii];
296 if ( entries > 0. ) {
297 mean =
peds_[1].vSumOfContents_[
ii] / entries;
298 spread =
sqrt(
peds_[1].vSumOfSquares_[
ii] / entries - mean * mean );
301 float noise = spread;
int adc(sample_type sample)
get the ADC sample (12 bits)
T getParameter(std::string const &) const
std::vector< float > vNumOfEntries_
edm::ParameterSet parameters_
parameters useful for the spy
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
Utility class that holds histogram title.
const std::string & title() const
DaqScopeModeTask(DQMStore *, const FedChannelConnection &, const edm::ParameterSet &)
static const char mlDqmSource_[]
std::vector< float > vSumOfContents_
const uint32_t & updateFreq() const
void updateHistoSet(HistoSet &, const uint32_t &bin, const float &value)
std::vector< HistoSet > peds_
Class containning control, module, detector and connection information, at the level of a FED channel...
void fill(const SiStripEventSummary &, const edm::DetSet< SiStripRawDigi > &) override
static void setBinContent(TProfile *const profile, const uint32_t &bin, const double &entries, const double &mean, const double &spread)
std::vector< HistoSet > cm_
int extract(std::vector< int > *output, const std::string &dati)
~DaqScopeModeTask() override
DQMStore *const dqm() const
const uint32_t & fillCntr() const
void histo(MonitorElement *)
const uint32_t & fedKey() const
std::vector< double > vSumOfSquares_
const FedChannelConnection & connection() const