CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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, edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken)
 
void uploadConfigurations () override
 
 ~PedsOnlyHistosUsingDb () 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 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,
Histos
HistosMap
 
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 ( const edm::ParameterSet pset,
DQMStore bei,
SiStripConfigDb * const  db,
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd tTopoToken 
)

Definition at line 14 of file PedsOnlyHistosUsingDb.cc.

References LogTrace, and sistrip::mlDqmClient_.

18  : CommissioningHistograms(pset.getParameter<edm::ParameterSet>("PedsOnlyParameters"), bei, sistrip::PEDS_ONLY),
20  PedsOnlyHistograms(pset.getParameter<edm::ParameterSet>("PedsOnlyParameters"), bei) {
21  LogTrace(mlDqmClient_) << "[PedsOnlyHistosUsingDb::" << __func__ << "]"
22  << " Constructing object...";
23 }
static const char mlDqmClient_[]
#define LogTrace(id)
PedsOnlyHistograms(const edm::ParameterSet &pset, DQMStore *)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
PedsOnlyHistosUsingDb::~PedsOnlyHistosUsingDb ( )
override

Definition at line 27 of file PedsOnlyHistosUsingDb.cc.

References LogTrace, and sistrip::mlDqmClient_.

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

Member Function Documentation

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

Reimplemented from CommissioningHistosUsingDb.

Definition at line 134 of file PedsOnlyHistosUsingDb.cc.

References CommissioningHistosUsingDb::db(), SiStripConfigDb::dbParams(), CommissioningAnalysis::fecKey(), CommissioningAnalysis::fedKey(), CommissioningAnalysis::getErrorCodes(), SiStripFecKey::i2cAddr(), sistrip::invalid_, PedsOnlyAnalysis::isValid(), SiStripDbParams::partitions(), PedsOnlyAnalysis::pedsMax(), PedsOnlyAnalysis::pedsMean(), PedsOnlyAnalysis::pedsMin(), PedsOnlyAnalysis::pedsSpread(), PedsOnlyAnalysis::rawMax(), PedsOnlyAnalysis::rawMean(), PedsOnlyAnalysis::rawMin(), PedsOnlyAnalysis::rawSpread(), and createJobs::tmp.

134  {
135  PedsOnlyAnalysis* anal = dynamic_cast<PedsOnlyAnalysis*>(analysis->second);
136  if (!anal) {
137  return;
138  }
139 
140  SiStripFecKey fec_key(anal->fecKey());
141  SiStripFedKey fed_key(anal->fedKey());
142 
143  for (uint16_t iapv = 0; iapv < 2; ++iapv) {
144  // Create description
145  PedestalsAnalysisDescription* tmp;
146  tmp = new PedestalsAnalysisDescription(std::vector<uint16_t>(0, 0), //@@
147  std::vector<uint16_t>(0, 0), //@@
148  anal->pedsMean()[iapv],
149  anal->pedsSpread()[iapv],
150  1. * sistrip::invalid_, //@@
151  1. * sistrip::invalid_, //@@
152  anal->rawMean()[iapv],
153  anal->rawSpread()[iapv],
154  anal->pedsMax()[iapv],
155  anal->pedsMin()[iapv],
156  1. * sistrip::invalid_, //@@
157  1. * sistrip::invalid_, //@@
158  anal->rawMax()[iapv],
159  anal->rawMin()[iapv],
160  fec_key.fecCrate(),
161  fec_key.fecSlot(),
162  fec_key.fecRing(),
163  fec_key.ccuAddr(),
164  fec_key.ccuChan(),
165  SiStripFecKey::i2cAddr(fec_key.lldChan(), !iapv),
166  db()->dbParams().partitions().begin()->second.partitionName(),
167  db()->dbParams().partitions().begin()->second.runNumber(),
168  anal->isValid(),
169  "",
170  fed_key.fedId(),
171  fed_key.feUnit(),
172  fed_key.feChan(),
173  fed_key.fedApv());
174 
175  // Add comments
176  typedef std::vector<std::string> Strings;
177  Strings errors = anal->getErrorCodes();
178  Strings::const_iterator istr = errors.begin();
179  Strings::const_iterator jstr = errors.end();
180  for (; istr != jstr; ++istr) {
181  tmp->addComments(*istr);
182  }
183 
184  // Store description
185  desc.push_back(tmp);
186  }
187 }
Histogram-based analysis for pedestal run.
const uint32_t & fedKey() 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
const VFloat & rawSpread() 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
bool isValid() const override
const VFloat & rawMin() const
const VFloat & pedsMin() const
const VFloat & pedsMax() const
const uint32_t & fecKey() const
const VFloat & rawMax() const
const SiStripDbParams & dbParams() const
static const uint16_t invalid_
Definition: Constants.h:16
const VFloat & pedsSpread() const
const VFloat & pedsMean() const
SiStripConfigDb *const db() const
tmp
align.sh
Definition: createJobs.py:716
const VString & getErrorCodes() const
const VFloat & rawMean() const
void PedsOnlyHistosUsingDb::update ( SiStripConfigDb::FedDescriptionsRange  feds)
private

