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 dqm::harvesting::DQMStore DQMStore
 
typedef SummaryPlotFactory< CommissioningAnalysis * > Factory
 
typedef std::map< uint32_t, uint32_t > FedToFecMap
 
typedef std::vector< Histo * > Histos
 
typedef std::map< uint32_t, HistosHistosMap
 
typedef dqm::harvesting::MonitorElement MonitorElement
 
- 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_.

18  pset.getParameter<edm::ParameterSet>("PedsFullNoiseParameters"), bei, sistrip::PEDS_FULL_NOISE),
20  PedsFullNoiseHistograms(pset.getParameter<edm::ParameterSet>("PedsFullNoiseParameters"), bei) {
21  LogTrace(mlDqmClient_) << "[PedsFullNoiseHistosUsingDb::" << __func__ << "]"
22  << " Constructing object...";
23 
24  highThreshold_ = this->pset().getParameter<double>("HighThreshold");
25  lowThreshold_ = this->pset().getParameter<double>("LowThreshold");
26 
27  LogTrace(mlDqmClient_) << "[PedsFullNoiseHistosUsingDb::" << __func__ << "]"
28  << " Set FED zero suppression high/low threshold to " << highThreshold_ << "/"
29  << lowThreshold_;
30 
31  disableBadStrips_ = this->pset().getParameter<bool>("DisableBadStrips");
32  keepStripsDisabled_ = this->pset().getParameter<bool>("KeepStripsDisabled");
33  skipEmptyStrips_ = this->pset().getParameter<bool>("SkipEmptyStrips");
34  uploadOnlyStripBadChannelBit_ = this->pset().getParameter<bool>("UploadOnlyStripBadChannelBit");
35  uploadPedsFullNoiseDBTable_ = this->pset().getParameter<bool>("UploadPedsFullNoiseDBTable");
36 
37  LogTrace(mlDqmClient_) << "[PedestalsHistosUsingDb::" << __func__ << "]"
38  << " Disabling strips: " << disableBadStrips_
39  << " ; keeping previously disabled strips: " << keepStripsDisabled_
40  << " ; skip strips with no data: " << skipEmptyStrips_
41  << " ; upload only bad channel bit: " << uploadOnlyStripBadChannelBit_;
42 
44  this->pset().existsAs<bool>("doSelectiveUpload") ? this->pset().getParameter<bool>("doSelectiveUpload") : false;
45  LogTrace(mlDqmClient_) << "[PedestalsHistosUsingDb::" << __func__ << "]"
46  << " Selective upload of modules set to : " << allowSelectiveUpload_;
47 }
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:160
const edm::ParameterSet & pset() const
static const char mlDqmClient_[]
PedsFullNoiseHistograms(const edm::ParameterSet &pset, DQMStore *)
DQMStore *const bei() const
#define LogTrace(id)
PedsFullNoiseHistosUsingDb::~PedsFullNoiseHistosUsingDb ( )
override

Definition at line 51 of file PedsFullNoiseHistosUsingDb.cc.

References LogTrace, and sistrip::mlDqmClient_.

51  {
52  LogTrace(mlDqmClient_) << "[PedsFullNoiseHistosUsingDb::" << __func__ << "]"
53  << " Destructing object...";
54 }
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 251 of file PedsFullNoiseHistosUsingDb.cc.

References PedsFullNoiseAnalysis::adProbab(), conversion_template_cfg::anal, 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_.

