CMS 3D CMS Logo

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

#include <VpspScanHistosUsingDb.h>

Inheritance diagram for VpspScanHistosUsingDb:
CommissioningHistosUsingDb VpspScanHistograms CommissioningHistograms CommissioningHistograms

Public Member Functions

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

Private Member Functions

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

Private Attributes

bool allowSelectiveUpload_
 

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

Constructor & Destructor Documentation

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

Definition at line 13 of file VpspScanHistosUsingDb.cc.

References allowSelectiveUpload_, edm::ParameterSet::existsAs(), edm::ParameterSet::getParameter(), LogTrace, sistrip::mlDqmClient_, and CommissioningHistograms::pset().

16  VpspScanHistograms(pset.getParameter<edm::ParameterSet>("VpspScanParameters"), bei) {
17  LogTrace(mlDqmClient_) << "[VpspScanHistosUsingDb::" << __func__ << "]"
18  << " Constructing object...";
19 
21  this->pset().existsAs<bool>("doSelectiveUpload") ? this->pset().getParameter<bool>("doSelectiveUpload") : false;
22  LogTrace(mlDqmClient_) << "[PedestalsHistosUsingDb::" << __func__ << "]"
23  << " Selective upload of modules set to : " << allowSelectiveUpload_;
24 }
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_[]
DQMStore *const bei() const
#define LogTrace(id)
VpspScanHistograms(const edm::ParameterSet &pset, DQMStore *)
VpspScanHistosUsingDb::~VpspScanHistosUsingDb ( )
override

Definition at line 28 of file VpspScanHistosUsingDb.cc.

References LogTrace, and sistrip::mlDqmClient_.

28  {
29  LogTrace(mlDqmClient_) << "[VpspScanHistosUsingDb::" << __func__ << "]"
30  << " Destructing object...";
31 }
static const char mlDqmClient_[]
#define LogTrace(id)

Member Function Documentation

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

Reimplemented from CommissioningHistosUsingDb.

Definition at line 127 of file VpspScanHistosUsingDb.cc.

References VpspScanAnalysis::adcLevel(), conversion_template_cfg::anal, VpspScanAnalysis::bottomEdge(), VpspScanAnalysis::bottomLevel(), CommissioningHistosUsingDb::db(), SiStripConfigDb::dbParams(), CommissioningAnalysis::fecKey(), CommissioningAnalysis::fedKey(), VpspScanAnalysis::fraction(), CommissioningAnalysis::getErrorCodes(), SiStripFecKey::i2cAddr(), VpspScanAnalysis::isValid(), SiStripDbParams::partitions(), createJobs::tmp, VpspScanAnalysis::topEdge(), VpspScanAnalysis::topLevel(), and VpspScanAnalysis::vpsp().

127  {
128  VpspScanAnalysis* anal = dynamic_cast<VpspScanAnalysis*>(analysis->second);
129  if (!anal) {
130  return;
131  }
132 
133  SiStripFecKey fec_key(anal->fecKey());
134  SiStripFedKey fed_key(anal->fedKey());
135 
136  for (uint16_t iapv = 0; iapv < 2; ++iapv) {
137  // Create description
138  VpspScanAnalysisDescription* tmp;
139  tmp = new VpspScanAnalysisDescription(anal->vpsp()[iapv],
140  anal->adcLevel()[iapv],
141  anal->fraction()[iapv],
142  anal->topEdge()[iapv],
143  anal->bottomEdge()[iapv],
144  anal->topLevel()[iapv],
145  anal->bottomLevel()[iapv],
146  fec_key.fecCrate(),
147  fec_key.fecSlot(),
148  fec_key.fecRing(),
149  fec_key.ccuAddr(),
150  fec_key.ccuChan(),
151  SiStripFecKey::i2cAddr(fec_key.lldChan(), !iapv),
152  db()->dbParams().partitions().begin()->second.partitionName(),
153  db()->dbParams().partitions().begin()->second.runNumber(),
154  anal->isValid(),
155  "",
156  fed_key.fedId(),
157  fed_key.feUnit(),
158  fed_key.feChan(),
159  fed_key.fedApv());
160 
161  // Add comments
162  typedef std::vector<std::string> Strings;
163  Strings errors = anal->getErrorCodes();
164  Strings::const_iterator istr = errors.begin();
165  Strings::const_iterator jstr = errors.end();
166  for (; istr != jstr; ++istr) {
167  tmp->addComments(*istr);
168  }
169 
170  // Store description
171  desc.push_back(tmp);
172  }
173 }
bool isValid() const override
const uint32_t & fedKey() const
const VInt & bottomEdge() const
A container class for generic run and event-related info, information required by the commissioning a...
Definition: SiStripFedKey.h:56
std::vector< std::string > Strings
Definition: MsgTools.h:18
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 VInt & topLevel() const
const VInt & fraction() const
const uint32_t & fecKey() const
const VInt & vpsp() const
Histogram-based analysis for VPSP scan.
const VInt & adcLevel() const
const SiStripDbParams & dbParams() const
Definition: errors.py:1
SiStripConfigDb *const db() const
tmp
align.sh
Definition: createJobs.py:716
const VString & getErrorCodes() const
const VInt & topEdge() const
const VInt & bottomLevel() const
void VpspScanHistosUsingDb::update ( SiStripConfigDb::DeviceDescriptionsRange  devices)
private

