CMS 3D CMS Logo

FedCablingHistograms.cc
Go to the documentation of this file.
9 #include <iostream>
10 #include <sstream>
11 #include <iomanip>
12 #include "TProfile.h"
13 
14 using namespace std;
15 using namespace sistrip;
16 
17 // -----------------------------------------------------------------------------
20  : CommissioningHistograms(pset.getParameter<edm::ParameterSet>("FedCablingParameters"), bei, sistrip::FED_CABLING),
21  factory_(new Factory) {
22  LogTrace(mlDqmClient_) << "[FedCablingHistograms::" << __func__ << "]"
23  << " Constructing object...";
24 }
25 
26 // -----------------------------------------------------------------------------
29  LogTrace(mlDqmClient_) << "[FedCablingHistograms::" << __func__ << "]"
30  << " Destructing object...";
31 }
32 
33 // -----------------------------------------------------------------------------
36  LogTrace(mlDqmClient_) << "[FedCablingHistograms::" << __func__ << "]";
37 
38  uint16_t valid = 0;
39  HistosMap::const_iterator iter;
40  Analyses::iterator ianal;
41 
42  // Clear map holding analysis objects
43  for (ianal = data_.begin(); ianal != data_.end(); ianal++) {
44  if (ianal->second) {
45  delete ianal->second;
46  }
47  }
48  data_.clear();
49 
50  // Iterate through map containing histograms
51  for (iter = histos().begin(); iter != histos().end(); iter++) {
52  // Check vector of histos is not empty
53  if (iter->second.empty()) {
54  edm::LogWarning(mlDqmClient_) << "[FedCablingHistograms::" << __func__ << "]"
55  << " Zero histograms found!";
56  continue;
57  }
58 
59  // Retrieve pointers to histos
60  std::vector<TH1*> profs;
61  Histos::const_iterator ihis = iter->second.begin();
62  for (; ihis != iter->second.end(); ihis++) {
63  TProfile* prof = ExtractTObject<TProfile>().extract((*ihis)->me_);
64  if (prof) {
65  profs.push_back(prof);
66  }
67  }
68 
69  // Perform histo analysis
70  FedCablingAnalysis* anal = new FedCablingAnalysis(iter->first);
71  FedCablingAlgorithm algo(this->pset(), anal);
72  algo.analysis(profs);
73  data_[iter->first] = anal;
74  if (anal->isValid()) {
75  valid++;
76  }
77  }
78 
79  if (!histos().empty()) {
80  edm::LogVerbatim(mlDqmClient_) << "[FedCablingHistograms::" << __func__ << "]"
81  << " Analyzed histograms for " << histos().size() << " FED channels, of which "
82  << valid << " (" << 100 * valid / histos().size() << "%) are valid.";
83  } else {
84  edm::LogWarning(mlDqmClient_) << "[FedCablingHistograms::" << __func__ << "]"
85  << " No histograms to analyze!";
86  }
87 }
88 
89 // -----------------------------------------------------------------------------
92  Analyses::iterator ianal = data_.begin();
93  Analyses::iterator janal = data_.end();
94  for (; ianal != janal; ++ianal) {
95  if (ianal->second) {
96  std::stringstream ss;
97  ianal->second->print(ss);
98  if (ianal->second->isValid()) {
99  LogTrace(mlDqmClient_) << ss.str();
100  } else {
101  edm::LogWarning(mlDqmClient_) << ss.str();
102  }
103  }
104  }
105 }
106 
107 // -----------------------------------------------------------------------------
111  const std::string& dir,
112  const sistrip::Granularity& gran) {
113  LogTrace(mlDqmClient_) << "[FedCablingHistograms::" << __func__ << "]";
114 
115  // Check view
117  if (view == sistrip::UNKNOWN_VIEW) {
118  return;
119  }
120 
121  // Analyze histograms if not done already
122  if (data_.empty()) {
123  histoAnalysis(false);
124  }
125 
126  // Extract data to be histogrammed
127  uint32_t xbins = factory_->init(histo, type, view, dir, gran, data_);
128 
129  // Create summary histogram (if it doesn't already exist)
130  TH1* summary = histogram(histo, type, view, dir, xbins);
131 
132  // Fill histogram with data
133  factory_->fill(*summary);
134 }
FedCablingAlgorithm
Histogram-based analysis for connection loop.
Definition: FedCablingAlgorithm.h:16
sistrip::Granularity
Granularity
Definition: ConstantsForGranularity.h:60
fw3dlego::xbins
const double xbins[]
Definition: fw3dlego_xbins.cc:16
MessageLogger.h
sistrip::View
View
Definition: ConstantsForView.h:26
CommissioningHistograms::pset
const edm::ParameterSet & pset() const
Definition: CommissioningHistograms.h:163
edm
HLT enums.
Definition: AlignableModifier.h:19
FedCablingHistograms::factory_
std::unique_ptr< Factory > factory_
Definition: FedCablingHistograms.h:32
timingPdfMaker.histo
histo
Definition: timingPdfMaker.py:278
ExtractTObject.h
FedCablingAlgorithm.h
ExtractTObject
Definition: ExtractTObject.h:9
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
sistrip::mlDqmClient_
static const char mlDqmClient_[]
Definition: ConstantsForLogger.h:19
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
cmsdt::algo
algo
Definition: constants.h:171
sistrip::Monitorable
Monitorable
Definition: ConstantsForMonitorable.h:200
debug
#define debug
Definition: HDRShower.cc:19
sistrip::FED_CABLING
Definition: ConstantsForRunType.h:81
dqm::legacy::DQMStore
Definition: DQMStore.h:728
FedCablingHistograms.h
sistrip::Presentation
Presentation
Definition: ConstantsForPresentation.h:28
FedCablingHistograms::histoAnalysis
void histoAnalysis(bool debug) override
Definition: FedCablingHistograms.cc:35
CommissioningHistograms::histogram
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_)
Definition: CommissioningHistograms.cc:656
SiStripConstants.h
edm::ParameterSet
Definition: ParameterSet.h:47
ParameterSet
Definition: Functions.h:16
type
type
Definition: SiPixelVCal_PayloadInspector.cc:39
edmLumisInFiles.summary
summary
Definition: edmLumisInFiles.py:39
SiStripEnumsAndStrings::view
static std::string view(const sistrip::View &)
Definition: SiStripEnumsAndStrings.cc:5
ExtractTObject::extract
static T * extract(MonitorElement *me)
Definition: ExtractTObject.cc:21
CommissioningHistograms
Definition: CommissioningHistograms.h:23
FedCablingHistograms::~FedCablingHistograms
~FedCablingHistograms() override
Definition: FedCablingHistograms.cc:28
FedCablingHistograms::printAnalyses
void printAnalyses() override
Definition: FedCablingHistograms.cc:91
sistrip::UNKNOWN_VIEW
Definition: ConstantsForView.h:27
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SummaryPlotFactory< CommissioningAnalysis * >
Definition: CommissioningSummaryFactory.h:12
std
Definition: JetResolutionObject.h:76
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
SiStripEnumsAndStrings.h
FedCablingHistograms::data_
Analyses data_
Definition: FedCablingHistograms.h:30
CommissioningHistograms::histos
const HistosMap & histos() const
Definition: CommissioningHistograms.h:161
SummaryGenerator.h
RunInfoPI::valid
Definition: RunInfoPayloadInspectoHelper.h:16
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
sistrip
sistrip classes
Definition: EnsembleCalibrationLA.cc:10
conversion_template_cfg.anal
anal
Definition: conversion_template_cfg.py:16
FedCablingHistograms::createSummaryHisto
void createSummaryHisto(const sistrip::Monitorable &, const sistrip::Presentation &, const std::string &top_level_dir, const sistrip::Granularity &) override
Definition: FedCablingHistograms.cc:109
FedCablingHistograms::FedCablingHistograms
FedCablingHistograms(const edm::ParameterSet &pset, DQMStore *)
Definition: FedCablingHistograms.cc:19
FedCablingAnalysis
Histogram-based analysis for connection loop.
Definition: FedCablingAnalysis.h:16
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23
FedCablingAnalysis.h