527 Double_t lowRange2) {
532 if (optList.size() == 0)
534 "[1,4,7,10](0,9){0.6,0.68,0.9,0.88}:[0.25,0.5,0.75,1](0,10){0.2,0.2,0.45,0.45}");
536 if (optList.size() != 2) {
537 RESTError <<
"TRestAxionOpticsMirror::DrawOpticsProperties. Wrong arguments!" <<
RESTendl;
543 std::vector<double> eLegendCoords =
StringToElements(optList[0],
"{",
",",
"}");
547 std::vector<double> aLegendCoords =
StringToElements(optList[1],
"{",
",",
"}");
549 if (eRange[0] < 0.03) eRange[0] = 0.03;
550 if (eRange[1] > 15) eRange[1] = 15;
551 if (aRange[0] < 0.0) aRange[0] = 0.0;
552 if (aRange[1] > 9) aRange[1] = 9;
561 fCanvas =
new TCanvas(
"canv",
"This is the canvas title", 1400, 1200);
564 TPad* pad1 =
new TPad(
"pad1",
"This is pad1", 0.01, 0.02, 0.99, 0.97);
570 pad1->cd(1)->SetLogy();
571 pad1->cd(1)->SetRightMargin(0.09);
572 pad1->cd(1)->SetLeftMargin(0.15);
573 pad1->cd(1)->SetBottomMargin(0.15);
575 std::vector<TGraph*> ref_vs_ang_graph;
577 for (
unsigned int n = 0; n < energies.size(); n++) {
579 TGraph* gr =
new TGraph();
580 gr->SetName(grname.c_str());
581 for (
double a = aRange[0]; a <= aRange[1]; a += (aRange[1] - aRange[0]) / 10000.) {
584 gr->SetLineColor(49 - n * 3);
586 ref_vs_ang_graph.push_back(gr);
589 ref_vs_ang_graph[0]->GetXaxis()->SetLimits(aRange[0], aRange[1]);
590 ref_vs_ang_graph[0]->GetHistogram()->SetMaximum(1);
591 ref_vs_ang_graph[0]->GetHistogram()->SetMinimum(lowRange);
593 ref_vs_ang_graph[0]->GetXaxis()->SetTitle(
"Angle [degrees]");
594 ref_vs_ang_graph[0]->GetXaxis()->SetTitleSize(0.05);
595 ref_vs_ang_graph[0]->GetXaxis()->SetLabelSize(0.05);
596 ref_vs_ang_graph[0]->GetYaxis()->SetTitle(
"Reflectivity");
597 ref_vs_ang_graph[0]->GetYaxis()->SetTitleOffset(1.5);
598 ref_vs_ang_graph[0]->GetYaxis()->SetTitleSize(0.05);
599 ref_vs_ang_graph[0]->GetYaxis()->SetLabelSize(0.05);
600 pad1->cd(1)->SetLogy();
601 ref_vs_ang_graph[0]->Draw(
"AL");
602 for (
unsigned int n = 1; n < energies.size(); n++) ref_vs_ang_graph[n]->Draw(
"L");
604 Double_t lx1 = 0.6, ly1 = 0.75, lx2 = 0.9, ly2 = 0.95;
605 if (eLegendCoords.size() > 0) {
606 lx1 = eLegendCoords[0];
607 ly1 = eLegendCoords[1];
608 lx2 = eLegendCoords[2];
609 ly2 = eLegendCoords[3];
611 TLegend* legend =
new TLegend(lx1, ly1, lx2, ly2);
613 legend->SetTextSize(0.03);
614 legend->SetHeader(
"Energies",
"C");
615 for (
unsigned int n = 0; n < energies.size(); n++) {
619 legend->AddEntry(lname.c_str(), ltitle.c_str(),
"l");
625 pad1->cd(2)->SetLogy();
626 pad1->cd(2)->SetRightMargin(0.09);
627 pad1->cd(2)->SetLeftMargin(0.15);
628 pad1->cd(2)->SetBottomMargin(0.15);
630 std::vector<TGraph*> ref_vs_en_graph;
632 for (
unsigned int n = 0; n < angles.size(); n++) {
634 TGraph* gr =
new TGraph();
635 gr->SetName(grname.c_str());
636 for (
double e = eRange[0]; e <= eRange[1]; e += (eRange[1] - eRange[0]) / 10000.) {
639 gr->SetLineColor(49 - n * 3);
641 ref_vs_en_graph.push_back(gr);
644 ref_vs_en_graph[0]->GetXaxis()->SetLimits(eRange[0], eRange[1]);
645 ref_vs_en_graph[0]->GetHistogram()->SetMaximum(1);
646 ref_vs_en_graph[0]->GetHistogram()->SetMinimum(lowRange2);
648 ref_vs_en_graph[0]->GetXaxis()->SetTitle(
"Energy [keV]");
649 ref_vs_en_graph[0]->GetXaxis()->SetTitleSize(0.05);
650 ref_vs_en_graph[0]->GetXaxis()->SetLabelSize(0.05);
651 ref_vs_en_graph[0]->GetYaxis()->SetTitle(
"Reflectivity");
652 ref_vs_en_graph[0]->GetYaxis()->SetTitleOffset(1.5);
653 ref_vs_en_graph[0]->GetYaxis()->SetTitleSize(0.05);
654 ref_vs_en_graph[0]->GetYaxis()->SetLabelSize(0.05);
655 pad1->cd(2)->SetLogy();
656 ref_vs_en_graph[0]->Draw(
"AL");
657 for (
unsigned int n = 1; n < angles.size(); n++) ref_vs_en_graph[n]->Draw(
"L");
659 if (aLegendCoords.size() > 0) {
660 lx1 = aLegendCoords[0];
661 ly1 = aLegendCoords[1];
662 lx2 = aLegendCoords[2];
663 ly2 = aLegendCoords[3];
665 TLegend* legendA =
new TLegend(lx1, ly1, lx2, ly2);
666 legendA->SetTextSize(0.03);
667 legendA->SetHeader(
"Angles",
"C");
668 for (
unsigned int n = 0; n < angles.size(); n++) {
672 legendA->AddEntry(lname.c_str(), ltitle.c_str(),
"l");
680 pad1->cd(3)->SetRightMargin(0.09);
681 pad1->cd(3)->SetLeftMargin(0.15);
682 pad1->cd(3)->SetBottomMargin(0.15);
684 ref_vs_ang_graph[0]->Draw(
"AL");
685 for (
unsigned int n = 1; n < energies.size(); n++) ref_vs_ang_graph[n]->Draw(
"L");
689 pad1->cd(4)->SetRightMargin(0.09);
690 pad1->cd(4)->SetLeftMargin(0.15);
691 pad1->cd(4)->SetBottomMargin(0.15);
694 ref_vs_en_graph[0]->Draw(
"AL");
695 for (
unsigned int n = 1; n < angles.size(); n++) ref_vs_en_graph[n]->Draw(
"L");
699 TPad* pad5 =
new TPad(
"all",
"all", 0, 0, 1, 1);
700 pad5->SetFillStyle(4000);
703 TLatex* lat =
new TLatex();
709 lat->SetTextSize(0.02);
716 lat->SetTextSize(0.015);
718 lat->SetTextAlign(22);
719 lat->DrawLatexNDC(.5, .95, title.c_str());