DQM
SiStripCommissioningSummary
src
FedCablingSummaryFactory.cc
Go to the documentation of this file.
1
#include "
DQM/SiStripCommissioningSummary/interface/FedCablingSummaryFactory.h
"
2
#include "
DQM/SiStripCommissioningSummary/interface/SummaryGenerator.h
"
3
#include "
DataFormats/SiStripCommon/interface/SiStripEnumsAndStrings.h
"
4
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
5
#include <iostream>
6
#include <sstream>
7
8
using namespace
sistrip
;
9
10
// -----------------------------------------------------------------------------
11
//
12
uint32_t
SummaryPlotFactory<FedCablingAnalysis*>::init
(
const
sistrip::Monitorable
&
mon
,
13
const
sistrip::Presentation
& pres,
14
const
sistrip::View
& view,
15
const
std::string
&
level
,
16
const
sistrip::Granularity
& gran,
17
const
std::map<uint32_t, FedCablingAnalysis*>&
data
) {
18
// Some initialisation
19
SummaryPlotFactoryBase::init
(
mon
, pres, view,
level
, gran);
20
21
// Check if generator class exists
22
if
(!
SummaryPlotFactoryBase::generator_
) {
23
return
0;
24
}
25
26
// Extract monitorable
27
std::map<uint32_t, FedCablingAnalysis*>::const_iterator iter =
data
.begin();
28
for
(; iter !=
data
.end(); iter++) {
29
float
value
= static_cast<float>(
sistrip::invalid_
);
30
if
(
SummaryPlotFactoryBase::mon_
==
sistrip::FED_CABLING_FED_ID
) {
31
value
= iter->second->fedId();
32
}
else
if
(
SummaryPlotFactoryBase::mon_
==
sistrip::FED_CABLING_FED_CH
) {
33
value
= iter->second->fedCh();
34
}
else
if
(
SummaryPlotFactoryBase::mon_
==
sistrip::FED_CABLING_ADC_LEVEL
) {
35
value
= iter->second->adcLevel();
36
}
else
{
37
edm::LogWarning
(
mlSummaryPlots_
) <<
"[SummaryPlotFactory::"
<< __func__ <<
"]"
38
<<
" Unexpected monitorable: "
39
<<
SiStripEnumsAndStrings::monitorable
(
SummaryPlotFactoryBase::mon_
);
40
continue
;
41
}
42
SummaryPlotFactoryBase::generator_
->
fillMap
(
43
SummaryPlotFactoryBase::level_
,
SummaryPlotFactoryBase::gran_
, iter->first,
value
);
44
}
45
46
return
SummaryPlotFactoryBase::generator_
->
nBins
();
47
}
48
49
//------------------------------------------------------------------------------
50
//
51
void
SummaryPlotFactory<FedCablingAnalysis*>::fill
(TH1& summary_histo) {
52
// Histogram filling and formating
53
SummaryPlotFactoryBase::fill
(summary_histo);
54
55
if
(!
SummaryPlotFactoryBase::generator_
) {
56
return
;
57
}
58
59
// Histogram formatting
60
if
(
SummaryPlotFactoryBase::mon_
==
sistrip::FED_CABLING_FED_ID
) {
61
SummaryPlotFactoryBase::generator_
->
axisLabel
(
"FED id"
);
62
}
else
if
(
SummaryPlotFactoryBase::mon_
==
sistrip::FED_CABLING_FED_CH
) {
63
SummaryPlotFactoryBase::generator_
->
axisLabel
(
"FED channel"
);
64
}
else
if
(
SummaryPlotFactoryBase::mon_
==
sistrip::FED_CABLING_ADC_LEVEL
) {
65
SummaryPlotFactoryBase::generator_
->
axisLabel
(
"Signal level [ADC]"
);
66
}
else
{
67
edm::LogWarning
(
mlSummaryPlots_
) <<
"[SummaryPlotFactory::"
<< __func__ <<
"]"
68
<<
" Unexpected SummaryHisto value:"
69
<<
SiStripEnumsAndStrings::monitorable
(
SummaryPlotFactoryBase::mon_
);
70
}
71
}
personalPlayback.level
level
Definition:
personalPlayback.py:22
sistrip::Granularity
Granularity
Definition:
ConstantsForGranularity.h:60
SummaryGenerator::fillMap
void fillMap(const std::string &top_level_dir, const sistrip::Granularity &, const uint32_t &key, const float &value, const float &error=0.)
Definition:
SummaryGenerator.cc:222
MessageLogger.h
sistrip::View
View
Definition:
ConstantsForView.h:26
FedCablingSummaryFactory.h
SummaryPlotFactoryBase::mon_
sistrip::Monitorable mon_
Definition:
SummaryPlotFactoryBase.h:25
SummaryPlotFactoryBase::fill
void fill(TH1 &summary_histo)
Definition:
SummaryPlotFactoryBase.cc:99
SummaryPlotFactory::init
uint32_t init(const sistrip::Monitorable &, const sistrip::Presentation &, const sistrip::View &, const std::string &top_level_dir, const sistrip::Granularity &, const std::map< uint32_t, T > &data)
Definition:
SummaryPlotFactory.cc:10
SummaryPlotFactory::fill
void fill(TH1 &summary_histo)
Definition:
SummaryPlotFactory.cc:36
sistrip::FED_CABLING_FED_CH
Definition:
ConstantsForMonitorable.h:205
sistrip::FED_CABLING_ADC_LEVEL
Definition:
ConstantsForMonitorable.h:206
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition:
MessageLogger.h:122
SummaryPlotFactoryBase::level_
std::string level_
Definition:
SummaryPlotFactoryBase.h:28
sistrip::Monitorable
Monitorable
Definition:
ConstantsForMonitorable.h:200
SummaryPlotFactoryBase::init
void init(const sistrip::Monitorable &, const sistrip::Presentation &, const sistrip::View &, const std::string &top_level_dir, const sistrip::Granularity &)
Definition:
SummaryPlotFactoryBase.cc:31
sistrip::Presentation
Presentation
Definition:
ConstantsForPresentation.h:28
LaserDQM_cfi.mon
mon
Definition:
LaserDQM_cfi.py:3
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
sistrip::FED_CABLING_FED_ID
Definition:
ConstantsForMonitorable.h:204
SummaryPlotFactoryBase::generator_
SummaryGenerator * generator_
Definition:
SummaryPlotFactoryBase.h:32
value
Definition:
value.py:1
SummaryGenerator::axisLabel
void axisLabel(const std::string &)
Definition:
SummaryGenerator.h:135
sistrip::invalid_
static const uint16_t invalid_
Definition:
Constants.h:16
SiStripEnumsAndStrings::monitorable
static std::string monitorable(const sistrip::Monitorable &)
Definition:
SiStripEnumsAndStrings.cc:547
SummaryPlotFactoryBase::gran_
sistrip::Granularity gran_
Definition:
SummaryPlotFactoryBase.h:29
sistrip::mlSummaryPlots_
static const char mlSummaryPlots_[]
Definition:
ConstantsForLogger.h:26
SiStripEnumsAndStrings.h
SummaryGenerator::nBins
uint32_t nBins() const
Definition:
SummaryGenerator.h:134
data
char data[epos_bytes_allocation]
Definition:
EPOS_Wrapper.h:79
SummaryGenerator.h
sistrip
sistrip classes
Definition:
SiStripQualityHelpers.h:14
Generated for CMSSW Reference Manual by
1.8.16