CMS 3D CMS Logo

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

#include <PedsOnlyHistosUsingDb.h>

Inheritance diagram for PedsOnlyHistosUsingDb:
CommissioningHistosUsingDb PedsOnlyHistograms CommissioningHistograms CommissioningHistograms

Public Member Functions

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

Constructor & Destructor Documentation

◆ PedsOnlyHistosUsingDb()

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

Definition at line 14 of file PedsOnlyHistosUsingDb.cc.

17  PedsOnlyHistograms(pset.getParameter<edm::ParameterSet>("PedsOnlyParameters"), bei) {
18  LogTrace(mlDqmClient_) << "[PedsOnlyHistosUsingDb::" << __func__ << "]"
19  << " Constructing object...";
20 }

References LogTrace, and sistrip::mlDqmClient_.

◆ ~PedsOnlyHistosUsingDb()

PedsOnlyHistosUsingDb::~PedsOnlyHistosUsingDb ( )
override

Definition at line 24 of file PedsOnlyHistosUsingDb.cc.

24  {
25  LogTrace(mlDqmClient_) << "[PedsOnlyHistosUsingDb::" << __func__ << "]"
26  << " Destructing object...";
27 }

References LogTrace, and sistrip::mlDqmClient_.

Member Function Documentation

◆ create()

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

Reimplemented from CommissioningHistosUsingDb.

Definition at line 131 of file PedsOnlyHistosUsingDb.cc.

131  {
132  PedsOnlyAnalysis* anal = dynamic_cast<PedsOnlyAnalysis*>(analysis->second);
133  if (!anal) {
134  return;
135  }
136 
137  SiStripFecKey fec_key(anal->fecKey());
138  SiStripFedKey fed_key(anal->fedKey());
139 
140  for (uint16_t iapv = 0; iapv < 2; ++iapv) {
141  // Create description
142  PedestalsAnalysisDescription* tmp;
143  tmp = new PedestalsAnalysisDescription(std::vector<uint16_t>(0, 0), //@@
144  std::vector<uint16_t>(0, 0), //@@
145  anal->pedsMean()[iapv],
146  anal->pedsSpread()[iapv],
147  1. * sistrip::invalid_, //@@
148  1. * sistrip::invalid_, //@@
149  anal->rawMean()[iapv],
150  anal->rawSpread()[iapv],
151  anal->pedsMax()[iapv],
152  anal->pedsMin()[iapv],
153  1. * sistrip::invalid_, //@@
154  1. * sistrip::invalid_, //@@
155  anal->rawMax()[iapv],
156  anal->rawMin()[iapv],
157  fec_key.fecCrate(),
158  fec_key.fecSlot(),
159  fec_key.fecRing(),
160  fec_key.ccuAddr(),
161  fec_key.ccuChan(),
162  SiStripFecKey::i2cAddr(fec_key.lldChan(), !iapv),
163  db()->dbParams().partitions().begin()->second.partitionName(),
164  db()->dbParams().partitions().begin()->second.runNumber(),
165  anal->isValid(),
166  "",
167  fed_key.fedId(),
168  fed_key.feUnit(),
169  fed_key.feChan(),
170  fed_key.fedApv());
171 
172  // Add comments
173  typedef std::vector<std::string> Strings;
174  Strings errors = anal->getErrorCodes();
175  Strings::const_iterator istr = errors.begin();
176  Strings::const_iterator jstr = errors.end();
177  for (; istr != jstr; ++istr) {
178  tmp->addComments(*istr);
179  }
180 
181  // Store description
182  desc.push_back(tmp);
183  }
184 }

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

◆ update()

void PedsOnlyHistosUsingDb::update ( SiStripConfigDb::FedDescriptionsRange  feds)
private

