2718{
2719
2720 map<string, string> titlemap;
2721 titlemap["WholeBarrel_1"] = "whole barrel";
2722 titlemap["Detector_-1"] = "barrel C";
2723 titlemap["Detector_1"] = "barrel A";
2724 titlemap["Detector_-2"] = "end-cap C";
2725 titlemap["Detector_2"] = "end-cap A";
2726
2727 titlemap["WholeBarrel_Ar_1"] = "whole barrel";
2728 titlemap["Detector_Ar_-1"] = "barrel C";
2729 titlemap["Detector_Ar_1"] = "barrel A";
2730 titlemap["Detector_Ar_-2"] = "end-cap C";
2731 titlemap["Detector_Ar-2"] = "end-cap A";
2732
2733 TFile *
file =
new TFile(infile);
2734
2735
2736 TPad *c1_3 = new TPad("c1_3", "newpad", 0.01, 0.33, 0.99, 0.99);
2737 c1_3->Draw();
2738 c1_3->cd();
2739 c1_3->SetTopMargin(0.1);
2740 c1_3->SetBottomMargin(0.01);
2741 c1_3->SetRightMargin(0.1);
2742 c1_3->SetFillStyle(0);
2743 c1_3->SetGrid();
2744
2746
2747 TDirectory *trt = nullptr;
2748 if (!isAr)
2749 trt = (TDirectory *)
file->FindKey(
"TRT_all")->ReadObj();
2750 else
2751 trt = (TDirectory *)
file->FindKey(
"TRT_Ar_all")->ReadObj();
2752
2753 if (folder != "")
2754 {
2755 TDirectory *
det = (TDirectory *)trt->FindKey(
folder.c_str())->ReadObj();
2756 cout <<
" RtColor plot for folder" <<
folder << endl;
2757 if (
det->FindKey(
"rt-relation"))
2758 {
2759 hist = (
TH2F *)
det->FindKey(
"rt-relation")->ReadObj();
2760
2762 {
2763 cout << " found rt-relation " << endl;
2764 hist->GetXaxis()->SetRangeUser(0, 40);
2765 hist->GetYaxis()->SetRangeUser(0, 2.4);
2767 sprintf(name,
"r(t) for %s",
folder.c_str());
2768 if (isAr)
2769 sprintf(name,
"Argon r(t) for %s",
folder.c_str());
2770 hist->SetTitle(name);
2771 hist->GetXaxis()->SetRangeUser(0, 50);
2773
2774 if (
det->FindKey(
"rtgraph"))
2775 {
2776 cout << " found rtgraph " << endl;
2777 rtgraph = (TGraphErrors *)
det->FindKey(
"rtgraph")->ReadObj();
2781 rtgraph->GetYaxis()->SetRangeUser(0, 2.4);
2783 if (
rtgraph->GetFunction(
"rtfunc"))
2785 else
2787 }
2788 if (
det->FindKey(
"oldrtfunc"))
2789 {
2790 cout << " found oldrtfunc " << endl;
2791 oldrtfunc = (TF1 *)
det->FindKey(
"oldrtfunc")->ReadObj();
2794 }
2795 }
2796 }
2797 else
2798 {
2799 throw string(" NO RT OBJECTS FOUND");
2800 }
2801 }
2802 else if (trt->FindKey("rt-relation"))
2803 {
2804 cout << " RtColor Plot entire TRT" << endl;
2805 hist = (
TH2F *)trt->FindKey(
"rt-relation")->ReadObj();
2806
2807 hist->GetXaxis()->SetRangeUser(0, 40);
2808 hist->SetTitle(
"r(t) for whole TRT");
2809 if (isAr)
2810 hist->SetTitle(
"Argon r(t) for whole TRT");
2811 hist->GetYaxis()->SetRangeUser(0, 2.4);
2812 hist->GetXaxis()->SetRangeUser(0, 50);
2814 if (trt->FindKey("rtgraph"))
2815 {
2816 rtgraph = (TGraphErrors *)trt->FindKey(
"rtgraph")->ReadObj();
2820 rtgraph->GetYaxis()->SetRangeUser(0, 2.4);
2821 if (
rtgraph->GetFunction(
"rtfunc"))
2823 else
2826 }
2827 if (trt->FindKey("oldrtfunc"))
2828 {
2829 oldrtfunc = (TF1 *)trt->FindKey(
"oldrtfunc")->ReadObj();
2832 }
2833 }
2834 else
2836
2837
2838
2839
2841 {
2844 TPad *c1_4 = new TPad("c1_4", "newpad", 0.01, 0, 0.99, 0.32);
2845 c1_4->Draw();
2846 c1_4->cd();
2847 c1_4->SetTopMargin(0.01);
2848 c1_4->SetBottomMargin(0.3);
2849 c1_4->SetRightMargin(0.1);
2850 c1_4->SetFillStyle(0);
2851 c1_4->SetGrid();
2852
2853 Double_t Xmax =
rtgraph->GetXaxis()->GetXmax();
2855
2856 const Int_t
n = 300;
2859
2860 Double_t Ymax = -10;
2861 Double_t Ymin = 10;
2862
2863 newRT->SetRange(-10., 60.);
2865
2866 for (Int_t i = 0;
i <
n;
i++)
2867 {
2874 }
2875
2876 TGraph *
gr1 =
new TGraph(n,
x,
y);
2877
2878
2880 gr1->GetXaxis()->SetTitle(
"t-T0/ns");
2881 gr1->GetXaxis()->SetRangeUser(Xmin, Xmax);
2882 gr1->GetYaxis()->SetTitle(
"Old r(t) - New r(t) /mm");
2883 gr1->GetYaxis()->SetRangeUser(-0.1, 0.1);
2884
2885 gr1->GetYaxis()->SetNdivisions(5);
2886 gr1->GetXaxis()->SetTitleSize(0.06);
2887 gr1->GetXaxis()->SetLabelSize(0.06);
2888 gr1->GetYaxis()->SetLabelSize(0.08);
2889 gr1->GetYaxis()->SetTitleOffset(0.8);
2890 gr1->GetYaxis()->SetTitleSize(0.06);
2891 gr1->SetLineStyle(2);
2892
2893
2894
2896 std::vector<Double_t>
x1(n1,0),
y1(n1,0),
ex1(n1,0), ey1(n1,0);
2898
2899 for (Int_t i = 0;
i <
n1;
i++)
2900 {
2907 ey1.at(i) =
rtgraph->GetErrorY(i);
2908 if (
y1.at(i) > Ymax)
2910 if (
y1.at(i) < Ymin)
2912 }
2913
2914
2915 TGraphErrors *
gr2 =
new TGraphErrors(n1, &
x1.at(0), &
y1.at(0), &
ex1.at(0), &ey1.at(0));
2916 gr2->SetMarkerColor(kBlack);
2917 gr2->SetMarkerStyle(20);
2919 gr2->GetYaxis()->SetTitle(
"Old r(t) - New r(t) /mm");
2920
2921
2922 gr2->GetYaxis()->SetRangeUser(-0.1, 0.1);
2923 gr2->GetXaxis()->SetRangeUser(0, 50);
2924
2927
2928 TLine *line0 = new TLine(0, 0, 50, 0);
2929 line0->SetLineColor(4);
2930 line0->Draw();
2931 }
2932}
TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)