From 71a5dd8374923cdc27cc271b1b2527bfac9783ca Mon Sep 17 00:00:00 2001 From: wiechula Date: Mon, 13 Jan 2025 12:34:28 +0100 Subject: [PATCH] Add line indicating selected time bin --- Detectors/TPC/monitor/src/SimpleEventDisplayGUI.cxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Detectors/TPC/monitor/src/SimpleEventDisplayGUI.cxx b/Detectors/TPC/monitor/src/SimpleEventDisplayGUI.cxx index 20da28eefe364..9f5f826dfe7e1 100644 --- a/Detectors/TPC/monitor/src/SimpleEventDisplayGUI.cxx +++ b/Detectors/TPC/monitor/src/SimpleEventDisplayGUI.cxx @@ -774,6 +774,19 @@ void SimpleEventDisplayGUI::drawPadSignal(int event, int x, int y, TObject* o) if (mCheckShowClusters->IsDown()) { showClusters(roc, row); } + const auto padTimeValsName = fmt::format("PadTimeVals{}", type[type.Length() - 1]); + TCanvas* cPadTimeVals = (TCanvas*)gROOT->GetListOfCanvases()->FindObject(padTimeValsName.data()); + if (cPadTimeVals) { + h = (TH1D*)gROOT->FindObject(("h" + padTimeValsName).data()); + if (h) { + cPadTimeVals->cd(); + delete cPadTimeVals->GetListOfPrimitives()->FindObject("TLine"); + TLine l; + l.SetLineColor(kRed); + const auto timeBin = mSelTimeBin->GetNumberEntry()->GetIntNumber(); + l.DrawLine(timeBin + 0.5, h->GetYaxis()->GetXmin(), timeBin + 0.5, h->GetYaxis()->GetXmax()); + } + } update(Form("%s;%sFFT;PadTimeVals%s;SingleTB", type.Data(), type.Data(), rocType.Data())); } // printf("bin=%03d.%03d(%03d)[%05d], name=%s, ROC=%02d content=%.1f, ev: %d\n",row,pad,cpad,chn,h->GetName(), roc, h->GetBinContent(binx,biny), event);