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 ()
 
 CommissioningHistograms (const edm::ParameterSet &pset, DQMStore *const, const sistrip::RunType &)
 
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 18 of file FastFedCablingHistograms.cc.

20  pset.getParameter<edm::ParameterSet>("FastFedCablingParameters"), bei, sistrip::FAST_CABLING) {
21  factory_ = unique_ptr<FastFedCablingSummaryFactory>(new FastFedCablingSummaryFactory);
22  LogTrace(mlDqmClient_) << "[FastFedCablingHistograms::" << __func__ << "]"
23  << " Constructing object...";
24 }

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

◆ ~FastFedCablingHistograms()

FastFedCablingHistograms::~FastFedCablingHistograms ( )
override

Definition at line 28 of file FastFedCablingHistograms.cc.

28  {
29  LogTrace(mlDqmClient_) << "[FastFedCablingHistograms::" << __func__ << "]"
30  << " Destructing object...";
31 }

References LogTrace, and sistrip::mlDqmClient_.

Member Function Documentation

◆ histoAnalysis()

void FastFedCablingHistograms::histoAnalysis ( bool  debug)
overridevirtual

Reimplemented from CommissioningHistograms.

Definition at line 35 of file FastFedCablingHistograms.cc.

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

References conversion_template_cfg::anal, begin, KineDebug3::count(), CommissioningHistograms::data(), relativeConstraints::empty, end, MessageLogger_cfi::errors, ExtractTObject< T >::extract(), CommissioningHistograms::histos(), cuy::ii, LogTrace, CommissioningHistograms::mapping(), sistrip::mlDqmClient_, CommissioningHistograms::pset(), contentValuesCheck::ss, and validateGeometry_cfg::valid.

◆ printAnalyses()

void FastFedCablingHistograms::printAnalyses ( )
overridevirtual

Reimplemented from CommissioningHistograms.

Definition at line 112 of file FastFedCablingHistograms.cc.

112  {
113  Analyses::iterator ianal = data().begin();
114  Analyses::iterator janal = data().end();
115  for (; ianal != janal; ++ianal) {
116  FastFedCablingAnalysis* anal = dynamic_cast<FastFedCablingAnalysis*>(ianal->second);
117  if (!anal) {
118  edm::LogError(mlDqmClient_) << "[FastFedCablingHistograms::" << __func__ << "]"
119  << " NULL pointer to analysis object!";
120  continue;
121  }
122 
123  std::stringstream ss;
124  anal->print(ss);
125  if (anal->isValid() && !(anal->isDirty()) && !(anal->badTrimDac())) {
126  LogTrace(mlDqmClient_) << ss.str();
127  } else {
128  edm::LogWarning(mlDqmClient_) << ss.str();
129  }
130  }
131 }

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

◆ printSummary()

void FastFedCablingHistograms::printSummary ( )
overridevirtual

Reimplemented from CommissioningHistograms.

Definition at line 135 of file FastFedCablingHistograms.cc.

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

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

sistrip::FAST_CABLING
Definition: ConstantsForRunType.h:89
CommissioningHistograms::pset
const edm::ParameterSet & pset() const
Definition: CommissioningHistograms.h:163
CommissioningHistograms::bei
DQMStore *const bei() const
Definition: CommissioningHistograms.h:159
MessageLogger_cfi.errors
errors
Definition: MessageLogger_cfi.py:18
FastFedCablingAnalysis
Histogram-based analysis for connection loop.
Definition: FastFedCablingAnalysis.h:16
CommissioningHistograms::data
Analyses & data(bool getMaskedData=false)
Definition: CommissioningHistograms.cc:718
ExtractTObject
Definition: ExtractTObject.h:9
sistrip::mlDqmClient_
static const char mlDqmClient_[]
Definition: ConstantsForLogger.h:19
validateGeometry_cfg.valid
valid
Definition: validateGeometry_cfg.py:21
end
#define end
Definition: vmac.h:39
CommissioningHistograms::CommissioningHistograms
CommissioningHistograms()
Definition: CommissioningHistograms.cc:60
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
cmsdt::algo
algo
Definition: constants.h:164
errors
Definition: errors.py:1
CommissioningHistograms::factory_
std::unique_ptr< Factory > factory_
Definition: CommissioningHistograms.h:129
edm::LogWarning
Definition: MessageLogger.h:141
edm::ParameterSet
Definition: ParameterSet.h:36
edm::LogError
Definition: MessageLogger.h:183
KineDebug3::count
void count()
Definition: KinematicConstrainedVertexUpdatorT.h:21
edm::LogVerbatim
Definition: MessageLogger.h:297
ExtractTObject::extract
static T * extract(MonitorElement *me)
Definition: ExtractTObject.cc:21
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
relativeConstraints.empty
bool empty
Definition: relativeConstraints.py:46
CommissioningHistograms::histos
const HistosMap & histos() const
Definition: CommissioningHistograms.h:161
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671
conversion_template_cfg.anal
anal
Definition: conversion_template_cfg.py:16
CommissioningHistograms::mapping
const FedToFecMap & mapping() const
Definition: CommissioningHistograms.h:162
cuy.ii
ii
Definition: cuy.py:590
begin
#define begin
Definition: vmac.h:32
FastFedCablingSummaryFactory
Definition: FastFedCablingSummaryFactory.h:6
FastFedCablingAlgorithm
Histogram-based analysis for connection loop.
Definition: FastFedCablingAlgorithm.h:16