CMS 3D CMS Logo

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

#include <PedsFullNoiseHistosUsingDb.h>

Inheritance diagram for PedsFullNoiseHistosUsingDb:
CommissioningHistosUsingDb PedsFullNoiseHistograms CommissioningHistograms CommissioningHistograms

Public Member Functions

 PedsFullNoiseHistosUsingDb (const edm::ParameterSet &pset, DQMStore *, SiStripConfigDb *const )
 
void uploadConfigurations () override
 
 ~PedsFullNoiseHistosUsingDb () override
 
- Public Member Functions inherited from CommissioningHistosUsingDb
 CommissioningHistosUsingDb (SiStripConfigDb *const, sistrip::RunType=sistrip::UNDEFINED_RUN_TYPE)
 
void configure (const edm::ParameterSet &, const edm::EventSetup &) override
 
bool doUploadAnal () const
 
void doUploadAnal (bool)
 
bool doUploadConf () const
 
void doUploadConf (bool)
 
void uploadToConfigDb ()
 
 ~CommissioningHistosUsingDb () override
 
- Public Member Functions inherited from CommissioningHistograms
 CommissioningHistograms (const edm::ParameterSet &pset, DQMStore *const, const sistrip::RunType &)
 
 CommissioningHistograms ()
 
void createCollations (const std::vector< std::string > &)
 
virtual void createSummaryHisto (const sistrip::Monitorable &, const sistrip::Presentation &, const std::string &top_level_dir, const sistrip::Granularity &)
 
void extractHistograms (const std::vector< std::string > &)
 
virtual void printSummary ()
 
void remove (std::string pattern="")
 
void save (std::string &filename, uint32_t run_number=0, std::string partitionName="")
 
virtual ~CommissioningHistograms ()
 
- Public Member Functions inherited from PedsFullNoiseHistograms
void histoAnalysis (bool debug) override
 
 PedsFullNoiseHistograms (const edm::ParameterSet &pset, DQMStore *)
 
void printAnalyses () override
 
 ~PedsFullNoiseHistograms () override
 

Private Member Functions

void create (SiStripConfigDb::AnalysisDescriptionsV &, Analysis) override
 
void update (SiStripConfigDb::FedDescriptionsRange)
 

Private Attributes

bool allowSelectiveUpload_
 
bool disableBadStrips_
 
float highThreshold_
 
bool keepStripsDisabled_
 
float lowThreshold_
 
bool skipEmptyStrips_
 
bool uploadOnlyStripBadChannelBit_
 
bool uploadPedsFullNoiseDBTable_
 

Additional Inherited Members

- Public Types inherited from CommissioningHistograms
typedef std::map< uint32_t, CommissioningAnalysis * > Analyses
 
typedef Analyses::iterator Analysis
 
typedef SummaryPlotFactory< CommissioningAnalysis * > Factory
 
typedef std::map< uint32_t, uint32_t > FedToFecMap
 
typedef std::vector< Histo * > Histos
 
typedef std::map< uint32_t, HistosHistosMap
 
- Static Public Member Functions inherited from CommissioningHistograms
static void copyCustomInformation (DQMStore *const, const std::vector< std::string > &)
 
static uint32_t runNumber (DQMStore *const, const std::vector< std::string > &)
 
static sistrip::RunType runType (DQMStore *const, const std::vector< std::string > &)
 
- Protected Member Functions inherited from CommissioningHistosUsingDb
virtual void addDcuDetIds ()
 
void buildDetInfo ()
 
SiStripFedCabling *const cabling () const
 
virtual void createAnalyses (SiStripConfigDb::AnalysisDescriptionsV &)
 
SiStripConfigDb *const db () const
 
std::pair< std::string, DetInfodetInfo (const SiStripFecKey &)
 
bool deviceIsPresent (const SiStripFecKey &)
 
void uploadAnalyses ()
 
- Protected Member Functions inherited from CommissioningHistograms
DQMStore *const bei () const
 
void clearHistosMap ()
 
Analysesdata (bool getMaskedData=false)
 
Factory *const factory ()
 
TH1 * histogram (const sistrip::Monitorable &, const sistrip::Presentation &, const sistrip::View &, const std::string &directory, const uint32_t &xbins, const float &xlow=1.*sistrip::invalid_, const float &xhigh=1.*sistrip::invalid_)
 
const HistosMaphistos () const
 
const FedToFecMapmapping () const
 
