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

- 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 ( DQMStore dqm,
const FedChannelConnection conn,
const edm::ParameterSet pset 
)

Definition at line 13 of file DaqScopeModeTask.cc.

15  :
16  CommissioningTask( dqm, conn, "DaqScopeModeTask" ),
17  scopeFrame_(),
18  nBins_(256), //@@ number of strips per FED channel
19  nBinsSpy_(298), //@@ in case of spy events includes header and trailing tick
20  parameters_(pset)
21 {}
edm::ParameterSet parameters_
parameters useful for the spy
DaqScopeModeTask::~DaqScopeModeTask ( )
override

Definition at line 25 of file DaqScopeModeTask.cc.

25  {
26 }

Member Function Documentation

void DaqScopeModeTask::book ( )
overrideprivatevirtual

Reimplemented from CommissioningTask.

Definition at line 30 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_, pileupCalc::nbins, nBins_, nBinsSpy_, sistrip::extrainfo::noise_, parameters_, sistrip::extrainfo::pedestals_, peds_, scopeFrame_, sistrip::extrainfo::scopeModeFrame_, sistrip::extrainfo::scopeModeHeaderHigh_, sistrip::extrainfo::scopeModeHeaderLow_, AlCaHLTBitMon_QueryRunRegistry::string, fftjetcommon_cfi::title, SiStripHistoTitle::title(), CommissioningTask::HistoSet::vNumOfEntries_, CommissioningTask::HistoSet::vSumOfContents_, and CommissioningTask::HistoSet::vSumOfSquares_.

30  {
31  LogTrace(mlDqmSource_) << "[CommissioningTask::" << __func__ << "]";
32 
34  if(not (parameters_.existsAs<bool>("isSpy") and parameters_.getParameter<bool>("isSpy"))){
35 
40  fedKey(),
42  connection().lldChannel(),
44 
45  scopeFrame_.histo( dqm()->book1D( title, title,
46  nBins_, -0.5, nBins_-0.5 ) );
47 
51  scopeFrame_.isProfile_ = false;
52  }
53  else{ // use spy run to measure pedestal and tick height
54 
55  std::string extra_info;
56  peds_.resize(2);
57  extra_info = sistrip::extrainfo::pedestals_;
58 
59  peds_[0].isProfile_ = true;
63  fedKey(),
65  connection().lldChannel(),
66  extra_info ).title();
67 
68  peds_[0].histo( dqm()->bookProfile( title, title,
69  nBins_, -0.5,nBins_*1.-0.5,
70  1025, 0., 1025. ) );
71 
72  peds_[0].vNumOfEntries_.resize(nBins_,0);
73  peds_[0].vSumOfContents_.resize(nBins_,0);
74  peds_[0].vSumOfSquares_.resize(nBins_,0);
75 
76  // Noise histogram
77  extra_info = sistrip::extrainfo::noise_;
78  peds_[1].isProfile_ = true;
79 
83  fedKey(),
85  connection().lldChannel(),
86  extra_info ).title();
87 
88  peds_[1].histo( dqm()->bookProfile( title, title,
89  nBins_, -0.5, nBins_*1.-0.5,
90  1025, 0., 1025. ) );
91 
92  peds_[1].vNumOfEntries_.resize(nBins_,0);
93  peds_[1].vSumOfContents_.resize(nBins_,0);
94  peds_[1].vSumOfSquares_.resize(nBins_,0);
95 
96  // Common mode histograms
97  cm_.resize(2);
98  int nbins = 1024;
99 
100  for ( uint16_t iapv = 0; iapv < 2; iapv++ ) {
104  fedKey(),
105  sistrip::APV,
106  connection().i2cAddr(iapv),
108 
109  cm_[iapv].histo( dqm()->book1D( title, title, nbins, -0.5, nbins*1.-0.5 ) );
110  cm_[iapv].isProfile_ = false;
111 
112  cm_[iapv].vNumOfEntries_.resize(nbins,0);
113  cm_[iapv].vNumOfEntries_.resize(nbins,0);
114  }
115 
116  // high and low header histograms
120  fedKey(),
122  connection().lldChannel(),
124 
125  lowHeader_.histo( dqm()->book1D( title, title, nbins, -0.5, 1024*1.-0.5 ) );
126  lowHeader_.isProfile_ = false;
127  lowHeader_.vNumOfEntries_.resize(nbins,0);
128 
129 
133  fedKey(),
135  connection().lldChannel(),
137 
138  highHeader_.histo( dqm()->book1D( title, title, nbins, -0.5, 1024*1.-0.5 ) );
139  highHeader_.isProfile_ = false;
140  highHeader_.vNumOfEntries_.resize(nbins,0);
141 
142 
147  fedKey(),
149  connection().lldChannel(),
151 
152  scopeFrame_.histo( dqm()->bookProfile( title, title,
153  nBinsSpy_, -0.5, nBinsSpy_*1.-0.5,
154  1025, 0., 1025. ) );
155 
159  scopeFrame_.isProfile_ = true;
160 
161 
162  }
163 }
static const char noise_[]
T getParameter(std::string const &) const
std::vector< float > vNumOfEntries_
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:161
Utility class that holds histogram title.
const std::string & title() const
static const char mlDqmSource_[]
std::vector< float > vSumOfContents_
std::vector< HistoSet > peds_
static const char scopeModeHeaderLow_[]
static const char commonMode_[]
#define LogTrace(id)
std::vector< HistoSet > cm_
static const char pedestals_[]
static const char scopeModeHeaderHigh_[]
DQMStore *const dqm() const
void histo(MonitorElement *)
static const char scopeModeFrame_[]
const uint32_t & fedKey() const
std::vector< double > vSumOfSquares_
const FedChannelConnection & connection() const
void DaqScopeModeTask::fill ( const SiStripEventSummary summary,
const edm::DetSet< SiStripRawDigi > &  digis 
)
overrideprivatevirtual

