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.root");
0010
0011 float tibrms[NBINS],tobrms[NBINS],tidrms[NBINS],tecrms[NBINS];
0012 float tibrmserror[NBINS],tobrmserror[NBINS],tidrmserror[NBINS],tecrmserror[NBINS];
0013 TH1F *tibres[NBINS],*tobres[NBINS],*tidres[NBINS],*tecres[NBINS];
0014 TH1F *allres[NBINS];
0015 float allrms[NBINS],allrmserror[NBINS];
0016 for(int i=0;i<NBINS;i++){
0017 TH1F *tibres[i]=(TH1F*)resfile->Get(Form("mTIBresy_%f-%f",i*8./NBINS,i*8./NBINS+8./NBINS));
0018 TH1F *tobres[i]=(TH1F*)resfile->Get(Form("mTOBresy_%f-%f",i*8./NBINS,i*8./NBINS+8./NBINS));
0019 TH1F *tidres[i]=(TH1F*)resfile->Get(Form("mTIDresy_%f-%f",i*8./NBINS,i*8./NBINS+8./NBINS));
0020 TH1F *tecres[i]=(TH1F*)resfile->Get(Form("mTECresy_%f-%f",i*8./NBINS,i*8./NBINS+8./NBINS));
0021 allres[i]=(TH1F*)tibres[i]->Clone(Form("Allres_%f-%f",i*8./NBINS,i*8./NBINS+8./NBINS));
0022 allres[i]->Add(tobres[i]);
0023 allres[i]->Add(tidres[i]);
0024 allres[i]->Add(tecres[i]);
0025 tibres[i]->Fit("gaus");
0026 tobres[i]->Fit("gaus");
0027 tidres[i]->Fit("gaus");
0028 tecres[i]->Fit("gaus");
0029 allres[i]->Fit("gaus");
0030 tibrms[i]=tibres[i]->GetFunction("gaus")->GetParameter(2);
0031 tibrmserror[i]=tibres[i]->GetFunction("gaus")->GetParError(2);
0032 tobrms[i]=tobres[i]->GetFunction("gaus")->GetParameter(2);
0033 tobrmserror[i]=tobres[i]->GetFunction("gaus")->GetParError(2);
0034 tidrms[i]=tidres[i]->GetFunction("gaus")->GetParameter(2);
0035 tidrmserror[i]=tidres[i]->GetFunction("gaus")->GetParError(2);
0036 tecrms[i]=tecres[i]->GetFunction("gaus")->GetParameter(2);
0037 tecrmserror[i]=tecres[i]->GetFunction("gaus")->GetParError(2);
0038 allrms[i]=allres[i]->GetFunction("gaus")->GetParameter(2);
0039 allrmserror[i]=allres[i]->GetFunction("gaus")->GetParError(2);
0040 }
0041 float proj[NBINS],proje[NBINS];
0042 for (int i=0;i<NBINS;i++){proj[i]=float(i)/4+0.125; proje[i]=0;};
0043 TGraphErrors *TIB=new TGraphErrors(NBINS,proj,tibrms,proje,tibrmserror);
0044 TGraphErrors *TOB=new TGraphErrors(NBINS,proj,tobrms,proje,tobrmserror);
0045 TGraphErrors *TID=new TGraphErrors(NBINS,proj,tidrms,proje,tidrmserror);
0046 TGraphErrors *TEC=new TGraphErrors(NBINS,proj,tecrms,proje,tecrmserror);
0047 TGraphErrors *ALL=new TGraphErrors(NBINS,proj,allrms,proje,allrmserror);
0048
0049
0050
0051
0052
0053 TProfile *tiberr=(TProfile*)resfile->Get("mTIBtksqrterrvsprojy");
0054 TProfile *toberr=(TProfile*)resfile->Get("mTOBtksqrterrvsprojy");
0055 TProfile *tiderr=(TProfile*)resfile->Get("mTIDtksqrterrvsprojy");
0056 TProfile *tecerr=(TProfile*)resfile->Get("mTECtksqrterrvsprojy");
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076 TCanvas * plot=new TCanvas("resolution","resolution");
0077 plot->Divide(2,2);
0078 plot->cd(1);
0079 TIB->SetMaximum(0.007);
0080 TIB->SetMinimum(0.);
0081 TIB->GetHistogram()->GetXaxis()->SetRangeUser(0,4);
0082 TIB->GetHistogram()->GetXaxis()->SetTitle("Track projection");
0083 TIB->GetHistogram()->SetTitle("TIB");
0084 TIB->Draw("ap");
0085
0086 TLine *l=new TLine(0,1./sqrt(12),4,1./sqrt(12));
0087 l->SetLineColor(3);
0088 l->Draw("same");
0089
0090 tiberr->SetMarkerColor(2);
0091 tiberr->SetLineColor(2);
0092 tiberr->Draw("same");
0093
0094
0095
0096
0097 plot->cd(2);
0098 TOB->SetMaximum(0.007);
0099 TOB->SetMinimum(0.);
0100 TOB->GetHistogram()->GetXaxis()->SetRangeUser(0,4);
0101 TOB->GetHistogram()->GetXaxis()->SetTitle("Track projection");
0102 TOB->GetHistogram()->SetTitle("TOB");
0103 TOB->Draw("ap");
0104
0105 TLine *l=new TLine(0,1./sqrt(12),4,1./sqrt(12));
0106 l->SetLineColor(3);
0107 l->Draw("same");
0108 toberr->SetMarkerColor(2);
0109 toberr->SetLineColor(2);
0110
0111 toberr->Draw("same");
0112
0113
0114
0115
0116 plot->cd(3);
0117 TID->SetMaximum(0.007);
0118 TID->SetMinimum(0.);
0119 TID->GetHistogram()->GetXaxis()->SetRangeUser(0,4);
0120 TID->GetHistogram()->GetXaxis()->SetTitle("Track projection");
0121 TID->GetHistogram()->SetTitle("TID");
0122 TID->Draw("ap");
0123
0124 TLine *l=new TLine(0,1./sqrt(12),4,1./sqrt(12));
0125 l->SetLineColor(3);
0126 l->Draw("same");
0127
0128 tiderr->SetMarkerColor(2);
0129 tiderr->SetLineColor(2);
0130 tiderr->Draw("same");
0131
0132
0133
0134
0135 plot->cd(4);
0136 TEC->SetMaximum(0.007);
0137 TEC->SetMinimum(0.);
0138 TEC->GetHistogram()->GetXaxis()->SetRangeUser(0,4);
0139 TEC->GetHistogram()->GetXaxis()->SetTitle("Track projection");
0140 TEC->GetHistogram()->SetTitle("TEC");
0141 TEC->Draw("ap");
0142
0143 TLine *l=new TLine(0,1./sqrt(12),4,1./sqrt(12));
0144 l->SetLineColor(3);
0145 l->Draw("same");
0146 tecerr->SetMarkerColor(2);
0147 tecerr->SetLineColor(2);
0148 tecerr->Draw("same");
0149
0150
0151
0152
0153 TCanvas * plot2=new TCanvas("resolution2","resolution2");
0154 ALL->SetMaximum(0.01);
0155 ALL->SetMinimum(0.);
0156 ALL->Draw("ap");
0157
0158 TLine *l=new TLine(0,1./sqrt(12),4,1./sqrt(12));
0159 l->SetLineColor(3);
0160 l->Draw("same");
0161 }