Definition at line 58 of file PedsOnlyHistosUsingDb.cc.

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  }
71  SiStripFedKey fed_key(conn.fedId(), SiStripFedKey::feUnit(conn.fedCh()), SiStripFedKey::feChan(conn.fedCh()));
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  PedsOnlyAnalysis* anal = dynamic_cast<PedsOnlyAnalysis*>(iter->second);
84  if (!anal) {
85  edm::LogError(mlDqmClient_) << "[PedsOnlyHistosUsingDb::" << __func__ << "]"
86  << " NULL pointer to analysis object!";
87  continue;
88  }
89 
90  // Determine the pedestal shift to apply
91  uint32_t pedshift = 127;
92  for (uint16_t iapv = 0; iapv < sistrip::APVS_PER_FEDCH; iapv++) {
93  uint32_t pedmin = (uint32_t)anal->pedsMin()[iapv];
94  pedshift = pedmin < pedshift ? pedmin : pedshift;
95  }
96 
97  // Iterate through APVs and strips
98  for (uint16_t iapv = 0; iapv < sistrip::APVS_PER_FEDCH; iapv++) {
99  for (uint16_t istr = 0; istr < anal->peds()[iapv].size(); istr++) {
100  constexpr float high_threshold = 5.;
101  constexpr float low_threshold = 2.;
102  constexpr bool disable_strip = false;
103  Fed9U::Fed9UStripDescription data(static_cast<uint32_t>(anal->peds()[iapv][istr] - pedshift),
104  high_threshold,
105  low_threshold,
106  anal->raw()[iapv][istr], //@@ raw noise!
107  disable_strip);
108  Fed9U::Fed9UAddress addr(ichan, iapv, istr);
109  (*ifed)->getFedStrips().setStrip(addr, data);
110  }
111  }
112  updated++;
113 
114  } else {
115  edm::LogWarning(mlDqmClient_) << "[PedsOnlyHistosUsingDb::" << __func__ << "]"
116  << " Unable to find pedestals/noise for FedKey/Id/Ch: " << hex << setw(8)
117  << setfill('0') << fed_key.key() << dec << "/" << (*ifed)->getFedId() << "/"
118  << ichan << " and device with FEC/slot/ring/CCU/LLD " << fec_key.fecCrate() << "/"
119  << fec_key.fecSlot() << "/" << fec_key.fecRing() << "/" << fec_key.ccuAddr()
120  << "/" << fec_key.ccuChan() << "/" << fec_key.channel();
121  }
122  }
123  }
124 
125  edm::LogVerbatim(mlDqmClient_) << "[PedsOnlyHistosUsingDb::" << __func__ << "]"
126  << " Updated FED pedestals/noise for " << updated << " channels";
127 }

References generateTowerEtThresholdLUT::addr, conversion_template_cfg::anal, sistrip::APVS_PER_FEDCH, CommissioningHistosUsingDb::cabling(), SiStripCommissioningClient_cfg::conn, CommissioningHistograms::data(), TauDecayModes::dec, SiStripFedKey::feChan(), sistrip::FEDCH_PER_FED, SiStripFedCabling::fedConnection(), l1tstage2emulator_dqm_sourceclient-live_cfg::feds, SiStripFedKey::feUnit(), sistrip::invalid_, SiStripKey::key(), and sistrip::mlDqmClient_.

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 PedsOnlyHistosUsingDb::uploadConfigurations ( )
overridevirtual

Reimplemented from CommissioningHistosUsingDb.

Definition at line 31 of file PedsOnlyHistosUsingDb.cc.

31  {
32  LogTrace(mlDqmClient_) << "[PedsOnlyHistosUsingDb::" << __func__ << "]";
33 
34  if (!db()) {
35  edm::LogError(mlDqmClient_) << "[PedsOnlyHistosUsingDb::" << __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_) << "[PedsOnlyHistosUsingDb::" << __func__ << "]"
46  << " Uploading pedestals/noise to DB...";
48  edm::LogVerbatim(mlDqmClient_) << "[PedsOnlyHistosUsingDb::" << __func__ << "]"
49  << " Completed database upload of " << feds.size() << " FED descriptions!";
50  } else {
51  edm::LogWarning(mlDqmClient_) << "[PedsOnlyHistosUsingDb::" << __func__ << "]"
52  << " TEST only! No pedestals/noise values will be uploaded to DB...";
53  }
54 }

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