void printHistosMap ()
 
const edm::ParameterSetpset () const
 
const sistrip::RunTypetask () const
 
- Protected Attributes inherited from CommissioningHistograms
std::unique_ptr< Factoryfactory_
 

Detailed Description

Definition at line 8 of file PedsFullNoiseHistosUsingDb.h.

Constructor & Destructor Documentation

PedsFullNoiseHistosUsingDb::PedsFullNoiseHistosUsingDb ( const edm::ParameterSet pset,
DQMStore bei,
SiStripConfigDb * const  db 
)

Definition at line 14 of file PedsFullNoiseHistosUsingDb.cc.

References allowSelectiveUpload_, disableBadStrips_, edm::ParameterSet::existsAs(), edm::ParameterSet::getParameter(), highThreshold_, keepStripsDisabled_, LogTrace, lowThreshold_, sistrip::mlDqmClient_, CommissioningHistograms::pset(), skipEmptyStrips_, uploadOnlyStripBadChannelBit_, and uploadPedsFullNoiseDBTable_.

19  PedsFullNoiseHistograms( pset.getParameter<edm::ParameterSet>("PedsFullNoiseParameters"),bei )
20 {
21 
23  << "[PedsFullNoiseHistosUsingDb::" << __func__ << "]"
24  << " Constructing object...";
25 
26  highThreshold_ = this->pset().getParameter<double>("HighThreshold");
27  lowThreshold_ = this->pset().getParameter<double>("LowThreshold");
28 
30  << "[PedsFullNoiseHistosUsingDb::" << __func__ << "]"
31  << " Set FED zero suppression high/low threshold to "
32  << highThreshold_ << "/" << lowThreshold_;
33 
34  disableBadStrips_ = this->pset().getParameter<bool>("DisableBadStrips");
35  keepStripsDisabled_ = this->pset().getParameter<bool>("KeepStripsDisabled");
36  skipEmptyStrips_ = this->pset().getParameter<bool>("SkipEmptyStrips");
37  uploadOnlyStripBadChannelBit_ = this->pset().getParameter<bool>("UploadOnlyStripBadChannelBit");
38  uploadPedsFullNoiseDBTable_ = this->pset().getParameter<bool>("UploadPedsFullNoiseDBTable");
39 
41  << "[PedestalsHistosUsingDb::" << __func__ << "]"
42  << " Disabling strips: " << disableBadStrips_
43  << " ; keeping previously disabled strips: " << keepStripsDisabled_
44  << " ; skip strips with no data: " << skipEmptyStrips_
45  << " ; upload only bad channel bit: " << uploadOnlyStripBadChannelBit_;
46 
47  allowSelectiveUpload_ = this->pset().existsAs<bool>("doSelectiveUpload")?this->pset().getParameter<bool>("doSelectiveUpload"):false;
49  << "[PedestalsHistosUsingDb::" << __func__ << "]"
50  << " Selective upload of modules set to : " << allowSelectiveUpload_;
51 }
T getParameter(std::string const &) const
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:161
const edm::ParameterSet & pset() const
static const char mlDqmClient_[]
PedsFullNoiseHistograms(const edm::ParameterSet &pset, DQMStore *)
#define LogTrace(id)
DQMStore *const bei() const
PedsFullNoiseHistosUsingDb::~PedsFullNoiseHistosUsingDb ( )
override

Definition at line 55 of file PedsFullNoiseHistosUsingDb.cc.

References LogTrace, and sistrip::mlDqmClient_.

55  {
57  << "[PedsFullNoiseHistosUsingDb::" << __func__ << "]"
58  << " Destructing object...";
59 }
static const char mlDqmClient_[]
#define LogTrace(id)

Member Function Documentation

void PedsFullNoiseHistosUsingDb::create ( SiStripConfigDb::AnalysisDescriptionsV desc,
Analysis  analysis 
)
overrideprivatevirtual

Reimplemented from CommissioningHistosUsingDb.

Definition at line 316 of file PedsFullNoiseHistosUsingDb.cc.

