CMS 3D CMS Logo

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

#include <CalibrationHistosUsingDb.h>

Inheritance diagram for CalibrationHistosUsingDb:
CommissioningHistosUsingDb CalibrationHistograms CommissioningHistograms CommissioningHistograms

Public Member Functions

 CalibrationHistosUsingDb (const edm::ParameterSet &pset, DQMStore *, SiStripConfigDb *const, const sistrip::RunType &task=sistrip::CALIBRATION)
 
void uploadConfigurations () override
 
 ~CalibrationHistosUsingDb () 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 ()
 
 CommissioningHistograms (const edm::ParameterSet &pset, DQMStore *const, const sistrip::RunType &)
 
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 CalibrationHistograms
 CalibrationHistograms (const edm::ParameterSet &pset, DQMStore *, const sistrip::RunType &task=sistrip::CALIBRATION)
 
void histoAnalysis (bool debug) override
 
void printAnalyses () override
 
void save (std::string &filename, uint32_t run_number=0, std::string partitionName="")
 
 ~CalibrationHistograms () 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 13 of file CalibrationHistosUsingDb.h.

Constructor & Destructor Documentation

◆ CalibrationHistosUsingDb()

CalibrationHistosUsingDb::CalibrationHistosUsingDb ( const edm::ParameterSet pset,
DQMStore bei,
SiStripConfigDb * const  db,
const sistrip::RunType task = sistrip::CALIBRATION 
)

Definition at line 20 of file CalibrationHistosUsingDb.cc.

24  : CommissioningHistograms(pset.getParameter<edm::ParameterSet>("CalibrationParameters"), bei, task),
26  CalibrationHistograms(pset.getParameter<edm::ParameterSet>("CalibrationParameters"), bei, task) {
27  LogTrace(mlDqmClient_) << "[CalibrationHistosUsingDb::" << __func__ << "]"
28  << " Constructing object...";
29 
30  // Load and dump the current ISHA/VFS values. This is used by the standalone analysis script
31  const SiStripConfigDb::DeviceDescriptionsRange& apvDescriptions = db->getDeviceDescriptions(APV25);
32  for (SiStripConfigDb::DeviceDescriptionsV::const_iterator apv = apvDescriptions.begin(); apv != apvDescriptions.end();
33  ++apv) {
34  apvDescription* desc = dynamic_cast<apvDescription*>(*apv);
35  if (!desc) {
36  continue;
37  }
38  // Retrieve device addresses from device description
40  std::stringstream bin;
41  bin << std::setw(1) << std::setfill('0') << addr.fecCrate_;
42  bin << "." << std::setw(2) << std::setfill('0') << addr.fecSlot_;
43  bin << "." << std::setw(1) << std::setfill('0') << addr.fecRing_;
44  bin << "." << std::setw(3) << std::setfill('0') << addr.ccuAddr_;
45  bin << "." << std::setw(2) << std::setfill('0') << addr.ccuChan_;
46  bin << "." << desc->getAddress();
47  LogTrace(mlDqmClient_) << "Present values for ISHA/VFS of APV " << bin.str() << " : "
48  << static_cast<uint16_t>(desc->getIsha()) << " " << static_cast<uint16_t>(desc->getVfs());
49  }
50 
52  this->pset().existsAs<bool>("doSelectiveUpload") ? this->pset().getParameter<bool>("doSelectiveUpload") : false;
54  LogTrace(mlDqmClient_) << "[CalibrationHistosUsingDb::" << __func__ << "]"
55  << " Enabling selective update of FED parameters.";
56 }

References generateTowerEtThresholdLUT::addr, allowSelectiveUpload_, newFWLiteAna::bin, CommissioningHistosUsingDb::db(), SiStripConfigDb::deviceAddress(), edm::ParameterSet::existsAs(), SiStripConfigDb::getDeviceDescriptions(), edm::ParameterSet::getParameter(), LogTrace, sistrip::mlDqmClient_, and CommissioningHistograms::pset().

◆ ~CalibrationHistosUsingDb()

CalibrationHistosUsingDb::~CalibrationHistosUsingDb ( )
override