251  {
252  PedsFullNoiseAnalysis* anal = dynamic_cast<PedsFullNoiseAnalysis*>(analysis->second);
253 
254  if (!anal) {
255  return;
256  }
257 
258  SiStripFecKey fec_key(anal->fecKey());
259  SiStripFedKey fed_key(anal->fedKey());
260 
261  for (uint16_t iapv = 0; iapv < 2; ++iapv) {
262  // Create a description for the standard pedestal analysis
263  PedestalsAnalysisDescription* pedestalDescription;
264  pedestalDescription =
265  new PedestalsAnalysisDescription(anal->deadStripBit()[iapv],
266  anal->badStripBit()[iapv],
267  anal->pedsMean()[iapv],
268  anal->pedsSpread()[iapv],
269  anal->noiseMean()[iapv],
270  anal->noiseSpread()[iapv],
271  anal->rawMean()[iapv],
272  anal->rawSpread()[iapv],
273  anal->pedsMax()[iapv],
274  anal->pedsMin()[iapv],
275  anal->noiseMax()[iapv],
276  anal->noiseMin()[iapv],
277  anal->rawMax()[iapv],
278  anal->rawMin()[iapv],
279  fec_key.fecCrate(),
280  fec_key.fecSlot(),
281  fec_key.fecRing(),
282  fec_key.ccuAddr(),
283  fec_key.ccuChan(),
284  SiStripFecKey::i2cAddr(fec_key.lldChan(), !iapv),
285  db()->dbParams().partitions().begin()->second.partitionName(),
286  db()->dbParams().partitions().begin()->second.runNumber(),
287  anal->isValid(),
288  "",
289  fed_key.fedId(),
290  fed_key.feUnit(),
291  fed_key.feChan(),
292  fed_key.fedApv());
293 
294  // Add comments
295  typedef std::vector<std::string> Strings;
296  Strings errors = anal->getErrorCodes();
297  Strings::const_iterator istr = errors.begin();
298  Strings::const_iterator jstr = errors.end();
299  for (; istr != jstr; ++istr) {
300  pedestalDescription->addComments(*istr);
301  }
302 
303  // Store description
304  desc.push_back(pedestalDescription);
305 
306  // Create description
308  PedsFullNoiseAnalysisDescription* pedsFullNoiseDescription;
309  pedsFullNoiseDescription = new PedsFullNoiseAnalysisDescription(
310  anal->deadStrip()[iapv],
311  anal->badStrip()[iapv],
312  anal->shiftedStrip()[iapv], // bad strip-id within an APV due to offset
313  anal->lowNoiseStrip()[iapv], // bad strip-id within an APV due to noise
314  anal->largeNoiseStrip()[iapv], // bad strip-id within an APV due to noise
315  anal->largeNoiseSignificance()[iapv], // bad strip-id within an APV due to noise significance
316  anal->badFitStatus()[iapv], // bad strip-id within an APV due to fit status
317  anal->badADProbab()[iapv], // bad strip-id within an APV due to AD probab
318  anal->badKSProbab()[iapv], // bad strip-id within an APV due to KS probab
319  anal->badJBProbab()[iapv], // bad strip-id within an APV due to JB probab
320  anal->badChi2Probab()[iapv], // bad strip-id within an APV due to Chi2 probab
321  anal->badTailStrip()[iapv], // bad strip-id within an APV due to tail
322  anal->badDoublePeakStrip()[iapv], // bad strip-id within an APV due to Double peaks
324  anal->adProbab()[iapv], // one value oer strip
325  anal->ksProbab()[iapv], // one value oer strip
326  anal->jbProbab()[iapv], // one value oer strip
327  anal->chi2Probab()[iapv], // one value oer strip
329  anal->residualRMS()[iapv],
330  anal->residualSigmaGaus()[iapv],
331  anal->noiseSignificance()[iapv],
332  anal->residualSkewness()[iapv],
333  anal->residualKurtosis()[iapv],
334  anal->residualIntegralNsigma()[iapv],
335  anal->residualIntegral()[iapv],
337  fec_key.fecCrate(),
338  fec_key.fecSlot(),
339  fec_key.fecRing(),
340  fec_key.ccuAddr(),
341  fec_key.ccuChan(),
342  SiStripFecKey::i2cAddr(fec_key.lldChan(), !iapv),
343  db()->dbParams().partitions().begin()->second.partitionName(),
344  db()->dbParams().partitions().begin()->second.runNumber(),
345  anal->isValid(),
346  "",
347  fed_key.fedId(),
348  fed_key.feUnit(),
349  fed_key.feChan(),
350  fed_key.fedApv());
351  istr = errors.begin();
352  jstr = errors.end();
353  for (; istr != jstr; ++istr) {
354  pedsFullNoiseDescription->addComments(*istr);
355  }
356 
357  // Store description
358  desc.push_back(pedsFullNoiseDescription);
359  }
360  }
361 }
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 88 of file PedsFullNoiseHistosUsingDb.cc.

References generateTowerEtThresholdLUT::addr, allowSelectiveUpload_, conversion_template_cfg::anal, sistrip::APVS_PER_FEDCH, PedsFullNoiseAnalysis::badStrip(), CommissioningHistosUsingDb::cabling(), FedChannelConnection::ccuAddr(), FedChannelConnection::ccuChan(), SiStripCommissioningClient_cfg::conn, 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_, contentValuesCheck::ss, 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().