References PedsFullNoiseAnalysis::adProbab(), PedsFullNoiseAnalysis::badADProbab(), PedsFullNoiseAnalysis::badChi2Probab(), PedsFullNoiseAnalysis::badDoublePeakStrip(), PedsFullNoiseAnalysis::badFitStatus(), PedsFullNoiseAnalysis::badJBProbab(), PedsFullNoiseAnalysis::badKSProbab(), PedsFullNoiseAnalysis::badStrip(), PedsFullNoiseAnalysis::badStripBit(), PedsFullNoiseAnalysis::badTailStrip(), PedsFullNoiseAnalysis::chi2Probab(), CommissioningHistosUsingDb::db(), SiStripConfigDb::dbParams(), PedsFullNoiseAnalysis::deadStrip(), PedsFullNoiseAnalysis::deadStripBit(), CommissioningAnalysis::fecKey(), CommissioningAnalysis::fedKey(), CommissioningAnalysis::getErrorCodes(), SiStripFecKey::i2cAddr(), PedsFullNoiseAnalysis::isValid(), PedsFullNoiseAnalysis::jbProbab(), PedsFullNoiseAnalysis::ksProbab(), PedsFullNoiseAnalysis::largeNoiseSignificance(), PedsFullNoiseAnalysis::largeNoiseStrip(), PedsFullNoiseAnalysis::lowNoiseStrip(), PedsFullNoiseAnalysis::noiseMax(), PedsFullNoiseAnalysis::noiseMean(), PedsFullNoiseAnalysis::noiseMin(), PedsFullNoiseAnalysis::noiseSignificance(), PedsFullNoiseAnalysis::noiseSpread(), SiStripDbParams::partitions(), PedsFullNoiseAnalysis::pedsMax(), PedsFullNoiseAnalysis::pedsMean(), PedsFullNoiseAnalysis::pedsMin(), PedsFullNoiseAnalysis::pedsSpread(), PedsFullNoiseAnalysis::rawMax(), PedsFullNoiseAnalysis::rawMean(), PedsFullNoiseAnalysis::rawMin(), PedsFullNoiseAnalysis::rawSpread(), PedsFullNoiseAnalysis::residualIntegral(), PedsFullNoiseAnalysis::residualIntegralNsigma(), PedsFullNoiseAnalysis::residualKurtosis(), PedsFullNoiseAnalysis::residualRMS(), PedsFullNoiseAnalysis::residualSigmaGaus(), PedsFullNoiseAnalysis::residualSkewness(), PedsFullNoiseAnalysis::shiftedStrip(), and uploadPedsFullNoiseDBTable_.

