CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions
NoiseHistosUsingDb Class Reference

#include <NoiseHistosUsingDb.h>

Inheritance diagram for NoiseHistosUsingDb:
CommissioningHistosUsingDb NoiseHistograms CommissioningHistograms CommissioningHistograms

Public Member Functions

 NoiseHistosUsingDb (const edm::ParameterSet &pset, DQMStore *, SiStripConfigDb *const)
 
void uploadConfigurations () override
 
 ~NoiseHistosUsingDb () 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 NoiseHistograms
void histoAnalysis (bool debug) override
 
 NoiseHistograms (const edm::ParameterSet &pset, DQMStore *)
 
void printAnalyses () override
 
 ~NoiseHistograms () override
 

Private Member Functions

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

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 NoiseHistosUsingDb.h.

Constructor & Destructor Documentation

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

Definition at line 14 of file NoiseHistosUsingDb.cc.

References LogTrace, and sistrip::mlDqmClient_.

17  NoiseHistograms(pset.getParameter<edm::ParameterSet>("NoiseParameters"), bei) {
18  LogTrace(mlDqmClient_) << "[NoiseHistosUsingDb::" << __func__ << "]"
19  << " Constructing object...";
20 }
T getParameter(std::string const &) const
static const char mlDqmClient_[]
NoiseHistograms(const edm::ParameterSet &pset, DQMStore *)
DQMStore *const bei() const
#define LogTrace(id)
NoiseHistosUsingDb::~NoiseHistosUsingDb ( )
override

Definition at line 24 of file NoiseHistosUsingDb.cc.

References LogTrace, and sistrip::mlDqmClient_.

24  {
25  LogTrace(mlDqmClient_) << "[NoiseHistosUsingDb::" << __func__ << "]"
26  << " Destructing object...";
27 }
static const char mlDqmClient_[]
#define LogTrace(id)

Member Function Documentation

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

Reimplemented from CommissioningHistosUsingDb.

Definition at line 124 of file NoiseHistosUsingDb.cc.

References conversion_template_cfg::anal, CommissioningHistosUsingDb::db(), SiStripConfigDb::dbParams(), NoiseAnalysis::dead(), CommissioningAnalysis::fecKey(), CommissioningAnalysis::fedKey(), CommissioningAnalysis::getErrorCodes(), SiStripFecKey::i2cAddr(), NoiseAnalysis::isValid(), NoiseAnalysis::noiseMax(), NoiseAnalysis::noiseMean(), NoiseAnalysis::noiseMin(), NoiseAnalysis::noiseSpread(), NoiseAnalysis::noisy(), SiStripDbParams::partitions(), NoiseAnalysis::pedsMax(), NoiseAnalysis::pedsMean(), NoiseAnalysis::pedsMin(), NoiseAnalysis::pedsSpread(), NoiseAnalysis::rawMax(), NoiseAnalysis::rawMean(), NoiseAnalysis::rawMin(), NoiseAnalysis::rawSpread(), and createJobs::tmp.