88  {
89  // Iterate through feds and update fed descriptions
90  uint16_t updated = 0;
91  SiStripConfigDb::FedDescriptionsV::const_iterator ifed;
92 
93  for (ifed = feds.begin(); ifed != feds.end(); ifed++) { // Loop on the FED for this partition
94 
95  for (uint16_t ichan = 0; ichan < sistrip::FEDCH_PER_FED; ichan++) {
96  // Build FED and FEC keys from the cabling object i.e. checking if there is a connection
97  const FedChannelConnection& conn = cabling()->fedConnection((*ifed)->getFedId(), ichan);
98  if (conn.fecCrate() == sistrip::invalid_ || conn.fecSlot() == sistrip::invalid_ ||
99  conn.fecRing() == sistrip::invalid_ || conn.ccuAddr() == sistrip::invalid_ ||
100  conn.ccuChan() == sistrip::invalid_ || conn.lldChannel() == sistrip::invalid_)
101  continue;
102 
103  // build the FED and FEC key from the connection object
104  SiStripFedKey fed_key(conn.fedId(), SiStripFedKey::feUnit(conn.fedCh()), SiStripFedKey::feChan(conn.fedCh()));
105 
106  SiStripFecKey fec_key(
107  conn.fecCrate(), conn.fecSlot(), conn.fecRing(), conn.ccuAddr(), conn.ccuChan(), conn.lldChannel());
108 
109  // Locate appropriate analysis object --> based on FEC keys cause they are per lldChannel
110  Analyses::const_iterator iter = data(allowSelectiveUpload_).find(fec_key.key());
111  if (iter != data(allowSelectiveUpload_).end()) {
112  PedsFullNoiseAnalysis* anal = dynamic_cast<PedsFullNoiseAnalysis*>(iter->second);
113 
114  if (!anal) {
115  edm::LogError(mlDqmClient_) << "[PedsFullNoiseHistosUsingDb::" << __func__ << "]"
116  << " NULL pointer to analysis object!";
117  continue;
118  }
119 
120  // Determine the pedestal shift to apply --> this is standard in the pedestal paylaod to avoid loss of signal from common-mode subtraction
121  uint32_t pedshift = 127;
122  for (uint16_t iapv = 0; iapv < sistrip::APVS_PER_FEDCH; iapv++) {
123  uint32_t pedmin = (uint32_t)anal->pedsMin()[iapv];
124  pedshift = pedmin < pedshift ? pedmin : pedshift;
125  }
126 
127  // Iterate through APVs and strips
128  for (uint16_t iapv = 0; iapv < sistrip::APVS_PER_FEDCH; iapv++) {
129  for (uint16_t istr = 0; istr < anal->peds()[iapv].size(); istr++) { // Loop on the pedestal for each APV
130 
131  if (not uploadOnlyStripBadChannelBit_ and anal->peds()[iapv][istr] < 1.) { //@@ ie, zero
133  << "[PedestalsHistosUsingDb::" << __func__ << "]"
134  << " Skipping ZERO pedestal value (ie, NO UPLOAD TO DB!) for FedKey/Id/Ch: " << hex << setw(8)
135  << setfill('0') << fed_key.key() << dec << "/" << (*ifed)->getFedId() << "/" << ichan
136  << " and device with FEC/slot/ring/CCU/LLD " << fec_key.fecCrate() << "/" << fec_key.fecSlot() << "/"
137  << fec_key.fecRing() << "/" << fec_key.ccuAddr() << "/" << fec_key.ccuChan() << "/"
138  << fec_key.channel();
139  continue; //@@ do not upload
140  }
141 
142  // get the information on the strip as it was on the db
143  Fed9U::Fed9UAddress addr(ichan, iapv, istr);
144  Fed9U::Fed9UStripDescription temp = (*ifed)->getFedStrips().getStrip(addr);
145 
146  // determine whether we need to disable the strip
147  bool disableStrip = false;
148  std::stringstream ss_disable;
149 
150  if (temp.getDisable()) { // strip already disabled in the database
151  ss_disable << "Already Disabled: " << conn.fecCrate() << " " << conn.fecSlot() << " " << conn.fecRing()
152  << " " << conn.ccuAddr() << " " << conn.ccuChan() << " " << conn.lldChannel() << " " << iapv
153  << " " << istr << std::endl;
155  disableStrip = true; // in case one wants to keep them disabled
156  }
157 
158  // to disable new strips
159  if (disableBadStrips_) {
160  SiStripFedKey fed_key(anal->fedKey());
161  PedsFullNoiseAnalysis::VInt dead = anal->deadStrip()[iapv];
162  if (not skipEmptyStrips_ and // if one don't want to skip dead strips
163  find(dead.begin(), dead.end(), istr) != dead.end()) {
164  disableStrip = true;
165  ss_disable << "Disabling Dead Strip: " << conn.fecCrate() << " " << conn.fecSlot() << " "
166  << conn.fecRing() << " " << conn.ccuAddr() << " " << conn.ccuChan() << " "
167  << conn.lldChannel() << " " << iapv << " " << istr << std::endl;
168  }
169 
170  PedsFullNoiseAnalysis::VInt badcChan =
171  anal->badStrip()[iapv]; // new feature --> this is the sample of the whole bad strips from the analysis
172  if (not disableStrip) {
173  if (find(badcChan.begin(), badcChan.end(), istr) != badcChan.end()) {
174  disableStrip = true;
175  ss_disable << "Disabling Bad strip: " << conn.fecCrate() << " " << conn.fecSlot() << " "
176  << conn.fecRing() << " " << conn.ccuAddr() << " " << conn.ccuChan() << " "
177  << conn.lldChannel() << " " << iapv << " " << istr << std::endl;
178  }
179  }
180  }
181 
182  if (edm::isDebugEnabled())
183  LogTrace(mlDqmClient_) << ss_disable.str();
184 
185  uint32_t pedestalVal = 0;
186  float noiseVal = 0;
187  float lowThr = 0;
188  float highThr = 0;
189 
190  // download the previous pedestal/noise payload from the DB
192  pedestalVal = static_cast<uint32_t>(temp.getPedestal());
193  noiseVal = static_cast<float>(temp.getNoise());
194  lowThr = static_cast<float>(temp.getLowThresholdFactor());
195  highThr = static_cast<float>(temp.getHighThresholdFactor());
196  } else {
197  pedestalVal = static_cast<uint32_t>(anal->peds()[iapv][istr] - pedshift);
198  noiseVal = anal->noise()[iapv][istr];
199  lowThr = lowThreshold_;
200  highThr = highThreshold_;
201  }
202 
204  Fed9U::Fed9UStripDescription data(pedestalVal, highThr, lowThr, noiseVal, disableStrip);
205 
206  std::stringstream ss;
207  if (data.getDisable() && edm::isDebugEnabled()) {
208  ss << "[PedsFullNoiseHistosUsingDb::" << __func__ << "]"
209  << " Disabling strip in Fed9UStripDescription object..." << std::endl
210  << " for FED id/channel and APV/strip : " << fed_key.fedId() << "/" << fed_key.fedChannel() << " "
211  << iapv << "/" << istr << std::endl
212  << " and crate/FEC/ring/CCU/module : " << fec_key.fecCrate() << "/" << fec_key.fecSlot() << "/"
213  << fec_key.fecRing() << "/" << fec_key.ccuAddr() << "/" << fec_key.ccuChan() << std::endl
214  << " from ped/noise/high/low/disable : " << static_cast<uint32_t>(temp.getPedestal()) << "/"
215  << static_cast<float>(temp.getHighThresholdFactor()) << "/"
216  << static_cast<float>(temp.getLowThresholdFactor()) << "/" << static_cast<float>(temp.getNoise())
217  << "/" << static_cast<uint16_t>(temp.getDisable()) << std::endl;
218  }
219 
220  (*ifed)->getFedStrips().setStrip(addr, data);
221 
222  if (data.getDisable() && edm::isDebugEnabled()) {
223  ss << " to ped/noise/high/low/disable : " << static_cast<uint32_t>(data.getPedestal()) << "/"
224  << static_cast<float>(data.getHighThresholdFactor()) << "/"
225  << static_cast<float>(data.getLowThresholdFactor()) << "/" << static_cast<float>(data.getNoise())
226  << "/" << static_cast<uint16_t>(data.getDisable()) << std::endl;
227  LogTrace(mlDqmClient_) << ss.str();
228  }
229  } // end loop on strips
230  } // end loop on apvs
231  updated++;
232  } else { // device not found in the analysis
233  if (deviceIsPresent(fec_key)) {
234  edm::LogWarning(mlDqmClient_) << "[PedsFullNoiseHistosUsingDb::" << __func__ << "]"
235  << " Unable to find pedestals/noise for FedKey/Id/Ch: " << hex << setw(8)
236  << setfill('0') << fed_key.key() << dec << "/" << (*ifed)->getFedId() << "/"
237  << ichan << " and device with FEC/slot/ring/CCU/LLD " << fec_key.fecCrate()
238  << "/" << fec_key.fecSlot() << "/" << fec_key.fecRing() << "/"
239  << fec_key.ccuAddr() << "/" << fec_key.ccuChan() << "/" << fec_key.channel();
240  }
241  }
242  }
243  }
244 
245  edm::LogVerbatim(mlDqmClient_) << "[PedsFullNoiseHistosUsingDb::" << __func__ << "]"
246  << " Updated FED pedestals/noise for " << updated << " channels";
247 }
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:19
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 58 of file PedsFullNoiseHistosUsingDb.cc.

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