317  {
318 
319  PedsFullNoiseAnalysis* anal = dynamic_cast<PedsFullNoiseAnalysis*>( analysis->second );
320 
321  if ( !anal ) { return; }
322 
323  SiStripFecKey fec_key( anal->fecKey() );
324  SiStripFedKey fed_key( anal->fedKey() );
325 
326  for ( uint16_t iapv = 0; iapv < 2; ++iapv ) {
327 
328  // Create a description for the standard pedestal analysis
329  PedestalsAnalysisDescription* pedestalDescription;
330  pedestalDescription = new PedestalsAnalysisDescription(
331  anal->deadStripBit()[iapv],
332  anal->badStripBit()[iapv],
333  anal->pedsMean()[iapv],
334  anal->pedsSpread()[iapv],
335  anal->noiseMean()[iapv],
336  anal->noiseSpread()[iapv],
337  anal->rawMean()[iapv],
338  anal->rawSpread()[iapv],
339  anal->pedsMax()[iapv],
340  anal->pedsMin()[iapv],
341  anal->noiseMax()[iapv],
342  anal->noiseMin()[iapv],
343  anal->rawMax()[iapv],
344  anal->rawMin()[iapv],
345  fec_key.fecCrate(),
346  fec_key.fecSlot(),
347  fec_key.fecRing(),
348  fec_key.ccuAddr(),
349  fec_key.ccuChan(),
350  SiStripFecKey::i2cAddr( fec_key.lldChan(), !iapv ),
351  db()->dbParams().partitions().begin()->second.partitionName(),
352  db()->dbParams().partitions().begin()->second.runNumber(),
353  anal->isValid(),
354  "",
355  fed_key.fedId(),
356  fed_key.feUnit(),
357  fed_key.feChan(),
358  fed_key.fedApv()
359  );
360 
361  // Add comments
362  typedef std::vector<std::string> Strings;
363  Strings errors = anal->getErrorCodes();
364  Strings::const_iterator istr = errors.begin();
365  Strings::const_iterator jstr = errors.end();
366  for ( ; istr != jstr; ++istr ) {pedestalDescription->addComments( *istr ); }
367 
368  // Store description
369  desc.push_back(pedestalDescription);
370 
371  // Create description
373  PedsFullNoiseAnalysisDescription* pedsFullNoiseDescription;
374  pedsFullNoiseDescription = new PedsFullNoiseAnalysisDescription(
375  anal->deadStrip()[iapv],
376  anal->badStrip()[iapv],
377  anal->shiftedStrip()[iapv], // bad strip-id within an APV due to offset
378  anal->lowNoiseStrip()[iapv], // bad strip-id within an APV due to noise
379  anal->largeNoiseStrip()[iapv], // bad strip-id within an APV due to noise
380  anal->largeNoiseSignificance()[iapv], // bad strip-id within an APV due to noise significance
381  anal->badFitStatus()[iapv], // bad strip-id within an APV due to fit status
382  anal->badADProbab()[iapv], // bad strip-id within an APV due to AD probab
383  anal->badKSProbab()[iapv], // bad strip-id within an APV due to KS probab
384  anal->badJBProbab()[iapv], // bad strip-id within an APV due to JB probab
385  anal->badChi2Probab()[iapv], // bad strip-id within an APV due to Chi2 probab
386  anal->badTailStrip()[iapv], // bad strip-id within an APV due to tail
387  anal->badDoublePeakStrip()[iapv], // bad strip-id within an APV due to Double peaks
389  anal->adProbab()[iapv], // one value oer strip
390  anal->ksProbab()[iapv], // one value oer strip
391  anal->jbProbab()[iapv], // one value oer strip
392  anal->chi2Probab()[iapv], // one value oer strip
394  anal->residualRMS()[iapv],
395  anal->residualSigmaGaus()[iapv],
396  anal->noiseSignificance()[iapv],
397  anal->residualSkewness()[iapv],
398  anal->residualKurtosis()[iapv],
399  anal->residualIntegralNsigma()[iapv],
400  anal->residualIntegral()[iapv],
402  fec_key.fecCrate(),
403  fec_key.fecSlot(),
404  fec_key.fecRing(),
405  fec_key.ccuAddr(),
406  fec_key.ccuChan(),
407  SiStripFecKey::i2cAddr( fec_key.lldChan(), !iapv ),
408  db()->dbParams().partitions().begin()->second.partitionName(),
409  db()->dbParams().partitions().begin()->second.runNumber(),
410  anal->isValid(),
411  "",
412  fed_key.fedId(),
413  fed_key.feUnit(),
414  fed_key.feChan(),
415  fed_key.fedApv()
416  );
417  istr = errors.begin();
418  jstr = errors.end();
419  for ( ; istr != jstr; ++istr ) {
420  pedsFullNoiseDescription->addComments( *istr );
421  }
422 
423  // Store description
424  desc.push_back(pedsFullNoiseDescription);
425  }
426  }
427 }
const VVInt & lowNoiseStrip() const
const VVInt & badJBProbab() const
const VFloat & rawMean() const
const uint32_t & fedKey() const
const VVFloat & residualKurtosis() const
A container class for generic run and event-related info, information required by the commissioning a...
Definition: SiStripFedKey.h:56
const VVFloat & chi2Probab() const
const VVFloat & residualSkewness() const
std::vector< std::string > Strings
Definition: MsgTools.h:18
const VVInt & badStripBit() const
const VVFloat & ksProbab() const
const VFloat & noiseMax() const
const uint16_t & i2cAddr() const
const VVInt & badADProbab() const
Histogram-based analysis for pedestal run.
Utility class that identifies a position within the strip tracker control structure, down to the level of an APV25.
Definition: SiStripFecKey.h:45
const VVInt & deadStrip() const
const VFloat & noiseMin() const
const_iterator_range partitions() const
const VVFloat & residualIntegralNsigma() const
const VVFloat & adProbab() const
const VFloat & pedsSpread() const
const VFloat & pedsMax() const
const VFloat & pedsMean() const
const VFloat & pedsMin() const
const VVInt & badChi2Probab() const
const uint32_t & fecKey() const
const VFloat & rawMin() const
const VFloat & rawSpread() const
const VVInt & deadStripBit() const
const VVInt & shiftedStrip() const
const VVInt & badKSProbab() const
const VFloat & rawMax() const
const VVInt & badDoublePeakStrip() const
const VVFloat & jbProbab() const
const VVFloat & noiseSignificance() const
const SiStripDbParams & dbParams() const
const VVFloat & residualSigmaGaus() const
const VVFloat & residualIntegral() const
const VVFloat & residualRMS() const
const VVInt & largeNoiseSignificance() const
const VVInt & badTailStrip() const
Definition: errors.py:1
SiStripConfigDb *const db() const
const VVInt & largeNoiseStrip() const
const VFloat & noiseSpread() const
const VString & getErrorCodes() const
const VVInt & badFitStatus() const
const VFloat & noiseMean() const
bool isValid() const override
const VVInt & badStrip() const
void PedsFullNoiseHistosUsingDb::update ( SiStripConfigDb::FedDescriptionsRange  feds)
private