124  {
125  NoiseAnalysis* anal = dynamic_cast<NoiseAnalysis*>(analysis->second);
126  if (!anal) {
127  return;
128  }
129 
130  SiStripFecKey fec_key(anal->fecKey());
131  SiStripFedKey fed_key(anal->fedKey());
132 
133  for (uint16_t iapv = 0; iapv < 2; ++iapv) {
134  // Create description
135  PedestalsAnalysisDescription* tmp;
136  tmp = new PedestalsAnalysisDescription(anal->dead()[iapv],
137  anal->noisy()[iapv],
138  anal->pedsMean()[iapv],
139  anal->pedsSpread()[iapv],
140  anal->noiseMean()[iapv],
141  anal->noiseSpread()[iapv],
142  anal->rawMean()[iapv],
143  anal->rawSpread()[iapv],
144  anal->pedsMax()[iapv],
145  anal->pedsMin()[iapv],
146  anal->noiseMax()[iapv],
147  anal->noiseMin()[iapv],
148  anal->rawMax()[iapv],
149  anal->rawMin()[iapv],
150  fec_key.fecCrate(),
151  fec_key.fecSlot(),
152  fec_key.fecRing(),
153  fec_key.ccuAddr(),
154  fec_key.ccuChan(),
155  SiStripFecKey::i2cAddr(fec_key.lldChan(), !iapv),
156  db()->dbParams().partitions().begin()->second.partitionName(),
157  db()->dbParams().partitions().begin()->second.runNumber(),
158  anal->isValid(),
159  "",
160  fed_key.fedId(),
161  fed_key.feUnit(),
162  fed_key.feChan(),
163  fed_key.fedApv());
164 
165  // Add comments
166  typedef std::vector<std::string> Strings;
167  Strings errors = anal->getErrorCodes();
168  Strings::const_iterator istr = errors.begin();
169  Strings::const_iterator jstr = errors.end();
170  for (; istr != jstr; ++istr) {
171  tmp->addComments(*istr);
172  }
173 
174  // Store description
175  desc.push_back(tmp);
176  }
177 }
const VVInt & dead() const
const VFloat & noiseMean() const
const uint32_t & fedKey() const
const VFloat & noiseSpread() const
A container class for generic run and event-related info, information required by the commissioning a...
Definition: SiStripFedKey.h:56
const VFloat & pedsMax() const
std::vector< std::string > Strings
Definition: MsgTools.h:18
bool isValid() const override
const VFloat & rawMin() const
const VFloat & rawMax() const
const VFloat & pedsMean() const
const uint16_t & i2cAddr() const
Utility class that identifies a position within the strip tracker control structure, down to the level of an APV25.
Definition: SiStripFecKey.h:45
const_iterator_range partitions() const
const VVInt & noisy() const
const uint32_t & fecKey() const
const VFloat & pedsSpread() const
const VFloat & noiseMin() const
const VFloat & noiseMax() const
const VFloat & rawSpread() const
const VFloat & rawMean() const
const SiStripDbParams & dbParams() const
Histogram-based analysis for pedestal run.
Definition: NoiseAnalysis.h:15
Definition: errors.py:1
SiStripConfigDb *const db() const
tmp
align.sh
Definition: createJobs.py:716
const VString & getErrorCodes() const
const VFloat & pedsMin() const
void NoiseHistosUsingDb::update ( SiStripConfigDb::FedDescriptionsRange  feds)
private

Definition at line 58 of file NoiseHistosUsingDb.cc.

References generateTowerEtThresholdLUT::addr, conversion_template_cfg::anal, sistrip::APVS_PER_FEDCH, CommissioningHistosUsingDb::cabling(), FedChannelConnection::ccuAddr(), FedChannelConnection::ccuChan(), SiStripCommissioningClient_cfg::conn, constexpr, CommissioningHistograms::data(), TauDecayModes::dec, FedChannelConnection::fecCrate(), SiStripFedKey::feChan(), FedChannelConnection::fecRing(), FedChannelConnection::fecSlot(), FedChannelConnection::fedCh(), sistrip::FEDCH_PER_FED, SiStripFedCabling::fedConnection(), FedChannelConnection::fedId(), SiStripFedKey::feUnit(), sistrip::invalid_, SiStripKey::key(), FedChannelConnection::lldChannel(), sistrip::mlDqmClient_, NoiseAnalysis::noise(), and NoiseAnalysis::peds().

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().