Reimplemented from CommissioningTask.

Definition at line 167 of file DaqScopeModeTask.cc.

References ecalMGPA::adc(), create_public_pileup_plots::bins, cm_, edm::DetSet< T >::data, diffTreeTool::diff, edm::ParameterSet::existsAs(), CommissioningTask::fillCntr(), edm::ParameterSet::getParameter(), sistrip::mlDqmSource_, pileupCalc::nbins, nBins_, parameters_, peds_, scopeFrame_, CommissioningTask::updateFreq(), and CommissioningTask::updateHistoSet().

168  {
169 
170  // Only fill every 'N' events
171  if(not (parameters_.existsAs<bool>("isSpy") and parameters_.getParameter<bool>("isSpy"))){
172  if ( !updateFreq() || fillCntr()%updateFreq() ) { return; }
173  }
174 
175  if ( digis.data.size() != nBins_ ) { //@@ check scope mode length?
177  << "[DaqScopeModeTask::" << __func__ << "]"
178  << " Unexpected number of digis ("
179  << digis.data.size()
180  << ") wrt number of histogram bins ("
181  << nBins_ << ")!";
182  }
183 
184 
185  if(not (parameters_.existsAs<bool>("isSpy") and parameters_.getParameter<bool>("isSpy"))){
186  uint16_t bins = digis.data.size() < nBins_ ? digis.data.size() : nBins_;
187  for ( uint16_t ibin = 0; ibin < bins; ibin++ ) {
188  updateHistoSet( scopeFrame_, ibin, digis.data[ibin].adc() );
189  }
190  }
191  else{
192  // fill the pedestal histograms as done in the pedestal task
193  // Check number of digis
194  uint16_t nbins = peds_[0].vNumOfEntries_.size();
195  if ( digis.data.size() < nbins ) { nbins = digis.data.size(); }
196 
197  uint16_t napvs = nbins / 128;
198  std::vector<uint32_t> cm; cm.resize(napvs,0);
199 
200  // Calc common mode for both APVs
201  std::vector<uint16_t> adc;
202  for ( uint16_t iapv = 0; iapv < napvs; iapv++ ) {
203  adc.clear(); adc.reserve(128);
204 
205  for ( uint16_t ibin = 0; ibin < 128; ibin++ ) {
206  if ( (iapv*128)+ibin < nbins ) {
207  adc.push_back( digis.data[(iapv*128)+ibin].adc() );
208  }
209  }
210 
211  sort( adc.begin(), adc.end() );
212  uint16_t index = adc.size()%2 ? adc.size()/2 : adc.size()/2-1;
213  if ( !adc.empty() ) { cm[iapv] = static_cast<uint32_t>( adc[index] ); }
214  }
215 
216  for ( uint16_t ibin = 0; ibin < nbins; ibin++ ) {
217  float digiVal = digis.data[ibin].adc();
218  updateHistoSet( peds_[0], ibin, digiVal ); // peds and raw noise
219  float diff = digiVal - static_cast<float>( cm[ibin/128] );
220  updateHistoSet( peds_[1], ibin, diff ); // residuals and real noise
221  }
222 
223  if ( cm.size() < cm_.size() ) {
225  << "[PedestalsTask::" << __func__ << "]"
226  << " Fewer CM values than expected: " << cm.size();
227  }
228 
229  updateHistoSet( cm_[0], cm[0] );
230  updateHistoSet( cm_[1], cm[1] );
231  }
232 }
T getParameter(std::string const &) const
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:161
static const char mlDqmSource_[]
const uint32_t & updateFreq() const
void updateHistoSet(HistoSet &, const uint32_t &bin, const float &value)
std::vector< HistoSet > peds_
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
std::vector< HistoSet > cm_
const uint32_t & fillCntr() const
collection_type data
Definition: DetSet.h:80
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 236 of file DaqScopeModeTask.cc.