Definition at line 101 of file PedsFullNoiseHistosUsingDb.cc.

References allowSelectiveUpload_, sistrip::APVS_PER_FEDCH, PedsFullNoiseAnalysis::badStrip(), CommissioningHistosUsingDb::cabling(), FedChannelConnection::ccuAddr(), FedChannelConnection::ccuChan(), CommissioningHistograms::data(), PedsFullNoiseAnalysis::deadStrip(), TauDecayModes::dec, CommissioningHistosUsingDb::deviceIsPresent(), disableBadStrips_, FedChannelConnection::fecCrate(), SiStripFedKey::feChan(), FedChannelConnection::fecRing(), FedChannelConnection::fecSlot(), FedChannelConnection::fedCh(), sistrip::FEDCH_PER_FED, SiStripFedKey::fedChannel(), SiStripFedCabling::fedConnection(), SiStripFedKey::fedId(), FedChannelConnection::fedId(), CommissioningAnalysis::fedKey(), SiStripFedKey::feUnit(), spr::find(), highThreshold_, sistrip::invalid_, edm::isDebugEnabled(), keepStripsDisabled_, SiStripKey::key(), FedChannelConnection::lldChannel(), LogTrace, lowThreshold_, sistrip::mlDqmClient_, PedsFullNoiseAnalysis::noise(), PedsFullNoiseAnalysis::peds(), PedsFullNoiseAnalysis::pedsMin(), skipEmptyStrips_, groupFilesInBlocks::temp, and uploadOnlyStripBadChannelBit_.

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(), Vispa.Gui.PortConnection.PointToPointConnection::updateConnection(), and uploadConfigurations().