Definition at line 64 of file VpspScanHistosUsingDb.cc.

References generateTowerEtThresholdLUT::addr, allowSelectiveUpload_, conversion_template_cfg::anal, SiStripFecKey::ccuAddr(), SiStripConfigDb::DeviceAddress::ccuAddr_, SiStripFecKey::ccuChan(), SiStripConfigDb::DeviceAddress::ccuChan_, SiStripKey::channel(), CommissioningHistograms::data(), CommissioningHistosUsingDb::db(), SiStripConfigDb::deviceAddress(), CommissioningHistosUsingDb::deviceIsPresent(), SiStripFecKey::fecCrate(), SiStripConfigDb::DeviceAddress::fecCrate_, SiStripFecKey::fecRing(), SiStripConfigDb::DeviceAddress::fecRing_, SiStripFecKey::fecSlot(), SiStripConfigDb::DeviceAddress::fecSlot_, SiStripKey::key(), LogTrace, sistrip::mlDqmClient_, contentValuesCheck::ss, and VpspScanAnalysis::vpsp().

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

64  {
65  // Iterate through devices and update device descriptions
66  SiStripConfigDb::DeviceDescriptionsV::const_iterator idevice;
67  for (idevice = devices.begin(); idevice != devices.end(); idevice++) {
68  // Check device type
69  if ((*idevice)->getDeviceType() != APV25) {
70  continue;
71  }
72 
73  // Cast to retrieve appropriate description object
74  apvDescription* desc = dynamic_cast<apvDescription*>(*idevice);
75  if (!desc) {
76  continue;
77  }
78 
79  // Retrieve device addresses from device description
81 
82  // Retrieve LLD channel and APV numbers
83  uint16_t ichan = (desc->getAddress() - 0x20) / 2;
84  uint16_t iapv = (desc->getAddress() - 0x20) % 2;
85 
86  // Construct key from device description
87  SiStripFecKey fec_key(addr.fecCrate_, addr.fecSlot_, addr.fecRing_, addr.ccuAddr_, addr.ccuChan_, ichan + 1);
88 
89  // Iterate through all channels and extract LLD settings
90  Analyses::const_iterator iter = data(allowSelectiveUpload_).find(fec_key.key());
91  if (iter != data(allowSelectiveUpload_).end()) {
92  VpspScanAnalysis* anal = dynamic_cast<VpspScanAnalysis*>(iter->second);
93  if (!anal) {
94  edm::LogError(mlDqmClient_) << "[VpspScanHistosUsingDb::" << __func__ << "]"
95  << " NULL pointer to analysis object!";
96  continue;
97  }
98 
99  std::stringstream ss;
100  ss << "[VpspScanHistosUsingDb::" << __func__ << "]"
101  << " Updating VPSP setting for crate/FEC/slot/ring/CCU/LLD/APV " << fec_key.fecCrate() << "/"
102  << fec_key.fecSlot() << "/" << fec_key.fecRing() << "/" << fec_key.ccuAddr() << "/" << fec_key.ccuChan() << "/"
103  << fec_key.channel() << iapv << " from " << static_cast<uint16_t>(desc->getVpsp());
104  if (iapv == 0) {
105  desc->setVpsp(anal->vpsp()[0]);
106  }
107  if (iapv == 1) {
108  desc->setVpsp(anal->vpsp()[1]);
109  }
110  ss << " to " << static_cast<uint16_t>(desc->getVpsp());
111  LogTrace(mlDqmClient_) << ss.str();
112 
113  } else {
114  if (deviceIsPresent(fec_key)) {
115  edm::LogWarning(mlDqmClient_) << "[VpspScanHistosUsingDb::" << __func__ << "]"
116  << " Unable to find FEC key with params FEC/slot/ring/CCU/LLDchan/APV: "
117  << fec_key.fecCrate() << "/" << fec_key.fecSlot() << "/" << fec_key.fecRing()
118  << "/" << fec_key.ccuAddr() << "/" << fec_key.ccuChan() << "/"
119  << fec_key.channel() << "/" << iapv + 1;
120  }
121  }
122  }
123 }
Analyses & data(bool getMaskedData=false)
bool deviceIsPresent(const SiStripFecKey &)
static const char mlDqmClient_[]
Utility class that identifies a position within the strip tracker control structure, down to the level of an APV25.
Definition: SiStripFecKey.h:45
DeviceAddress deviceAddress(const deviceDescription &)
const VInt & vpsp() const
#define LogTrace(id)
Histogram-based analysis for VPSP scan.
SiStripConfigDb *const db() const
void VpspScanHistosUsingDb::uploadConfigurations ( )
overridevirtual

