CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
DaqScopeModeTask Class Reference

#include <DaqScopeModeTask.h>

Inheritance diagram for DaqScopeModeTask:
CommissioningTask

Public Member Functions

 DaqScopeModeTask (DQMStore *, const FedChannelConnection &, const edm::ParameterSet &)
 
 ~DaqScopeModeTask () override
 
- Public Member Functions inherited from CommissioningTask
void bookHistograms ()
 
 CommissioningTask (DQMStore *, const FedChannelConnection &, const std::string &my_name)
 
void eventSetup (const edm::EventSetup *)
 
const uint32_t & fillCntr () const
 
void fillHistograms (const SiStripEventSummary &, const edm::DetSet< SiStripRawDigi > &)
 
void fillHistograms (const SiStripEventSummary &, const edm::DetSet< SiStripRawDigi > &, const edm::DetSet< SiStripRawDigi > &)
 
void fillHistograms (const SiStripEventSummary &, const edm::DetSet< SiStripRawDigi > &, const edm::DetSet< SiStripRawDigi > &, const std::vector< uint16_t > &)
 
void fillHistograms (const SiStripEventSummary &, const uint16_t &fed_id, const std::map< uint16_t, float > &fed_ch)
 
const std::string & myName () const
 
const uint32_t & updateFreq () const
 
void updateFreq (const uint32_t &)
 
void updateHistograms ()
 
virtual ~CommissioningTask ()
 

Private Member Functions

void book () override
 
void fill (const SiStripEventSummary &, const edm::DetSet< SiStripRawDigi > &) override
 
void fill (const SiStripEventSummary &, const edm::DetSet< SiStripRawDigi > &, const edm::DetSet< SiStripRawDigi > &) override
 
void fill (const SiStripEventSummary &, const edm::DetSet< SiStripRawDigi > &, const edm::DetSet< SiStripRawDigi > &, const std::vector< uint16_t > &) override
 
void update () override
 

Private Attributes

std::vector< HistoSetcm_
 
HistoSet highHeader_
 
HistoSet lowHeader_
 
uint16_t nBins_
 
uint16_t nBinsSpy_
 
edm::ParameterSet parameters_
 parameters useful for the spy More...
 
std::vector< HistoSetpeds_
 
HistoSet scopeFrame_
 

Additional Inherited Members

- Public Types inherited from CommissioningTask
typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Protected Member Functions inherited from CommissioningTask
const FedChannelConnectionconnection () const
 
DQMStore *const dqm () const
 
const edm::EventSetup *const eventSetup () const
 
const uint32_t & fecKey () const
 
const uint32_t & fedKey () const
 
void updateHistoSet (HistoSet &, const uint32_t &bin, const float &value)
 
void updateHistoSet (CompactHistoSet &, const uint32_t &bin, const short &value)
 
void updateHistoSet (HistoSet &, const uint32_t &bin)
 
void updateHistoSet (CompactHistoSet &, const uint32_t &bin)
 
void updateHistoSet (HistoSet &, const float &value)
 
void updateHistoSet (CompactHistoSet &)
 
void updateHistoSet (HistoSet &)
 

Detailed Description

Definition at line 12 of file DaqScopeModeTask.h.

Constructor & Destructor Documentation

◆ DaqScopeModeTask()

DaqScopeModeTask::DaqScopeModeTask ( DQMStore dqm,
const FedChannelConnection conn,
const edm::ParameterSet pset 
)

Definition at line 13 of file DaqScopeModeTask.cc.

14  : CommissioningTask(dqm, conn, "DaqScopeModeTask"),
15  scopeFrame_(),
16  nBins_(256), //@@ number of strips per FED channel
17  nBinsSpy_(298), //@@ in case of spy events includes header and trailing tick
18  parameters_(pset) {}
edm::ParameterSet parameters_
parameters useful for the spy
conn
Definition: getInfo.py:9
Definition: DQMStore.h:18

