Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions CondCore/EcalPlugins/plugins/ESChannelStatus_PayloadInspector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ namespace {
enum { kESChannels = 137216 };
enum { IX_MIN = 1, IY_MIN = 1, IX_MAX = 40, IY_MAX = 40 }; // endcaps lower and upper bounds on x and y

/*********************************************************
2d plot of ES channel status of 1 IOV
*********************************************************/
/********************************************
2d plot of ES channel status of 1 IOV
*********************************************/
class ESChannelStatusPlot : public cond::payloadInspector::PlotImage<ESChannelStatus> {
public:
ESChannelStatusPlot() : cond::payloadInspector::PlotImage<ESChannelStatus>("ES channel status") {
Expand Down Expand Up @@ -117,9 +117,9 @@ namespace {
} // fill method
};

/************************************************************************
2d plot of ES channel status difference between 2 IOVs
************************************************************************/
/*************************************************************
2d plot of ES channel status difference between 2 IOVs
**************************************************************/
template <cond::payloadInspector::IOVMultiplicity nIOVs, int ntags>
class ESChannelStatusDiffBase : public cond::payloadInspector::PlotImage<ESChannelStatus, nIOVs, ntags> {
public:
Expand Down Expand Up @@ -200,15 +200,19 @@ namespace {
t1.SetNDC();
t1.SetTextAlign(26);
int len = l_tagname[0].length() + l_tagname[1].length();
if (ntags == 2 && len < 60) {
t1.SetTextSize(0.03);
t1.DrawLatex(
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]));
if (ntags == 2) {
if (len < 60) {
t1.SetTextSize(0.03);
t1.DrawLatex(
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]));
} else {
t1.SetTextSize(0.05);
t1.DrawLatex(0.5, 0.96, Form("ES Channel Status, IOV %i - %i", run[1], run[0]));
}
} else {
t1.SetTextSize(0.05);
t1.DrawLatex(0.5, 0.96, Form("ES Channel Status, IOV %i - %i", run[1], run[0]));
t1.DrawLatex(0.5, 0.96, Form("%s IOV %i - %i", l_tagname[0].c_str(), run[1], run[0]));
}
t1.SetTextSize(0.025);

float xmi[2] = {0.0, 0.5};
float xma[2] = {0.5, 1.0};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,12 @@ namespace {
/************************************************************************
2d plot of ES channel status difference between 2 IOVs
************************************************************************/
class ESIntercalibConstantsDiff : public cond::payloadInspector::PlotImage<ESIntercalibConstants> {
template <cond::payloadInspector::IOVMultiplicity nIOVs, int ntags>
class ESIntercalibConstantsDiffBase : public cond::payloadInspector::PlotImage<ESIntercalibConstants, nIOVs, ntags> {
public:
ESIntercalibConstantsDiff()
: cond::payloadInspector::PlotImage<ESIntercalibConstants>("ES IntercalibConstants difference") {
setSingleIov(false);
}
bool fill(const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs) override {
ESIntercalibConstantsDiffBase()
: cond::payloadInspector::PlotImage<ESIntercalibConstants, nIOVs, ntags>("ES IntercalibConstants difference") {}
bool fill() override {
TH2F*** esmap = new TH2F**[2];
std::string title[2][2] = {{"ES+F", "ES-F"}, {"ES+R", "ES-R"}};
for (int plane = 0; plane < 2; plane++) {
Expand All @@ -127,12 +126,30 @@ namespace {
esmap[plane][side] = new TH2F(
Form("esmap%i%i", plane, side), title[plane][side].c_str(), IX_MAX, 0, IX_MAX, IY_MAX, 0, IY_MAX);
}
unsigned int run[2], irun = 0;
unsigned int run[2];
std::string l_tagname[2];
float val[kESChannels], valmin = 999.;
for (auto const& iov : iovs) {
std::shared_ptr<ESIntercalibConstants> payload = fetchPayload(std::get<1>(iov));
run[irun] = std::get<0>(iov);
// std::cout << " irun " << irun << " IOV " << run[irun] << std::endl;
auto iovs = cond::payloadInspector::PlotBase::getTag<0>().iovs;
l_tagname[0] = cond::payloadInspector::PlotBase::getTag<0>().name;
auto firstiov = iovs.front();
run[0] = std::get<0>(firstiov);
std::tuple<cond::Time_t, cond::Hash> lastiov;
if (ntags == 2) {
auto tag2iovs = cond::payloadInspector::PlotBase::getTag<1>().iovs;
l_tagname[1] = cond::payloadInspector::PlotBase::getTag<1>().name;
lastiov = tag2iovs.front();
} else {
lastiov = iovs.back();
l_tagname[1] = l_tagname[0];
}
run[1] = std::get<0>(lastiov);
for (int irun = 0; irun < nIOVs; irun++) {
std::shared_ptr<ESIntercalibConstants> payload;
if (irun == 0) {
payload = this->fetchPayload(std::get<1>(firstiov));
} else {
payload = this->fetchPayload(std::get<1>(lastiov));
}
if (payload.get()) {
for (int id = 0; id < kESChannels; id++) // looping over all the ES channels
if (ESDetId::validHashIndex(id)) {
Expand Down Expand Up @@ -165,19 +182,23 @@ namespace {
} // 2nd IOV
} // validHashIndex
} // payload
irun++;
} // loop over IOVs
} // loop over IOVs

gStyle->SetOptStat(0);
gStyle->SetPalette(1);
TCanvas canvas("CC map", "CC map", 1680, 1320);
TLatex t1;
t1.SetNDC();
t1.SetTextAlign(26);
t1.SetTextSize(0.05);
t1.DrawLatex(0.5, 0.96, Form("ES Intercalib Constants, IOV %i - %i", run[1], run[0]));
t1.SetTextSize(0.025);

int len = l_tagname[0].length() + l_tagname[1].length();
if (ntags == 2 && len < 58) {
t1.SetTextSize(0.025);
t1.DrawLatex(
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]));
} else {
t1.SetTextSize(0.03);
t1.DrawLatex(0.5, 0.96, Form("ES Intercalib Constants, IOV %i - %i", run[1], run[0]));
}
float xmi[2] = {0.0, 0.5};
float xma[2] = {0.5, 1.0};
TPad*** pad = new TPad**[2];
Expand All @@ -203,15 +224,19 @@ namespace {
}
}

std::string ImageName(m_imageFileName);
std::string ImageName(this->m_imageFileName);
canvas.SaveAs(ImageName.c_str());
return true;
} // fill method
};
}; // class ESIntercalibConstantsDiffBase
using ESIntercalibConstantsDiffOneTag = ESIntercalibConstantsDiffBase<cond::payloadInspector::SINGLE_IOV, 1>;
using ESIntercalibConstantsDiffTwoTags = ESIntercalibConstantsDiffBase<cond::payloadInspector::SINGLE_IOV, 2>;

} // namespace

