75 vector<vector<double>> dataV;
76 vector<vector<double>> dataH;
79 Fatal(
"CbmRichRonchiAna::Run:",
"No FileNameV or FileNameH!");
87 int width = dataV.size();
88 int height = dataV[0].size();
94 new TH2D(
"hInitH",
"hInitH;X [pixel];Y [pixel];Intensity", width, -.5, width - 0.5, height, -0.5, height - 0.5);
95 TH2D* hMeanIntensityH =
new TH2D(
"hMeanIntensityH",
"hMeanIntensityH;X [pixel];Y [pixel];Intensity", width, -.5,
96 width - 0.5, height, -0.5, height - 0.5);
98 new TH2D(
"hPeakH",
"hPeakH;X [pixel];Y [pixel];Intensity", width, -.5, width - 0.5, height, -0.5, height - 0.5);
99 TH2D* hSmoothLinesH =
new TH2D(
"hSmoothLinesH",
"hSmoothLinesH;X [pixel];Y [pixel];Intensity", width, -.5,
100 width - 0.5, height, -0.5, height - 0.5);
101 TH2D* hLineSearchH =
new TH2D(
"hLineSearchH",
"hLineSearchH;X [pixel];Y [pixel];Intensity", width, -.5, width - 0.5,
102 height, -0.5, height - 0.5);
105 new TH2D(
"hInitV",
"hInitV;X [pixel];Y [pixel];Intensity", width, -.5, width - 0.5, height, -0.5, height - 0.5);
106 TH2D* hMeanIntensityV =
new TH2D(
"hMeanIntensityV",
"hMeanIntensityV;X [pixel];Y [pixel];Intensity", width, -.5,
107 width - 0.5, height, -0.5, height - 0.5);
109 new TH2D(
"hPeakV",
"hPeakV;X [pixel];Y [pixel];Intensity", width, -.5, width - 0.5, height, -0.5, height - 0.5);
110 TH2D* hSmoothLinesV =
new TH2D(
"hSmoothLinesV",
"hSmoothLinesV;X [pixel];Y [pixel];Intensity", width, -.5,
111 width - 0.5, height, -0.5, height - 0.5);
112 TH2D* hLineSearchV =
new TH2D(
"hLineSearchV",
"hLineSearchV;X [pixel];Y [pixel];Intensity", width, -.5, width - 0.5,
113 height, -0.5, height - 0.5);
115 TH2D* hSuperpose =
new TH2D(
"hSuperpose",
"hSuperpose;X [pixel];Y [pixel];Intensity", width, -.5, width - 0.5, height,
144 vector<CbmRichRonchiIntersectionData> intersections =
DoIntersection(dataH, dataV);
145 vector<vector<double>> dataSup =
DoSuperpose(dataH, dataV);
159 TCanvas* c =
new TCanvas(
"ronchi_2d_horizontal",
"ronchi_2d_horizontal", 1500, 1000);
174 TCanvas* c =
new TCanvas(
"ronchi_2d_vertical",
"ronchi_2d_vertical", 1500, 1000);
189 TCanvas* c2 =
new TCanvas(
"ronchi_1d_slices_horizontal",
"ronchi_1d_slices_horizontal", 1200, 600);
192 TH1D* h1 = hInitH->ProjectionY(
"_py2", 250, 250);
193 TH1D* h2 = hInitH->ProjectionY(
"_py3", 300, 300);
194 TH1D* hM1 = hMeanIntensityH->ProjectionY(
"_pyM1", 250, 250);
195 TH1D* hM2 = hMeanIntensityH->ProjectionY(
"_pyM2", 300, 300);
196 TH1D* hP1 = hPeakH->ProjectionY(
"_pyP1", 250, 250);
197 TH1D* hP2 = hPeakH->ProjectionY(
"_pyP2", 300, 300);
199 DrawH1({h1, hM1, hP1}, {
"Init",
"Mean",
"Peak"});
201 DrawH1({h2, hM2, hP2}, {
"Init",
"Mean",
"Peak"});
206 TCanvas* c =
new TCanvas(
"ronchi_2d_intersection",
"ronchi_2d_intersection", 1000, 1000);
208 for (
size_t i = 0; i < intersections.size(); i++) {
209 TEllipse* center =
new TEllipse(intersections[i].fPixelX, intersections[i].fPixelY, 5);
214 vector<int> colors = {kBlack, kGreen, kBlue, kRed, kYellow, kOrange, kCyan, kGray, kMagenta, kYellow + 2, kRed + 3};
216 TCanvas* c =
new TCanvas(
"ronchi_2d_intersection_x",
"ronchi_2d_intersection_x", 1000, 1000);
218 for (
size_t i = 0; i < intersections.size(); i++) {
219 TEllipse* center =
new TEllipse(intersections[i].fPixelX, intersections[i].fPixelY, 5);
220 center->SetFillColor(colors[intersections[i].fOrderedLineX % colors.size()]);
226 TCanvas* c =
new TCanvas(
"ronchi_2d_intersection_y",
"ronchi_2d_intersection_y", 1000, 1000);
228 for (
size_t i = 0; i < intersections.size(); i++) {
229 TEllipse* center =
new TEllipse(intersections[i].fPixelX, intersections[i].fPixelY, 5);
230 center->SetFillColor(colors[intersections[i].fOrderedLineY % colors.size()]);
294 int nX = data.size();
295 int nY = data[0].size();
297 int halfAvWindow = 5;
300 vector<double> weightsX = {1., 0.75, 0.4, 0.2, 0.08, 0.04};
301 vector<double> weightsY = {1., 0.75, 0.4, 0.2, 0.08, 0.04};
303 vector<vector<double>> dataNew(nX, std::vector<double>(nY, 0.));
305 for (
int x = 0;
x < nX;
x++) {
306 for (
int y = 0;
y < nY;
y++) {
308 double weightSum = 0.;
309 for (
int xW = -halfAvWindow; xW <= halfAvWindow;
311 for (
int yW = -halfAvWindow; yW <= halfAvWindow; yW++) {
313 int xWAbs = std::abs(xW);
314 int yWAbs = std::abs(yW);
317 (xWAbs < (int) weightsX.size())
319 : weightsX[weightsX.size()
322 (yWAbs < (int) weightsY.size()) ? weightsY[yWAbs] : weightsY[weightsY.size() - 1];
324 double weight = weightX * weightY;
327 if (indX < 0) indX = 0;
328 if (indX >= nX) indX = nX - 1;
330 if (indY < 0) indY = 0;
331 if (indY >= nY) indY = nY - 1;
333 total += data[indX][indY] * weight;
337 dataNew[
x][
y] = total / weightSum;
338 if (dataNew[
x][
y] <= threshold)
430 int nX = data.size();
431 int nY = data[0].size();
433 int missingCounterCut = 15;
434 int missingCounterTotalCut = 25;
437 vector<vector<double>> dataNew(nX, std::vector<double>(nY, 0.));
438 double curIndex = 0.;
440 for (
int x = 0;
x < nX;
x++) {
441 for (
int y = 0;
y < nY;
y++) {
442 if (data[
x][
y] > 0. && dataNew[
x][
y] == 0.) {
444 dataNew[
x][
y] = curIndex;
445 int missingCounterTotal = 0.;
446 int missingCounter = 0.;
448 for (
int x1 =
x + 1; x1 < nX; x1++) {
449 bool isFound =
false;
450 for (
int y1 = -halfWindowY; y1 <= halfWindowY; y1++) {
451 if (data[x1][curY + y1] > 0.
452 && dataNew[x1][curY + y1] == 0.) {
453 dataNew[x1][curY + y1] = curIndex;
461 missingCounterTotal++;
467 if (missingCounterTotal >= missingCounterTotalCut || missingCounter >= missingCounterCut)
break;
472 cout <<
"curIndex:" << curIndex << endl;
479 const vector<vector<double>>& dataV)
481 int nX = dataV.size();
482 int nY = dataV[0].size();
484 vector<CbmRichRonchiIntersectionData> intersections;
486 for (
int x = 0;
x < nX;
x++) {
487 for (
int y = 0;
y < nY;
y++) {
497 intersections.push_back(data);
501 cout <<
"intersections.size(): " << intersections.size() << endl;
505 for (
size_t i1 = 0; i1 < intersections.size(); i1++) {
506 for (
size_t i2 = i1 + 1; i2 < intersections.size(); i2++) {
507 double dX = intersections[i1].fPixelX
508 - intersections[i2].fPixelX;
509 double dY = intersections[i1].fPixelY - intersections[i2].fPixelY;
510 double dist = std::sqrt(dX * dX + dY * dY);
514 removeSet.insert(i2);
519 set<int>::iterator it;
520 for (it = removeSet.begin(); it != removeSet.end(); ++it) {
521 swap(intersections[*it],
523 [intersections.size()
525 intersections.resize(intersections.size() - 1);
527 cout <<
"removeSet.size():" << removeSet.size() <<
" intersections.size(): " << intersections.size() << endl;
529 return intersections;
550 map<int, CbmRichRonchiLineData> linesMap;
551 vector<CbmRichRonchiLineData> lines;
554 for (
auto const& curIntr : intersections) {
556 (option ==
"x") ? curIntr.fLineX : curIntr.fLineY;
557 linesMap[lineInd].fMeanPrimary +=
558 (option ==
"x") ? curIntr.fPixelX : curIntr.fPixelY;
559 linesMap[lineInd].fMeanSecondary += (option ==
"x") ? curIntr.fPixelY : curIntr.fPixelX;
560 linesMap[lineInd].fNofPoints++;
561 linesMap[lineInd].fLineInd = lineInd;
564 for (
auto& kv : linesMap) {
565 kv.second.fMeanPrimary = (double) kv.second.fMeanPrimary
566 / kv.second.fNofPoints;
567 kv.second.fMeanSecondary = (double) kv.second.fMeanSecondary / kv.second.fNofPoints;
568 lines.push_back(kv.second);
573 return lhs.fMeanPrimary < rhs.fMeanPrimary;
578 for (
size_t i = 0; i < lines.size() - 1; i++) {
579 if (lines[i].fNofPoints >= 35) {
586 for (
int i = lineIndMany - 1; i >= 1; i--) {
593 for (
size_t i = lineIndMany; i < lines.size() - 1; i++) {
601 int newLineIndex = 1;
602 set<int> duplicateLines;
603 for (
auto& curLine : lines) {
604 if (duplicateLines.find(curLine.fLineInd) != duplicateLines.end())
continue;
605 duplicateLines.insert(curLine.fLineInd);
606 for (
auto& curIntr : intersections) {
607 if (option ==
"x" && curIntr.fLineX == curLine.fLineInd) curIntr.fOrderedLineX = newLineIndex;
608 if (option ==
"y" && curIntr.fLineY == curLine.fLineInd) curIntr.fOrderedLineY = newLineIndex;
612 cout <<
"newLineIndex:" << newLineIndex << endl;
645 for (
size_t i = 0; i < data.size(); i++) {
646 if (data[i].fOrderedLineX < xMin) xMin = data[i].fOrderedLineX;
647 if (data[i].fOrderedLineX > xMax) xMax = data[i].fOrderedLineX;
648 if (data[i].fOrderedLineY < yMin) yMin = data[i].fOrderedLineY;
649 if (data[i].fOrderedLineY > yMax) yMax = data[i].fOrderedLineY;
652 int centerLineX = (xMax - xMin) / 2;
653 int centerLineY = (yMax - yMin) / 2;
658 for (
size_t i = 0; i < data.size(); i++) {
659 if (
fCenterCcdX == -1 && data[i].fOrderedLineX == centerLineX) {
662 if (
fCenterCcdY == -1 && data[i].fOrderedLineY == centerLineY) {
667 cout <<
"xMin:" << xMin <<
" xMax:" << xMax <<
" yMin:" << yMin <<
" yMax:" << yMax << endl;
668 cout <<
"centerLineX:" << centerLineX <<
" centerLineY:" << centerLineY << endl;
671 for (
size_t i = 0; i < data.size(); i++) {
676 data[i].fCcdV.SetXYZ(ccdX, ccdY, 0.);
679 data[i].fRulingV.SetXYZ((data[i].fOrderedLineX - centerLineX) *
fPitchGrid,
685 double sRefY = -(data[i].fRulingV.Y() - data[i].fCcdV.Y()) /
fDistRulingCCD;
701 atan(data[i].fMirrorV.X()
706 double angleRefX = atan(sRefX);
707 double angleRefY = atan(sRefY);
708 data[i].fNormalRadX = ((angleIncX + angleRefX) / 2.0);
709 data[i].fNormalRadY = ((angleIncY + angleRefY) / 2.0);
714 double segmentSize = 3500;
715 data[i].fTL.SetXYZ(data[i].fMirrorV.X() - segmentSize, data[i].fMirrorV.Y() + segmentSize, data[i].fMirrorV.Z());
716 RotatePointImpl(&data[i].fTL, &data[i].fTLRot, data[i].fNormalRadX, data[i].fNormalRadY, &data[i].fMirrorV);
718 data[i].fTR.SetXYZ(data[i].fMirrorV.X() + segmentSize, data[i].fMirrorV.Y() + segmentSize, data[i].fMirrorV.Z());
719 RotatePointImpl(&data[i].fTR, &data[i].fTRRot, data[i].fNormalRadX, data[i].fNormalRadY, &data[i].fMirrorV);
721 data[i].fBL.SetXYZ(data[i].fMirrorV.X() - segmentSize, data[i].fMirrorV.Y() - segmentSize, data[i].fMirrorV.Z());
722 RotatePointImpl(&data[i].fBL, &data[i].fBLRot, data[i].fNormalRadX, data[i].fNormalRadY, &data[i].fMirrorV);
724 data[i].fBR.SetXYZ(data[i].fMirrorV.X() + segmentSize, data[i].fMirrorV.Y() - segmentSize, data[i].fMirrorV.Z());
725 RotatePointImpl(&data[i].fBR, &data[i].fBRRot, data[i].fNormalRadX, data[i].fNormalRadY, &data[i].fMirrorV);
744 TCanvas* c =
new TCanvas(
"ronchi_xz_mum_lineY20",
"ronchi_xz_mum_lineY20", 1800, 900);
766 for (
size_t i = 0; i < data.size(); i++) {
767 if (data[i].fOrderedLineX < xMin) xMin = data[i].fOrderedLineX;
768 if (data[i].fOrderedLineX > xMax) xMax = data[i].fOrderedLineX;
769 if (data[i].fOrderedLineY < yMin) yMin = data[i].fOrderedLineY;
770 if (data[i].fOrderedLineY > yMax) yMax = data[i].fOrderedLineY;
775 for (
int iX = xMin; iX <= xMax; iX++) {
779 if (iPX < 0 || iPX0 < 0)
continue;
780 double shiftX = data[iPX0].fTRRot.X() - data[iPX].fTLRot.X();
781 data[iPX].fTLRot.SetXYZ(data[iPX].fTLRot.X() + shiftX, data[iPX].fTLRot.Y(), data[iPX].fTLRot.Z());
782 data[iPX].fTRRot.SetXYZ(data[iPX].fTRRot.X() + shiftX, data[iPX].fTRRot.Y(), data[iPX].fTRRot.Z());
783 data[iPX].fBLRot.SetXYZ(data[iPX].fBLRot.X() + shiftX, data[iPX].fBLRot.Y(), data[iPX].fBLRot.Z());
784 data[iPX].fBRRot.SetXYZ(data[iPX].fBRRot.X() + shiftX, data[iPX].fBRRot.Y(), data[iPX].fBRRot.Z());
788 for (
int iY = yMin; iY <= yMax; iY++) {
791 if (iPY < 0 || iPY0 < 0)
continue;
792 double shiftY = data[iPY0].fTRRot.Y() - data[iPY].fBRRot.Y();
793 data[iPY].fTLRot.SetXYZ(data[iPY].fTLRot.X(), data[iPY].fTLRot.Y() + shiftY, data[iPY].fTLRot.Z());
794 data[iPY].fTRRot.SetXYZ(data[iPY].fTRRot.X(), data[iPY].fTRRot.Y() + shiftY, data[iPY].fTRRot.Z());
795 data[iPY].fBLRot.SetXYZ(data[iPY].fBLRot.X(), data[iPY].fBLRot.Y() + shiftY, data[iPY].fBLRot.Z());
796 data[iPY].fBRRot.SetXYZ(data[iPY].fBRRot.X(), data[iPY].fBRRot.Y() + shiftY, data[iPY].fBRRot.Z());
802 for (
int iX = xMin; iX <= xMax; iX++) {
804 if (iPX < 0)
continue;
805 for (
int iY = yMin; iY <= yMax; iY++) {
807 if (iC < 0)
continue;
809 if (iPY < 0)
continue;
811 double shiftX = data[iPX].fTLRot.X() - data[iC].fTLRot.X();
812 double shiftY = data[iPY].fTLRot.Y() - data[iC].fTLRot.Y();
814 data[iC].fTLSph.SetXYZ(data[iC].fTLRot.X() + shiftX, data[iC].fTLRot.Y() + shiftY, data[iC].fTLRot.Z());
815 data[iC].fTRSph.SetXYZ(data[iC].fTRRot.X() + shiftX, data[iC].fTRRot.Y() + shiftY, data[iC].fTRRot.Z());
816 data[iC].fBLSph.SetXYZ(data[iC].fBLRot.X() + shiftX, data[iC].fBLRot.Y() + shiftY, data[iC].fBLRot.Z());
817 data[iC].fBRSph.SetXYZ(data[iC].fBRRot.X() + shiftX, data[iC].fBRRot.Y() + shiftY, data[iC].fBRRot.Z());
822 for (
int iX = xMin; iX <= xMax; iX++) {
823 for (
int iY = yMin; iY <= yMax; iY++) {
828 if (iC < 0)
continue;
832 double shiftZ = data[iPY].fTLSph.Z() - data[iC].fBLSph.Z();
833 data[iC].fTLSph.SetZ(data[iC].fTLSph.Z() + shiftZ);
834 data[iC].fTRSph.SetZ(data[iC].fTRSph.Z() + shiftZ);
835 data[iC].fBLSph.SetZ(data[iC].fBLSph.Z() + shiftZ);
836 data[iC].fBRSph.SetZ(data[iC].fBRSph.Z() + shiftZ);
842 for (
int iX = xMin; iX <= xMax; iX++) {
846 if (iPX < 0 || iPX0 < 0)
continue;
847 double shiftZ = data[iPX0].fTRSph.Z() - data[iPX].fTLSph.Z();
848 for (
int iY = yMin; iY <= yMax; iY++) {
850 data[iC].fTLSph.SetZ(data[iC].fTLSph.Z() + shiftZ);
851 data[iC].fTRSph.SetZ(data[iC].fTRSph.Z() + shiftZ);
852 data[iC].fBLSph.SetZ(data[iC].fBLSph.Z() + shiftZ);
853 data[iC].fBRSph.SetZ(data[iC].fBRSph.Z() + shiftZ);
902 int correctionValue = 11800;
905 for (
size_t i = 0; i < data.size(); i++) {
906 double meanX = 0.25 * (data[i].fTLSph.X() + data[i].fTRSph.X() + data[i].fBLSph.X() + data[i].fBRSph.X());
907 double meanY = 0.25 * (data[i].fTLSph.Y() + data[i].fTRSph.Y() + data[i].fBLSph.Y() + data[i].fBRSph.Y());
908 double meanZ = 0.25 * (data[i].fTLSph.Z() + data[i].fTRSph.Z() + data[i].fBLSph.Z() + data[i].fBRSph.Z());
909 double dX = mirX - meanX;
910 double dY = mirY - meanY;
911 double dZ = mirZ - meanZ;
912 double d =
sqrt(dZ * dZ);
918 double mirrorCenterDist =
sqrt(pow(meanX, 2) + pow(meanY, 2));
924 TH2D* hMirrorHeight =
925 new TH2D(
"hMirrorDeviation",
"hMirrorDeviation;index X;index Y;Deviation [mum]", 60, -0.5, 59.5, 60, -0.5, 59.5);
926 TCanvas* c =
new TCanvas(
"mirror_deviation",
"mirror_deviation", 1000, 1000);
927 for (
size_t i = 0; i < data.size(); i++) {
928 if (data[i].fDeviation > threshold) {
929 hMirrorHeight->SetBinContent(data[i].fOrderedLineX, data[i].fOrderedLineY, data[i].fDeviation - correctionValue);
937 vector<int> colors = {kBlack, kGreen, kBlue, kRed, kYellow, kOrange, kCyan, kGray, kMagenta, kYellow + 2, kRed + 3};
938 TH2D* hCcdXY =
new TH2D(
"hCcdXY",
"hCcdXY;CCD_X [mum];CCD_Y [mum];", 1, -7000, 7000, 1, -7000, 7000);
939 TH2D* hRulingXY =
new TH2D(
"hRulingXY",
"hRulingXY;Ruling_X [mum];Ruling_Y [mum];", 1, -7000, 7000, 1, -7000, 7000);
941 new TH2D(
"hMirrorXY",
"hMirrorXY;Mirror_X [mum];Mirror_Y [mum];", 1, -250000, 250000, 1, -250000, 250000);
942 TCanvas* c =
new TCanvas(
"ronchi_xy_mum",
"ronchi_xy_mum", 1800, 600);
946 gPad->SetRightMargin(0.10);
947 for (
size_t i = 0; i < data.size(); i++) {
948 TEllipse* center =
new TEllipse(data[i].fCcdV.X(), data[i].fCcdV.Y(), 50);
949 center->SetFillColor(colors[data[i].fOrderedLineX % colors.size()]);
955 gPad->SetRightMargin(0.10);
956 for (
size_t i = 0; i < data.size(); i++) {
957 TEllipse* center =
new TEllipse(data[i].fRulingV.X(), data[i].fRulingV.Y(), 50);
958 center->SetFillColor(colors[data[i].fOrderedLineX % colors.size()]);
964 gPad->SetRightMargin(0.10);
965 for (
size_t i = 0; i < data.size(); i++) {
966 TEllipse* center =
new TEllipse(data[i].fMirrorV.X(), data[i].fMirrorV.Y(), 2500);
967 center->SetFillColor(colors[data[i].fOrderedLineX % colors.size()]);
974 string histName =
"hZX_lineY" + to_string(orderedLineY) +
"_scale" + to_string(scale);
977 new TH2D(histName.c_str(), (histName +
";Z [mum];X [mum];").c_str(), 100, -0.02 * scale *
fDistMirrorRuling,
980 gPad->SetRightMargin(0.10);
981 for (
size_t i = 0; i < data.size(); i++) {
982 if (data[i].fOrderedLineY != orderedLineY)
continue;
984 TEllipse* ccdEllipse =
new TEllipse(data[i].fCcdV.Z(), data[i].fCcdV.X(), scale * 20000, scale * 2000);
985 ccdEllipse->SetFillColor(kRed);
988 TEllipse* rulingEllipse =
new TEllipse(data[i].fRulingV.Z(), data[i].fRulingV.X(), scale * 20000, scale * 2000);
989 rulingEllipse->SetFillColor(kBlue);
990 rulingEllipse->Draw();
992 TEllipse* mirrorEllipse =
new TEllipse(data[i].fMirrorV.Z(), data[i].fMirrorV.X(), scale * 20000, scale * 2000);
993 mirrorEllipse->SetFillColor(kGreen);
994 mirrorEllipse->Draw();
996 TLine* rulingLine =
new TLine(data[i].fCcdV.Z(), data[i].fCcdV.X(), data[i].fRulingV.Z(), data[i].fRulingV.X());
1000 new TLine(data[i].fRulingV.Z(), data[i].fRulingV.X(), data[i].fMirrorV.Z(), data[i].fMirrorV.X());
1003 double xNorm = data[i].fMirrorV.X() -
fDistMirrorRuling * tan(data[i].fNormalRadX);
1004 TLine* mirrorLineNorm =
new TLine(
fDistRulingCCD, xNorm, data[i].fMirrorV.Z(), data[i].fMirrorV.X());
1005 mirrorLineNorm->SetLineColor(kBlue);
1006 mirrorLineNorm->Draw();
1014 string cName =
"ronchi_mirror_segments_rot_lineX" + to_string(orderedLineX) +
"_lineY" + to_string(orderedLineY);
1015 TCanvas* c =
new TCanvas(cName.c_str(), cName.c_str(), 1800, 900);
1018 string histNameXY =
"hXY_mirror_segments_rot_lineX" + to_string(orderedLineX) +
"_lineY" + to_string(orderedLineY);
1020 new TH2D(histNameXY.c_str(), (histNameXY +
"hXY;X [mum];Y [mum];").c_str(), 1, -250000, 250000, 1, -250000, 250000);
1021 vector<int> colors = {kBlack, kGreen, kBlue, kRed, kYellow, kOrange, kCyan, kGray, kMagenta, kYellow + 2, kRed + 3};
1024 gPad->SetRightMargin(0.10);
1025 for (
size_t i = 0; i < data.size(); i++) {
1026 int color = colors[data[i].fOrderedLineY % colors.size()];
1030 double hSize = 250000;
1031 string histNameZX =
"hZX_mirror_segments_lrot_ineX" + to_string(orderedLineX) +
"_lineY" + to_string(orderedLineY);
1032 TH2D* hZX =
new TH2D(histNameZX.c_str(), (histNameZX +
";Z [mum];X [mum];").c_str(), 100,
fDistMirrorRuling - hSize,
1036 gPad->SetRightMargin(0.10);
1037 for (
size_t i = 0; i < data.size(); i++) {
1038 if (data[i].fOrderedLineY != orderedLineY)
continue;
1040 TEllipse* mirrorEllipse =
new TEllipse(data[i].fMirrorV.Z(), data[i].fMirrorV.X(), 2000, 2000);
1041 mirrorEllipse->SetFillColor(kGreen);
1042 mirrorEllipse->Draw();
1044 TLine* rulingLine =
new TLine(data[i].fCcdV.Z(), data[i].fCcdV.X(), data[i].fRulingV.Z(), data[i].fRulingV.X());
1048 new TLine(data[i].fRulingV.Z(), data[i].fRulingV.X(), data[i].fMirrorV.Z(), data[i].fMirrorV.X());
1051 double xNorm = data[i].fMirrorV.X() -
fDistMirrorRuling * tan(data[i].fNormalRadX);
1052 TLine* mirrorLineNorm =
new TLine(
fDistRulingCCD, xNorm, data[i].fMirrorV.Z(), data[i].fMirrorV.X());
1053 mirrorLineNorm->SetLineColor(kBlue);
1054 mirrorLineNorm->Draw();
1056 TLine* mirrorLineSeg =
new TLine(data[i].fTRRot.Z(), data[i].fTRRot.X(), data[i].fTLRot.Z(), data[i].fTLRot.X());
1057 mirrorLineSeg->SetLineColor(kRed);
1058 mirrorLineSeg->Draw();
1064 string cName =
"ronchi_mirror_segments_sphere_all";
1065 TCanvas* c =
new TCanvas(cName.c_str(), cName.c_str(), 900, 900);
1067 string histNameXY =
"hXY_mirror_segments_sphere_all";
1069 new TH2D(histNameXY.c_str(), (histNameXY +
"hXY;X [mum];Y [mum];").c_str(), 1, -250000, 250000, 1, -250000, 250000);
1070 vector<int> colors = {kBlack, kGreen, kBlue, kRed, kYellow, kOrange, kCyan, kGray, kMagenta, kYellow + 2, kRed + 3};
1072 gPad->SetRightMargin(0.10);
1073 for (
size_t i = 0; i < data.size(); i++) {
1074 int color = colors[data[i].fOrderedLineY % colors.size()];
1082 string cName =
"ronchi_mirror_segments_sphere_lineX" + to_string(orderedLineX) +
"_lineY" + to_string(orderedLineY);
1083 TCanvas* c =
new TCanvas(cName.c_str(), cName.c_str(), 1800, 900);
1086 string histNameXY =
"hXY_mirror_segments_sphere_lineX" + to_string(orderedLineX) +
"_lineY" + to_string(orderedLineY);
1088 new TH2D(histNameXY.c_str(), (histNameXY +
"hXY;X [mum];Y [mum];").c_str(), 1, -250000, 250000, 1, -250000, 250000);
1089 vector<int> colors = {kBlack, kGreen, kBlue, kRed, kYellow, kOrange, kCyan, kGray, kMagenta, kYellow + 2, kRed + 3};
1092 gPad->SetRightMargin(0.10);
1093 for (
size_t i = 0; i < data.size(); i++) {
1094 if (data[i].fOrderedLineX == orderedLineX)
1096 if (data[i].fOrderedLineY == orderedLineY)
1100 double hSize = 20000;
1101 string histNameZX =
"hZX_mirror_segments_sphere_lineX" + to_string(orderedLineX) +
"_lineY" + to_string(orderedLineY);
1102 TH2D* hZX =
new TH2D(histNameZX.c_str(), (histNameZX +
";Z [mum];X(Y) [mum];").c_str(), 100,
1103 data[0].fBRSph.Z() - 0.25 * hSize, data[0].fBRSph.Z() + hSize, 100, -1. * 250000, 250000);
1106 gPad->SetRightMargin(0.10);
1107 for (
size_t i = 0; i < data.size(); i++) {
1108 if (data[i].fOrderedLineX == orderedLineX) {
1109 TLine* mirrorLineSeg =
new TLine(data[i].fBRSph.Z(), data[i].fBRSph.Y(), data[i].fTRSph.Z(), data[i].fTRSph.Y());
1110 mirrorLineSeg->SetLineColor(kBlue);
1111 mirrorLineSeg->Draw();
1114 if (data[i].fOrderedLineY == orderedLineY) {
1115 TLine* mirrorLineSeg =
new TLine(data[i].fTRSph.Z(), data[i].fTRSph.X(), data[i].fTLSph.Z(), data[i].fTLSph.X());
1116 mirrorLineSeg->SetLineColor(kRed);
1117 mirrorLineSeg->Draw();
1172 const TVector3& br,
int color)
1174 TLine* line1 =
new TLine(tl.X(), tl.Y(), tr.X(), tr.Y());
1175 line1->SetLineColor(color);
1178 TLine* line2 =
new TLine(tr.X(), tr.Y(), br.X(), br.Y());
1179 line2->SetLineColor(color);
1182 TLine* line3 =
new TLine(br.X(), br.Y(), bl.X(), bl.Y());
1183 line3->SetLineColor(color);
1186 TLine* line4 =
new TLine(bl.X(), bl.Y(), tl.X(), tl.Y());
1187 line4->SetLineColor(color);