58  {
59  LogTrace(mlDqmClient_) << "[PedsFullNoiseHistosUsingDb::" << __func__ << "]";
60 
61  if (!db()) {
62  edm::LogError(mlDqmClient_) << "[PedsFullNoiseHistosUsingDb::" << __func__ << "]"
63  << " NULL pointer to SiStripConfigDb interface!"
64  << " Aborting upload...";
65  return;
66  }
67 
68  // Update FED descriptions with new peds/noise values
70  update(feds);
71  if (doUploadConf()) { // check whether the upload HD config is set to true
72 
73  edm::LogVerbatim(mlDqmClient_) << "[PedsFullNoiseHistosUsingDb::" << __func__ << "]"
74  << " Uploading pedestals/noise to DB...";
75 
76  db()->uploadFedDescriptions(); // change the FED version
77 
78  edm::LogVerbatim(mlDqmClient_) << "[PedsFullNoiseHistosUsingDb::" << __func__ << "]"
79  << " Completed database upload of " << feds.size() << " FED descriptions!";
80  } else {
81  edm::LogWarning(mlDqmClient_) << "[PedsFullNoiseHistosUsingDb::" << __func__ << "]"
82  << " TEST! No pedestals/noise values will be uploaded to DB...";
83  }
84 }
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 30 of file PedsFullNoiseHistosUsingDb.h.