58  {
59  // Iterate through feds and update fed descriptions
60  uint16_t updated = 0;
61  SiStripConfigDb::FedDescriptionsV::const_iterator ifed;
62  for (ifed = feds.begin(); ifed != feds.end(); ifed++) {
63  for (uint16_t ichan = 0; ichan < sistrip::FEDCH_PER_FED; ichan++) {
64  // Build FED and FEC keys
65  const FedChannelConnection& conn = cabling()->fedConnection((*ifed)->getFedId(), ichan);
66  if (conn.fecCrate() == sistrip::invalid_ || conn.fecSlot() == sistrip::invalid_ ||
67  conn.fecRing() == sistrip::invalid_ || conn.ccuAddr() == sistrip::invalid_ ||
68  conn.ccuChan() == sistrip::invalid_ || conn.lldChannel() == sistrip::invalid_) {
69  continue;
70  }
72  SiStripFecKey fec_key(
73  conn.fecCrate(), conn.fecSlot(), conn.fecRing(), conn.ccuAddr(), conn.ccuChan(), conn.lldChannel());
74 
75  // Locate appropriate analysis object
76  Analyses::const_iterator iter = data().find(fec_key.key());
77  if (iter != data().end()) {
78  // Check if analysis is valid
79  if (!iter->second->isValid()) {
80  continue;
81  }
82 
83  NoiseAnalysis* anal = dynamic_cast<NoiseAnalysis*>(iter->second);
84  if (!anal) {
85  edm::LogError(mlDqmClient_) << "[NoiseHistosUsingDb::" << __func__ << "]"
86  << " NULL pointer to analysis object!";
87  continue;
88  }
89 
90  // Iterate through APVs and strips
91  for (uint16_t iapv = 0; iapv < sistrip::APVS_PER_FEDCH; iapv++) {
92  for (uint16_t istr = 0; istr < anal->peds()[iapv].size(); istr++) {
93  constexpr float high_threshold = 5.;
94  constexpr float low_threshold = 2.;
95  constexpr bool disable_strip = false;
96  Fed9U::Fed9UStripDescription data(static_cast<uint32_t>(anal->peds()[iapv][istr]),
97  high_threshold,
98  low_threshold,
99  anal->noise()[iapv][istr],
100  disable_strip);
101  Fed9U::Fed9UAddress addr(ichan, iapv, istr);
102  (*ifed)->getFedStrips().setStrip(addr, data);
103  }
104  }
105  updated++;
106 
107  } else {
108  edm::LogWarning(mlDqmClient_) << "[NoiseHistosUsingDb::" << __func__ << "]"
109  << " Unable to find pedestals/noise for FedKey/Id/Ch: " << hex << setw(8)
110  << setfill('0') << fed_key.key() << dec << "/" << (*ifed)->getFedId() << "/"
111  << ichan << " and device with FEC/slot/ring/CCU/LLD " << fec_key.fecCrate() << "/"
112  << fec_key.fecSlot() << "/" << fec_key.fecRing() << "/" << fec_key.ccuAddr()
113  << "/" << fec_key.ccuChan() << "/" << fec_key.channel();
114  }
115  }
116  }
117 
118  edm::LogVerbatim(mlDqmClient_) << "[NoiseHistosUsingDb::" << __func__ << "]"
119  << " Updated FED pedestals/noise for " << updated << " channels";
120 }
const uint16_t & fecSlot() const
const uint16_t & fecCrate() 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
static const char mlDqmClient_[]
uint16_t lldChannel() const
const uint16_t & fedId() const
Utility class that identifies a position within the strip tracker control structure, down to the level of an APV25.
Definition: SiStripFecKey.h:45
const uint16_t & fecRing() const
Class containning control, module, detector and connection information, at the level of a FED channel...
const VVFloat & noise() const
const uint16_t & ccuChan() const
const uint16_t & ccuAddr() const
const uint16_t & feUnit() const
static const uint16_t invalid_
Definition: Constants.h:16
const VVFloat & peds() const
static const uint16_t FEDCH_PER_FED
const uint16_t & feChan() const
Histogram-based analysis for pedestal run.
Definition: NoiseAnalysis.h:15
SiStripFedCabling *const cabling() const
static const uint16_t APVS_PER_FEDCH
#define constexpr
void NoiseHistosUsingDb::uploadConfigurations ( )
overridevirtual

Reimplemented from CommissioningHistosUsingDb.

Definition at line 31 of file NoiseHistosUsingDb.cc.

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

31  {
32  LogTrace(mlDqmClient_) << "[NoiseHistosUsingDb::" << __func__ << "]";
33 
34  if (!db()) {
35  edm::LogError(mlDqmClient_) << "[NoiseHistosUsingDb::" << __func__ << "]"
36  << " NULL pointer to SiStripConfigDb interface!"
37  << " Aborting upload...";
38  return;
39  }
40 
41  // Update FED descriptions with new peds/noise values
43  update(feds);
44  if (doUploadConf()) {
45  edm::LogVerbatim(mlDqmClient_) << "[NoiseHistosUsingDb::" << __func__ << "]"
46  << " Uploading pedestals/noise to DB...";
48  edm::LogVerbatim(mlDqmClient_) << "[NoiseHistosUsingDb::" << __func__ << "]"
49  << " Completed database upload of " << feds.size() << " FED descriptions!";
50  } else {
51  edm::LogWarning(mlDqmClient_) << "[NoiseHistosUsingDb::" << __func__ << "]"
52  << " TEST only! No pedestals/noise values will be uploaded to DB...";
53  }
54 }
FedDescriptionsRange getFedDescriptions(std::string partition="")
FedDescriptions::range FedDescriptionsRange
static const char mlDqmClient_[]
#define LogTrace(id)
void uploadFedDescriptions(std::string partition="")
void update(SiStripConfigDb::FedDescriptionsRange)
SiStripConfigDb *const db() const