101  {
102 
103  // Iterate through feds and update fed descriptions
104  uint16_t updated = 0;
105  SiStripConfigDb::FedDescriptionsV::const_iterator ifed;
106 
107  for ( ifed = feds.begin(); ifed != feds.end(); ifed++ ) { // Loop on the FED for this partition
108 
109  for ( uint16_t ichan = 0; ichan < sistrip::FEDCH_PER_FED; ichan++ ) {
110  // Build FED and FEC keys from the cabling object i.e. checking if there is a connection
111  const FedChannelConnection& conn = cabling()->fedConnection( (*ifed)->getFedId(), ichan );
112  if ( conn.fecCrate() == sistrip::invalid_ ||
113  conn.fecSlot() == sistrip::invalid_ ||
114  conn.fecRing() == sistrip::invalid_ ||
115  conn.ccuAddr() == sistrip::invalid_ ||
116  conn.ccuChan() == sistrip::invalid_ ||
117  conn.lldChannel() == sistrip::invalid_ )
118  continue;
119 
120  // build the FED and FEC key from the connection object
121  SiStripFedKey fed_key( conn.fedId(),
122  SiStripFedKey::feUnit( conn.fedCh() ),
123  SiStripFedKey::feChan( conn.fedCh() ) );
124 
125  SiStripFecKey fec_key( conn.fecCrate(),
126  conn.fecSlot(),
127  conn.fecRing(),
128  conn.ccuAddr(),
129  conn.ccuChan(),
130  conn.lldChannel() );
131 
132  // Locate appropriate analysis object --> based on FEC keys cause they are per lldChannel
133  Analyses::const_iterator iter = data(allowSelectiveUpload_).find( fec_key.key() );
134  if ( iter != data(allowSelectiveUpload_).end() ) {
135 
136  PedsFullNoiseAnalysis* anal = dynamic_cast<PedsFullNoiseAnalysis*>( iter->second );
137 
138  if ( !anal ) {
140  << "[PedsFullNoiseHistosUsingDb::" << __func__ << "]"
141  << " NULL pointer to analysis object!";
142  continue;
143  }
144 
145  // Determine the pedestal shift to apply --> this is standard in the pedestal paylaod to avoid loss of signal from common-mode subtraction
146  uint32_t pedshift = 127;
147  for ( uint16_t iapv = 0; iapv < sistrip::APVS_PER_FEDCH; iapv++ ) {
148  uint32_t pedmin = (uint32_t) anal->pedsMin()[iapv];
149  pedshift = pedmin < pedshift ? pedmin : pedshift;
150  }
151 
152  // Iterate through APVs and strips
153  for ( uint16_t iapv = 0; iapv < sistrip::APVS_PER_FEDCH; iapv++ ) {
154  for ( uint16_t istr = 0; istr < anal->peds()[iapv].size(); istr++ ) { // Loop on the pedestal for each APV
155 
156  if ( not uploadOnlyStripBadChannelBit_ and anal->peds()[iapv][istr] < 1. ) { //@@ ie, zero
158  << "[PedestalsHistosUsingDb::" << __func__ << "]"
159  << " Skipping ZERO pedestal value (ie, NO UPLOAD TO DB!) for FedKey/Id/Ch: "
160  << hex << setw(8) << setfill('0') << fed_key.key() << dec << "/"
161  << (*ifed)->getFedId() << "/"
162  << ichan
163  << " and device with FEC/slot/ring/CCU/LLD "
164  << fec_key.fecCrate() << "/"
165  << fec_key.fecSlot() << "/"
166  << fec_key.fecRing() << "/"
167  << fec_key.ccuAddr() << "/"
168  << fec_key.ccuChan() << "/"
169  << fec_key.channel();
170  continue; //@@ do not upload
171  }
172 
173  // get the information on the strip as it was on the db
174  Fed9U::Fed9UAddress addr( ichan, iapv, istr );
175  Fed9U::Fed9UStripDescription temp = (*ifed)->getFedStrips().getStrip( addr );
176 
177  // determine whether we need to disable the strip
178  bool disableStrip = false;
179  std::stringstream ss_disable;
180 
181  if(temp.getDisable()) { // strip already disabled in the database
182  ss_disable<<"Already Disabled: "<<conn.fecCrate()
183  <<" "<<conn.fecSlot()
184  <<" "<<conn.fecRing()
185  <<" "<<conn.ccuAddr()
186  <<" "<<conn.ccuChan()
187  <<" "<<conn.lldChannel()
188  <<" "<<iapv<<" "<<istr<<std::endl;
189  if(keepStripsDisabled_) disableStrip = true; // in case one wants to keep them disabled
190  }
191 
192  // to disable new strips
193  if(disableBadStrips_){
194  SiStripFedKey fed_key(anal->fedKey());
195  PedsFullNoiseAnalysis::VInt dead = anal->deadStrip()[iapv];
196  if (not skipEmptyStrips_ and // if one don't want to skip dead strips
197  find( dead.begin(), dead.end(), istr ) != dead.end() ) {
198  disableStrip = true;
199  ss_disable<<"Disabling Dead Strip: "<<conn.fecCrate()
200  <<" "<<conn.fecSlot()
201  <<" "<<conn.fecRing()
202  <<" "<<conn.ccuAddr()
203  <<" "<<conn.ccuChan()
204  <<" "<<conn.lldChannel()
205  <<" "<<iapv<<" "<<istr<<std::endl;
206  }
207 
208  PedsFullNoiseAnalysis::VInt badcChan = anal->badStrip()[iapv]; // new feature --> this is the sample of the whole bad strips from the analysis
209  if(not disableStrip){
210  if ( find( badcChan.begin(), badcChan.end(), istr ) != badcChan.end() ) {
211  disableStrip = true;
212  ss_disable<<"Disabling Bad strip: "<<conn.fecCrate()
213  <<" "<<conn.fecSlot()
214  <<" "<<conn.fecRing()
215  <<" "<<conn.ccuAddr()
216  <<" "<<conn.ccuChan()
217  <<" "<<conn.lldChannel()
218  <<" "<<iapv<<" "<<istr<<std::endl;
219 
220  }
221  }
222  }
223 
224  if(edm::isDebugEnabled())
225  LogTrace(mlDqmClient_) << ss_disable.str();
226 
227  uint32_t pedestalVal = 0;
228  float noiseVal = 0;
229  float lowThr = 0;
230  float highThr = 0;
231 
232  // download the previous pedestal/noise payload from the DB
234  pedestalVal = static_cast<uint32_t>(temp.getPedestal());
235  noiseVal = static_cast<float>(temp.getNoise());
236  lowThr = static_cast<float>(temp.getLowThresholdFactor());
237  highThr = static_cast<float>(temp.getHighThresholdFactor());
238  }
239  else{
240  pedestalVal = static_cast<uint32_t>(anal->peds()[iapv][istr]-pedshift);
241  noiseVal = anal->noise()[iapv][istr];
242  lowThr = lowThreshold_;
243  highThr = highThreshold_;
244  }
245 
247  Fed9U::Fed9UStripDescription data(pedestalVal,highThr,lowThr,noiseVal,disableStrip);
248 
249  std::stringstream ss;
250  if ( data.getDisable() && edm::isDebugEnabled() ) {
251  ss << "[PedsFullNoiseHistosUsingDb::" << __func__ << "]"
252  << " Disabling strip in Fed9UStripDescription object..." << std::endl
253  << " for FED id/channel and APV/strip : "
254  << fed_key.fedId() << "/"
255  << fed_key.fedChannel() << " "
256  << iapv << "/"
257  << istr << std::endl
258  << " and crate/FEC/ring/CCU/module : "
259  << fec_key.fecCrate() << "/"
260  << fec_key.fecSlot() << "/"
261  << fec_key.fecRing() << "/"
262  << fec_key.ccuAddr() << "/"
263  << fec_key.ccuChan() << std::endl
264  << " from ped/noise/high/low/disable : "
265  << static_cast<uint32_t>( temp.getPedestal() ) << "/"
266  << static_cast<float>( temp.getHighThresholdFactor() ) << "/"
267  << static_cast<float>( temp.getLowThresholdFactor() ) << "/"
268  << static_cast<float>( temp.getNoise() ) << "/"
269  << static_cast<uint16_t>( temp.getDisable() ) << std::endl;
270  }
271 
272  (*ifed)->getFedStrips().setStrip( addr, data );
273 
274  if ( data.getDisable() && edm::isDebugEnabled() ) {
275  ss << " to ped/noise/high/low/disable : "
276  << static_cast<uint32_t>( data.getPedestal() ) << "/"
277  << static_cast<float>( data.getHighThresholdFactor() ) << "/"
278  << static_cast<float>( data.getLowThresholdFactor() ) << "/"
279  << static_cast<float>( data.getNoise() ) << "/"
280  << static_cast<uint16_t>( data.getDisable() ) << std::endl;
281  LogTrace(mlDqmClient_) << ss.str();
282  }
283  } // end loop on strips
284  } // end loop on apvs
285  updated++;
286  }
287  else { // device not found in the analysis
288  if ( deviceIsPresent(fec_key) ) {
290  << "[PedsFullNoiseHistosUsingDb::" << __func__ << "]"
291  << " Unable to find pedestals/noise for FedKey/Id/Ch: "
292  << hex << setw(8) << setfill('0') << fed_key.key() << dec << "/"
293  << (*ifed)->getFedId() << "/"
294  << ichan
295  << " and device with FEC/slot/ring/CCU/LLD "
296  << fec_key.fecCrate() << "/"
297  << fec_key.fecSlot() << "/"
298  << fec_key.fecRing() << "/"
299  << fec_key.ccuAddr() << "/"
300  << fec_key.ccuChan() << "/"
301  << fec_key.channel();
302  }
303  }
304  }
305  }
306 
308  << "[PedsFullNoiseHistosUsingDb::" << __func__ << "]"
309  << " Updated FED pedestals/noise for "
310  << updated << " channels";
311 
312 }
const uint16_t & fecSlot() const
bool isDebugEnabled()
const uint16_t & fecCrate() const
const uint32_t & fedKey() const
Analyses & data(bool getMaskedData=false)
FedChannelConnection fedConnection(uint16_t fed_id, uint16_t fed_ch) const
A container class for generic run and event-related info, information required by the commissioning a...
Definition: SiStripFedKey.h:56
const uint16_t & fedCh() const
bool deviceIsPresent(const SiStripFecKey &)
static const char mlDqmClient_[]
const VVFloat & peds() const
uint16_t lldChannel() const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
const uint16_t & fedId() const
Histogram-based analysis for pedestal run.
Utility class that identifies a position within the strip tracker control structure, down to the level of an APV25.
Definition: SiStripFecKey.h:45
const VVInt & deadStrip() const
const uint16_t & fecRing() const
Class containning control, module, detector and connection information, at the level of a FED channel...
const uint16_t & ccuChan() const
const VFloat & pedsMin() const
const uint16_t & ccuAddr() const
#define LogTrace(id)
std::vector< uint16_t > VInt
const VVFloat & noise() const
const uint16_t & feUnit() const
static const uint16_t invalid_
Definition: Constants.h:16
static const uint16_t FEDCH_PER_FED
const uint16_t & feChan() const
SiStripFedCabling *const cabling() const
static const uint16_t APVS_PER_FEDCH
const VVInt & badStrip() const
void PedsFullNoiseHistosUsingDb::uploadConfigurations ( )
overridevirtual