Definition at line 60 of file CalibrationHistosUsingDb.cc.

60  {
61  LogTrace(mlDqmClient_) << "[CalibrationHistosUsingDb::" << __func__ << "]"
62  << " Destructing object...";
63 }

References LogTrace, and sistrip::mlDqmClient_.

Member Function Documentation

◆ create()

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

Reimplemented from CommissioningHistosUsingDb.

Definition at line 178 of file CalibrationHistosUsingDb.cc.

178  {
179  if (task() == sistrip::CALIBRATION or
180  task() == sistrip::CALIBRATION_DECO) { // calibration run --> pulse shape measurement
181 
182  CalibrationAnalysis* anal = dynamic_cast<CalibrationAnalysis*>(analysis->second);
183  if (!anal) {
184  return;
185  }
186 
187  SiStripFecKey fec_key(anal->fecKey());
188  SiStripFedKey fed_key(anal->fedKey());
189 
190  for (uint16_t iapv = 0; iapv < 2; ++iapv) {
191  // Create description table with placeholder values for isha and vfs
192  CalibrationAnalysisDescription* tmp;
193  tmp = new CalibrationAnalysisDescription(anal->amplitudeMean()[iapv],
194  anal->tailMean()[iapv],
195  anal->riseTimeMean()[iapv],
196  anal->decayTimeMean()[iapv],
197  anal->smearingMean()[iapv],
198  anal->chi2Mean()[iapv],
199  anal->deconvMode(),
200  fec_key.fecCrate(),
201  fec_key.fecSlot(),
202  fec_key.fecRing(),
203  fec_key.ccuAddr(),
204  fec_key.ccuChan(),
205  SiStripFecKey::i2cAddr(fec_key.lldChan(), !iapv),
206  db()->dbParams().partitions().begin()->second.partitionName(),
207  db()->dbParams().partitions().begin()->second.runNumber(),
208  anal->isValid(),
209  "",
210  fed_key.fedId(),
211  fed_key.feUnit(),
212  fed_key.feChan(),
213  fed_key.fedApv(),
214  anal->calChan(),
215  -1,
216  -1);
217 
218  // Add comments
219  typedef std::vector<std::string> Strings;
220  Strings errors = anal->getErrorCodes();
221  Strings::const_iterator istr = errors.begin();
222  Strings::const_iterator jstr = errors.end();
223  for (; istr != jstr; ++istr) {
224  tmp->addComments(*istr);
225  }
226  // Store description
227  desc.push_back(tmp);
228  }
230  CalibrationScanAnalysis* anal = dynamic_cast<CalibrationScanAnalysis*>(analysis->second);
231  if (!anal) {
232  return;
233  }
234 
235  SiStripFecKey fec_key(anal->fecKey());
236  SiStripFedKey fed_key(anal->fedKey());
237 
238  for (uint16_t iapv = 0; iapv < 2; ++iapv) {
239  // Create description table with placeholder values for isha and vfs
240  CalibrationAnalysisDescription* tmp;
241  tmp = new CalibrationAnalysisDescription(anal->tunedAmplitude()[iapv],
242  anal->tunedTail()[iapv],
243  anal->tunedRiseTime()[iapv],
244  anal->tunedDecayTime()[iapv],
245  anal->tunedSmearing()[iapv],
246  anal->tunedChi2()[iapv],
247  anal->deconvMode(),
248  fec_key.fecCrate(),
249  fec_key.fecSlot(),
250  fec_key.fecRing(),
251  fec_key.ccuAddr(),
252  fec_key.ccuChan(),
253  SiStripFecKey::i2cAddr(fec_key.lldChan(), !iapv),
254  db()->dbParams().partitions().begin()->second.partitionName(),
255  db()->dbParams().partitions().begin()->second.runNumber(),
256  anal->isValid(),
257  "",
258  fed_key.fedId(),
259  fed_key.feUnit(),
260  fed_key.feChan(),
261  fed_key.fedApv(),
262  -1,
263  anal->tunedISHA()[iapv],
264  anal->tunedVFS()[iapv]);
265 
266  // Add comments
267  typedef std::vector<std::string> Strings;
268  Strings errors = anal->getErrorCodes();
269  Strings::const_iterator istr = errors.begin();
270  Strings::const_iterator jstr = errors.end();
271  for (; istr != jstr; ++istr) {
272  tmp->addComments(*istr);
273  }
274  // Store description
275  desc.push_back(tmp);
276  }
277  }
278 }

