21 enum { kESChannels = 137216 };
29 ESChannelStatusPlot() :
cond::payloadInspector::PlotImage<
ESChannelStatus>(
"ES channel status") {
32 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs)
override {
33 TH2F*** esmap =
new TH2F**[2];
35 for (
int plane = 0; plane < 2; plane++) {
36 esmap[plane] =
new TH2F*[2];
37 for (
int side = 0; side < 2; side++)
38 esmap[plane][side] =
new TH2F(
43 auto iov = iovs.front();
45 run = std::get<0>(iov);
48 for (
int id = 0;
id < kESChannels;
id++)
51 int side = myESId.
zside();
56 int plane = myESId.
plane() - 1;
57 if (side < 0 || side > 1 || plane < 0 || plane > 1) {
58 std::cout <<
" channel " <<
id <<
" side " << myESId.
zside() <<
" plane " << myESId.
plane() << std::endl;
64 if (myESId.
strip() == 1) {
65 esmap[plane][side]->Fill(myESId.
six() - 1, myESId.
siy() - 1,
status);
75 gStyle->SetOptStat(0);
76 gStyle->SetPalette(1);
77 TCanvas
canvas(
"CC map",
"CC map", 1680, 1320);
82 t1.DrawLatex(0.5, 0.96, Form(
"ES Channel Status, IOV %i",
run));
83 t1.SetTextSize(0.025);
85 float xmi[2] = {0.0, 0.5};
86 float xma[2] = {0.5, 1.0};
87 TPad*** pad =
new TPad**[2];
88 for (
int plane = 0; plane < 2; plane++) {
89 pad[plane] =
new TPad*[2];
90 for (
int side = 0; side < 2; side++) {
91 float yma = 0.94 - (0.46 * plane);
92 float ymi = yma - 0.44;
94 new TPad(Form(
"p_%i_%i", plane, side), Form(
"p_%i_%i", plane, side), xmi[side], ymi, xma[side], yma);
95 pad[plane][side]->Draw();
99 for (
int side = 0; side < 2; side++) {
100 for (
int plane = 0; plane < 2; plane++) {
101 pad[plane][side]->cd();
102 esmap[plane][side]->Draw(
"colz1");
107 t1.SetTextSize(0.025);
108 int Nbdead = escount * 32;
112 t1.DrawLatex(0.5, 0.92, Form(
"Number of dead strips %i", Nbdead));
115 canvas.SaveAs(ImageName.c_str());
123 template <cond::payloadInspector::IOVMultiplicity nIOVs,
int ntags>
126 ESChannelStatusDiffBase()
127 :
cond::payloadInspector::PlotImage<
ESChannelStatus, nIOVs, ntags>(
"ES channel status difference") {}
128 bool fill()
override {
129 TH2F*** esmap =
new TH2F**[2];
131 for (
int plane = 0; plane < 2; plane++) {
132 esmap[plane] =
new TH2F*[2];
133 for (
int side = 0; side < 2; side++)
134 esmap[plane][side] =
new TH2F(
138 unsigned int run[2] = {0, 0};
139 int stat[kESChannels];
142 auto iovs = cond::payloadInspector::PlotBase::getTag<0>().iovs;
143 l_tagname[0] = cond::payloadInspector::PlotBase::getTag<0>().
name;
144 auto firstiov = iovs.front();
145 run[0] = std::get<0>(firstiov);
146 std::tuple<cond::Time_t, cond::Hash> lastiov;
148 auto tag2iovs = cond::payloadInspector::PlotBase::getTag<1>().iovs;
149 l_tagname[1] = cond::payloadInspector::PlotBase::getTag<1>().
name;
150 lastiov = tag2iovs.front();
152 lastiov = iovs.back();
153 l_tagname[1] = l_tagname[0];
155 run[1] = std::get<0>(lastiov);
156 for (
int irun = 0; irun < nIOVs; irun++) {
157 std::shared_ptr<ESChannelStatus>
payload;
165 for (
int id = 0;
id < kESChannels;
id++)
173 int side = myESId.
zside();
178 int plane = myESId.
plane() - 1;
179 if (side < 0 || side > 1 || plane < 0 || plane > 1) {
180 std::cout <<
" channel " <<
id <<
" side " << myESId.
zside() <<
" plane " << myESId.
plane()
186 if (myESId.
strip() == 1) {
187 esmap[plane][side]->Fill(myESId.
six() - 1, myESId.
siy() - 1,
diff);
196 gStyle->SetOptStat(0);
197 gStyle->SetPalette(1);
198 TCanvas
canvas(
"CC map",
"CC map", 1680, 1320);
202 int len = l_tagname[0].length() + l_tagname[1].length();
205 t1.SetTextSize(0.03);
207 0.5, 0.96, Form(
"%s IOV %i - %s IOV %i", l_tagname[1].c_str(),
run[1], l_tagname[0].c_str(),
run[0]));
209 t1.SetTextSize(0.05);
210 t1.DrawLatex(0.5, 0.96, Form(
"ES Channel Status, IOV %i - %i",
run[1],
run[0]));
213 t1.SetTextSize(0.05);
214 t1.DrawLatex(0.5, 0.96, Form(
"%s IOV %i - %i", l_tagname[0].c_str(),
run[1],
run[0]));
217 float xmi[2] = {0.0, 0.5};
218 float xma[2] = {0.5, 1.0};
219 TPad*** pad =
new TPad**[2];
220 for (
int plane = 0; plane < 2; plane++) {
221 pad[plane] =
new TPad*[2];
222 for (
int side = 0; side < 2; side++) {
223 float yma = 0.94 - (0.46 * plane);
224 float ymi = yma - 0.44;
226 new TPad(Form(
"p_%i_%i", plane, side), Form(
"p_%i_%i", plane, side), xmi[side], ymi, xma[side], yma);
227 pad[plane][side]->Draw();
231 for (
int side = 0; side < 2; side++) {
232 for (
int plane = 0; plane < 2; plane++) {
233 pad[plane][side]->cd();
234 esmap[plane][side]->Draw(
"colz1");
239 t1.SetTextSize(0.025);
240 int Nbdead = escount * 32;
244 t1.DrawLatex(0.5, 0.92, Form(
"Number of different strips %i", Nbdead));
247 canvas.SaveAs(ImageName.c_str());
251 using ESChannelStatusDiffOneTag = ESChannelStatusDiffBase<cond::payloadInspector::SINGLE_IOV, 1>;
252 using ESChannelStatusDiffTwoTags = ESChannelStatusDiffBase<cond::payloadInspector::SINGLE_IOV, 2>;
#define PAYLOAD_INSPECTOR_CLASS(CLASS_NAME)
#define PAYLOAD_INSPECTOR_MODULE(PAYLOAD_TYPENAME)
void DrawES(int plane, int side)
static ESDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
uint16_t getStatusCode() const
static bool validHashIndex(int hi)
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)