2943 this->SetName(
"resplots");
2947 TDirectory *trt =
nullptr;
2948 TDirectory *det1 =
nullptr;
2949 TDirectory *det2 =
nullptr;
2950 TDirectory *det3 =
nullptr;
2951 TDirectory *det4 =
nullptr;
2955 cout <<
" In ResidualPlots Xenon" << endl;
2956 trt = (TDirectory *)
file->FindKey(
"TRT_all")->ReadObj();
2958 throw std::runtime_error(
"trt pointer is null");
2960 det1 = (TDirectory *)trt->FindKey(
"Detector_-1")->ReadObj();
2961 det2 = (TDirectory *)trt->FindKey(
"Detector_1")->ReadObj();
2962 det3 = (TDirectory *)trt->FindKey(
"Detector_-2")->ReadObj();
2963 det4 = (TDirectory *)trt->FindKey(
"Detector_2")->ReadObj();
2968 throw std::runtime_error(
"trt pointer is null");
2970 cout <<
" In ResidualPlots Argon" << endl;
2971 if (
file->FindKey(
"TRT_Ar_all"))
2972 trt = (TDirectory *)
file->FindKey(
"TRT_Ar_all")->ReadObj();
2973 if (trt->FindKey(
"Detector_Ar_-1"))
2974 det1 = (TDirectory *)trt->FindKey(
"Detector_Ar_-1")->ReadObj();
2975 if (trt->FindKey(
"Detector_Ar_1"))
2976 det2 = (TDirectory *)trt->FindKey(
"Detector_Ar_1")->ReadObj();
2977 if (trt->FindKey(
"Detector_Ar_-2"))
2978 det3 = (TDirectory *)trt->FindKey(
"Detector_Ar_-2")->ReadObj();
2979 if (trt->FindKey(
"Detector_Ar_2"))
2980 det4 = (TDirectory *)trt->FindKey(
"Detector_Ar_2")->ReadObj();
2983 TH2F *reshist1 =
nullptr;
2984 TH2F *reshist2 =
nullptr;
2985 TH2F *reshist3 =
nullptr;
2986 TH2F *reshist4 =
nullptr;
2987 TH2F *reshist5 =
nullptr;
2988 TH2F *treshist1 =
nullptr;
2989 TH2F *treshist2 =
nullptr;
2990 TH2F *treshist3 =
nullptr;
2991 TH2F *treshist4 =
nullptr;
2992 TH2F *treshist5 =
nullptr;
2994 cout <<
" Find residual histograms " << endl;
2996 if (trt->FindKey(
"residual"))
2997 reshist1 = (
TH2F *)trt->FindKey(
"residual")->ReadObj();
3000 if (det1->FindKey(
"residual"))
3001 reshist2 = (
TH2F *)det1->FindKey(
"residual")->ReadObj();
3005 if (det2->FindKey(
"residual"))
3006 reshist3 = (
TH2F *)det2->FindKey(
"residual")->ReadObj();
3010 if (det3->FindKey(
"residual"))
3011 reshist4 = (
TH2F *)det3->FindKey(
"residual")->ReadObj();
3015 if (det4->FindKey(
"residual"))
3016 reshist5 = (
TH2F *)det4->FindKey(
"residual")->ReadObj();
3019 cout <<
" Find time residual histograms" << endl;
3020 if (trt->FindKey(
"timeresidual"))
3021 treshist1 = (
TH2F *)trt->FindKey(
"timeresidual")->ReadObj();
3024 if (det1->FindKey(
"timeresidual"))
3025 treshist2 = (
TH2F *)det1->FindKey(
"timeresidual")->ReadObj();
3029 if (det2->FindKey(
"timeresidual"))
3030 treshist3 = (
TH2F *)det2->FindKey(
"timeresidual")->ReadObj();
3034 if (det3->FindKey(
"timeresidual"))
3035 treshist4 = (
TH2F *)det3->FindKey(
"timeresidual")->ReadObj();
3039 if (det4->FindKey(
"timeresidual"))
3040 treshist5 = (
TH2F *)det4->FindKey(
"timeresidual")->ReadObj();
3043 cout <<
" Configure residual histograms" << endl;
3045 reshist1->SetTitle(Form(
"residual whole TRT"));
3047 reshist2->SetTitle(Form(
"residual (barrel side C)"));
3049 reshist3->SetTitle(Form(
"residual (barrel side A)"));
3051 reshist4->SetTitle(Form(
"residual (endcap side C)"));
3053 reshist5->SetTitle(Form(
"residual (endcap side A)"));
3055 reshist2->SetFillColor(46);
3057 reshist3->SetFillColor(46);
3059 reshist4->SetFillColor(46);
3061 reshist5->SetFillColor(46);
3063 cout <<
" Configure time residual histograms" << endl;
3065 treshist1->SetTitle(
"time-residual whole TRT");
3067 treshist2->SetTitle(
"time-residual (barrel side C)");
3069 treshist3->SetTitle(
"time-residual (barrel side A)");
3071 treshist4->SetTitle(
"time-residual (endcap side C)");
3073 treshist5->SetTitle(
"time-residual (endcap side A)");
3075 treshist2->SetFillColor(38);
3077 treshist3->SetFillColor(38);
3079 treshist4->SetFillColor(38);
3081 treshist5->SetFillColor(38);
3085 cout <<
" Configure Argon residual histograms" << endl;
3087 reshist1->SetTitle(
"residual Argon whole TRT");
3089 reshist2->SetTitle(
"residual Argon (barrel side C)");
3091 reshist3->SetTitle(
"residual Argon (barrel side A)");
3093 reshist4->SetTitle(
"residual Argon (endcap side C)");
3095 reshist5->SetTitle(
"residual Argon (endcap side A)");
3097 treshist1->SetTitle(
"time-residual Argon whole TRT");
3099 treshist2->SetTitle(
"time-residual Argon (barrel side C)");
3101 treshist3->SetTitle(
"time-residual Argon (barrel side A)");
3103 treshist4->SetTitle(
"time-residual Argon (endcap side C)");
3105 treshist5->SetTitle(
"time-residual Argon (endcap side A)");
3108 TF1 *resfit2 =
nullptr;
3109 TF1 *resfit3 =
nullptr;
3110 TF1 *resfit4 =
nullptr;
3111 TF1 *resfit5 =
nullptr;
3112 TF1 *tresfit2 =
nullptr;
3113 TF1 *tresfit3 =
nullptr;
3114 TF1 *tresfit4 =
nullptr;
3115 TF1 *tresfit5 =
nullptr;
3118 resfit2 = (TF1 *)reshist2->GetListOfFunctions()->First();
3120 resfit3 = (TF1 *)reshist3->GetListOfFunctions()->First();
3122 resfit4 = (TF1 *)reshist4->GetListOfFunctions()->First();
3124 resfit5 = (TF1 *)reshist5->GetListOfFunctions()->First();
3126 tresfit2 = (TF1 *)treshist2->GetListOfFunctions()->First();
3128 tresfit3 = (TF1 *)treshist3->GetListOfFunctions()->First();
3130 tresfit4 = (TF1 *)treshist4->GetListOfFunctions()->First();
3132 tresfit5 = (TF1 *)treshist5->GetListOfFunctions()->First();
3134 TText *mintxt =
new TText();
3135 mintxt->SetNDC(kTRUE);
3142 cout <<
" Draw residual barrel C" << endl;
3144 mintxt->DrawText(0.15, 0.85, Form(
"Mean: %.3f", resfit2->GetParameter(1)));
3145 mintxt->DrawText(0.15, 0.80, Form(
"Sigma: %.3f", resfit2->GetParameter(2)));
3151 cout <<
" Draw residual barrel A" << endl;
3153 mintxt->DrawText(0.15, 0.85, Form(
"Mean: %.3f", resfit3->GetParameter(1)));
3154 mintxt->DrawText(0.15, 0.80, Form(
"Sigma: %.3f", resfit3->GetParameter(2)));
3160 cout <<
" Draw residual endcap C" << endl;
3162 mintxt->DrawText(0.15, 0.85, Form(
"Mean: %.3f", resfit4->GetParameter(1)));
3163 mintxt->DrawText(0.15, 0.80, Form(
"Sigma: %.3f", resfit4->GetParameter(2)));
3168 cout <<
" Draw residual endcap A" << endl;
3170 mintxt->DrawText(0.15, 0.85, Form(
"Mean: %.3f", resfit5->GetParameter(1)));
3171 mintxt->DrawText(0.15, 0.80, Form(
"Sigma: %.3f", resfit5->GetParameter(2)));
3177 cout <<
" Draw time residual barrel C" << endl;
3179 mintxt->DrawText(0.15, 0.85, Form(
"Mean: %.3f", tresfit2->GetParameter(1)));
3180 mintxt->DrawText(0.15, 0.80, Form(
"Sigma: %.3f", tresfit2->GetParameter(2)));
3186 cout <<
" Draw time residual barrel A" << endl;
3188 mintxt->DrawText(0.15, 0.85, Form(
"Mean: %.3f", tresfit3->GetParameter(1)));
3189 mintxt->DrawText(0.15, 0.80, Form(
"Sigma: %.3f", tresfit3->GetParameter(2)));
3194 cout <<
" Draw time residual endcap C" << endl;
3196 mintxt->DrawText(0.15, 0.85, Form(
"Mean: %.3f", tresfit4->GetParameter(1)));
3197 mintxt->DrawText(0.15, 0.80, Form(
"Sigma: %.3f", tresfit4->GetParameter(2)));
3202 cout <<
" Draw time residual endcap A" << endl;
3204 mintxt->DrawText(0.15, 0.85, Form(
"Mean: %.3f", tresfit5->GetParameter(1)));
3205 mintxt->DrawText(0.15, 0.80, Form(
"Sigma: %.3f", tresfit5->GetParameter(2)));
3207 gStyle->SetOptStat(0);