References conversion_template_cfg::anal, sistrip::CALIBRATION, sistrip::CALIBRATION_DECO, sistrip::CALIBRATION_SCAN, sistrip::CALIBRATION_SCAN_DECO, CommissioningHistosUsingDb::db(), SiStripConfigDb::dbParams(), SiStripFecKey::i2cAddr(), or, SiStripDbParams::partitions(), CommissioningHistograms::task(), and createJobs::tmp.

◆ update()

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

Definition at line 102 of file CalibrationHistosUsingDb.cc.

102  {
105  << "[CalibrationHistosUsingDb::" << __func__ << "]"
106  << " Nothing has to be uploaded to the SiStripConfigDb for CALIBRATION_SCAN or CALIBRATION_SCAN_DECO run-type"
107  << " Aborting upload...";
108  return;
110  // Iterate through devices and update device descriptions
111  SiStripConfigDb::DeviceDescriptionsV::const_iterator idevice;
112  for (idevice = devices.begin(); idevice != devices.end(); idevice++) {
113  // Check device type
114  if ((*idevice)->getDeviceType() != APV25) {
115  continue;
116  }
117  // Cast to retrieve appropriate description object
118  apvDescription* desc = dynamic_cast<apvDescription*>(*idevice);
119  if (!desc) {
120  continue;
121  }
122  // Retrieve the device address from device description
124 
125  // Retrieve LLD channel and APV numbers
126  uint16_t ichan = (desc->getAddress() - 0x20) / 2;
127  uint16_t iapv = (desc->getAddress() - 0x20) % 2;
128 
129  // Construct key from device description
130  SiStripFecKey fec_key(addr.fecCrate_, addr.fecSlot_, addr.fecRing_, addr.ccuAddr_, addr.ccuChan_, ichan + 1);
131 
132  // Iterate through all channels and extract LLD settings
133  Analyses::const_iterator iter = data(allowSelectiveUpload_).find(fec_key.key());
134  if (iter != data(allowSelectiveUpload_).end()) {
135  CalibrationScanAnalysis* anal = dynamic_cast<CalibrationScanAnalysis*>(iter->second);
136 
137  if (!anal) {
138  edm::LogError(mlDqmClient_) << "[CalibrationHistosUsingDb::" << __func__ << "]"
139  << " NULL pointer to analysis object!";
140  continue;
141  }
142 
143  std::stringstream ss;
144  ss << "[CalibrationHistosUsingDb::" << __func__ << "]"
145  << " Updating ISHA and VFS setting for FECCrate/FECSlot/FECRing/CCUAddr/LLD/APV " << fec_key.fecCrate()
146  << "/" << fec_key.fecSlot() << "/" << fec_key.fecRing() << "/" << fec_key.ccuAddr() << "/"
147  << fec_key.ccuChan() << "/" << fec_key.channel() << iapv << " from ISHA "
148  << static_cast<uint16_t>(desc->getIsha()) << " and VFS " << static_cast<uint16_t>(desc->getVfs());
149  if (iapv == 0) {
150  desc->setIsha(anal->bestISHA()[0]);
151  }
152  if (iapv == 1) {
153  desc->setIsha(anal->bestISHA()[1]);
154  }
155  if (iapv == 0) {
156  desc->setVfs(anal->bestVFS()[0]);
157  }
158  if (iapv == 1) {
159  desc->setVfs(anal->bestVFS()[1]);
160  }
161  ss << " to ISHA " << static_cast<uint16_t>(desc->getIsha()) << " and VFS "
162  << static_cast<uint16_t>(desc->getVfs());
163  edm::LogWarning(mlDqmClient_) << ss.str();
164  } else {
165  if (deviceIsPresent(fec_key)) {
166  edm::LogWarning(mlDqmClient_) << "[CalibrationHistosUsingDb::" << __func__ << "]"
167  << " Unable to find FEC key with params FEC/slot/ring/CCU/LLDchan/APV: "
168  << fec_key.fecCrate() << "/" << fec_key.fecSlot() << "/" << fec_key.fecRing()
169  << "/" << fec_key.ccuAddr() << "/" << fec_key.ccuChan() << "/"
170  << fec_key.channel() << "/" << iapv + 1;
171  }
172  }
173  }
174  }
175 }