◆ ~DaqScopeModeTask()

DaqScopeModeTask::~DaqScopeModeTask ( )
override

Definition at line 22 of file DaqScopeModeTask.cc.

22 {}

Member Function Documentation

◆ book()

void DaqScopeModeTask::book ( )
overrideprivatevirtual

Reimplemented from CommissioningTask.

Definition at line 26 of file DaqScopeModeTask.cc.

References sistrip::APV, cm_, sistrip::extrainfo::commonMode_, CommissioningTask::connection(), sistrip::DAQ_SCOPE_MODE, CommissioningTask::dqm(), edm::ParameterSet::existsAs(), sistrip::EXPERT_HISTO, sistrip::FED_KEY, CommissioningTask::fedKey(), edm::ParameterSet::getParameter(), highHeader_, CommissioningTask::HistoSet::histo(), CommissioningTask::HistoSet::isProfile_, sistrip::LLD_CHAN, LogTrace, lowHeader_, sistrip::mlDqmSource_, LaserClient_cfi::nbins, nBins_, nBinsSpy_, sistrip::extrainfo::noise_, parameters_, sistrip::extrainfo::pedestals_, peds_, scopeFrame_, sistrip::extrainfo::scopeModeFrame_, sistrip::extrainfo::scopeModeHeaderHigh_, sistrip::extrainfo::scopeModeHeaderLow_, AlCaHLTBitMon_QueryRunRegistry::string, SiStripHistoTitle::title(), runGCPTkAlMap::title, CommissioningTask::HistoSet::vNumOfEntries_, CommissioningTask::HistoSet::vSumOfContents_, and CommissioningTask::HistoSet::vSumOfSquares_.

26  {
27  LogTrace(mlDqmSource_) << "[CommissioningTask::" << __func__ << "]";
28 
30  if (not(parameters_.existsAs<bool>("isSpy") and parameters_.getParameter<bool>("isSpy"))) {
35  fedKey(),
37  connection().lldChannel(),
39  .title();
40 
41  scopeFrame_.histo(dqm()->book1D(title, title, nBins_, -0.5, nBins_ - 0.5));
42 
46  scopeFrame_.isProfile_ = false;
47  } else { // use spy run to measure pedestal and tick height
48 
49  std::string extra_info;
50  peds_.resize(2);
51  extra_info = sistrip::extrainfo::pedestals_;
52 
53  peds_[0].isProfile_ = true;
57  fedKey(),
59  connection().lldChannel(),
60  extra_info)
61  .title();
62 
63  peds_[0].histo(dqm()->bookProfile(title, title, nBins_, -0.5, nBins_ * 1. - 0.5, 1025, 0., 1025.));
64 
65  peds_[0].vNumOfEntries_.resize(nBins_, 0);
66  peds_[0].vSumOfContents_.resize(nBins_, 0);
67  peds_[0].vSumOfSquares_.resize(nBins_, 0);
68 
69  // Noise histogram
70  extra_info = sistrip::extrainfo::noise_;
71  peds_[1].isProfile_ = true;
72 
76  fedKey(),
78  connection().lldChannel(),
79  extra_info)
80  .title();
81 
82  peds_[1].histo(dqm()->bookProfile(title, title, nBins_, -0.5, nBins_ * 1. - 0.5, 1025, 0., 1025.));
83 
84  peds_[1].vNumOfEntries_.resize(nBins_, 0);
85  peds_[1].vSumOfContents_.resize(nBins_, 0);
86  peds_[1].vSumOfSquares_.resize(nBins_, 0);
87 
88  // Common mode histograms
89  cm_.resize(2);
90  int nbins = 1024;
91 
92  for (uint16_t iapv = 0; iapv < 2; iapv++) {
96  fedKey(),
98  connection().i2cAddr(iapv),
100  .title();
101 
102  cm_[iapv].histo(dqm()->book1D(title, title, nbins, -0.5, nbins * 1. - 0.5));
103  cm_[iapv].isProfile_ = false;
104 
105  cm_[iapv].vNumOfEntries_.resize(nbins, 0);
106  cm_[iapv].vNumOfEntries_.resize(nbins, 0);
107  }
108 
109  // high and low header histograms
113  fedKey(),
115  connection().lldChannel(),
117  .title();
118 
119  lowHeader_.histo(dqm()->book1D(title, title, nbins, -0.5, 1024 * 1. - 0.5));
120  lowHeader_.isProfile_ = false;
121  lowHeader_.vNumOfEntries_.resize(nbins, 0);
122 
126  fedKey(),
128  connection().lldChannel(),
130  .title();
131 
132  highHeader_.histo(dqm()->book1D(title, title, nbins, -0.5, 1024 * 1. - 0.5));
133  highHeader_.isProfile_ = false;
134  highHeader_.vNumOfEntries_.resize(nbins, 0);
135 
140  fedKey(),
142  connection().lldChannel(),
144  .title();
145 
146  scopeFrame_.histo(dqm()->bookProfile(title, title, nBinsSpy_, -0.5, nBinsSpy_ * 1. - 0.5, 1025, 0., 1025.));
147 
151  scopeFrame_.isProfile_ = true;
152  }
153 }
static const char noise_[]
std::vector< float > vNumOfEntries_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ParameterSet parameters_
parameters useful for the spy
Utility class that holds histogram title.
static const char mlDqmSource_[]
std::vector< float > vSumOfContents_
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:171
#define LogTrace(id)
std::vector< HistoSet > peds_
static const char scopeModeHeaderLow_[]
static const char commonMode_[]
const uint32_t & fedKey() const
std::vector< HistoSet > cm_
DQMStore *const dqm() const
static const char pedestals_[]
static const char scopeModeHeaderHigh_[]
void histo(MonitorElement *)
static const char scopeModeFrame_[]
std::vector< double > vSumOfSquares_
const std::string & title() const
const FedChannelConnection & connection() const