l1tstage2emulator_dqm_sourceclient-live_cfg.feds
feds
Definition: l1tstage2emulator_dqm_sourceclient-live_cfg.py:146
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
SiStripConfigDb::getFedDescriptions
FedDescriptionsRange getFedDescriptions(std::string partition="")
Definition: FedDescriptions.cc:12
SiStripConfigDb::uploadFedDescriptions
void uploadFedDescriptions(std::string partition="")
Definition: FedDescriptions.cc:197
CommissioningHistosUsingDb::cabling
SiStripFedCabling *const cabling() const
Definition: CommissioningHistosUsingDb.h:94
SiStripCommissioningClient_cfg.conn
conn
Definition: SiStripCommissioningClient_cfg.py:5
SiStripFedCabling::fedConnection
FedChannelConnection fedConnection(uint16_t fed_id, uint16_t fed_ch) const
Definition: SiStripFedCabling.cc:171
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
PedsOnlyHistograms::PedsOnlyHistograms
PedsOnlyHistograms(const edm::ParameterSet &pset, DQMStore *)
Definition: PedsOnlyHistograms.cc:18
sistrip::mlDqmClient_
static const char mlDqmClient_[]
Definition: ConstantsForLogger.h:19
CommissioningHistograms::CommissioningHistograms
CommissioningHistograms()
Definition: CommissioningHistograms.cc:60
CommissioningHistosUsingDb::CommissioningHistosUsingDb
CommissioningHistosUsingDb()
Definition: CommissioningHistosUsingDb.cc:34
SiStripConfigDb::FedDescriptionsRange
FedDescriptions::range FedDescriptionsRange
Definition: SiStripConfigDb.h:116
generateTowerEtThresholdLUT.addr
addr
Definition: generateTowerEtThresholdLUT.py:57
PedsOnlyHistosUsingDb::update
void update(SiStripConfigDb::FedDescriptionsRange)
Definition: PedsOnlyHistosUsingDb.cc:58
errors
Definition: errors.py:1
SiStripFecKey
Utility class that identifies a position within the strip tracker control structure,...
Definition: SiStripFecKey.h:45
PedsOnlyAnalysis
Histogram-based analysis for pedestal run.
Definition: PedsOnlyAnalysis.h:15
edm::LogWarning
Definition: MessageLogger.h:141
FedChannelConnection
Class containning control, module, detector and connection information, at the level of a FED channel...
Definition: FedChannelConnection.h:26
edm::ParameterSet
Definition: ParameterSet.h:36
edm::LogError
Definition: MessageLogger.h:183
SiStripDbParams::partitions
const_iterator_range partitions() const
Definition: SiStripDbParams.h:178
SiStripFedKey::feUnit
const uint16_t & feUnit() const
Definition: SiStripFedKey.h:189
edm::LogVerbatim
Definition: MessageLogger.h:297
CommissioningHistosUsingDb::doUploadConf
bool doUploadConf() const
Definition: CommissioningHistosUsingDb.h:91
sistrip::PEDS_ONLY
Definition: ConstantsForRunType.h:90
sistrip::invalid_
static const uint16_t invalid_
Definition: Constants.h:16
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
SiStripFecKey::i2cAddr
const uint16_t & i2cAddr() const
Definition: SiStripFecKey.h:204
sistrip::APVS_PER_FEDCH
static const uint16_t APVS_PER_FEDCH
Definition: ConstantsForHardwareSystems.h:34
sistrip::FEDCH_PER_FED
static const uint16_t FEDCH_PER_FED
Definition: ConstantsForHardwareSystems.h:30
CommissioningHistosUsingDb::db
SiStripConfigDb *const db() const
Definition: CommissioningHistosUsingDb.h:93
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671
conversion_template_cfg.anal
anal
Definition: conversion_template_cfg.py:16
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
SiStripFedKey::feChan
const uint16_t & feChan() const
Definition: SiStripFedKey.h:190