References generateTowerEtThresholdLUT::addr, allowSelectiveUpload_, conversion_template_cfg::anal, sistrip::CALIBRATION, sistrip::CALIBRATION_DECO, sistrip::CALIBRATION_SCAN, sistrip::CALIBRATION_SCAN_DECO, SiStripFecKey::ccuAddr(), SiStripFecKey::ccuChan(), SiStripKey::channel(), CommissioningHistograms::data(), CommissioningHistosUsingDb::db(), SiStripConfigDb::deviceAddress(), CommissioningHistosUsingDb::deviceIsPresent(), SiStripFecKey::fecCrate(), SiStripFecKey::fecRing(), SiStripFecKey::fecSlot(), SiStripKey::key(), sistrip::mlDqmClient_, or, contentValuesCheck::ss, and CommissioningHistograms::task().

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

◆ uploadConfigurations()

void CalibrationHistosUsingDb::uploadConfigurations ( )
overridevirtual

Reimplemented from CommissioningHistosUsingDb.

Definition at line 67 of file CalibrationHistosUsingDb.cc.

67  {
68  if (!db()) {
69  edm::LogWarning(mlDqmClient_) << "[CalibrationHistosUsingDb::" << __func__ << "]"
70  << " NULL pointer to SiStripConfigDb interface!"
71  << " Aborting upload...";
72  return;
73  }
74 
77  << "[CalibrationHistosUsingDb::" << __func__ << "]"
78  << " Nothing has to be uploaded to the SiStripConfigDb for CALIBRATION_SCAN or CALIBRATION_SCAN_DECO run-types"
79  << " Aborting upload...";
80  return;
82  // Update all APV device descriptions with new ISHA and VFS settings
84  update(devices);
85  if (doUploadConf()) {
86  edm::LogVerbatim(mlDqmClient_) << "[CalibrationHistosUsingDb::" << __func__ << "]"
87  << " Uploading ISHA/VFS settings to DB...";
89  edm::LogVerbatim(mlDqmClient_) << "[CalibrationHistosUsingDb::" << __func__ << "]"
90  << " Uploaded ISHA/VFS settings to DB!";
91  } else {
92  edm::LogWarning(mlDqmClient_) << "[CalibrationHistosUsingDb::" << __func__ << "]"
93  << " TEST only! No ISHA/VFS settings will be uploaded to DB...";
94  }
95 
96  LogTrace(mlDqmClient_) << "[CalibrationHistosUsingDb::" << __func__ << "]"
97  << " Upload of ISHA/VFS settings to DB finished!";
98  }
99 }

References sistrip::CALIBRATION, sistrip::CALIBRATION_DECO, sistrip::CALIBRATION_SCAN, sistrip::CALIBRATION_SCAN_DECO, CommissioningHistosUsingDb::db(), CommissioningHistosUsingDb::doUploadConf(), SiStripConfigDb::getDeviceDescriptions(), LogTrace, sistrip::mlDqmClient_, or, CommissioningHistograms::task(), update(), and SiStripConfigDb::uploadDeviceDescriptions().

Member Data Documentation

◆ allowSelectiveUpload_

bool CalibrationHistosUsingDb::allowSelectiveUpload_
private

Definition at line 25 of file CalibrationHistosUsingDb.h.

Referenced by CalibrationHistosUsingDb(), and update().

