CMS 3D CMS Logo

List of all members | Public Member Functions
FastFedCablingHistograms Class Reference

#include <FastFedCablingHistograms.h>

Inheritance diagram for FastFedCablingHistograms:
CommissioningHistograms FastFedCablingHistosUsingDb

Public Member Functions

 FastFedCablingHistograms (const edm::ParameterSet &pset, DQMStore *)
 
void histoAnalysis (bool debug) override
 
void printAnalyses () override
 
void printSummary () override
 
 ~FastFedCablingHistograms () override
 
- Public Member Functions inherited from CommissioningHistograms
 CommissioningHistograms (const edm::ParameterSet &pset, DQMStore *const, const sistrip::RunType &)
 
 CommissioningHistograms ()
 
virtual void configure (const edm::ParameterSet &, const edm::EventSetup &)
 
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 > &)
 
void remove (std::string pattern="")
 
void save (std::string &filename, uint32_t run_number=0, std::string partitionName="")
 
virtual ~CommissioningHistograms ()
 

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 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 7 of file FastFedCablingHistograms.h.

Constructor & Destructor Documentation

◆ FastFedCablingHistograms()

FastFedCablingHistograms::FastFedCablingHistograms ( const edm::ParameterSet pset,
DQMStore bei 
)

Definition at line 20 of file FastFedCablingHistograms.cc.

References CommissioningHistograms::factory_, LogTrace, and sistrip::mlDqmClient_.

