ATLAS Offline Software
Public Member Functions | List of all members
ResidualPlots Class Reference
Inheritance diagram for ResidualPlots:
Collaboration diagram for ResidualPlots:

Public Member Functions

 ResidualPlots (TFile *, bool)
 

Detailed Description

Definition at line 2934 of file TRTCalib_makeplots.cxx.

Constructor & Destructor Documentation

◆ ResidualPlots()

ResidualPlots::ResidualPlots ( TFile *  file,
bool  isAr = false 
)

Definition at line 2940 of file TRTCalib_makeplots.cxx.

2941 {
2942 
2943  this->SetName("resplots");
2944 
2945  file->cd();
2946 
2947  TDirectory *trt = nullptr;
2948  TDirectory *det1 = nullptr;
2949  TDirectory *det2 = nullptr;
2950  TDirectory *det3 = nullptr;
2951  TDirectory *det4 = nullptr;
2952 
2953  if (!isAr)
2954  {
2955  cout << " In ResidualPlots Xenon" << endl;
2956  trt = (TDirectory *)file->FindKey("TRT_all")->ReadObj();
2957  if (not trt){
2958  throw std::runtime_error("trt pointer is null");
2959  }
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();
2964  }
2965  else
2966  {
2967  if (not trt){
2968  throw std::runtime_error("trt pointer is null");
2969  }
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();
2981  }
2982 
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;
2993 
2994  cout << " Find residual histograms " << endl;
2995 
2996  if (trt->FindKey("residual"))
2997  reshist1 = (TH2F *)trt->FindKey("residual")->ReadObj();
2998  if (det1)
2999  {
3000  if (det1->FindKey("residual"))
3001  reshist2 = (TH2F *)det1->FindKey("residual")->ReadObj();
3002  }
3003  if (det2)
3004  {
3005  if (det2->FindKey("residual"))
3006  reshist3 = (TH2F *)det2->FindKey("residual")->ReadObj();
3007  }
3008  if (det3)
3009  {
3010  if (det3->FindKey("residual"))
3011  reshist4 = (TH2F *)det3->FindKey("residual")->ReadObj();
3012  }
3013  if (det4)
3014  {
3015  if (det4->FindKey("residual"))
3016  reshist5 = (TH2F *)det4->FindKey("residual")->ReadObj();
3017  }
3018 
3019  cout << " Find time residual histograms" << endl;
3020  if (trt->FindKey("timeresidual"))
3021  treshist1 = (TH2F *)trt->FindKey("timeresidual")->ReadObj();
3022  if (det1)
3023  {
3024  if (det1->FindKey("timeresidual"))
3025  treshist2 = (TH2F *)det1->FindKey("timeresidual")->ReadObj();
3026  }
3027  if (det2)
3028  {
3029  if (det2->FindKey("timeresidual"))
3030  treshist3 = (TH2F *)det2->FindKey("timeresidual")->ReadObj();
3031  }
3032  if (det3)
3033  {
3034  if (det3->FindKey("timeresidual"))
3035  treshist4 = (TH2F *)det3->FindKey("timeresidual")->ReadObj();
3036  }
3037  if (det4)
3038  {
3039  if (det4->FindKey("timeresidual"))
3040  treshist5 = (TH2F *)det4->FindKey("timeresidual")->ReadObj();
3041  }
3042 
3043  cout << " Configure residual histograms" << endl;
3044  if (reshist1)
3045  reshist1->SetTitle(Form("residual whole TRT"));
3046  if (reshist2)
3047  reshist2->SetTitle(Form("residual (barrel side C)"));
3048  if (reshist3)
3049  reshist3->SetTitle(Form("residual (barrel side A)"));
3050  if (reshist4)
3051  reshist4->SetTitle(Form("residual (endcap side C)"));
3052  if (reshist5)
3053  reshist5->SetTitle(Form("residual (endcap side A)"));
3054  if (reshist2)
3055  reshist2->SetFillColor(46);
3056  if (reshist3)
3057  reshist3->SetFillColor(46);
3058  if (reshist4)
3059  reshist4->SetFillColor(46);
3060  if (reshist5)
3061  reshist5->SetFillColor(46);
3062 
3063  cout << " Configure time residual histograms" << endl;
3064  if (treshist1)
3065  treshist1->SetTitle("time-residual whole TRT");
3066  if (treshist2)
3067  treshist2->SetTitle("time-residual (barrel side C)");
3068  if (treshist3)
3069  treshist3->SetTitle("time-residual (barrel side A)");
3070  if (treshist4)
3071  treshist4->SetTitle("time-residual (endcap side C)");
3072  if (treshist5)
3073  treshist5->SetTitle("time-residual (endcap side A)");
3074  if (treshist2)
3075  treshist2->SetFillColor(38);
3076  if (treshist3)
3077  treshist3->SetFillColor(38);
3078  if (treshist4)
3079  treshist4->SetFillColor(38);
3080  if (treshist5)
3081  treshist5->SetFillColor(38);
3082 
3083  if (isAr)
3084  {
3085  cout << " Configure Argon residual histograms" << endl;
3086  if (reshist1)
3087  reshist1->SetTitle("residual Argon whole TRT");
3088  if (reshist2)
3089  reshist2->SetTitle("residual Argon (barrel side C)");
3090  if (reshist3)
3091  reshist3->SetTitle("residual Argon (barrel side A)");
3092  if (reshist4)
3093  reshist4->SetTitle("residual Argon (endcap side C)");
3094  if (reshist5)
3095  reshist5->SetTitle("residual Argon (endcap side A)");
3096  if (treshist1)
3097  treshist1->SetTitle("time-residual Argon whole TRT");
3098  if (treshist2)
3099  treshist2->SetTitle("time-residual Argon (barrel side C)");
3100  if (treshist3)
3101  treshist3->SetTitle("time-residual Argon (barrel side A)");
3102  if (treshist4)
3103  treshist4->SetTitle("time-residual Argon (endcap side C)");
3104  if (treshist5)
3105  treshist5->SetTitle("time-residual Argon (endcap side A)");
3106  }
3107 
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;
3116 
3117  if (reshist2)
3118  resfit2 = (TF1 *)reshist2->GetListOfFunctions()->First();
3119  if (reshist3)
3120  resfit3 = (TF1 *)reshist3->GetListOfFunctions()->First();
3121  if (reshist4)
3122  resfit4 = (TF1 *)reshist4->GetListOfFunctions()->First();
3123  if (reshist5)
3124  resfit5 = (TF1 *)reshist5->GetListOfFunctions()->First();
3125  if (treshist2)
3126  tresfit2 = (TF1 *)treshist2->GetListOfFunctions()->First();
3127  if (treshist3)
3128  tresfit3 = (TF1 *)treshist3->GetListOfFunctions()->First();
3129  if (treshist4)
3130  tresfit4 = (TF1 *)treshist4->GetListOfFunctions()->First();
3131  if (treshist5)
3132  tresfit5 = (TF1 *)treshist5->GetListOfFunctions()->First();
3133 
3134  TText *mintxt = new TText();
3135  mintxt->SetNDC(kTRUE);
3136 
3137  this->Divide(4, 2);
3138 
3139  this->cd(3);
3140  if (reshist2)
3141  {
3142  cout << " Draw residual barrel C" << endl;
3143  reshist2->Draw();
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)));
3146  }
3147  this->cd(2);
3148  // if( !isAr && reshist3){
3149  if (reshist3)
3150  { // changed this (PH)
3151  cout << " Draw residual barrel A" << endl;
3152  reshist3->Draw();
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)));
3155  }
3156  this->cd(1);
3157 
3158  if (reshist4)
3159  {
3160  cout << " Draw residual endcap C" << endl;
3161  reshist4->Draw();
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)));
3164  }
3165  this->cd(4);
3166  if (reshist5)
3167  {
3168  cout << " Draw residual endcap A" << endl;
3169  reshist5->Draw();
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)));
3172  }
3173  this->cd(7);
3174 
3175  if (treshist2)
3176  {
3177  cout << " Draw time residual barrel C" << endl;
3178  treshist2->Draw();
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)));
3181  }
3182  this->cd(6);
3183  // if(!isAr && treshist3){ // Changed this (PH)
3184  if (treshist3)
3185  {
3186  cout << " Draw time residual barrel A" << endl;
3187  treshist3->Draw();
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)));
3190  }
3191  this->cd(5);
3192  if (treshist4)
3193  {
3194  cout << " Draw time residual endcap C" << endl;
3195  treshist4->Draw();
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)));
3198  }
3199  this->cd(8);
3200  if (treshist5)
3201  {
3202  cout << " Draw time residual endcap A" << endl;
3203  treshist5->Draw();
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)));
3206  }
3207  gStyle->SetOptStat(0);
3208 }

The documentation for this class was generated from the following file:
python.TrigEgammaMonitorHelper.TH2F
def TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:45
file
TFile * file
Definition: tile_monitor.h:29
calibdata.cd
cd
Definition: calibdata.py:51