SiStripConfigDb::getDeviceDescriptions
DeviceDescriptionsRange getDeviceDescriptions(std::string partition="")
Definition: DeviceDescriptions.cc:11
sistrip::CALIBRATION_SCAN
Definition: ConstantsForRunType.h:87
CommissioningHistograms::task
const sistrip::RunType & task() const
Definition: CommissioningHistograms.h:158
sistrip::CALIBRATION
Definition: ConstantsForRunType.h:73
SiStripConfigDb::DeviceDescriptionsRange
DeviceDescriptions::range DeviceDescriptionsRange
Definition: SiStripConfigDb.h:110
CommissioningHistograms::pset
const edm::ParameterSet & pset() const
Definition: CommissioningHistograms.h:163
CommissioningHistograms::bei
DQMStore *const bei() const
Definition: CommissioningHistograms.h:159
SiStripConfigDb::dbParams
const SiStripDbParams & dbParams() const
Definition: SiStripConfigDb.h:421
CalibrationHistosUsingDb::update
void update(SiStripConfigDb::DeviceDescriptionsRange &)
Definition: CalibrationHistosUsingDb.cc:102
SiStripConfigDb::deviceAddress
DeviceAddress deviceAddress(const deviceDescription &)
Definition: DeviceDescriptions.cc:503
CalibrationHistograms::CalibrationHistograms
CalibrationHistograms(const edm::ParameterSet &pset, DQMStore *, const sistrip::RunType &task=sistrip::CALIBRATION)
Definition: CalibrationHistograms.cc:26
CalibrationScanAnalysis
Analysis for calibration scans.
Definition: CalibrationScanAnalysis.h:19
edm::ParameterSet::existsAs
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:160
SiStripFedKey
A container class for generic run and event-related info, information required by the commissioning a...
Definition: SiStripFedKey.h:56
CommissioningHistograms::data
Analyses & data(bool getMaskedData=false)
Definition: CommissioningHistograms.cc:718
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
Strings
std::vector< std::string > Strings
Definition: MsgTools.h:18
sistrip::mlDqmClient_
static const char mlDqmClient_[]
Definition: ConstantsForLogger.h:19
CommissioningHistograms::CommissioningHistograms
CommissioningHistograms()
Definition: CommissioningHistograms.cc:60
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
CommissioningHistosUsingDb::CommissioningHistosUsingDb
CommissioningHistosUsingDb()
Definition: CommissioningHistosUsingDb.cc:34
generateTowerEtThresholdLUT.addr
addr
Definition: generateTowerEtThresholdLUT.py:57
errors
Definition: errors.py:1
SiStripFecKey
Utility class that identifies a position within the strip tracker control structure,...
Definition: SiStripFecKey.h:45
SiStripConfigDb::uploadDeviceDescriptions
void uploadDeviceDescriptions(std::string partition="")
Definition: DeviceDescriptions.cc:264
CalibrationHistosUsingDb::allowSelectiveUpload_
bool allowSelectiveUpload_
Definition: CalibrationHistosUsingDb.h:25
edm::LogWarning
Definition: MessageLogger.h:141
edm::ParameterSet
Definition: ParameterSet.h:36
sistrip::CALIBRATION_DECO
Definition: ConstantsForRunType.h:93
edm::LogError
Definition: MessageLogger.h:183
SiStripDbParams::partitions
const_iterator_range partitions() const
Definition: SiStripDbParams.h:178
edm::LogVerbatim
Definition: MessageLogger.h:297
CommissioningHistosUsingDb::doUploadConf
bool doUploadConf() const
Definition: CommissioningHistosUsingDb.h:91
newFWLiteAna.bin
bin
Definition: newFWLiteAna.py:161
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
sistrip::CALIBRATION_SCAN_DECO
Definition: ConstantsForRunType.h:88
SiStripFecKey::i2cAddr
const uint16_t & i2cAddr() const
Definition: SiStripFecKey.h:204
or
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
CommissioningHistosUsingDb::db
SiStripConfigDb *const db() const
Definition: CommissioningHistosUsingDb.h:93
SiStripConfigDb::DeviceAddress
Definition: SiStripConfigDb.h:141
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671
CommissioningHistosUsingDb::deviceIsPresent
bool deviceIsPresent(const SiStripFecKey &)
Definition: CommissioningHistosUsingDb.cc:369
conversion_template_cfg.anal
anal
Definition: conversion_template_cfg.py:16
CalibrationAnalysis
Analysis for calibration runs.
Definition: CalibrationAnalysis.h:16