42 class SiStripConfObjectTest :
public Histogram1D<SiStripConfObject, SINGLE_IOV> {
44 SiStripConfObjectTest()
46 "SiStrip Configuration Object test",
"SiStrip Configuration Object test", 1, 0.0, 1.0) {}
48 bool fill()
override {
49 auto tag = PlotBase::getTag<0>();
50 for (
auto const& iov :
tag.iovs) {
51 std::shared_ptr<SiStripConfObject>
payload = Base::fetchPayload(std::get<1>(iov));
56 ss <<
"Summary of strips configuration object:" << std::endl;
58 SiStripConfObject::parMap::const_iterator
it =
payload->parameters.begin();
60 ss <<
"parameter name = " <<
it->first <<
" value = " <<
it->second << std::endl;
72 class SiStripConfObjectDisplay :
public PlotImage<SiStripConfObject, SINGLE_IOV> {
76 bool fill()
override {
77 auto tag = PlotBase::getTag<0>();
78 auto iov =
tag.iovs.front();
79 std::shared_ptr<SiStripConfObject>
payload = fetchPayload(std::get<1>(iov));
81 unsigned int run = std::get<0>(iov);
82 std::vector<float> y_line;
87 t1.SetTextSize(0.045);
92 latex.SetTextSize(0.035);
94 unsigned int configsize_ =
payload->parameters.size();
95 TLine
lines[configsize_ + 1];
97 auto h_Config = std::make_unique<TH1F>(
"ConfigParamter",
";;configuration value", configsize_, 0., configsize_);
98 h_Config->SetStats(
false);
100 bool isShiftAndXTalk =
payload->isParameter(
"shift_IB1Deco");
103 int c_width = isShiftAndXTalk ? 2000 : 1000;
104 int c_height = isShiftAndXTalk ? 1000 : 800;
106 TCanvas
canvas(
"Configuration Summary",
"Configuration Summary", c_width, c_height);
110 if (!isShiftAndXTalk) {
111 t1.DrawLatex(0.5, 0.96, Form(
"SiStrip ConfObject, IOV %i",
run));
112 latex.DrawLatex(0.1, 0.92,
"Parameter");
113 latex.DrawLatex(0.6, 0.92,
"Value");
114 y_line.push_back(0.92);
115 latex.SetTextFont(42);
116 latex.SetTextColor(kBlack);
118 SiStripConfObject::parMap::const_iterator
it =
payload->parameters.begin();
119 unsigned int count = 0;
122 float y_loc = 0.92 - (0.90 / configsize_) *
count;
123 latex.SetTextSize(
std::min(0.035, 0.95 / configsize_));
124 latex.DrawLatex(0.1, y_loc, (
it->first).c_str());
125 latex.DrawLatex(0.6, y_loc, (
it->second).c_str());
126 y_line.push_back(y_loc);
130 for (
const auto&
line : y_line) {
131 lines[iL] = TLine(gPad->GetUxmin(),
line, gPad->GetUxmax(),
line);
132 lines[iL].SetLineWidth(1);
133 lines[iL].SetLineStyle(9);
134 lines[iL].SetLineColor(2);
135 lines[iL].Draw(
"same");
142 canvas.SetBottomMargin(0.16);
143 canvas.SetLeftMargin(0.08);
144 canvas.SetRightMargin(0.02);
145 canvas.SetTopMargin(0.05);
148 SiStripConfObject::parMap::const_iterator
it =
payload->parameters.begin();
150 unsigned int count = 0;
154 h_Config->SetBinContent(
count, std::stof(
it->second));
155 h_Config->GetXaxis()->SetBinLabel(
count, (std::regex_replace(
it->first, std::regex(
"_"),
" ")).c_str());
159 h_Config->GetYaxis()->SetTitleOffset(0.8);
160 h_Config->GetXaxis()->SetLabelSize(0.03);
161 h_Config->SetMaximum(h_Config->GetMaximum() * 1.20);
162 h_Config->SetFillColorAlpha(kRed, 0.35);
164 h_Config->Draw(
"textsame");
166 t1.DrawLatex(0.5, 0.96, Form(
"SiStrip ConfObject, IOV %i: Payload %s",
run, (std::get<1>(iov)).c_str()));
#define PAYLOAD_INSPECTOR_CLASS(CLASS_NAME)
void makeNicePlotStyle(TH1 *hist)
#define PAYLOAD_INSPECTOR_MODULE(PAYLOAD_TYPENAME)