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, edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken)
 
 ~VpspScanHistosUsingDb () override
 
- Public Member Functions inherited from CommissioningHistosUsingDb
 CommissioningHistosUsingDb (SiStripConfigDb *const, edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken, 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::VpspScanHistosUsingDb ( const edm::ParameterSet pset,
DQMStore bei,
SiStripConfigDb * const  db,
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd tTopoToken 
)

Definition at line 13 of file VpspScanHistosUsingDb.cc.

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

19  VpspScanHistograms(pset.getParameter<edm::ParameterSet>("VpspScanParameters"), bei) {
20  LogTrace(mlDqmClient_) << "[VpspScanHistosUsingDb::" << __func__ << "]"
21  << " Constructing object...";
22 
24  this->pset().existsAs<bool>("doSelectiveUpload") ? this->pset().getParameter<bool>("doSelectiveUpload") : false;
25  LogTrace(mlDqmClient_) << "[PedestalsHistosUsingDb::" << __func__ << "]"
26  << " Selective upload of modules set to : " << allowSelectiveUpload_;
27 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
static const char mlDqmClient_[]
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:171
#define LogTrace(id)
SiStripConfigDb *const db() const
const edm::ParameterSet & pset() const
DQMStore *const bei() const
VpspScanHistograms(const edm::ParameterSet &pset, DQMStore *)

◆ ~VpspScanHistosUsingDb()

VpspScanHistosUsingDb::~VpspScanHistosUsingDb ( )
override

Definition at line 31 of file VpspScanHistosUsingDb.cc.

References LogTrace, and sistrip::mlDqmClient_.

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

Member Function Documentation

◆ create()

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

Reimplemented from CommissioningHistosUsingDb.

Definition at line 130 of file VpspScanHistosUsingDb.cc.

References conversion_template_cfg::anal, CommissioningHistosUsingDb::db(), SiStripConfigDb::dbParams(), submitPVResolutionJobs::desc, SiStripFecKey::i2cAddr(), SiStripDbParams::partitions(), and createJobs::tmp.

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

◆ update()

void VpspScanHistosUsingDb::update ( SiStripConfigDb::DeviceDescriptionsRange  devices)
private

Definition at line 67 of file VpspScanHistosUsingDb.cc.

References generateTowerEtThresholdLUT::addr, allowSelectiveUpload_, conversion_template_cfg::anal, SiStripFecKey::ccuAddr(), SiStripFecKey::ccuChan(), SiStripKey::channel(), CommissioningHistograms::data(), CommissioningHistosUsingDb::db(), submitPVResolutionJobs::desc, SiStripConfigDb::deviceAddress(), CommissioningHistosUsingDb::deviceIsPresent(), SiStripFecKey::fecCrate(), SiStripFecKey::fecRing(), SiStripFecKey::fecSlot(), SiStripKey::key(), LogTrace, sistrip::mlDqmClient_, and contentValuesCheck::ss.

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), dqm-mbProfile.Profile::finish(), progressbar.ProgressBar::finish(), MatrixUtil.Steps::overwrite(), and uploadConfigurations().

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

◆ uploadConfigurations()

void VpspScanHistosUsingDb::uploadConfigurations ( )
overridevirtual

Reimplemented from CommissioningHistosUsingDb.

Definition at line 38 of file VpspScanHistosUsingDb.cc.

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

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

Member Data Documentation

◆ allowSelectiveUpload_

bool VpspScanHistosUsingDb::allowSelectiveUpload_
private

Definition at line 25 of file VpspScanHistosUsingDb.h.

Referenced by update(), and VpspScanHistosUsingDb().