1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
|
/*!
\file SiStripLatency_PayloadInspector
\Payload Inspector Plugin for SiStrip Latency
\author Jessica Prisciandaro
\version $Revision: 1.0 $
\date $Date: 2018/05/22 17:59:56 $
*/
#include "CondCore/Utilities/interface/PayloadInspectorModule.h"
#include "CondCore/Utilities/interface/PayloadInspector.h"
#include "CondCore/CondDB/interface/Time.h"
// the data format of the condition to be inspected
#include "CondFormats/SiStripObjects/interface/SiStripLatency.h"
#include "DataFormats/DetId/interface/DetId.h"
#include "DataFormats/SiStripDetId/interface/StripSubdetector.h"
#include "CondFormats/SiStripObjects/interface/SiStripDetSummary.h"
// needed for the tracker map
#include "CommonTools/TrackerMap/interface/TrackerMap.h"
// auxilliary functions
#include "CondCore/SiStripPlugins/interface/SiStripPayloadInspectorHelper.h"
#include "CalibTracker/StandaloneTrackerTopology/interface/StandaloneTrackerTopology.h"
#include <memory>
#include <sstream>
#include <iostream>
// include ROOT
#include "TProfile.h"
#include "TH2F.h"
#include "TLegend.h"
#include "TCanvas.h"
#include "TLine.h"
#include "TStyle.h"
#include "TLatex.h"
#include "TPave.h"
#include "TPaveStats.h"
namespace {
using namespace cond::payloadInspector;
/************************************************
// test class
*************************************************/
class SiStripLatencyTest : public Histogram1D<SiStripLatency, SINGLE_IOV> {
public:
SiStripLatencyTest()
: Histogram1D<SiStripLatency, SINGLE_IOV>("SiStripLatency values", "SiStripLatency values", 5, 0.0, 5.0) {}
bool fill() override {
auto tag = PlotBase::getTag<0>();
for (auto const& iov : tag.iovs) {
std::shared_ptr<SiStripLatency> payload = Base::fetchPayload(std::get<1>(iov));
if (payload.get()) {
std::vector<SiStripLatency::Latency> lat = payload->allLatencyAndModes();
fillWithValue(lat.size());
}
}
return true;
} // fill
};
/***********************************************
// 1d histogram of mode of 1 IOV
************************************************/
class SiStripLatencyMode : public Histogram1D<SiStripLatency, SINGLE_IOV> {
public:
SiStripLatencyMode() : Histogram1D<SiStripLatency>("SiStripLatency mode", "SiStripLatency mode", 70, -10, 60) {}
bool fill() override {
auto tag = PlotBase::getTag<0>();
for (auto const& iov : tag.iovs) {
std::shared_ptr<SiStripLatency> payload = Base::fetchPayload(std::get<1>(iov));
if (payload.get()) {
std::vector<uint16_t> modes;
payload->allModes(modes);
for (const auto& mode : modes) {
if (mode != 0)
fillWithValue(mode);
else
fillWithValue(-1);
}
}
}
return true;
}
};
/************************************************
// historic trend plot of mode as a function of the run
************************************************/
class SiStripLatencyModeHistory : public HistoryPlot<SiStripLatency, uint16_t> {
public:
SiStripLatencyModeHistory() : HistoryPlot<SiStripLatency, uint16_t>("Mode vs run number", "Mode vs run number") {}
uint16_t getFromPayload(SiStripLatency& payload) override {
uint16_t singlemode = payload.singleMode();
return singlemode;
}
};
/************************************************
// historic trend plot of mode as a function of the run
************************************************/
class SiStripIsPeakModeHistory : public HistoryPlot<SiStripLatency, int16_t> {
public:
SiStripIsPeakModeHistory() : HistoryPlot<SiStripLatency, int16_t>("Mode vs run number", "Mode vs run number") {}
int16_t getFromPayload(SiStripLatency& payload) override {
uint16_t mode = payload.singleReadOutMode();
return mode;
}
};
/************************************************
// historic trend plot of number of modes per run
************************************************/
class SiStripLatencyNumbOfModeHistory : public HistoryPlot<SiStripLatency, int> {
public:
SiStripLatencyNumbOfModeHistory()
: HistoryPlot<SiStripLatency, int>("Number of modes vs run ", "Number of modes vs run") {}
int getFromPayload(SiStripLatency& payload) override {
std::vector<uint16_t> modes;
payload.allModes(modes);
return modes.size();
}
};
} // namespace
// Register the classes as boost python plugin
PAYLOAD_INSPECTOR_MODULE(SiStripLatency) {
PAYLOAD_INSPECTOR_CLASS(SiStripLatencyTest);
PAYLOAD_INSPECTOR_CLASS(SiStripLatencyMode);
PAYLOAD_INSPECTOR_CLASS(SiStripLatencyModeHistory);
PAYLOAD_INSPECTOR_CLASS(SiStripIsPeakModeHistory);
PAYLOAD_INSPECTOR_CLASS(SiStripLatencyNumbOfModeHistory);
}
|