CMS 3D CMS Logo

FedCablingTask.cc
Go to the documentation of this file.
6 #include <algorithm>
7 #include <sstream>
8 #include <iomanip>
9 
10 using namespace sistrip;
11 
12 // -----------------------------------------------------------------------------
13 //
15  : CommissioningTask(dqm, conn, "FedCablingTask"), histos_() {}
16 
17 // -----------------------------------------------------------------------------
18 //
20 
21 // -----------------------------------------------------------------------------
22 //
24  histos_.resize(2);
25 
27  uint16_t nbins = 0;
28  std::string extra_info = "";
29  for (uint16_t iter = 0; iter < 2; iter++) {
30  // Define number of histo bins and title
31  if (iter == 0) {
32  nbins = 1024;
33  extra_info = sistrip::feDriver_;
34  } else if (iter == 1) {
35  nbins = 96;
36  extra_info = sistrip::fedChannel_;
37  } else {
38  edm::LogWarning(mlDqmSource_) << "[FedCablingTask::" << __func__ << "]"
39  << " Unexpected number of HistoSets: " << iter;
40  }
41 
45  fedKey(),
47  connection().lldChannel(),
48  extra_info)
49  .title();
50 
51  histos_[iter].histo(dqm()->bookProfile(title, title, nbins, -0.5, nbins * 1. - 0.5, 1025, 0., 1025.));
52 
53  histos_[iter].vNumOfEntries_.resize(nbins, 0);
54  histos_[iter].vSumOfContents_.resize(nbins, 0);
55  histos_[iter].vSumOfSquares_.resize(nbins, 0);
56  }
57 }
58 
59 // -----------------------------------------------------------------------------
60 //
62  const uint16_t& fed_id,
63  const std::map<uint16_t, float>& fed_ch) {
64  if (fed_ch.empty()) {
65  edm::LogWarning(mlDqmSource_) << "[FedCablingTask::" << __func__ << "]"
66  << " No FED channels with high signal!";
67  return;
68  } else {
69  LogTrace(mlDqmSource_) << "[FedCablingTask::" << __func__ << "]"
70  << " Found " << fed_ch.size() << " FED channels with high signal!";
71  }
72 
73  std::map<uint16_t, float>::const_iterator ichan = fed_ch.begin();
74  for (; ichan != fed_ch.end(); ichan++) {
75  updateHistoSet(histos_[0], fed_id, ichan->second);
76  updateHistoSet(histos_[1], ichan->first, ichan->second);
77  }
78 }
79 
80 // -----------------------------------------------------------------------------
81 //
83  for (uint32_t iter = 0; iter < histos_.size(); iter++) {
84  updateHistoSet(histos_[iter]);
85  }
86 }
static const char feDriver_[]
Utility class that holds histogram title.
static const char mlDqmSource_[]
sistrip classes
#define LogTrace(id)
void updateHistoSet(HistoSet &, const uint32_t &bin, const float &value)
std::vector< HistoSet > histos_
Class containning control, module, detector and connection information, at the level of a FED channel...
static const char fedChannel_[]
const uint32_t & fedKey() const
FedCablingTask(DQMStore *, const FedChannelConnection &)
DQMStore *const dqm() const
conn
Definition: getInfo.py:9
void fill(const SiStripEventSummary &, const uint16_t &fed_id, const std::map< uint16_t, float > &fed_ch) override
const std::string & title() const
const FedChannelConnection & connection() const
Log< level::Warning, false > LogWarning
~FedCablingTask() override
Definition: DQMStore.h:18
void book() override
void update() override