// Register the classes as boost python plugin
PAYLOAD_INSPECTOR_MODULE(ESIntercalibConstants) {
PAYLOAD_INSPECTOR_CLASS(ESIntercalibConstantsPlot);
PAYLOAD_INSPECTOR_CLASS(ESIntercalibConstantsDiff);
PAYLOAD_INSPECTOR_CLASS(ESIntercalibConstantsDiffOneTag);
PAYLOAD_INSPECTOR_CLASS(ESIntercalibConstantsDiffTwoTags);
}
64 changes: 46 additions & 18 deletions CondCore/EcalPlugins/plugins/EcalAlignment_PayloadInspector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -122,24 +122,44 @@ namespace {
};

/*********************************************************
2d plot of ECAL Alignment difference between 2 IOVs
**********************************************************/
class EcalAlignmentDiff : public cond::payloadInspector::PlotImage<Alignments> {
2d plot of ECAL Alignment difference between 2 IOVs
**********************************************************/
template <cond::payloadInspector::IOVMultiplicity nIOVs, int ntags>
class EcalAlignmentDiffBase : public cond::payloadInspector::PlotImage<Alignments, nIOVs, ntags> {
public:
EcalAlignmentDiff() : cond::payloadInspector::PlotImage<Alignments>("ECAL Alignment difference") {
setSingleIov(false);
}
EcalAlignmentDiffBase()
: cond::payloadInspector::PlotImage<Alignments, nIOVs, ntags>("ECAL Alignment difference") {}

bool fill(const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs) override {
unsigned int run[2], irun = 0;
bool fill() override {
unsigned int run[2];
float val[6][36];
TH2F* align = new TH2F("", "", 1, 0., 1., 1, 0., 1.); // pseudo creation
std::string subdet;
int NbRows = 0;
std::string l_tagname[2];

for (auto const& iov : iovs) {
std::shared_ptr<Alignments> payload = fetchPayload(std::get<1>(iov));
run[irun] = std::get<0>(iov);
auto iovs = cond::payloadInspector::PlotBase::getTag<0>().iovs;
l_tagname[0] = cond::payloadInspector::PlotBase::getTag<0>().name;
auto firstiov = iovs.front();
run[0] = std::get<0>(firstiov);
std::tuple<cond::Time_t, cond::Hash> lastiov;
if (ntags == 2) {
auto tag2iovs = cond::payloadInspector::PlotBase::getTag<1>().iovs;
l_tagname[1] = cond::payloadInspector::PlotBase::getTag<1>().name;
lastiov = tag2iovs.front();
} else {
lastiov = iovs.back();
l_tagname[1] = l_tagname[0];
}
run[1] = std::get<0>(lastiov);

for (int irun = 0; irun < nIOVs; irun++) {
std::shared_ptr<Alignments> payload;
if (irun == 0) {
payload = this->fetchPayload(std::get<1>(firstiov));
} else {
payload = this->fetchPayload(std::get<1>(lastiov));
}

if (payload.get()) {
NbRows = (*payload).m_align.size();
Expand Down Expand Up @@ -190,7 +210,6 @@ namespace {
} // if payload.get()
else
return false;
irun++;
} // loop over IOVs

gStyle->SetPalette(1);
Expand All @@ -199,10 +218,16 @@ namespace {
TLatex t1;
t1.SetNDC();
t1.SetTextAlign(26);
t1.SetTextSize(0.05);
t1.SetTextColor(2);
t1.DrawLatex(0.5, 0.96, Form("Ecal %s Alignment, IOV %i - %i", subdet.c_str(), run[1], run[0]));

int len = l_tagname[0].length() + l_tagname[1].length();
if (ntags == 2 && len < 58) {
t1.SetTextSize(0.025);
t1.DrawLatex(
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]));
} else {
t1.SetTextSize(0.05);
t1.DrawLatex(0.5, 0.96, Form("Ecal %s Alignment, IOV %i - %i", subdet.c_str(), run[1], run[0]));
}
TPad* pad = new TPad("pad", "pad", 0.0, 0.0, 1.0, 0.94);
pad->Draw();
pad->cd();
Expand All @@ -228,16 +253,19 @@ namespace {
align->GetYaxis()->SetTickLength(0.);
align->GetYaxis()->SetLabelSize(0.);

std::string ImageName(m_imageFileName);
std::string ImageName(this->m_imageFileName);
canvas.SaveAs(ImageName.c_str());
return true;
} // fill method
};
}; // class EcalAlignmentDiffBase
using EcalAlignmentDiffOneTag = EcalAlignmentDiffBase<cond::payloadInspector::SINGLE_IOV, 1>;
using EcalAlignmentDiffTwoTags = EcalAlignmentDiffBase<cond::payloadInspector::SINGLE_IOV, 2>;

} // namespace

// Register the classes as boost python plugin
PAYLOAD_INSPECTOR_MODULE(EcalAlignment) {
PAYLOAD_INSPECTOR_CLASS(EcalAlignmentPlot);
PAYLOAD_INSPECTOR_CLASS(EcalAlignmentDiff);
PAYLOAD_INSPECTOR_CLASS(EcalAlignmentDiffOneTag);
PAYLOAD_INSPECTOR_CLASS(EcalAlignmentDiffTwoTags);
}
45 changes: 22 additions & 23 deletions CondCore/EcalPlugins/plugins/EcalChannelStatus_PayloadInspector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -388,18 +388,17 @@ namespace {
ebmap_coarse->Draw("text,same");

int len = l_tagname[0].length() + l_tagname[1].length();
if (ntags == 2 && len < 60) {
t1.SetTextSize(0.03);
t1.DrawLatex(0.5,
0.96,
Form("EB Channel Status Masks (Diff), %s IOV %i - %s IOV %i",
l_tagname[1].c_str(),
run[1],
l_tagname[0].c_str(),
run[0]));
if (ntags == 2) {
if (len < 60) {
t1.SetTextSize(0.03);
t1.DrawLatex(
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]));
} else
t1.SetTextSize(0.05);
t1.DrawLatex(0.5, 0.96, Form("EB Channel Status Masks (Diff), IOV %i - IOV %i", run[1], run[0]));
} else {
t1.SetTextSize(0.05);
t1.DrawLatex(0.5, 0.96, Form("EB Channel Status Masks (Diff), IOV: %i vs %i", run[0], run[1]));
t1.DrawLatex(0.5, 0.96, Form("%s IOV: %i - %i", l_tagname[0].c_str(), run[1], run[0]));
}

char txt[80];
Expand Down Expand Up @@ -560,18 +559,18 @@ namespace {

t1.SetTextColor(1);
int len = l_tagname[0].length() + l_tagname[1].length();
if (ntags == 2 && len < 60) {
t1.SetTextSize(0.03);
t1.DrawLatex(0.5,
0.96,
Form("EE Channel Status Masks (Diff), %s IOV %i - %s IOV %i",
l_tagname[1].c_str(),
run[1],
l_tagname[0].c_str(),
run[0]));
if (ntags == 2) {
if (len < 60) {
t1.SetTextSize(0.03);
t1.DrawLatex(
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]));
} else {
t1.SetTextSize(0.05);
t1.DrawLatex(0.5, 0.96, Form("EE Channel Status Masks (Diff), IOV %i - IOV %i", run[1], run[0]));
}
} else {
t1.SetTextSize(0.05);
t1.DrawLatex(0.5, 0.96, Form("EE Channel Status Masks (Diff), IOV %i vs %i", run[0], run[1]));
t1.DrawLatex(0.5, 0.96, Form("%s IOV: %i - %i", l_tagname[0].c_str(), run[1], run[0]));
}

char txt[80];
Expand All @@ -592,9 +591,9 @@ namespace {
using EcalChannelStatusEEDiffOneTag = EcalChannelStatusEEDiffBase<cond::payloadInspector::SINGLE_IOV, 1>;
using EcalChannelStatusEEDiffTwoTags = EcalChannelStatusEEDiffBase<cond::payloadInspector::SINGLE_IOV, 2>;

/*****************************************
2d plot of EcalChannelStatus Error Summary of 1 IOV
******************************************/
/********************************************************
2d plot of EcalChannelStatus Error Summary of 1 IOV
********************************************************/
class EcalChannelStatusSummaryPlot : public cond::payloadInspector::PlotImage<EcalChannelStatus> {
public:
EcalChannelStatusSummaryPlot()
Expand Down
Loading