15#include <fmt/format.h>
19#include "TMultiGraph.h"
20#include "TGraphErrors.h"
26#include "TProfile2D.h"
32#include "TPaletteAxis.h"
48#include <boost/geometry.hpp>
49#include <boost/geometry/geometries/point_xy.hpp>
50#include <boost/geometry/geometries/polygon.hpp>
56std::array<int, 6> painter::colors = {EColor::kBlack, EColor::kRed + 1, EColor::kOrange + 2, EColor::kGreen + 2, EColor::kBlue + 1, EColor::kMagenta + 1};
57std::array<int, 10> painter::markers = {20, 21, 33, 34, 47, 24, 25, 27, 28, 46};
59std::vector<painter::PadCoordinates> painter::getPadCoordinatesSector()
61 std::vector<painter::PadCoordinates> padCoords;
65 for (
const auto& padReg : regInf) {
66 const auto npr = padReg.getNumberOfPadRows();
67 const auto ro = padReg.getRowOffset();
68 const auto xm = padReg.getXhelper();
69 const auto ph = padReg.getPadHeight();
70 const auto pw = padReg.getPadWidth();
71 const auto yro = padReg.getRadiusFirstRow();
72 const auto ks = ph / pw * std::tan(1.74532925199432948e-01);
74 for (
int irow = 0; irow < npr; ++irow) {
75 const auto npads = std::floor(ks * (irow + ro) + xm);
76 for (
int ipad = -npads; ipad < npads; ++ipad) {
77 const auto xPadBottomRight = yro + ph * irow;
78 const auto xPadTopRight = yro + ph * (irow + 1);
79 const auto ri = xPadBottomRight;
80 const auto yPadBottomRight = pw * ipad * xPadBottomRight / (ri + ph / 2);
81 const auto yPadTopRight = pw * ipad * xPadTopRight / (ri + ph / 2);
82 const auto yPadBottomLeft = pw * (ipad + 1) * xPadBottomRight / (ri + ph / 2);
83 const auto yPadTopLeft = pw * (ipad + 1) * xPadTopRight / (ri + ph / 2);
84 auto& padCoord = padCoords.emplace_back();
85 padCoord.xVals = {xPadBottomRight, xPadTopRight, xPadTopRight, xPadBottomRight};
86 padCoord.yVals = {yPadBottomRight, yPadTopRight, yPadTopLeft, yPadBottomLeft};
96 std::vector<painter::PadCoordinates> padCoords;
99 std::vector<GEMstack> stacks;
102 stacks.emplace_back(
CRU(cru).gemStack());
106 auto& padCoord = padCoords.emplace_back();
107 padCoord.xVals.resize(0);
108 padCoord.yVals.resize(0);
111 const auto first = std::find(stacks.cbegin(), stacks.cend(), currentStack);
112 const auto last = std::find(stacks.crbegin(), stacks.crend(), currentStack);
113 const int firstRegion = std::distance(stacks.cbegin(),
first);
114 const int lastRegion = (stacks.size() - std::distance(stacks.crbegin(), last) - 1);
116 for (
int region = firstRegion; region <= lastRegion; ++region) {
117 const auto& padReg = regInf[region];
118 const auto npr = padReg.getNumberOfPadRows();
119 const auto ro = padReg.getRowOffset();
120 const auto xm = padReg.getXhelper();
121 const auto ph = padReg.getPadHeight();
122 const auto pw = padReg.getPadWidth();
123 const auto yro = padReg.getRadiusFirstRow();
124 const auto ks = ph / pw * std::tan(1.74532925199432948e-01);
126 for (
int irow = 0; irow < npr; ++irow) {
127 const auto npads = std::floor(ks * (irow + ro) + xm);
128 const int ipad = -npads;
129 const auto xPadBottomRight = yro + ph * irow;
130 const auto xPadTopRight = yro + ph * (irow + 1);
131 const auto ri = xPadBottomRight;
132 const auto yPadBottomRight = pw * ipad * xPadBottomRight / (ri + ph / 2);
133 const auto yPadTopRight = pw * ipad * xPadTopRight / (ri + ph / 2);
134 const auto yPadBottomLeft = pw * (ipad + 1) * xPadBottomRight / (ri + ph / 2);
135 const auto yPadTopLeft = pw * (ipad + 1) * xPadTopRight / (ri + ph / 2);
136 padCoord.xVals.emplace_back(xPadBottomRight);
137 padCoord.yVals.emplace_back(yPadBottomRight);
138 padCoord.xVals.emplace_back(xPadTopRight);
139 padCoord.yVals.emplace_back(yPadTopRight);
143 for (
int i = padCoord.xVals.size() - 1;
i >= 0;
i--) {
144 padCoord.xVals.emplace_back(padCoord.xVals[
i]);
145 padCoord.yVals.emplace_back(std::abs(padCoord.yVals[
i]));
153 std::vector<painter::PadCoordinates> padCoords;
158 const int regionStart = 2 *
stack;
159 const int regionEnd = regionStart + 2;
162 void addPad(
int pad,
int row) { pad_map[
row].emplace_back(pad); }
163 const std::vector<int>& getPads(
const int row) {
return pad_map[
row]; }
164 std::unordered_map<int, std::vector<int>> pad_map;
167 std::unordered_map<size_t, std::array<fecInf, 2>> fecs;
168 for (
int region = regionStart; region < regionEnd; ++region) {
172 const size_t fecIndex = fec.
getIndex();
173 fecs[fecIndex][region - regionStart].addPad(pad, lrow);
178 for (
auto& fec : fecs) {
179 auto& padCoord = padCoords.emplace_back();
180 padCoord.xVals.resize(0);
181 padCoord.yVals.resize(0);
182 for (
int j = 0;
j < 2; ++
j) {
183 for (
int regionTmp = regionStart; regionTmp < regionEnd; ++regionTmp) {
184 const int region = (
j == 0) ? regionTmp : (regionStart + regionEnd - regionTmp - 1);
185 const auto& padReg = regInf[region];
186 const auto npr = padReg.getNumberOfPadRows();
187 const auto ro = padReg.getRowOffset();
188 const auto xm = padReg.getXhelper();
189 const auto ph = padReg.getPadHeight();
190 const auto pw = padReg.getPadWidth();
191 const auto yro = padReg.getRadiusFirstRow();
192 const auto ks = ph / pw * std::tan(1.74532925199432948e-01);
194 for (
int irowTmp = 0; irowTmp < npr; ++irowTmp) {
195 const int irow = (
j == 0) ? irowTmp : (npr - irowTmp - 1);
196 const auto npads = std::floor(ks * (irow + ro) + xm);
197 const std::vector<int>& padsFEC = fec.second[region - regionStart].getPads(irow);
198 const int padOff = (
j == 0) ? padsFEC.front() : (padsFEC.back() + 1);
199 const int ipad = -npads + padOff;
200 const auto xPadBottomRight = yro + ph * irow;
201 const auto xPadTopRight = yro + ph * (irow + 1);
202 const auto ri = xPadBottomRight;
203 const auto yPadBottomRight = pw * ipad * xPadBottomRight / (ri + ph / 2);
204 const auto yPadTopRight = pw * ipad * xPadTopRight / (ri + ph / 2);
205 const auto yPadBottomLeft = pw * (ipad + 1) * xPadBottomRight / (ri + ph / 2);
206 const auto yPadTopLeft = pw * (ipad + 1) * xPadTopRight / (ri + ph / 2);
208 padCoord.xVals.emplace_back(xPadBottomRight);
209 padCoord.yVals.emplace_back(yPadBottomRight);
210 padCoord.xVals.emplace_back(xPadTopRight);
211 padCoord.yVals.emplace_back(yPadTopRight);
213 padCoord.yVals.emplace_back(yPadTopRight);
214 padCoord.xVals.emplace_back(xPadTopRight);
215 padCoord.yVals.emplace_back(yPadBottomRight);
216 padCoord.xVals.emplace_back(xPadBottomRight);
235 LOGP(warning,
"Wrong Type provided!");
236 return std::vector<o2::tpc::painter::PadCoordinates>();
244 int firstRegion = 0, lastRegion = 10;
248 }
else if (
roc < 72) {
257 binning.emplace_back(localX - 3);
259 for (
int iregion = firstRegion; iregion < lastRegion; ++iregion) {
263 if (std::abs(padHeight - lastPadHeight) > 1e-5) {
264 lastPadHeight = padHeight;
265 localX = regionInfo.getRadiusFirstRow();
269 for (
int irow = 0; irow < regionInfo.getNumberOfPadRows(); ++irow) {
270 localX += lastPadHeight;
274 binning.emplace_back(localX + 3);
281 const std::string_view
type = (rocNumber < 36) ?
"IROC" :
"OROC";
282 const std::string_view
side = ((rocNumber % 36) < 18) ?
"A" :
"C";
283 return fmt::format(
"{} {}{:02}",
type,
side, rocNumber % 18);
287TCanvas*
painter::draw(
const CalDet<T>& calDet,
int nbins1D,
float xMin1D,
float xMax1D, TCanvas* outputCanvas)
295 std::string title = calDet.
getName();
297 std::replace(
name.begin(),
name.end(),
' ',
'_');
298 std::replace(title.begin(), title.end(),
'_',
' ');
305 const int bufferSize = TH1::GetDefaultBufferSize();
308 auto hAside1D =
new TH1F(fmt::format(
"h_Aside_1D_{}",
name).
data(), fmt::format(
"{0} (A-Side);{0}", title).
data(),
309 nbins1D, xMin1D, xMax1D);
311 auto hCside1D =
new TH1F(fmt::format(
"h_Cside_1D_{}",
name).
data(), fmt::format(
"{0} (C-Side);{0}", title).
data(),
312 nbins1D, xMin1D, xMax1D);
314 auto hAside2D =
new TH2F(fmt::format(
"h_Aside_2D_{}",
name).
data(), fmt::format(
"{0} (A-Side);#it{{x}} (cm);#it{{y}} (cm);{0}", title).
data(),
315 330, -270, 270, 330, -270, 270);
317 auto hCside2D =
new TH2F(fmt::format(
"h_Cside_2D_{}",
name).
data(), fmt::format(
"{0} (C-Side);#it{{x}} (cm);#it{{y}} (cm);{0}", title).
data(),
318 330, -270, 270, 330, -270, 270);
322 auto hist2D = hAside2D;
323 auto hist1D = hAside1D;
330 for (
int irow = 0; irow < nrows; ++irow) {
332 for (
int ipad = 0; ipad < npads; ++ipad) {
335 const int bin = hist2D->FindBin(
pos.X(),
pos.Y());
336 if (!hist2D->GetBinContent(bin)) {
337 hist2D->SetBinContent(bin,
double(
val));
339 hist1D->Fill(
double(
val));
344 if (xMax1D > xMin1D) {
345 hAside2D->SetMinimum(xMin1D);
346 hAside2D->SetMaximum(xMax1D);
347 hCside2D->SetMinimum(xMin1D);
348 hCside2D->SetMaximum(xMax1D);
352 gStyle->SetOptStat(
"mr");
353 auto c = outputCanvas;
355 c =
new TCanvas(fmt::format(
"c_{}",
name).
data(), title.data(), 1000, 1000);
357 gStyle->SetStatX(1. - gPad->GetRightMargin());
358 gStyle->SetStatY(1. - gPad->GetTopMargin());
364 hAside2D->Draw(
"colz");
365 hAside2D->SetStats(0);
366 hAside2D->SetTitleOffset(1.05,
"XY");
367 hAside2D->SetTitleSize(0.05,
"XY");
372 hCside2D->Draw(
"colz");
373 hCside2D->SetStats(0);
374 hCside2D->SetTitleOffset(1.05,
"XY");
375 hCside2D->SetTitleSize(0.05,
"XY");
386 TH1::SetDefaultBufferSize(bufferSize);
389 hAside1D->SetBit(TObject::kCanDelete);
390 hCside1D->SetBit(TObject::kCanDelete);
391 hAside2D->SetBit(TObject::kCanDelete);
392 hCside2D->SetBit(TObject::kCanDelete);
402 std::string
name = hist->GetName();
404 auto c =
new TCanvas(fmt::format(
"c_{}",
name).
data(), hist->GetTitle());
409 hist->SetBit(TObject::kCanDelete);
426 for (
int irow = 0; irow < nrows; ++irow) {
428 for (
int ipad = 0; ipad < npads; ++ipad) {
431 const int bin = h2D.FindBin(
pos.X(),
pos.Y());
432 if (!h2D.GetBinContent(bin)) {
433 h2D.SetBinContent(bin,
double(
val));
451 for (
int irow = 0; irow < nrows; ++irow) {
453 for (
int ipad = 0; ipad < padsInRow; ++ipad) {
456 const int cpad = ipad - padsInRow / 2;
457 h2D.Fill(irow, cpad,
double(
val));
466 std::string title = calDet.
getName();
468 std::replace(
name.begin(),
name.end(),
' ',
'_');
469 std::replace(title.begin(), title.end(),
'_',
' ');
470 const char side_name = (
side ==
Side::A) ?
'A' :
'C';
472 auto h2D =
new TH2F(fmt::format(
"h_{}side_2D_{}", side_name,
name).
data(),
473 fmt::format(
"{} ({}-Side);x (cm);y (cm)", title, side_name).
data(),
474 300, -300, 300, 300, -300, 300);
495 std::string title = calArray.
getName();
497 std::replace(title.begin(), title.end(),
'_',
' ');
498 std::replace(
name.begin(),
name.end(),
' ',
'_');
501 title += fmt::format(
" ({})",
getROCTitle(position));
504 auto hist =
new TH2F(fmt::format(
"h_{}",
name).
data(),
505 fmt::format(
"{};pad row;pad", title).
data(),
507 npads, -npads / 2., npads / 2.);
517 return std::abs(cal.
getSum()) > T{0};
523 return cal.
getSum() > T{0};
529 for (
const auto v : cal.
getData()) {
541 std::vector<TCanvas*> vecCanvases;
543 auto nROCs = calDet.
getData().size();
547 for (
size_t iroc = 0; iroc < calDet.
getData().
size(); ++iroc) {
561 TCanvas* cSides =
nullptr;
562 TCanvas* cROCs1D =
nullptr;
563 TCanvas* cROCs2D =
nullptr;
564 const std::string_view calName = calDet.
getName();
566 if (outputCanvases) {
567 if (outputCanvases->size() < 3) {
568 LOGP(error,
"At least 3 canvases are needed to fill the output, only {} given", outputCanvases->size());
572 cSides = outputCanvases->at(0);
573 cROCs1D = outputCanvases->at(1);
574 cROCs2D = outputCanvases->at(2);
580 cROCs1D =
new TCanvas(fmt::format(
"c_ROCs_{}_1D", calName).
data(), fmt::format(
"{} values for each ROC", calName).
data(), 1400, 1000);
581 cROCs2D =
new TCanvas(fmt::format(
"c_ROCs_{}_2D", calName).
data(), fmt::format(
"{} values for each ROC", calName).
data(), 1400, 1000);
583 cSides =
draw(calDet, nbins1D, xMin1D, xMax1D, cSides);
584 cROCs1D->DivideSquare(nROCs);
585 cROCs2D->DivideSquare(nROCs);
587 vecCanvases.emplace_back(cSides);
588 vecCanvases.emplace_back(cROCs1D);
589 vecCanvases.emplace_back(cROCs2D);
593 for (
size_t iroc = 0; iroc < calDet.
getData().
size(); ++iroc) {
601 auto h1D =
new TH1F(fmt::format(
"h1_{}_{:02d}", calName, iroc).
data(), fmt::format(
"{} distribution ROC {:02d} ({});ADC value", calName, iroc,
getROCTitle(iroc)).
data(), nbins1D, xMin1D, xMax1D);
603 h1D->Fill(
double(
val));
609 if (xMax1D > xMin1D) {
610 h2D->SetMinimum(xMin1D);
611 h2D->SetMaximum(xMax1D);
613 h2D->SetUniqueID(iroc);
624 h1D->SetBit(TObject::kCanDelete);
625 h2D->SetBit(TObject::kCanDelete);
635 std::vector<TCanvas*> vecCanvases;
638 std::string title = draw.data();
639 std::string
name = title;
640 std::replace(
name.begin(),
name.end(),
' ',
'_');
641 std::replace(
name.begin(),
name.end(),
'/',
'_');
642 const std::string_view calName =
name;
646 const size_t nROCs = 72;
647 auto cROCs1D =
new TCanvas(fmt::format(
"c_ROCs_{}_1D", calName).
data(), fmt::format(
"{} values for each ROC", calName).
data(), 1400, 1000);
648 auto cROCs2D =
new TCanvas(fmt::format(
"c_ROCs_{}_2D", calName).
data(), fmt::format(
"{} values for each ROC", calName).
data(), 1400, 1000);
650 cROCs1D->DivideSquare(nROCs);
651 cROCs2D->DivideSquare(nROCs);
653 vecCanvases.emplace_back(cROCs1D);
654 vecCanvases.emplace_back(cROCs2D);
658 for (
size_t iroc = 0; iroc < nROCs; ++iroc) {
661 auto h1D =
new TH1F(fmt::format(
"h1_{}_{:02d}", calName, iroc).
data(), fmt::format(
"{} distribution ROC {:02d} ({});{}", calName, iroc, getROCTitle(iroc), draw).
data(), nbins1D, xMin1D, xMax1D);
662 tree.Draw(fmt::format(
"{} >> {}", draw, h1D->GetName()).data(), fmt::format(
"(roc == {}) && ({})", iroc, cut).data(),
"goff");
670 const std::string rocTitle = title + fmt::format(
" ({})", getROCTitle(iroc));
672 auto h2D =
new TProfile2D(fmt::format(
"h_{}_ROC{}",
name, iroc).
data(),
673 fmt::format(
"{};pad row;pad;{}", rocTitle, draw).
data(),
675 npads, -npads / 2., npads / 2.);
676 tree.Draw(fmt::format(
"{} : cpad : row >> {}", draw, h2D->GetName()).data(), fmt::format(
"(roc == {}) && ({})", iroc, cut).data(),
"profcolzgoff");
679 if (xMax1D > xMin1D) {
680 h2D->SetMinimum(xMin1D);
681 h2D->SetMaximum(xMax1D);
683 h2D->SetUniqueID(iroc);
694 h1D->SetBit(TObject::kCanDelete);
695 h2D->SetBit(TObject::kCanDelete);
706 const int bufferSize = TH1::GetDefaultBufferSize();
709 auto hAside1D =
new TH1F(fmt::format(
"h_Aside_1D_{}",
name).
data(), fmt::format(
"{0} (A-Side);{0}", title).
data(),
710 std::abs(nbins1D), xMin1D, xMax1D);
712 auto hCside1D =
new TH1F(fmt::format(
"h_Cside_1D_{}",
name).
data(), fmt::format(
"{0} (C-Side);{0}", title).
data(),
713 std::abs(nbins1D), xMin1D, xMax1D);
715 auto hAside2D =
new TProfile2D(fmt::format(
"h_Aside_2D_{}",
name).
data(), fmt::format(
"{} (A-Side);#it{{x}} (cm);#it{{y}} (cm);{}", title, draw).
data(),
716 330, -270, 270, 330, -270, 270);
718 auto hCside2D =
new TProfile2D(fmt::format(
"h_Cside_2D_{}",
name).
data(), fmt::format(
"{} (C-Side);#it{{x}} (cm);#it{{y}} (cm);{}", title, draw).
data(),
719 330, -270, 270, 330, -270, 270);
721 tree.Draw(fmt::format(
"{} >> {}", draw, hAside1D->GetName()).data(), fmt::format(
"(A_Side) && ({})", cut).data(),
"goff");
722 tree.Draw(fmt::format(
"{} >> {}", draw, hCside1D->GetName()).data(), fmt::format(
"(C_Side) && ({})", cut).data(),
"goff");
723 tree.Draw(fmt::format(
"{} : gy : gx >> {}", draw, hAside2D->GetName()).data(), fmt::format(
"(A_Side) && ({})", cut).data(),
"profcolzgoff");
724 tree.Draw(fmt::format(
"{} : gy : gx >> {}", draw, hCside2D->GetName()).data(), fmt::format(
"(C_Side) && ({})", cut).data(),
"profcolzgoff");
726 if (xMax1D > xMin1D) {
727 hAside2D->SetMinimum(xMin1D);
728 hAside2D->SetMaximum(xMax1D);
729 hCside2D->SetMinimum(xMin1D);
730 hCside2D->SetMaximum(xMax1D);
734 gStyle->SetOptStat(
"mr");
735 auto cSides =
new TCanvas(fmt::format(
"c_{}",
name).
data(), title.data(), 1000, 1000);
736 vecCanvases.emplace_back(cSides);
738 gStyle->SetStatX(1. - gPad->GetRightMargin());
739 gStyle->SetStatY(1. - gPad->GetTopMargin());
742 cSides->Divide(2, 2);
745 hAside2D->Draw(
"colz");
746 hAside2D->SetStats(0);
747 hAside2D->SetTitleOffset(1.05,
"XY");
748 hAside2D->SetTitleSize(0.05,
"XY");
749 adjustPalette(hAside2D, 0.92);
753 hCside2D->Draw(
"colz");
754 hCside2D->SetStats(0);
755 hCside2D->SetTitleOffset(1.05,
"XY");
756 hCside2D->SetTitleSize(0.05,
"XY");
757 adjustPalette(hCside2D, 0.92);
767 TH1::SetDefaultBufferSize(bufferSize);
770 hAside1D->SetBit(TObject::kCanDelete);
771 hCside1D->SetBit(TObject::kCanDelete);
772 hAside2D->SetBit(TObject::kCanDelete);
773 hCside2D->SetBit(TObject::kCanDelete);
779std::vector<TCanvas*>
painter::makeSummaryCanvases(
const std::string_view fileName,
const std::string_view calPadNames,
int nbins1D,
float xMin1D,
float xMax1D,
bool onlyFilled)
785 std::vector<TCanvas*> vecCanvases;
787 for (
const auto calPad : calPads) {
789 for (
auto c : canvases) {
790 vecCanvases.emplace_back(
c);
798TH2Poly*
painter::makeSectorHist(
const std::string_view
name,
const std::string_view title,
const float xMin,
const float xMax,
const float yMin,
const float yMax,
const Type
type)
800 auto poly =
new TH2Poly(
name.data(), title.data(), xMin, xMax, yMin,
yMax);
804 poly->AddBin(
coord.xVals.size(),
coord.xVals.data(),
coord.yVals.data());
814 auto poly =
new TH2Poly(fmt::format(
"hSide_{}", s).
data(), fmt::format(
"{}-Side;#it{{x}} (cm);#it{{y}} (cm)", s).
data(), -270., 270., -270., 270.);
817 for (
int isec = 0; isec < 18; ++isec) {
818 const float angDeg = 10.f + isec * 20;
820 coord.rotate(angDeg);
821 poly->AddBin(
coord.xVals.size(),
coord.xVals.data(),
coord.yVals.data());
835 for (
const auto& calROC : calDet.
getData()) {
836 ROC roc(calROC.getPadSubsetNumber());
842 for (
int irow = 0; irow < nrows; ++irow) {
844 for (
int ipad = 0; ipad <= padMax; ++ipad) {
857 l.SetLineColor(std::abs(sectorLineColor));
860 latSide.SetTextColor(sectorTextColor);
861 latSide.SetTextAlign(22);
862 latSide.SetTextSize(0.08);
863 if (sectorTextColor >= 0) {
864 latSide.DrawLatex(0, 0, (
side ==
Side::C) ?
"C" :
"A");
868 lat.SetTextAlign(22);
869 lat.SetTextSize(0.03);
870 lat.SetTextColor(std::abs(sectorLineColor));
873 const float rFactor = std::cos(phiWidth / 2.);
874 const float rLow = 83.65 / rFactor;
875 const float rIROCup = 133.3 / rFactor;
876 const float rOROClow = 133.5 / rFactor;
877 const float rOROC12 = 169.75 / rFactor;
878 const float rOROC23 = 207.85 / rFactor;
879 const float rOut = 247.7 / rFactor;
880 const float rText = rLow * rFactor * 3. / 4.;
882 for (Int_t isector = 0; isector < 18; ++isector) {
883 const float sinR = std::sin(phiWidth * isector);
884 const float cosR = std::cos(phiWidth * isector);
886 const float sinL = std::sin(phiWidth * ((isector + 1) % 18));
887 const float cosL = std::cos(phiWidth * ((isector + 1) % 18));
889 const float sinText = std::sin(phiWidth * (isector + 0.5));
890 const float cosText = std::cos(phiWidth * (isector + 0.5));
892 const float xR1 = rLow * cosR;
893 const float yR1 = rLow * sinR;
894 const float xR2 = rOut * cosR;
895 const float yR2 = rOut * sinR;
897 const float xL1 = rLow * cosL;
898 const float yL1 = rLow * sinL;
899 const float xL2 = rOut * cosL;
900 const float yL2 = rOut * sinL;
902 const float xOROCmup1 = rOROClow * cosR;
903 const float yOROCmup1 = rOROClow * sinR;
904 const float xOROCmup2 = rOROClow * cosL;
905 const float yOROCmup2 = rOROClow * sinL;
907 const float xIROCmup1 = rIROCup * cosR;
908 const float yIROCmup1 = rIROCup * sinR;
909 const float xIROCmup2 = rIROCup * cosL;
910 const float yIROCmup2 = rIROCup * sinL;
912 const float xO121 = rOROC12 * cosR;
913 const float yO121 = rOROC12 * sinR;
914 const float xO122 = rOROC12 * cosL;
915 const float yO122 = rOROC12 * sinL;
917 const float xO231 = rOROC23 * cosR;
918 const float yO231 = rOROC23 * sinR;
919 const float xO232 = rOROC23 * cosL;
920 const float yO232 = rOROC23 * sinL;
922 const float xText = rText * cosText;
923 const float yText = rText * sinText;
926 l.DrawLine(xR1, yR1, xR2, yR2);
929 l.DrawLine(xR1, yR1, xL1, yL1);
932 l.DrawLine(xIROCmup1, yIROCmup1, xIROCmup2, yIROCmup2);
935 l.DrawLine(xOROCmup1, yOROCmup1, xOROCmup2, yOROCmup2);
938 l.DrawLine(xO121, yO121, xO122, yO122);
941 l.DrawLine(xO231, yO231, xO232, yO232);
944 l.DrawLine(xR2, yR2, xL2, yL2);
947 if (sectorLineColor >= 0) {
948 lat.DrawLatex(xText, yText, fmt::format(
"{}", isector).
data());
958 lat.SetTextAlign(12);
959 lat.SetTextSize(0.002f);
960 lat.SetTextColor(padTextColor);
961 gStyle->SetLineScalePS(lineScalePS);
968 const auto coordinate =
coords[padNum];
969 const float yPos = (coordinate.yVals[0] + coordinate.yVals[2]) / 2;
970 const float xPos = (coordinate.xVals[0] + coordinate.xVals[2]) / 2;
971 lat.DrawLatex(xPos, yPos, Form(
"%i", ipad));
982 lat.SetTextColor(rowTextColor);
983 lat.SetTextSize(0.02f);
984 lat.SetTextAlign(12);
987 line.SetLineColor(regionLineColor);
995 line.DrawLine(rad, -43, rad, 43);
1000 lat.DrawLatex((radii[ireg] + radii[ireg + 1]) / 2, 45, Form(
"%i", ireg));
1003 lat.SetTextSize(0.002f);
1004 lat.SetTextAlign(13);
1006 const std::array<float, Mapper::NREGIONS> posRow{16.2f, 18.2f, 20.2f, 22.3f, 26.f, 29.f, 33.f, 35.f, 39.f, 42.5f};
1010 const float nRows = reg.getNumberOfPadRows();
1012 const float padHeight = reg.getPadHeight();
1013 const float radiusFirstRow = reg.getRadiusFirstRow();
1014 const float xPos = radiusFirstRow + (
i + 0.5f) * padHeight;
1015 const float yPos = posRow[ireg];
1017 lat.DrawLatex(xPos, yPos, Form(
"%i",
i));
1018 lat.DrawLatex(xPos, -yPos, Form(
"%i",
i));
1020 const float offs = 0.5f;
1021 lat.DrawLatex(xPos, yPos + offs, Form(
"%i", globalRow));
1022 lat.DrawLatex(xPos, -yPos - offs, Form(
"%i", globalRow++));
1027template <
typename DataT>
1030 const int nZBins = calDet.size();
1031 TH3F histConvSum(
"hisCalDet",
"hisCalDet", nPhiBins, 0,
o2::constants::math::TwoPI, nRBins, rMin, rMax, 2 * nZBins, -
zMax,
zMax);
1032 TH3F histConvWeight(
"histConvWeight",
"histConvWeight", nPhiBins, 0,
o2::constants::math::TwoPI, nRBins, rMin, rMax, 2 * nZBins, -
zMax,
zMax);
1034 typedef boost::geometry::model::polygon<boost::geometry::model::d2::point_xy<float>> polygon;
1038 std::vector<polygon> geoBin;
1039 const int nGeoBins = nPhiBins * nRBins;
1040 geoBin.reserve(nGeoBins);
1041 for (
int iphi = 1; iphi <= nPhiBins; ++iphi) {
1042 const double phiLow = histConvSum.GetXaxis()->GetBinLowEdge(iphi);
1043 const double phiUp = histConvSum.GetXaxis()->GetBinUpEdge(iphi);
1044 for (
int ir = 1;
ir <= nRBins; ++
ir) {
1045 const double rLow = histConvSum.GetYaxis()->GetBinLowEdge(
ir);
1046 const double rUp = histConvSum.GetYaxis()->GetBinUpEdge(
ir);
1047 const double xPos1 = rLow * std::cos(phiLow);
1048 const double yPos1 = rLow * std::sin(phiLow);
1049 const double xPos2 = rLow * std::cos(phiUp);
1050 const double yPos2 = rLow * std::sin(phiUp);
1051 const double xPos4 = rUp * std::cos(phiLow);
1052 const double yPos4 = rUp * std::sin(phiLow);
1053 const double xPos3 = rUp * std::cos(phiUp);
1054 const double yPos3 = rUp * std::sin(phiUp);
1056 boost::geometry::read_wkt(Form(
"POLYGON((%.4f %.4f, %.4f %.4f, %.4f %.4f, %.4f %.4f, %.4f %.4f))", xPos1, yPos1, xPos2, yPos2, xPos3, yPos3, xPos4, yPos4, xPos1, yPos1), geoBin.emplace_back());
1057 boost::geometry::correct(geoBin.back());
1064 for (
unsigned int iRow = 0; iRow < rowsRegion; ++iRow) {
1066 for (
unsigned int iPad = 0; iPad <= padsInRow; ++iPad) {
1069 const float angDeg = 10.f + sector * 20;
1070 auto coordinate =
coords[padNum];
1071 coordinate.rotate(angDeg);
1073 const std::array<double, 2> radiusPadCoord{
1074 std::sqrt(coordinate.xVals[0] * coordinate.xVals[0] + coordinate.yVals[0] * coordinate.yVals[0]),
1075 std::sqrt(coordinate.xVals[2] * coordinate.xVals[2] + coordinate.yVals[2] * coordinate.yVals[2]),
1078 std::array<float, 4> phiPadCoord{
1079 static_cast<float>(std::atan2(coordinate.yVals[0], coordinate.xVals[0])),
1080 static_cast<float>(std::atan2(coordinate.yVals[1], coordinate.xVals[1])),
1081 static_cast<float>(std::atan2(coordinate.yVals[2], coordinate.xVals[2])),
1082 static_cast<float>(std::atan2(coordinate.yVals[3], coordinate.xVals[3]))};
1084 for (
auto& phi : phiPadCoord) {
1089 const int binRBottomStart = std::clamp(histConvSum.GetYaxis()->FindBin(radiusPadCoord[0]) - 1, 1, nRBins);
1090 const int binRTopEnd = std::clamp(histConvSum.GetYaxis()->FindBin(radiusPadCoord[1]) + 1, 1, nRBins);
1091 int binPhiStart = std::min(histConvSum.GetXaxis()->FindBin(phiPadCoord[0]), histConvSum.GetXaxis()->FindBin(phiPadCoord[1]));
1092 int binPhiEnd = std::max(histConvSum.GetXaxis()->FindBin(phiPadCoord[2]), histConvSum.GetXaxis()->FindBin(phiPadCoord[3]));
1096 boost::geometry::read_wkt(Form(
"POLYGON((%f %f, %f %f, %f %f, %f %f, %f %f))", coordinate.xVals[0], coordinate.yVals[0], coordinate.xVals[1], coordinate.yVals[1], coordinate.xVals[2], coordinate.yVals[2], coordinate.xVals[3], coordinate.yVals[3], coordinate.xVals[0], coordinate.yVals[0]), geoPad);
1097 boost::geometry::correct(geoPad);
1099 for (
int binR = binRBottomStart; binR <= binRTopEnd; ++binR) {
1100 for (
int binPhi = binPhiStart; binPhi <= binPhiEnd; ++binPhi) {
1101 const int ind = (binPhi - 1) * nRBins + binR - 1;
1103 std::deque<polygon>
output;
1104 boost::geometry::intersection(geoPad, geoBin[ind],
output);
1108 const double area = boost::geometry::area(
output.front());
1111 for (
int iSide = 0; iSide < 2; ++iSide) {
1114 const CRU cru(iCRU);
1116 for (
int iz = 0;
iz < nZBins; ++
iz) {
1119 const auto globBin = histConvSum.GetBin(binPhi, binR, zBin);
1120 histConvSum.AddBinContent(globBin,
val * fac);
1122 histConvWeight.AddBinContent(globBin, fac);
1134 histConvSum.Divide(&histConvWeight);
1142 std::vector<TCanvas*> vecCanvases;
1145 TCanvas* cLtrCoverage =
nullptr;
1146 TCanvas* cLtrdEdx =
nullptr;
1147 TCanvas* cCalibValues =
nullptr;
1149 const auto size = 1400;
1150 if (outputCanvases) {
1151 if (outputCanvases->size() < 3) {
1152 LOGP(error,
"At least 3 canvases are needed to fill the output, only {} given", outputCanvases->size());
1156 cLtrCoverage = outputCanvases->at(0);
1157 cCalibValues = outputCanvases->at(1);
1158 cLtrdEdx = outputCanvases->at(2);
1159 cLtrCoverage->Clear();
1160 cCalibValues->Clear();
1162 cLtrCoverage->SetCanvasSize(
size, 2. *
size * 7 / 24 * 1.1);
1163 cCalibValues->SetCanvasSize(
size, 2. *
size * 7 / 24 * 1.1);
1164 cLtrdEdx->SetCanvasSize(
size, 2. *
size * 7 / 24 * 1.1);
1166 cLtrCoverage =
new TCanvas(
"cLtrCoverage",
"laser track coverage",
size, 2. *
size * 7 / 24 * 1.1);
1167 cLtrdEdx =
new TCanvas(
"cLtrdEdx",
"laser track average dEdx",
size, 2. *
size * 7 / 24 * 1.1);
1168 cCalibValues =
new TCanvas(
"cCalibValues",
"calibration values",
size, 2. *
size * 7 / 24 * 1.1);
1173 auto getLtrStatHist = [](
Side side, std::string_view
type =
"Coverage") -> TH2F* {
1175 auto hltr =
new TH2F(fmt::format(
"hltr{}_{}",
type, sideName).
data(),
";Bundle ID;Track in bundle", 24, 0, 24, 7, 0, 7);
1176 hltr->SetBit(TObject::kCanDelete);
1178 hltr->GetXaxis()->SetNdivisions(406,
false);
1179 hltr->GetYaxis()->SetNdivisions(107,
false);
1180 hltr->SetLabelSize(0.05,
"XY");
1181 hltr->SetTitleSize(0.06,
"X");
1182 hltr->SetTitleSize(0.07,
"Y");
1183 hltr->SetTitleOffset(0.8,
"X");
1184 hltr->SetTitleOffset(0.4,
"Y");
1189 const std::array<const std::string_view, 6> namesA{
"A01/02",
"A04/05",
"A07/08",
"A10/11",
"A13/14",
"A16/17"};
1190 const std::array<const std::string_view, 6> namesC{
"C00/01",
"C03/04",
"C06/07",
"C09/10",
"C12/13",
"C15/16"};
1191 const auto& names = (
side ==
Side::A) ? namesA : namesC;
1194 lat.SetTextAlign(22);
1195 lat.SetTextSize(0.06);
1198 for (
int i = 0;
i < 6; ++
i) {
1199 lat.DrawLatex(2.f +
i * 4.f, 7.5, names[
i].
data());
1201 line.DrawLine(4.f +
i * 4.f, 0, 4.f +
i * 4.f, 8);
1206 auto hltrCoverageA = getLtrStatHist(
Side::A);
1207 auto hltrCoverageC = getLtrStatHist(
Side::C);
1209 auto hltrdEdxA = getLtrStatHist(
Side::A,
"dEdx");
1210 auto hltrdEdxC = getLtrStatHist(
Side::C,
"dEdx");
1212 float dEdxSumA = 0.f;
1213 float dEdxSumC = 0.f;
1217 for (
size_t itrack = 0; itrack < ltr.
matchedLtrIDs.size(); ++itrack) {
1219 const auto dEdx = ltr.
dEdx.at(itrack);
1224 auto hltrCoverage = (sideA) ? hltrCoverageA : hltrCoverageC;
1225 auto hltrdEdx = (sideA) ? hltrdEdxA : hltrdEdxC;
1227 hltrCoverage->Fill(bundleID, trackID);
1228 hltrdEdx->Fill(bundleID, trackID, dEdx);
1241 dEdxSumA /= nTrackA;
1245 dEdxSumC /= nTrackC;
1249 cLtrCoverage->Divide(1, 2);
1252 cLtrCoverage->cd(1);
1255 gPad->SetRightMargin(0.01);
1256 hltrCoverageA->Draw(
"col text");
1260 cLtrCoverage->cd(2);
1263 gPad->SetRightMargin(0.01);
1264 hltrCoverageC->Draw(
"col text");
1268 cLtrdEdx->Divide(1, 2);
1274 gPad->SetRightMargin(0.01);
1275 hltrdEdxA->Divide(hltrCoverageA);
1276 hltrdEdxA->Draw(
"col text");
1283 gPad->SetRightMargin(0.01);
1284 hltrdEdxC->Divide(hltrCoverageC);
1285 hltrdEdxC->Draw(
"col text");
1290 auto calibValMsg =
new TPaveText(0.1, 0.1, 0.9, 0.9,
"NDC");
1291 calibValMsg->SetFillColor(0);
1292 calibValMsg->SetBorderSize(0);
1293 calibValMsg->AddText(fmt::format(
"processedTFs: {}", ltr.
processedTFs).data());
1294 calibValMsg->AddText(fmt::format(
"dvCorrectionA: {}", ltr.
dvCorrectionA).data());
1295 calibValMsg->AddText(fmt::format(
"dvCorrectionC: {}", ltr.
dvCorrectionC).data());
1298 calibValMsg->AddText(fmt::format(
"dvOffsetA: {}", ltr.
dvOffsetA).data());
1299 calibValMsg->AddText(fmt::format(
"dvOffsetC: {}", ltr.
dvOffsetC).data());
1300 calibValMsg->AddText(fmt::format(
"t0A: {}", ltr.
getT0A()).data());
1301 calibValMsg->AddText(fmt::format(
"t0C: {}", ltr.
getT0C()).data());
1302 calibValMsg->AddText(fmt::format(
"nTracksA: {}", ltr.
nTracksA).data());
1303 calibValMsg->AddText(fmt::format(
"nTracksC: {}", ltr.
nTracksC).data());
1304 calibValMsg->AddText(fmt::format(
"#LTdEdx A#GT: {}", dEdxSumA).
data());
1305 calibValMsg->AddText(fmt::format(
"#LTdEdx C#GT: {}", dEdxSumC).
data());
1308 calibValMsg->Draw();
1310 vecCanvases.emplace_back(cLtrCoverage);
1311 vecCanvases.emplace_back(cCalibValues);
1312 vecCanvases.emplace_back(cLtrdEdx);
1318 auto c = outputCanvas;
1320 c =
new TCanvas(
"junk_detection",
"Junk Detection", 1000, 1000);
1325 auto strA = (TH2F*)
data->At(4);
1326 auto strB = (TH2F*)
data->At(5);
1331 strA->GetStats(statsA);
1332 strB->GetStats(statsB);
1334 auto junkDetectionMsg =
new TPaveText(0.1, 0.1, 0.9, 0.9,
"NDC");
1335 junkDetectionMsg->SetFillColor(0);
1336 junkDetectionMsg->SetBorderSize(0);
1337 junkDetectionMsg->AddText(
"Removal Strategy A");
1338 junkDetectionMsg->AddText(fmt::format(
"Number of Clusters before Removal: {}", statsA[2]).
data());
1339 junkDetectionMsg->AddText(fmt::format(
"Removed Fraction: {:.2f}%", statsA[4]).
data());
1340 junkDetectionMsg->AddLine(.0, .5, 1., .5);
1341 junkDetectionMsg->AddText(
"Removal Strategy B");
1342 junkDetectionMsg->AddText(fmt::format(
"Number of Clusters before Removal: {}", statsB[2]).
data());
1343 junkDetectionMsg->AddText(fmt::format(
"Removed Fraction: {:.2f}%", statsB[4]).
data());
1346 junkDetectionMsg->Draw();
1355 auto palette = (TPaletteAxis*)
h->GetListOfFunctions()->FindObject(
"palette");
1359 palette->SetX2NDC(x2ndc);
1360 auto ax =
h->GetZaxis();
1361 ax->SetTickLength(tickLength);
1364TMultiGraph*
painter::makeMultiGraph(TTree&
tree, std::string_view varX, std::string_view varsY, std::string_view errVarsY, std::string_view cut,
bool makeSparse)
1366 bool hasErrors = errVarsY.size() > 0 && (std::count(varsY.begin(), varsY.end(),
':') == std::count(errVarsY.begin(), errVarsY.end(),
':'));
1368 tree.Draw(fmt::format(
"{} : {} {} {}", varX, varsY, hasErrors ?
" : " :
"", hasErrors ? errVarsY :
"").
data(), cut.
data(),
"goff");
1369 const auto nRows =
tree.GetSelectedRows();
1372 std::vector<size_t>
idx(
tree.GetSelectedRows());
1373 std::iota(
idx.begin(),
idx.end(),
static_cast<size_t>(0));
1374 std::sort(
idx.begin(),
idx.end(), [&
tree](
auto a,
auto b) { return tree.GetVal(0)[a] < tree.GetVal(0)[b]; });
1376 auto mgr =
new TMultiGraph();
1379 for (
size_t ivarY = 0; ivarY <
params.size(); ++ivarY) {
1380 auto gr =
new TGraphErrors(nRows);
1381 gr->SetMarkerSize(1);
1386 for (Long64_t iEntry = 0; iEntry <
nRows; ++iEntry) {
1388 gr->SetPoint(iEntry, iEntry + 0.5,
tree.GetVal(ivarY + 1)[idx[iEntry]]);
1390 gr->SetPoint(iEntry,
tree.GetVal(0)[idx[iEntry]],
tree.GetVal(ivarY + 1)[idx[iEntry]]);
1393 gr->SetPointError(iEntry, 0,
tree.GetVal(ivarY + 1 +
params.size())[idx[iEntry]]);
1401 auto xax = mgr->GetXaxis();
1402 xax->Set(nRows, 0.,
static_cast<Double_t
>(nRows));
1403 for (Long64_t iEntry = 0; iEntry <
nRows; ++iEntry) {
1404 xax->SetBinLabel(iEntry + 1, fmt::format(
"{}",
tree.GetVal(0)[idx[iEntry]]).data());
1406 xax->LabelsOption(
"v");
1415template TCanvas* painter::draw<float>(
const CalDet<float>& calDet,
int,
float,
float, TCanvas*);
1416template std::vector<TCanvas*> painter::makeSummaryCanvases<float>(
const CalDet<float>& calDet,
int,
float,
float,
bool, std::vector<TCanvas*>*);
1417template TCanvas* painter::draw<float>(
const CalArray<float>& calArray);
1420template void painter::fillHistogram2D<float>(TH2& h2D,
const CalArray<float>& calArray);
1422template TH2* painter::getHistogram2D<float>(
const CalArray<float>& calArray);
1424template TCanvas* painter::draw<double>(
const CalDet<double>& calDet,
int,
float,
float, TCanvas*);
1425template std::vector<TCanvas*> painter::makeSummaryCanvases<double>(
const CalDet<double>& calDet,
int,
float,
float,
bool, std::vector<TCanvas*>*);
1428template TH2* painter::getHistogram2D<double>(
const CalArray<double>& calArray);
1430template TCanvas* painter::draw<int>(
const CalDet<int>& calDet,
int,
float,
float, TCanvas*);
1431template std::vector<TCanvas*> painter::makeSummaryCanvases<int>(
const CalDet<int>& calDet,
int,
float,
float,
bool, std::vector<TCanvas*>*);
1432template TCanvas* painter::draw<int>(
const CalArray<int>& calArray);
1434template TH2* painter::getHistogram2D<int>(
const CalArray<int>& calArray);
1436template TCanvas* painter::draw<short>(
const CalDet<short>& calDet,
int,
float,
float, TCanvas*);
1437template std::vector<TCanvas*> painter::makeSummaryCanvases<short>(
const CalDet<short>& calDet,
int,
float,
float,
bool, std::vector<TCanvas*>*);
1438template TCanvas* painter::draw<short>(
const CalArray<short>& calArray);
1440template TH2* painter::getHistogram2D<short>(
const CalArray<short>& calArray);
1442template TCanvas* painter::draw<PadFlags>(
const CalDet<PadFlags>& calDet,
int,
float,
float, TCanvas*);
1443template std::vector<TCanvas*> painter::makeSummaryCanvases<PadFlags>(
const CalDet<PadFlags>& calDet,
int,
float,
float,
bool, std::vector<TCanvas*>*);
1448template TCanvas* painter::draw<bool>(
const CalDet<bool>& calDet,
int,
float,
float, TCanvas*);
1449template std::vector<TCanvas*> painter::makeSummaryCanvases<bool>(
const CalDet<bool>& calDet,
int,
float,
float,
bool, std::vector<TCanvas*>*);
1450template TCanvas* painter::draw<bool>(
const CalArray<bool>& calArray);
1452template TH2* painter::getHistogram2D<bool>(
const CalArray<bool>& calArray);
1454template TH3F painter::convertCalDetToTH3<float>(
const std::vector<
CalDet<float>>&,
const bool,
const int,
const float,
const float,
const int,
const float);
General auxilliary methods.
std::enable_if_t< std::is_signed< T >::value, bool > hasData(const CalArray< T > &cal)
Class for time synchronization of RawReader instances.
const U getSum() const
calculate the sum of all elements
const std::string & getName() const
PadSubset getPadSubset() const
const std::vector< T > & getData() const
int getPadSubsetNumber() const
const T getValue(const size_t channel) const
const CalType & getCalArray(size_t position) const
const T getValue(const int sec, const int globalPadInSector) const
const std::vector< CalType > & getData() const
const std::string & getName() const
unsigned char getIndex() const
static constexpr int RodsPerSide
Number of laser rods per side.
static constexpr int BundlesPerRod
number of micro-mirror bundle per laser rod
static constexpr int NumberOfTracks
Total number of laser tracks.
static constexpr int TracksPerBundle
number of micro-mirrors per bundle
const std::array< PadRegionInfo, 10 > & getMapPadRegionInfo() const
static GlobalPadNumber getGlobalPadNumber(const unsigned int lrow, const unsigned int pad, const unsigned int region)
static const std::vector< unsigned int > PADSPERROW[NREGIONS]
number of pads per row in region
const FECInfo & fecInfo(GlobalPadNumber padNumber) const
int getNumberOfRowsROC(ROC roc) const
int getNumberOfPadsInRow(PadSubset padSubset, int position, int row) const
int getNumberOfPadsInRowROC(int roc, int row) const
static constexpr float INVPADAREA[NREGIONS]
inverse size of the pad area padwidth*padLength
static Mapper & instance(const std::string mappingDir="")
GlobalPadNumber getPadNumber(const PadSubset padSubset, const size_t padSubsetNumber, const int row, const int pad) const
static constexpr unsigned int ROWSPERREGION[NREGIONS]
number of pad rows for region
static constexpr unsigned int NSECTORS
total number of sectors in the TPC
const PadRegionInfo & getPadRegionInfo(const unsigned char region) const
static constexpr unsigned int NREGIONS
total number of regions in one sector
static constexpr unsigned short getPadsInSector()
int getNumberOfPadRows(PadSubset padSubset, int position) const
GlobalPosition2D getPadCentre(const PadSecPos &padSec) const
Pad and row inside a ROC.
float getRadiusFirstRow() const
float getPadHeight() const
bool looped() const
if increment operator went above MaxROC
static constexpr int MAXSECTOR
GLsizei const GLubyte GLsizei GLenum const void * coords
GLuint const GLchar * name
GLboolean GLboolean GLboolean b
GLint GLint GLsizei GLint GLenum GLenum type
GLenum const GLfloat * params
GLboolean GLboolean GLboolean GLboolean a
constexpr std::array< float, nLayers > radii
void bringTo02PiGen(float &phi)
std::vector< CalPad * > readCalPads(const std::string_view fileName, const std::vector< std::string > &calPadNames)
Global TPC definitions and constants.
GEMstack
TPC GEM stack types.
constexpr double SECPHIWIDTH
PadSubset
Definition of the different pad subsets.
unsigned short GlobalPadNumber
global pad number
constexpr unsigned short GEMSTACKSPERSECTOR
float getDriftVCorrection() const
float dvCorrectionA
drift velocity correction factor A-Side (inverse multiplicative)
float dvOffsetC
drift velocity trigger offset C-Side
float dvOffsetA
drift velocity trigger offset A-Side
float dvCorrectionC
drift velocity correction factor C-Side (inverse multiplicative)
std::vector< uint16_t > matchedLtrIDs
matched laser track IDs
std::vector< float > dEdx
dE/dx of each track
size_t processedTFs
number of processed TFs with laser track candidates
uint16_t nTracksC
number of tracks used for C-Side fit
uint16_t nTracksA
number of tracks used for A-Side fit
float refVDrift
reference vdrift for which factor was extracted
static std::vector< double > getRowBinningCM(uint32_t roc=72)
static std::array< int, 6 > colors
static TH3F convertCalDetToTH3(const std::vector< CalDet< DataT > > &calDet, const bool norm=true, const int nRBins=150, const float rMin=83.5, const float rMax=254.5, const int nPhiBins=720, const float zMax=1)
static std::vector< PadCoordinates > getStackCoordinatesSector()
create a vector of stack corner coordinate for one full sector
static TH2Poly * makeSectorHist(const std::string_view name="hSector", const std::string_view title="Sector;local #it{x} (cm);local #it{y} (cm)", const float xMin=83.65f, const float xMax=247.7f, const float yMin=-43.7f, const float yMax=43.7f, const Type type=Type::Pad)
static std::array< int, 10 > markers
static void fillHistogram2D(TH2 &h2D, const CalDet< T > &calDet, Side side)
static std::vector< o2::tpc::painter::PadCoordinates > getCoordinates(const Type type)
static TMultiGraph * makeMultiGraph(TTree &tree, std::string_view varX, std::string_view varsY, std::string_view errVarsY="", std::string_view cut="", bool makeSparse=true)
static std::string getROCTitle(const int rocNumber)
ROC title from ROC number.
static std::vector< PadCoordinates > getFECCoordinatesSector()
create a vector of FEC corner coordinates for one full sector
static void drawSectorLocalPadNumberPoly(short padTextColor=kBlack, float lineScalePS=1)
static void adjustPalette(TH1 *h, float x2ndc, float tickLength=0.015)
static void fillPoly2D(TH2Poly &h2D, const CalDet< T > &calDet, Side side)
static TH2 * getHistogram2D(const CalDet< T > &calDet, Side side)
static TH2Poly * makeSideHist(Side side, const Type type=Type::Pad)
static void drawSectorInformationPoly(short regionLineColor=kRed, short rowTextColor=kRed)
static void drawSectorsXY(Side side, int sectorLineColor=920, int sectorTextColor=1)
draw sector boundaris, side name and sector numbers
static std::vector< PadCoordinates > getPadCoordinatesSector()
create a vector of pad corner coordinate for one full sector
static TCanvas * makeJunkDetectionCanvas(const TObjArray *data, TCanvas *outputCanvas=nullptr)
make a canvas for junk detection data
static TCanvas * draw(const CalDet< T > &calDet, int nbins1D=300, float xMin1D=0, float xMax1D=0, TCanvas *outputCanvas=nullptr)
static std::vector< TCanvas * > makeSummaryCanvases(const CalDet< T > &calDet, int nbins1D=300, float xMin1D=0, float xMax1D=0, bool onlyFilled=true, std::vector< TCanvas * > *outputCanvases=nullptr)
static std::vector< std::string > tokenize(const std::string &src, char delim, bool trimToken=true, bool skipEmpty=true)
o2::InteractionRecord ir(0, 0)
std::unique_ptr< TTree > tree((TTree *) flIn.Get(std::string(o2::base::NameConf::CTFTREENAME).c_str()))