References ecalMGPA::adc(), create_public_pileup_plots::bins, cm_, edm::DetSet< T >::data, diffTreeTool::diff, edm::ParameterSet::existsAs(), CommissioningTask::fillCntr(), edm::ParameterSet::getParameter(), highHeader_, mps_fire::i, lowHeader_, sistrip::mlDqmSource_, pileupCalc::nbins, nBins_, nBinsSpy_, parameters_, peds_, scopeFrame_, CommissioningTask::updateFreq(), and CommissioningTask::updateHistoSet().

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

References ecalMGPA::adc(), create_public_pileup_plots::bins, cm_, edm::DetSet< T >::data, diffTreeTool::diff, edm::ParameterSet::existsAs(), CommissioningTask::fillCntr(), spr::find(), edm::ParameterSet::getParameter(), highHeader_, mps_fire::i, lowHeader_, sistrip::mlDqmSource_, pileupCalc::nbins, nBins_, nBinsSpy_, parameters_, peds_, scopeFrame_, CommissioningTask::updateFreq(), and CommissioningTask::updateHistoSet().

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

Reimplemented from CommissioningTask.

Definition at line 471 of file DaqScopeModeTask.cc.

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

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), dqm-mbProfile.Profile::finish(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), MatrixUtil.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

471  {
472 
473  if(not (parameters_.existsAs<bool>("isSpy") and parameters_.getParameter<bool>("isSpy")))
475  else{
476 
477  updateHistoSet( peds_[0] );
478  TProfile* histo = ExtractTObject<TProfile>().extract( peds_[1].histo() );
479  for ( uint16_t ii = 0; ii < peds_[1].vNumOfEntries_.size(); ++ii ) {
480 
481  float mean = 0.;
482  float spread = 0.;
483  float entries = peds_[1].vNumOfEntries_[ii];
484  if ( entries > 0. ) {
485  mean = peds_[1].vSumOfContents_[ii] / entries;
486  spread = sqrt( peds_[1].vSumOfSquares_[ii] / entries - mean * mean );
487  }
488 
489  float noise = spread;
490  float error = 0; // sqrt(entries) / entries;
491  UpdateTProfile::setBinContent( histo, ii+1, entries, noise, error );
492  }
493 
494  updateHistoSet( cm_[0] );
495  updateHistoSet( cm_[1] );
496 
500  }
501 }
T getParameter(std::string const &) const
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:161
void updateHistoSet(HistoSet &, const uint32_t &bin, const float &value)
std::vector< HistoSet > peds_
T sqrt(T t)
Definition: SSEVec.h:18
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:590
int extract(std::vector< int > *output, const std::string &dati)

Member Data Documentation

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

Definition at line 42 of file DaqScopeModeTask.h.

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

HistoSet DaqScopeModeTask::highHeader_
private

Definition at line 46 of file DaqScopeModeTask.h.

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

HistoSet DaqScopeModeTask::lowHeader_
private

Definition at line 45 of file DaqScopeModeTask.h.

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

uint16_t DaqScopeModeTask::nBins_
private

Definition at line 48 of file DaqScopeModeTask.h.

Referenced by book(), and fill().

uint16_t DaqScopeModeTask::nBinsSpy_
private

Definition at line 49 of file DaqScopeModeTask.h.

Referenced by book(), and fill().

edm::ParameterSet DaqScopeModeTask::parameters_
private
std::vector<HistoSet> DaqScopeModeTask::peds_
private

Definition at line 41 of file DaqScopeModeTask.h.

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

HistoSet DaqScopeModeTask::scopeFrame_
private

Definition at line 38 of file DaqScopeModeTask.h.

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