Reimplemented from CommissioningHistosUsingDb.

Definition at line 35 of file VpspScanHistosUsingDb.cc.

References CommissioningHistosUsingDb::db(), CommissioningHistosUsingDb::doUploadConf(), SiStripConfigDb::getDeviceDescriptions(), LogTrace, sistrip::mlDqmClient_, update(), and SiStripConfigDb::uploadDeviceDescriptions().

35  {
36  LogTrace(mlDqmClient_) << "[VpspScanHistosUsingDb::" << __func__ << "]";
37 
38  if (!db()) {
39  edm::LogError(mlDqmClient_) << "[VpspScanHistosUsingDb::" << __func__ << "]"
40  << " NULL pointer to SiStripConfigDb interface!"
41  << " Aborting upload...";
42  return;
43  }
44 
45  // Update all APV device descriptions with new VPSP settings
47  update(devices);
48  if (doUploadConf()) {
49  edm::LogVerbatim(mlDqmClient_) << "[VpspScanHistosUsingDb::" << __func__ << "]"
50  << " Uploading VPSP settings to DB...";
52  edm::LogVerbatim(mlDqmClient_) << "[VpspScanHistosUsingDb::" << __func__ << "]"
53  << " Uploaded VPSP settings to DB!";
54  } else {
55  edm::LogWarning(mlDqmClient_) << "[VpspScanHistosUsingDb::" << __func__ << "]"
56  << " TEST only! No VPSP settings will be uploaded to DB...";
57  }
58  LogTrace(mlDqmClient_) << "[VpspScanHistosUsingDb::" << __func__ << "]"
59  << " Upload of VPSP settings to DB finished!";
60 }
static const char mlDqmClient_[]
void update(SiStripConfigDb::DeviceDescriptionsRange)
DeviceDescriptions::range DeviceDescriptionsRange
#define LogTrace(id)
SiStripConfigDb *const db() const
DeviceDescriptionsRange getDeviceDescriptions(std::string partition="")
void uploadDeviceDescriptions(std::string partition="")

Member Data Documentation

bool VpspScanHistosUsingDb::allowSelectiveUpload_
private

Definition at line 22 of file VpspScanHistosUsingDb.h.

Referenced by update(), and VpspScanHistosUsingDb().