File indexing completed on 2024-04-06 12:26:30
0001
0002
0003
0004
0005
0006
0007 {
0008 int NBINS=32;
0009 TFile *resfile=new TFile("resolution_2.5.root");
0010
0011 float tibrms[NBINS],tobrms[NBINS],tidrms[NBINS],tecrms[NBINS];
0012 float tibsigma[NBINS],tobsigma[NBINS],tidsigma[NBINS],tecsigma[NBINS];
0013 float tibrmserror[NBINS],tobrmserror[NBINS],tidrmserror[NBINS],tecrmserror[NBINS];
0014 float tibsigmaerror[NBINS],tobsigmaerror[NBINS],tidsigmaerror[NBINS],tecsigmaerror[NBINS];
0015 TH1F *tibres[NBINS],*tobres[NBINS],*tidres[NBINS],*tecres[NBINS];
0016 TH1F *allres[NBINS];
0017 float allrms[NBINS],allrmserror[NBINS];
0018 float allsigma[NBINS],allsigmaerror[NBINS];
0019 for(int i=0;i<NBINS;i++){
0020 TH1F *tibres[i]=(TH1F*)resfile->Get(Form("TIBreswc_%d_strip",i));
0021 TH1F *tobres[i]=(TH1F*)resfile->Get(Form("TOBreswc_%d_strip",i));
0022 TH1F *tidres[i]=(TH1F*)resfile->Get(Form("TIDreswc_%d_strip",i));
0023 TH1F *tecres[i]=(TH1F*)resfile->Get(Form("TECreswc_%d_strip",i));
0024 allres[i]=(TH1F*)tibres[i]->Clone(Form("Allres_%d_strip",i));
0025 allres[i]->Add(tobres[i]);
0026 allres[i]->Add(tidres[i]);
0027 allres[i]->Add(tecres[i]);
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043 TF1 *newparam_old=new TF1("error_param_old","[0]*x*exp(-x*[1])+[2]",0.,8);
0044
0045 newparam_old->SetParameter(0,-3.18e-01);
0046 newparam_old->SetParameter(1,6.67e-01);
0047 newparam_old->SetParameter(2,3.19e-01);
0048
0049 float range=5;
0050 tibres[i]->GetXaxis()->SetRangeUser(-range,range);
0051 tidres[i]->GetXaxis()->SetRangeUser(-range,range);
0052 tobres[i]->GetXaxis()->SetRangeUser(-range,range);
0053 tecres[i]->GetXaxis()->SetRangeUser(-range,range);
0054 allres[i]->GetXaxis()->SetRangeUser(-range,range);
0055 tibrms[i]=tibres[i]->GetRMS();
0056 tibrmserror[i]=tibres[i]->GetRMSError();
0057 tobrms[i]=tobres[i]->GetRMS();
0058 tobrmserror[i]=tobres[i]->GetRMSError();
0059 tidrms[i]=tidres[i]->GetRMS();
0060 tidrmserror[i]=tidres[i]->GetRMSError();
0061 tecrms[i]=tecres[i]->GetRMS();
0062 tecrmserror[i]=tecres[i]->GetRMSError();
0063 allrms[i]=allres[i]->GetRMS();
0064 allrmserror[i]=allres[i]->GetRMSError();
0065 }
0066 float proj[NBINS],proje[NBINS];
0067 for (int i=0;i<NBINS;i++){proj[i]=i; proje[i]=0.;};
0068 TGraphErrors *TIB=new TGraphErrors(NBINS,proj,tibrms,proje,tibrmserror);
0069 TGraphErrors *TOB=new TGraphErrors(NBINS,proj,tobrms,proje,tobrmserror);
0070 TGraphErrors *TID=new TGraphErrors(NBINS,proj,tidrms,proje,tidrmserror);
0071 TGraphErrors *TEC=new TGraphErrors(NBINS,proj,tecrms,proje,tecrmserror);
0072 TGraphErrors *ALL=new TGraphErrors(NBINS,proj,allrms,proje,allrmserror);
0073
0074 TF1 *errparamtib=new TF1("error_paramtib","((x-[0])*(x-[0])*([1]-[2])/([0]*[0])+[2])",0.01,4);
0075 errparamtib->SetParameter(0,38.07*0.032);
0076 errparamtib->SetParameter(1,0.3184);
0077 errparamtib->SetParameter(2,0.09828);
0078 TF1 *errparamtob=new TF1("error_paramtob","((x-[0])*(x-[0])*([1]-[2])/([0]*[0])+[2])",0.01,4);
0079 errparamtob->SetParameter(0,38.07*0.05);
0080 errparamtob->SetParameter(1,0.3184);
0081 errparamtob->SetParameter(2,0.09828);
0082
0083
0084 TF1 *newparam=new TF1("error_param","[0]*x*exp(-x*[1])+[2]",0.,4);
0085
0086
0087 newparam->SetParameter(0,-0.411);
0088 newparam->SetParameter(1,0.740);
0089 newparam->SetParameter(2,0.325);
0090
0091
0092 TCanvas * plot=new TCanvas("resolution","resolution");
0093 plot->Divide(2,2);
0094 plot->cd(1);
0095 TIB->SetMaximum(4);
0096 TIB->SetMinimum(0.);
0097 TIB->GetHistogram()->GetXaxis()->SetTitle("Track projection");
0098 TIB->GetHistogram()->SetTitle("TIB");
0099 TIB->Draw("ap");
0100
0101 TLine *l=new TLine(4,4/sqrt(12),32,32./sqrt(12));
0102 l->SetLineColor(3);
0103 l->SetLineWidth(2);
0104 l->Draw("same");
0105 errparamtib->SetLineColor(4);
0106
0107
0108
0109 plot->cd(2);
0110 TOB->SetMaximum(4);
0111 TOB->SetMinimum(0.);
0112 TOB->GetHistogram()->GetXaxis()->SetTitle("Track projection");
0113 TOB->GetHistogram()->SetTitle("TOB");
0114 TOB->Draw("ap");
0115
0116 TLine *l=new TLine(4,4./sqrt(12),32,32./sqrt(12));
0117 l->SetLineColor(3);
0118 l->SetLineWidth(2);
0119 l->Draw("same");
0120 errparamtob->SetLineColor(4);
0121
0122
0123
0124 plot->cd(3);
0125 TID->SetMaximum(4);
0126 TID->SetMinimum(0.);
0127 TID->GetHistogram()->GetXaxis()->SetTitle("Track projection");
0128 TID->GetHistogram()->SetTitle("TID");
0129 TID->Draw("ap");
0130
0131 TLine *l=new TLine(4,4./sqrt(12),32,32./sqrt(12));
0132 l->SetLineColor(3);
0133 l->Draw("same");
0134 errparamtib->SetLineColor(4);
0135
0136
0137
0138 plot->cd(4);
0139 TEC->SetMaximum(4);
0140 TEC->SetMinimum(0.);
0141 TEC->GetHistogram()->GetXaxis()->SetTitle("Track projection");
0142 TEC->GetHistogram()->SetTitle("TEC");
0143 TEC->Draw("ap");
0144
0145 TLine *l=new TLine(4,4./sqrt(12),32,32./sqrt(12));
0146 l->SetLineColor(3);
0147 l->SetLineWidth(2);
0148 l->Draw("same");
0149
0150
0151 TCanvas * plot2=new TCanvas("resolution2","resolution2");
0152 ALL->SetMaximum(4);
0153 ALL->SetMinimum(0.);
0154 ALL->Draw("ap");
0155
0156 TLine *l=new TLine(4,2./sqrt(12),32,16./sqrt(12));
0157 l->SetLineColor(3);
0158 l->Draw("same");
0159
0160 }