Referenced by PedsFullNoiseHistosUsingDb(), and update().

bool PedsFullNoiseHistosUsingDb::disableBadStrips_
private

Definition at line 24 of file PedsFullNoiseHistosUsingDb.h.

Referenced by PedsFullNoiseHistosUsingDb(), and update().

float PedsFullNoiseHistosUsingDb::highThreshold_
private

Definition at line 22 of file PedsFullNoiseHistosUsingDb.h.

Referenced by PedsFullNoiseHistosUsingDb(), and update().

bool PedsFullNoiseHistosUsingDb::keepStripsDisabled_
private

Definition at line 25 of file PedsFullNoiseHistosUsingDb.h.

Referenced by PedsFullNoiseHistosUsingDb(), and update().

float PedsFullNoiseHistosUsingDb::lowThreshold_
private

Definition at line 23 of file PedsFullNoiseHistosUsingDb.h.

Referenced by PedsFullNoiseHistosUsingDb(), and update().

bool PedsFullNoiseHistosUsingDb::skipEmptyStrips_
private

Definition at line 26 of file PedsFullNoiseHistosUsingDb.h.

Referenced by PedsFullNoiseHistosUsingDb(), and update().

bool PedsFullNoiseHistosUsingDb::uploadOnlyStripBadChannelBit_
private

Definition at line 27 of file PedsFullNoiseHistosUsingDb.h.

Referenced by PedsFullNoiseHistosUsingDb(), and update().

bool PedsFullNoiseHistosUsingDb::uploadPedsFullNoiseDBTable_
private

Definition at line 33 of file PedsFullNoiseHistosUsingDb.h.

Referenced by create(), and PedsFullNoiseHistosUsingDb().