Definition at line 61 of file PedsOnlyHistosUsingDb.cc.

References generateTowerEtThresholdLUT::addr, sistrip::APVS_PER_FEDCH, CommissioningHistosUsingDb::cabling(), FedChannelConnection::ccuAddr(), FedChannelConnection::ccuChan(), getInfo::conn, 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_, PedsOnlyAnalysis::peds(), PedsOnlyAnalysis::pedsMin(), and PedsOnlyAnalysis::raw().

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

61  {
62  // Iterate through feds and update fed descriptions
63  uint16_t updated = 0;
64  SiStripConfigDb::FedDescriptionsV::const_iterator ifed;
65  for (ifed = feds.begin(); ifed != feds.end(); ifed++) {
66  for (uint16_t ichan = 0; ichan < sistrip::FEDCH_PER_FED; ichan++) {
67  // Build FED and FEC keys
68  const FedChannelConnection& conn = cabling()->fedConnection((*ifed)->getFedId(), ichan);
69  if (conn.fecCrate() == sistrip::invalid_ || conn.fecSlot() == sistrip::invalid_ ||
70  conn.fecRing() == sistrip::invalid_ || conn.ccuAddr() == sistrip::invalid_ ||
71  conn.ccuChan() == sistrip::invalid_ || conn.lldChannel() == sistrip::invalid_) {
72  continue;
73  }
75  SiStripFecKey fec_key(
76  conn.fecCrate(), conn.fecSlot(), conn.fecRing(), conn.ccuAddr(), conn.ccuChan(), conn.lldChannel());
77 
78  // Locate appropriate analysis object
79  Analyses::const_iterator iter = data().find(fec_key.key());
80  if (iter != data().end()) {
81  // Check if analysis is valid
82  if (!iter->second->isValid()) {
83  continue;
84  }
85 
86  PedsOnlyAnalysis* anal = dynamic_cast<PedsOnlyAnalysis*>(iter->second);
87  if (!anal) {
88  edm::LogError(mlDqmClient_) << "[PedsOnlyHistosUsingDb::" << __func__ << "]"
89  << " NULL pointer to analysis object!";
90  continue;
91  }
92 
93  // Determine the pedestal shift to apply
94  uint32_t pedshift = 127;
95  for (uint16_t iapv = 0; iapv < sistrip::APVS_PER_FEDCH; iapv++) {
96  uint32_t pedmin = (uint32_t)anal->pedsMin()[iapv];
97  pedshift = pedmin < pedshift ? pedmin : pedshift;
98  }
99 
100  // Iterate through APVs and strips
101  for (uint16_t iapv = 0; iapv < sistrip::APVS_PER_FEDCH; iapv++) {
102  for (uint16_t istr = 0; istr < anal->peds()[iapv].size(); istr++) {
103  constexpr float high_threshold = 5.;
104  constexpr float low_threshold = 2.;
105  constexpr bool disable_strip = false;
106  Fed9U::Fed9UStripDescription data(static_cast<uint32_t>(anal->peds()[iapv][istr] - pedshift),
107  high_threshold,
108  low_threshold,
109  anal->raw()[iapv][istr], //@@ raw noise!
110  disable_strip);
111  Fed9U::Fed9UAddress addr(ichan, iapv, istr);
112  (*ifed)->getFedStrips().setStrip(addr, data);
113  }
114  }
115  updated++;
116 
117  } else {
118  edm::LogWarning(mlDqmClient_) << "[PedsOnlyHistosUsingDb::" << __func__ << "]"
119  << " Unable to find pedestals/noise for FedKey/Id/Ch: " << hex << setw(8)
120  << setfill('0') << fed_key.key() << dec << "/" << (*ifed)->getFedId() << "/"
121  << ichan << " and device with FEC/slot/ring/CCU/LLD " << fec_key.fecCrate() << "/"
122  << fec_key.fecSlot() << "/" << fec_key.fecRing() << "/" << fec_key.ccuAddr()
123  << "/" << fec_key.ccuChan() << "/" << fec_key.channel();
124  }
125  }
126  }
127 
128  edm::LogVerbatim(mlDqmClient_) << "[PedsOnlyHistosUsingDb::" << __func__ << "]"
129  << " Updated FED pedestals/noise for " << updated << " channels";
130 }
const uint16_t & fecSlot() const
Log< level::Info, true > LogVerbatim
const uint16_t & fecCrate() const
Histogram-based analysis for pedestal run.
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
Log< level::Error, false > LogError
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 VVFloat & raw() const
const uint16_t & fecRing() const
Class containning control, module, detector and connection information, at the level of a FED channel...
const VFloat & pedsMin() 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
tuple conn
Definition: getInfo.py:9
Log< level::Warning, false > LogWarning
SiStripFedCabling *const cabling() const
static const uint16_t APVS_PER_FEDCH
void PedsOnlyHistosUsingDb::uploadConfigurations ( )
overridevirtual

Reimplemented from CommissioningHistosUsingDb.

Definition at line 34 of file PedsOnlyHistosUsingDb.cc.

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

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