Reimplemented from CommissioningHistosUsingDb.

Definition at line 63 of file PedsFullNoiseHistosUsingDb.cc.

References CommissioningHistosUsingDb::db(), CommissioningHistosUsingDb::doUploadConf(), SiStripConfigDb::getFedDescriptions(), LogTrace, sistrip::mlDqmClient_, update(), and SiStripConfigDb::uploadFedDescriptions().

63  {
64 
66  << "[PedsFullNoiseHistosUsingDb::" << __func__ << "]";
67 
68  if ( !db() ) {
70  << "[PedsFullNoiseHistosUsingDb::" << __func__ << "]"
71  << " NULL pointer to SiStripConfigDb interface!"
72  << " Aborting upload...";
73  return;
74  }
75 
76  // Update FED descriptions with new peds/noise values
78  update( feds );
79  if (doUploadConf()) { // check whether the upload HD config is set to true
80 
82  << "[PedsFullNoiseHistosUsingDb::" << __func__ << "]"
83  << " Uploading pedestals/noise to DB...";
84 
85  db()->uploadFedDescriptions(); // change the FED version
86 
88  << "[PedsFullNoiseHistosUsingDb::" << __func__ << "]"
89  << " Completed database upload of " << feds.size()
90  << " FED descriptions!";
91  }
92  else {
94  << "[PedsFullNoiseHistosUsingDb::" << __func__ << "]"
95  << " TEST! No pedestals/noise values will be uploaded to DB...";
96  }
97 }
void update(SiStripConfigDb::FedDescriptionsRange)
FedDescriptionsRange getFedDescriptions(std::string partition="")
FedDescriptions::range FedDescriptionsRange
static const char mlDqmClient_[]
#define LogTrace(id)
void uploadFedDescriptions(std::string partition="")
SiStripConfigDb *const db() const

