DQM
SiStripCommissioningClients
src
FedTimingHistograms.cc
Go to the documentation of this file.
1
#include "
DQM/SiStripCommissioningClients/interface/FedTimingHistograms.h
"
2
#include "
CondFormats/SiStripObjects/interface/FedTimingAnalysis.h
"
3
#include "
DataFormats/SiStripCommon/interface/SiStripEnumsAndStrings.h
"
4
#include "
DQM/SiStripCommissioningAnalysis/interface/FedTimingAlgorithm.h
"
5
#include "
DQM/SiStripCommissioningSummary/interface/SummaryGenerator.h
"
6
#include <iostream>
7
#include <sstream>
8
#include <iomanip>
9
10
using namespace
std
;
11
12
// -----------------------------------------------------------------------------
14
FedTimingHistograms::FedTimingHistograms
(
const
edm::ParameterSet
&
pset
,
DQMStore
* bei)
15
:
CommissioningHistograms
(
pset
.getParameter<
edm
::
ParameterSet
>(
"FedTimingParameters"
), bei,
sistrip
::
FED_TIMING
),
16
factory_(new
Factory
),
17
optimumSamplingPoint_(15.),
18
minDelay_(
sistrip
::
invalid_
),
19
maxDelay_(-1. *
sistrip
::
invalid_
),
20
deviceWithMinDelay_(
sistrip
::
invalid_
),
21
deviceWithMaxDelay_(
sistrip
::
invalid_
) {
22
cout
<<
"["
<< __PRETTY_FUNCTION__ <<
"]"
23
<<
" Created object for APV TIMING histograms"
<< endl;
24
}
25
26
// -----------------------------------------------------------------------------
28
FedTimingHistograms::~FedTimingHistograms
() {
cout
<<
"["
<< __PRETTY_FUNCTION__ <<
"]"
<< endl; }
29
30
// -----------------------------------------------------------------------------
32
void
FedTimingHistograms::histoAnalysis
(
bool
debug
) {
33
// Clear std::map holding analysis objects
34
data_
.clear();
35
36
// Reset minimum / maximum delays
37
float
time_min = 1. *
sistrip::invalid_
;
38
float
time_max = -1. *
sistrip::invalid_
;
39
uint32_t device_min =
sistrip::invalid_
;
40
uint32_t device_max =
sistrip::invalid_
;
41
42
// // Iterate through std::map containing std::vectors of profile histograms
43
// CollationsMap::const_iterator iter = collations().begin();
44
// for ( ; iter != collations().end(); iter++ ) {
45
46
// // Check std::vector of histos is not empty (should be 2 histos)
47
// if ( iter->second.empty() ) {
48
// cerr << "[" << __PRETTY_FUNCTION__ << "]"
49
// << " Zero collation histograms found!" << endl;
50
// continue;
51
// }
52
53
// // Retrieve pointers to profile histos for this FED channel
54
// std::vector<TH1*> profs;
55
// Collations::const_iterator ihis = iter->second.begin();
56
// for ( ; ihis != iter->second.end(); ihis++ ) {
57
// OBSOLETE!!!
58
// TProfile* prof = ExtractTObject<TProfile>().extract( mui()->get( ihis->first ) );
59
// if ( prof ) { profs.push_back(prof); }
60
// }
61
62
// // Perform histo analysis
63
// FedTimingAnalysis anal( iter->first );
64
// FedTimingAlgorithm algo( &anal );
65
// algo.analysis( profs );
66
// data_[iter->first] = anal;
67
68
// // Check tick height is valid
69
// if ( anal.height() < 100. ) {
70
// cerr << "[" << __PRETTY_FUNCTION__ << "]"
71
// << " Tick mark height too small: " << anal.height() << endl;
72
// continue;
73
// }
74
75
// // Check time of rising edge
76
// if ( anal.time() > sistrip::maximum_ ) { continue; }
77
78
// // Find maximum time
79
// if ( anal.time() > time_max ) {
80
// time_max = anal.time();
81
// device_max = iter->first;
82
// }
83
84
// // Find minimum time
85
// if ( anal.time() < time_min ) {
86
// time_min = anal.time();
87
// device_min = iter->first;
88
// }
89
90
// }
91
92
// cout << "[" << __PRETTY_FUNCTION__ << "]"
93
// << " Analyzed histograms for "
94
// << collations().size()
95
// << " FED channels" << endl;
96
97
// Adjust maximum (and minimum) delay(s) to find optimum sampling point(s)
98
if
(time_max >
sistrip::maximum_
|| time_max < -1. *
sistrip::maximum_
) {
99
cerr
<<
"["
<< __PRETTY_FUNCTION__ <<
"]"
100
<<
" Unable to set maximum time! Found unexpected value: "
<< time_max << endl;
101
return
;
102
}
103
104
SiStripFecKey
max
(device_max);
105
cout
<<
" Device (FEC/slot/ring/CCU/module/channel) "
<<
max
.fecCrate() <<
"/"
<<
max
.fecSlot() <<
"/"
106
<<
max
.fecRing() <<
"/"
<<
max
.ccuAddr() <<
"/"
<<
max
.ccuChan() <<
"/"
107
<<
" has maximum delay (rising edge) [ns]:"
<< time_max << endl;
108
109
SiStripFecKey
min
(device_min);
110
cout
<<
" Device (FEC/slot/ring/CCU/module/channel): "
<<
min
.fecCrate() <<
"/"
<<
min
.fecSlot() <<
"/"
111
<<
min
.fecRing() <<
"/"
<<
min
.ccuAddr() <<
"/"
<<
min
.ccuChan() <<
"/"
112
<<
" has minimum delay (rising edge) [ns]:"
<< time_min << endl;
113
114
// Set maximum time for all analysis objects
115
std::map<uint32_t, FedTimingAnalysis>::iterator ianal =
data_
.begin();
116
for
(; ianal !=
data_
.end(); ianal++) {
117
ianal->second.max(time_max);
118
static
uint16_t cntr = 0;
119
if
(
debug
) {
120
std::stringstream
ss
;
121
ianal->second.print(
ss
);
122
cout
<<
ss
.str() << endl;
123
cntr++;
124
}
125
}
126
}
127
128
// -----------------------------------------------------------------------------
130
void
FedTimingHistograms::createSummaryHisto
(
const
sistrip::Monitorable
&
histo
,
131
const
sistrip::Presentation
&
type
,
132
const
std::string
&
directory
,
133
const
sistrip::Granularity
& gran) {
134
cout
<<
"["
<< __PRETTY_FUNCTION__ <<
"]"
<< endl;
135
136
// Check view
137
sistrip::View
view =
SiStripEnumsAndStrings::view
(
directory
);
138
if
(view ==
sistrip::UNKNOWN_VIEW
) {
139
return
;
140
}
141
142
// Analyze histograms
143
histoAnalysis
(
false
);
144
145
// Extract data to be histogrammed
146
factory_
->init(
histo
,
type
, view,
directory
, gran);
147
uint32_t
xbins
=
factory_
->extract(
data_
);
148
149
// Create summary histogram (if it doesn't already exist)
150
TH1*
summary
=
histogram
(
histo
,
type
, view,
directory
,
xbins
);
151
152
// Fill histogram with data
153
factory_
->fill(*
summary
);
154
}
sistrip::Granularity
Granularity
Definition:
ConstantsForGranularity.h:60
fw3dlego::xbins
const double xbins[]
Definition:
fw3dlego_xbins.cc:16
FedTimingHistograms::factory_
std::unique_ptr< Factory > factory_
Definition:
FedTimingHistograms.h:27
sistrip::View
View
Definition:
ConstantsForView.h:26
min
T min(T a, T b)
Definition:
MathUtil.h:58
edm
HLT enums.
Definition:
AlignableModifier.h:19
gather_cfg.cout
cout
Definition:
gather_cfg.py:144
timingPdfMaker.histo
histo
Definition:
timingPdfMaker.py:278
FedTimingHistograms::createSummaryHisto
void createSummaryHisto(const sistrip::Monitorable &, const sistrip::Presentation &, const std::string &top_level_dir, const sistrip::Granularity &) override
Definition:
FedTimingHistograms.cc:130
contentValuesCheck.ss
ss
Definition:
contentValuesCheck.py:33
sistrip::Monitorable
Monitorable
Definition:
ConstantsForMonitorable.h:200
debug
#define debug
Definition:
HDRShower.cc:19
FedTimingAnalysis.h
dqm::legacy::DQMStore
Definition:
DQMStore.h:728
FedTimingHistograms::FedTimingHistograms
FedTimingHistograms(const edm::ParameterSet &pset, DQMStore *)
Definition:
FedTimingHistograms.cc:14
sistrip::Presentation
Presentation
Definition:
ConstantsForPresentation.h:28
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
SiStripFecKey
Utility class that identifies a position within the strip tracker control structure,...
Definition:
SiStripFecKey.h:45
edm::ParameterSet
Definition:
ParameterSet.h:47
ParameterSet
Definition:
Functions.h:16
FedTimingHistograms::data_
std::map< uint32_t, FedTimingAnalysis > data_
Definition:
FedTimingHistograms.h:25
SiStripPI::max
Definition:
SiStripPayloadInspectorHelper.h:169
type
type
Definition:
SiPixelVCal_PayloadInspector.cc:39
sistrip::maximum_
static const uint16_t maximum_
Definition:
Constants.h:20
FedTimingHistograms::~FedTimingHistograms
~FedTimingHistograms() override
Definition:
FedTimingHistograms.cc:28
edmLumisInFiles.summary
summary
Definition:
edmLumisInFiles.py:39
SiStripEnumsAndStrings::view
static std::string view(const sistrip::View &)
Definition:
SiStripEnumsAndStrings.cc:5
sistrip::FED_TIMING
Definition:
ConstantsForRunType.h:80
sistrip::invalid_
static const uint16_t invalid_
Definition:
Constants.h:16
CommissioningHistograms
Definition:
CommissioningHistograms.h:23
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
SiStripEnumsAndStrings.h
createBeamHaloJobs.directory
string directory
Definition:
createBeamHaloJobs.py:211
FedTimingAlgorithm.h
SummaryGenerator.h
FedTimingHistograms.h
sistrip
sistrip classes
Definition:
EnsembleCalibrationLA.cc:10
FedTimingHistograms::histoAnalysis
void histoAnalysis(bool debug) override
Definition:
FedTimingHistograms.cc:32
EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.cerr
cerr
Definition:
EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.py:8
muonDTDigis_cfi.pset
pset
Definition:
muonDTDigis_cfi.py:27
Generated for CMSSW Reference Manual by
1.8.16