◆ fill() [1/3]

void DaqScopeModeTask::fill ( const SiStripEventSummary summary,
const edm::DetSet< SiStripRawDigi > &  digis 
)
overrideprivatevirtual

Reimplemented from CommissioningTask.

Definition at line 157 of file DaqScopeModeTask.cc.

References gpuClustering::adc, trigObjTnPSource_cfi::bins, cm_, edm::DetSet< T >::data, change_name::diff, edm::ParameterSet::existsAs(), CommissioningTask::fillCntr(), edm::ParameterSet::getParameter(), sistrip::mlDqmSource_, LaserClient_cfi::nbins, nBins_, parameters_, peds_, scopeFrame_, jetUpdater_cfi::sort, CommissioningTask::updateFreq(), and CommissioningTask::updateHistoSet().

157  {
158  // Only fill every 'N' events
159  if (not(parameters_.existsAs<bool>("isSpy") and parameters_.getParameter<bool>("isSpy"))) {
160  if (!updateFreq() || fillCntr() % updateFreq()) {
161  return;
162  }
163  }
164 
165  if (digis.data.size() != nBins_) { //@@ check scope mode length?
166  edm::LogWarning(mlDqmSource_) << "[DaqScopeModeTask::" << __func__ << "]"
167  << " Unexpected number of digis (" << digis.data.size()
168  << ") wrt number of histogram bins (" << nBins_ << ")!";
169  }
170 
171  if (not(parameters_.existsAs<bool>("isSpy") and parameters_.getParameter<bool>("isSpy"))) {
172  uint16_t bins = digis.data.size() < nBins_ ? digis.data.size() : nBins_;
173  for (uint16_t ibin = 0; ibin < bins; ibin++) {
174  updateHistoSet(scopeFrame_, ibin, digis.data[ibin].adc());
175  }
176  } else {
177  // fill the pedestal histograms as done in the pedestal task
178  // Check number of digis
179  uint16_t nbins = peds_[0].vNumOfEntries_.size();
180  if (digis.data.size() < nbins) {
181  nbins = digis.data.size();
182  }
183 
184  uint16_t napvs = nbins / 128;
185  std::vector<uint32_t> cm;
186  cm.resize(napvs, 0);
187 
188  // Calc common mode for both APVs
189  std::vector<uint16_t> adc;
190  for (uint16_t iapv = 0; iapv < napvs; iapv++) {
191  adc.clear();
192  adc.reserve(128);
193 
194  for (uint16_t ibin = 0; ibin < 128; ibin++) {
195  if ((iapv * 128) + ibin < nbins) {
196  adc.push_back(digis.data[(iapv * 128) + ibin].adc());
197  }
198  }
199 
200  sort(adc.begin(), adc.end());
201  uint16_t index = adc.size() % 2 ? adc.size() / 2 : adc.size() / 2 - 1;
202  if (!adc.empty()) {
203  cm[iapv] = static_cast<uint32_t>(adc[index]);
204  }
205  }
206 
207  for (uint16_t ibin = 0; ibin < nbins; ibin++) {
208  float digiVal = digis.data[ibin].adc();
209  updateHistoSet(peds_[0], ibin, digiVal); // peds and raw noise
210  float diff = digiVal - static_cast<float>(cm[ibin / 128]);
211  updateHistoSet(peds_[1], ibin, diff); // residuals and real noise
212  }
213 
214  if (cm.size() < cm_.size()) {
215  edm::LogWarning(mlDqmSource_) << "[PedestalsTask::" << __func__ << "]"
216  << " Fewer CM values than expected: " << cm.size();
217  }
218 
219  updateHistoSet(cm_[0], cm[0]);
220  updateHistoSet(cm_[1], cm[1]);
221  }
222 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ParameterSet parameters_
parameters useful for the spy
static const char mlDqmSource_[]
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:171
void updateHistoSet(HistoSet &, const uint32_t &bin, const float &value)
std::vector< HistoSet > peds_
const uint32_t & fillCntr() const
std::vector< HistoSet > cm_
collection_type data
Definition: DetSet.h:80
const uint32_t & updateFreq() const
Log< level::Warning, false > LogWarning
uint16_t *__restrict__ uint16_t const *__restrict__ adc

◆ fill() [2/3]

void DaqScopeModeTask::fill ( const SiStripEventSummary summary,
const edm::DetSet< SiStripRawDigi > &  digis,
const edm::DetSet< SiStripRawDigi > &  digisAlt 
)
overrideprivatevirtual

Calculate pedestal

Reimplemented from CommissioningTask.

Definition at line 226 of file DaqScopeModeTask.cc.

References gpuClustering::adc, trigObjTnPSource_cfi::bins, cm_, edm::DetSet< T >::data, change_name::diff, edm::ParameterSet::existsAs(), CommissioningTask::fillCntr(), edm::ParameterSet::getParameter(), highHeader_, mps_fire::i, lowHeader_, sistrip::mlDqmSource_, LaserClient_cfi::nbins, nBins_, nBinsSpy_, parameters_, peds_, scopeFrame_, jetUpdater_cfi::sort, CommissioningTask::updateFreq(), and CommissioningTask::updateHistoSet().

228  {
229  // Only fill every 'N' events
230  if (not(parameters_.existsAs<bool>("isSpy") and parameters_.getParameter<bool>("isSpy"))) {
231  if (!updateFreq() || fillCntr() % updateFreq()) {
232  return;
233  }
234  }
235 
236  if (digis.data.size() != nBins_) { //@@ check scope mode length?
237  edm::LogWarning(mlDqmSource_) << "[DaqScopeModeTask::" << __func__ << "]"
238  << " Unexpected number of digis (" << digis.data.size()
239  << ") wrt number of histogram bins (" << nBins_ << ")!";
240  }
241 
242  if (not(parameters_.existsAs<bool>("isSpy") and parameters_.getParameter<bool>("isSpy"))) {
243  uint16_t bins = digis.data.size() < nBins_ ? digis.data.size() : nBins_;
244  for (uint16_t ibin = 0; ibin < bins; ibin++) {
245  updateHistoSet(scopeFrame_, ibin, digis.data[ibin].adc());
246  }
247  } else {
248  // fill the pedestal histograms as done in the pedestal task
249  // Check number of digis
250  uint16_t nbins = peds_[0].vNumOfEntries_.size();
251  if (digis.data.size() < nbins) {
252  nbins = digis.data.size();
253  }
254 
255  uint16_t napvs = nbins / 128;
256  std::vector<uint32_t> cm;
257  cm.resize(napvs, 0);
258 
259  // Calc common mode for both APVs
260  std::vector<uint16_t> adc;
261  for (uint16_t iapv = 0; iapv < napvs; iapv++) {
262  adc.clear();
263  adc.reserve(128);
264  for (uint16_t ibin = 0; ibin < 128; ibin++) {
265  if ((iapv * 128) + ibin < nbins) {
266  adc.push_back(digis.data[(iapv * 128) + ibin].adc());
267  }
268  }
269  sort(adc.begin(), adc.end());
270  uint16_t index = adc.size() % 2 ? adc.size() / 2 : adc.size() / 2 - 1;
271  if (!adc.empty()) {
272  cm[iapv] = static_cast<uint32_t>(adc[index]);
273  }
274  }
275 
277  for (uint16_t ibin = 0; ibin < nbins; ibin++) {
278  float digiVal = digis.data[ibin].adc();
279  updateHistoSet(peds_[0], ibin, digiVal); // peds and raw noise
280  float diff = digiVal - static_cast<float>(cm[ibin / 128]);
281  updateHistoSet(peds_[1], ibin, diff); // residuals and real noise
282  }
283 
284  if (cm.size() < cm_.size()) {
285  edm::LogWarning(mlDqmSource_) << "[PedestalsTask::" << __func__ << "]"
286  << " Fewer CM values than expected: " << cm.size();
287  }
288 
289  updateHistoSet(cm_[0], cm[0]);
290  updateHistoSet(cm_[1], cm[1]);
291 
292  uint16_t bins = digisAlt.data.size() < nBinsSpy_ ? digisAlt.data.size() : nBinsSpy_;
293  for (uint16_t ibin = 0; ibin < bins; ibin++) {
294  updateHistoSet(scopeFrame_, ibin, digisAlt.data[ibin].adc());
295  }
296 
297  // Header low and high for both APVs
298  std::vector<uint32_t> adcHeader_high;
299  std::vector<uint32_t> adcHeader_low;
300 
301  float threshold_high = (digisAlt.data[286].adc() + digisAlt.data[287].adc()) / 4;
302  float threshold_low = 100;
303  int minNumberForHeader = 4;
304  bool goodHeaderFound = false;
305  int nConsecutiveHigh = 0;
306  adcHeader_high.clear();
307  adcHeader_high.reserve(30);
308  adcHeader_low.clear();
309  adcHeader_low.reserve(30);
310 
311  for (uint16_t ibin = 6; ibin < 11; ibin++) {
312  if (digisAlt.data[ibin].adc() > threshold_high) {
313  nConsecutiveHigh++;
314  }
315  }
316 
317  if (nConsecutiveHigh > minNumberForHeader)
318  goodHeaderFound = true; // if nConsecutiveHigh > 4 --> good header found
319  if (goodHeaderFound == false)
320  return;
321  for (uint16_t ibin = 0; ibin < 30; ibin++) {
322  if (digisAlt.data[ibin].adc() > threshold_high &&
323  goodHeaderFound) { // save of samples above avg(trailing ticks)/4
324  adcHeader_high.push_back(digisAlt.data[ibin].adc());
325  }
326  if (digisAlt.data[ibin].adc() < threshold_low && goodHeaderFound) {
327  adcHeader_low.push_back(digisAlt.data[ibin].adc());
328  }
329  }
330  if (adcHeader_low.empty() || adcHeader_high.empty()) {
331  return;
332  }
333  for (uint16_t i = 0; i < adcHeader_low.size(); i++) {
334  updateHistoSet(lowHeader_, adcHeader_low[i]);
335  }
336  for (uint16_t i = 0; i < adcHeader_high.size(); i++) {
337  updateHistoSet(highHeader_, adcHeader_high[i]);
338  }
339  }
340 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ParameterSet parameters_
parameters useful for the spy
static const char mlDqmSource_[]
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:171
void updateHistoSet(HistoSet &, const uint32_t &bin, const float &value)
std::vector< HistoSet > peds_
const uint32_t & fillCntr() const
std::vector< HistoSet > cm_
collection_type data
Definition: DetSet.h:80
const uint32_t & updateFreq() const
Log< level::Warning, false > LogWarning
uint16_t *__restrict__ uint16_t const *__restrict__ adc

◆ fill() [3/3]

void DaqScopeModeTask::fill ( const SiStripEventSummary summary,
const edm::DetSet< SiStripRawDigi > &  digis,
const edm::DetSet< SiStripRawDigi > &  digisAlt,
const std::vector< uint16_t > &  stripOnCluster 
)
overrideprivatevirtual

Calculate pedestal

Reimplemented from CommissioningTask.

Definition at line 344 of file DaqScopeModeTask.cc.

References gpuClustering::adc, trigObjTnPSource_cfi::bins, cm_, edm::DetSet< T >::data, change_name::diff, edm::ParameterSet::existsAs(), CommissioningTask::fillCntr(), spr::find(), edm::ParameterSet::getParameter(), highHeader_, mps_fire::i, lowHeader_, sistrip::mlDqmSource_, LaserClient_cfi::nbins, nBins_, nBinsSpy_, parameters_, peds_, scopeFrame_, jetUpdater_cfi::sort, CommissioningTask::updateFreq(), and CommissioningTask::updateHistoSet().

347  {
348  // Only fill every 'N' events
349  if (not(parameters_.existsAs<bool>("isSpy") and parameters_.getParameter<bool>("isSpy"))) {
350  if (!updateFreq() || fillCntr() % updateFreq()) {
351  return;
352  }
353  }
354 
355  if (digis.data.size() != nBins_) { //@@ check scope mode length?
356  edm::LogWarning(mlDqmSource_) << "[DaqScopeModeTask::" << __func__ << "]"
357  << " Unexpected number of digis (" << digis.data.size()
358  << ") wrt number of histogram bins (" << nBins_ << ")!";
359  }
360 
361  if (not(parameters_.existsAs<bool>("isSpy") and parameters_.getParameter<bool>("isSpy"))) {
362  uint16_t bins = digis.data.size() < nBins_ ? digis.data.size() : nBins_;
363  for (uint16_t ibin = 0; ibin < bins; ibin++) {
364  updateHistoSet(scopeFrame_, ibin, digis.data[ibin].adc());
365  }
366  } else {
367  // fill the pedestal histograms as done in the pedestal task
368  uint16_t nbins = peds_[0].vNumOfEntries_.size();
369  if (digis.data.size() < nbins) {
370  nbins = digis.data.size();
371  }
372  uint16_t napvs = nbins / 128;
373  std::vector<uint32_t> cm;
374  cm.resize(napvs, 0);
375  // Calc common mode for both APVs
376  std::vector<uint16_t> adc;
377  for (uint16_t iapv = 0; iapv < napvs; iapv++) {
378  adc.clear();
379  adc.reserve(128);
380  for (uint16_t ibin = 0; ibin < 128; ibin++) {
381  if ((iapv * 128) + ibin < nbins) {
382  if (std::find(stripOnCluster.begin(), stripOnCluster.end(), (iapv * 128) + ibin) ==
383  stripOnCluster.end()) // if not found, strip is good
384  adc.push_back(digis.data[(iapv * 128) + ibin].adc());
385  }
386  }
387  sort(adc.begin(), adc.end());
388  uint16_t index = adc.size() % 2 ? adc.size() / 2 : adc.size() / 2 - 1;
389  if (!adc.empty()) {
390  cm[iapv] = static_cast<uint32_t>(adc[index]);
391  }
392  }
393 
395  for (uint16_t ibin = 0; ibin < nbins; ibin++) {
396  if (std::find(stripOnCluster.begin(), stripOnCluster.end(), ibin) != stripOnCluster.end()) {
397  continue;
398  }
399  float digiVal = digis.data[ibin].adc();
400  updateHistoSet(peds_[0], ibin, digiVal); // peds and raw noise
401  float diff = digiVal - static_cast<float>(cm[ibin / 128]);
402  updateHistoSet(peds_[1], ibin, diff); // residuals and real noise
403  }
404 
405  if (cm.size() < cm_.size()) {
406  edm::LogWarning(mlDqmSource_) << "[PedestalsTask::" << __func__ << "]"
407  << " Fewer CM values than expected: " << cm.size();
408  }
409 
410  updateHistoSet(cm_[0], cm[0]);
411  updateHistoSet(cm_[1], cm[1]);
412 
413  uint16_t bins = digisAlt.data.size() < nBinsSpy_ ? digisAlt.data.size() : nBinsSpy_;
414  for (uint16_t ibin = 0; ibin < bins; ibin++) {
415  updateHistoSet(scopeFrame_, ibin, digisAlt.data[ibin].adc());
416  }
417  // Header low and high for both APVs
418  std::vector<uint32_t> adcHeader_high;
419  std::vector<uint32_t> adcHeader_low;
420 
421  float threshold_high = (digisAlt.data[286].adc() + digisAlt.data[287].adc()) / 4;
422  float threshold_low = 120;
423  int minNumberForHeader = 4;
424  bool goodHeaderFound = false;
425  int nConsecutiveHigh = 0;
426  adcHeader_high.clear();
427  adcHeader_high.reserve(30);
428  adcHeader_low.clear();
429  adcHeader_low.reserve(30);
430 
431  for (uint16_t ibin = 6; ibin < 11; ibin++) {
432  if (digisAlt.data[ibin].adc() > threshold_high) {
433  nConsecutiveHigh++;
434  }
435  }
436 
437  if (nConsecutiveHigh > minNumberForHeader)
438  goodHeaderFound = true; // if nConsecutiveHigh > 4 --> good header found
439  if (goodHeaderFound == false)
440  return;
441  for (uint16_t ibin = 0; ibin < 30; ibin++) {
442  if (digisAlt.data[ibin].adc() > threshold_high &&
443  goodHeaderFound) { // save of samples above avg(trailing ticks)/4
444  adcHeader_high.push_back(digisAlt.data[ibin].adc());
445  }
446  if (digisAlt.data[ibin].adc() < threshold_low && goodHeaderFound) {
447  adcHeader_low.push_back(digisAlt.data[ibin].adc());
448  }
449  }
450  if (adcHeader_low.empty() || adcHeader_high.empty()) {
451  return;
452  }
453  for (uint16_t i = 0; i < adcHeader_low.size(); i++) {
454  updateHistoSet(lowHeader_, adcHeader_low[i]);
455  }
456  for (uint16_t i = 0; i < adcHeader_high.size(); i++) {
457  updateHistoSet(highHeader_, adcHeader_high[i]);
458  }
459  }
460 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ParameterSet parameters_
parameters useful for the spy
static const char mlDqmSource_[]
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:171
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
void updateHistoSet(HistoSet &, const uint32_t &bin, const float &value)
std::vector< HistoSet > peds_
const uint32_t & fillCntr() const
std::vector< HistoSet > cm_
collection_type data
Definition: DetSet.h:80
const uint32_t & updateFreq() const
Log< level::Warning, false > LogWarning
uint16_t *__restrict__ uint16_t const *__restrict__ adc

◆ update()

void DaqScopeModeTask::update ( )
overrideprivatevirtual

Reimplemented from CommissioningTask.

Definition at line 464 of file DaqScopeModeTask.cc.

References cm_, relativeConstraints::error, edm::ParameterSet::existsAs(), extract(), edm::ParameterSet::getParameter(), highHeader_, timingPdfMaker::histo, cuy::ii, lowHeader_, SiStripPI::mean, hgchebackDigitizer_cfi::noise, parameters_, peds_, scopeFrame_, UpdateTProfile::setBinContent(), mathSSE::sqrt(), and CommissioningTask::updateHistoSet().

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), dqm-mbProfile.Profile::finish(), progressbar.ProgressBar::finish(), and MatrixUtil.Steps::overwrite().

464  {
465  if (not(parameters_.existsAs<bool>("isSpy") and parameters_.getParameter<bool>("isSpy")))
467  else {
468  updateHistoSet(peds_[0]);
469  TProfile* histo = ExtractTObject<TProfile>().extract(peds_[1].histo());
470  for (uint16_t ii = 0; ii < peds_[1].vNumOfEntries_.size(); ++ii) {
471  float mean = 0.;
472  float spread = 0.;
473  float entries = peds_[1].vNumOfEntries_[ii];
474  if (entries > 0.) {
475  mean = peds_[1].vSumOfContents_[ii] / entries;
476  spread = sqrt(peds_[1].vSumOfSquares_[ii] / entries - mean * mean);
477  }
478 
479  float noise = spread;
480  float error = 0; // sqrt(entries) / entries;
482  }
483 
484  updateHistoSet(cm_[0]);
485  updateHistoSet(cm_[1]);
486 
490  }
491 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ParameterSet parameters_
parameters useful for the spy
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:171
void updateHistoSet(HistoSet &, const uint32_t &bin, const float &value)
std::vector< HistoSet > peds_
T sqrt(T t)
Definition: SSEVec.h:19
static void setBinContent(TProfile *const profile, const uint32_t &bin, const double &entries, const double &mean, const double &spread)
std::vector< HistoSet > cm_
ii
Definition: cuy.py:589
int extract(std::vector< int > *output, const std::string &dati)

Member Data Documentation

◆ cm_

std::vector<HistoSet> DaqScopeModeTask::cm_
private

Definition at line 38 of file DaqScopeModeTask.h.

Referenced by book(), fill(), and update().

◆ highHeader_

HistoSet DaqScopeModeTask::highHeader_
private

Definition at line 42 of file DaqScopeModeTask.h.

Referenced by book(), fill(), and update().

◆ lowHeader_

HistoSet DaqScopeModeTask::lowHeader_
private

Definition at line 41 of file DaqScopeModeTask.h.

Referenced by book(), fill(), and update().

◆ nBins_

uint16_t DaqScopeModeTask::nBins_
private

Definition at line 44 of file DaqScopeModeTask.h.

Referenced by book(), and fill().

◆ nBinsSpy_

uint16_t DaqScopeModeTask::nBinsSpy_
private

Definition at line 45 of file DaqScopeModeTask.h.

Referenced by book(), and fill().

◆ parameters_

edm::ParameterSet DaqScopeModeTask::parameters_
private

◆ peds_

std::vector<HistoSet> DaqScopeModeTask::peds_
private

Definition at line 37 of file DaqScopeModeTask.h.

Referenced by book(), fill(), and update().

◆ scopeFrame_

HistoSet DaqScopeModeTask::scopeFrame_
private

Definition at line 34 of file DaqScopeModeTask.h.

Referenced by book(), fill(), and update().