Member Data Documentation

bool PedsFullNoiseHistosUsingDb::allowSelectiveUpload_
private

Definition at line 35 of file PedsFullNoiseHistosUsingDb.h.

Referenced by PedsFullNoiseHistosUsingDb(), and update().

bool PedsFullNoiseHistosUsingDb::disableBadStrips_
private

Definition at line 29 of file PedsFullNoiseHistosUsingDb.h.

Referenced by PedsFullNoiseHistosUsingDb(), and update().

float PedsFullNoiseHistosUsingDb::highThreshold_
private

Definition at line 27 of file PedsFullNoiseHistosUsingDb.h.

Referenced by PedsFullNoiseHistosUsingDb(), and update().

bool PedsFullNoiseHistosUsingDb::keepStripsDisabled_
private

Definition at line 30 of file PedsFullNoiseHistosUsingDb.h.

Referenced by PedsFullNoiseHistosUsingDb(), and update().

float PedsFullNoiseHistosUsingDb::lowThreshold_
private

Definition at line 28 of file PedsFullNoiseHistosUsingDb.h.

Referenced by PedsFullNoiseHistosUsingDb(), and update().

bool PedsFullNoiseHistosUsingDb::skipEmptyStrips_
private

Definition at line 31 of file PedsFullNoiseHistosUsingDb.h.

Referenced by PedsFullNoiseHistosUsingDb(), and update().

bool PedsFullNoiseHistosUsingDb::uploadOnlyStripBadChannelBit_
private

Definition at line 32 of file PedsFullNoiseHistosUsingDb.h.

Referenced by PedsFullNoiseHistosUsingDb(), and update().

bool PedsFullNoiseHistosUsingDb::uploadPedsFullNoiseDBTable_
private

Definition at line 38 of file PedsFullNoiseHistosUsingDb.h.

Referenced by create(), and PedsFullNoiseHistosUsingDb().