22  pset.getParameter<edm::ParameterSet>("FastFedCablingParameters"), bei, sistrip::FAST_CABLING) {
23  factory_ = std::make_unique<FastFedCablingSummaryFactory>();
24  LogTrace(mlDqmClient_) << "[FastFedCablingHistograms::" << __func__ << "]"
25  << " Constructing object...";
26 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
static const char mlDqmClient_[]
#define LogTrace(id)
std::unique_ptr< Factory > factory_
const edm::ParameterSet & pset() const
DQMStore *const bei() const

◆ ~FastFedCablingHistograms()

FastFedCablingHistograms::~FastFedCablingHistograms ( )
override

Definition at line 30 of file FastFedCablingHistograms.cc.

References LogTrace, and sistrip::mlDqmClient_.

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

Member Function Documentation

◆ histoAnalysis()

void FastFedCablingHistograms::histoAnalysis ( bool  debug)
overridevirtual

Reimplemented from CommissioningHistograms.

Definition at line 37 of file FastFedCablingHistograms.cc.

References conversion_template_cfg::anal, submitPVResolutionJobs::count, CommissioningHistograms::data(), relativeConstraints::empty, mps_fire::end, nano_mu_digi_cff::errors, extract(), CommissioningHistograms::histos(), cuy::ii, LogTrace, CommissioningHistograms::mapping(), sistrip::mlDqmClient_, CommissioningHistograms::pset(), contentValuesCheck::ss, and validateGeometry_cfg::valid.

37  {
38  LogTrace(mlDqmClient_) << "[FastFedCablingHistograms::" << __func__ << "]";
39 
40  // Some initialisation
41  uint16_t valid = 0;
42  HistosMap::const_iterator iter;
43  Analyses::iterator ianal;
44  std::map<std::string, uint16_t> errors;
45 
46  // Clear map holding analysis objects
47  for (ianal = data().begin(); ianal != data().end(); ianal++) {
48  if (ianal->second) {
49  delete ianal->second;
50  }
51  }
52  data().clear();
53 
54  // Iterate through map containing histograms
55  for (iter = histos().begin(); iter != histos().end(); iter++) {
56  // Check vector of histos is not empty
57  if (iter->second.empty()) {
58  edm::LogWarning(mlDqmClient_) << "[FastFedCablingHistograms::" << __func__ << "]"
59  << " Zero histograms found!";
60  continue;
61  }
62 
63  // Retrieve pointers to histos
64  std::vector<TH1*> profs;
65  Histos::const_iterator ihis = iter->second.begin();
66  for (; ihis != iter->second.end(); ihis++) {
67  TProfile* prof = ExtractTObject<TProfile>().extract((*ihis)->me_);
68  if (prof) {
69  profs.push_back(prof);
70  }
71  }
72 
73  // Perform histo analysis
75  FastFedCablingAlgorithm algo(this->pset(), anal);
76  FedToFecMap::const_iterator ifed = mapping().find(iter->first);
77  if (ifed != mapping().end()) {
78  anal->fecKey(ifed->second);
79  }
80  algo.analysis(profs);
81  data()[iter->first] = anal;
82  if (anal->isValid()) {
83  valid++;
84  }
85  if (!anal->getErrorCodes().empty()) {
86  errors[anal->getErrorCodes()[0]]++;
87  }
88  }
89 
90  if (!histos().empty()) {
91  edm::LogVerbatim(mlDqmClient_) << "[FastFedCablingHistograms::" << __func__ << "]"
92  << " Analyzed histograms for " << histos().size() << " FED channels, of which "
93  << valid << " (" << 100 * valid / histos().size() << "%) are valid.";
94  if (!errors.empty()) {
95  uint16_t count = 0;
96  std::stringstream ss;
97  ss << std::endl;
98  std::map<std::string, uint16_t>::const_iterator ii;
99  for (ii = errors.begin(); ii != errors.end(); ++ii) {
100  ss << " " << ii->first << ": " << ii->second << std::endl;
101  count += ii->second;
102  }
103  edm::LogWarning(mlDqmClient_) << "[FastFedCablingHistograms::" << __func__ << "]"
104  << " Found " << count << " error strings: " << ss.str();
105  }
106  } else {
107  edm::LogWarning(mlDqmClient_) << "[FastFedCablingHistograms::" << __func__ << "]"
108  << " No histograms to analyze!";
109  }
110 }
Log< level::Info, true > LogVerbatim
const FedToFecMap & mapping() const
const HistosMap & histos() const
Analyses & data(bool getMaskedData=false)
static const char mlDqmClient_[]
#define LogTrace(id)
Histogram-based analysis for connection loop.
Histogram-based analysis for connection loop.
ii
Definition: cuy.py:589
int extract(std::vector< int > *output, const std::string &dati)
const edm::ParameterSet & pset() const
Definition: errors.py:1
Log< level::Warning, false > LogWarning

◆ printAnalyses()

void FastFedCablingHistograms::printAnalyses ( )
overridevirtual

Reimplemented from CommissioningHistograms.

Definition at line 114 of file FastFedCablingHistograms.cc.

References conversion_template_cfg::anal, CommissioningHistograms::data(), LogTrace, sistrip::mlDqmClient_, and contentValuesCheck::ss.

114  {
115  Analyses::iterator ianal = data().begin();
116  Analyses::iterator janal = data().end();
117  for (; ianal != janal; ++ianal) {
118  FastFedCablingAnalysis* anal = dynamic_cast<FastFedCablingAnalysis*>(ianal->second);
119  if (!anal) {
120  edm::LogError(mlDqmClient_) << "[FastFedCablingHistograms::" << __func__ << "]"
121  << " NULL pointer to analysis object!";
122  continue;
123  }
124 
125  std::stringstream ss;
126  anal->print(ss);
127  if (anal->isValid() && !(anal->isDirty()) && !(anal->badTrimDac())) {
128  LogTrace(mlDqmClient_) << ss.str();
129  } else {
130  edm::LogWarning(mlDqmClient_) << ss.str();
131  }
132  }
133 }
Analyses & data(bool getMaskedData=false)
static const char mlDqmClient_[]
Log< level::Error, false > LogError
#define LogTrace(id)
Histogram-based analysis for connection loop.
Log< level::Warning, false > LogWarning

◆ printSummary()

void FastFedCablingHistograms::printSummary ( )
overridevirtual

Reimplemented from CommissioningHistograms.

Definition at line 137 of file FastFedCablingHistograms.cc.

References conversion_template_cfg::anal, CommissioningHistograms::data(), caHitNtupletGeneratorKernels::good, LogTrace, and sistrip::mlDqmClient_.

137  {
138  std::stringstream good;
139  std::stringstream bad;
140 
141  Analyses::iterator ianal = data().begin();
142  Analyses::iterator janal = data().end();
143  for (; ianal != janal; ++ianal) {
144  FastFedCablingAnalysis* anal = dynamic_cast<FastFedCablingAnalysis*>(ianal->second);
145  if (!anal) {
146  edm::LogError(mlDqmClient_) << "[FastFedCablingHistograms::" << __func__ << "]"
147  << " NULL pointer to analysis object!";
148  continue;
149  }
150 
151  if (anal->isValid() && !(anal->isDirty()) && !(anal->badTrimDac())) {
152  anal->summary(good);
153  } else {
154  anal->summary(bad);
155  }
156  }
157 
158  if (good.str().empty()) {
159  good << "None found!";
160  }
161  LogTrace(mlDqmClient_) << "[FastFedCablingHistograms::" << __func__ << "]"
162  << " Printing summary of good analyses:"
163  << "\n"
164  << good.str();
165 
166  if (bad.str().empty()) {
167  return;
168  } //@@ bad << "None found!"; }
169  LogTrace(mlDqmClient_) << "[FastFedCablingHistograms::" << __func__ << "]"
170  << " Printing summary of bad analyses:"
171  << "\n"
172  << bad.str();
173 }
Analyses & data(bool getMaskedData=false)
static const char mlDqmClient_[]
Log< level::Error, false > LogError
#define LogTrace(id)
Histogram-based analysis for connection loop.