00001 {
00002
00003
00004 gROOT->Reset();
00005 #include "Riostream.h"
00006
00007 ifstream in0;
00008
00009
00010 Float_t x[50]={0.,5.,10.,15.,20.,25.,30.,35.,40.,45.,50.};
00011 Float_t y[31][11],ey[31][11];
00012 Float_t r;
00013
00014 East = new TH1D("East","East",50,30,50);
00015 West = new TH1D("West","West",50,30,50);
00016
00017 in0.open("timing.tex");
00018
00019 for(Int_t is=0;is<11;is++) {
00020 x[is] += 12.;
00021 for(Int_t ic=0;ic<30;ic++) {
00022 in0>>r>>r>>y[ic][is];
00023 ey[ic][is]=sqrt(y[ic][is]);
00024 }
00025 }
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049 Float_t yf[5],ef[5],xf[5];
00050
00051 gStyle->SetOptStat(0);
00052
00053 c1 = new TCanvas("c1","Timing of BEMC Crate", 200, 10, 700, 500);
00054 c1->Divide(4,4);
00055 for(int j=0;j<15;j++){
00056 c1->cd(j+1);
00057 Float_t yy[11],eyy[11];
00058 c1->SetGridy(1);
00059 c1->SetGridx(1) ;
00060
00061 for(Int_t i=0;i<11;i++){
00062 yy[i]=y[j][i];
00063 eyy[i]=ey[j][i];
00064 }
00065
00066 for(Int_t i=0;i<5;i++){
00067 yf[i]=yy[i+3];
00068 ef[i]=eyy[i+3];
00069 xf[i]=x[i+3];
00070 }
00071
00072 graph1 = new TGraphErrors(11, x, yy,0,eyy);
00073 graph1->SetMarkerStyle(20);
00074 graph1->SetMarkerSize(1.0);
00075 graph1->SetMarkerColor(1);
00076 graph1->Draw("AP");
00077
00078 graph2 = new TGraphErrors(5, xf, yf,0,ef);
00079 graph2->SetMarkerStyle(20);
00080 graph2->SetMarkerSize(1.0);
00081 graph2->SetMarkerColor(2);
00082
00083
00084 graph2->Fit("gaus");
00085 graph2->GetXaxis()->SetTitle("TCD Phase (ns)");
00086 graph2->GetYaxis()->SetTitle("Integral 100<ADC<2000");
00087 graph2->Draw("SP");
00088 East->Fill(gaus->GetParameter(1));
00089
00090 TLine *tl = new TLine(36.,0.,36.,1.e+07);
00091 tl->SetLineColor(2);
00092 tl->SetLineWidth(3);
00093 tl->Draw();
00094 Float_t gl=gaus->GetParameter(1);
00095 TLine *t2 = new TLine(gl,0.,gl,1.e+07);
00096 t2->SetLineColor(3);
00097 t2->SetLineWidth(3);
00098 t2->Draw();
00099
00100
00101 }
00102 c1->cd(16);
00103 gStyle->SetOptStat(1);
00104 gStyle->SetOptStat(1);
00105 East->Draw();
00106
00107
00108 c2 = new TCanvas("c2","Timing of BEMC Crate", 200, 10, 700, 500);
00109 gStyle->SetOptStat(0);
00110
00111 c2->Divide(4,4);
00112 for(int j=15;j<30;j++){
00113 c2->cd(j-14);
00114 Float_t yy[11],eyy[11];
00115 c2->SetGridy(1);
00116 c2->SetGridx(1) ;
00117
00118 for(Int_t i=0;i<11;i++){
00119 yy[i]=y[j][i];
00120 eyy[i]=ey[j][i];
00121 }
00122
00123 for(Int_t i=0;i<5;i++){
00124 yf[i]=yy[i+3];
00125 ef[i]=eyy[i+3];
00126 xf[i]=x[i+3];
00127 }
00128
00129
00130 graph1 = new TGraphErrors(11, x, yy,0,eyy);
00131 graph1->SetMarkerStyle(20);
00132 graph1->SetMarkerSize(1.0);
00133 graph1->SetMarkerColor(1);
00134 graph1->Draw("AP");
00135
00136 graph2 = new TGraphErrors(5, xf, yf,0,ef);
00137 graph2->SetMarkerStyle(20);
00138 graph2->SetMarkerSize(1.0);
00139 graph2->SetMarkerColor(2);
00140
00141 graph2->Fit("gaus");
00142 graph2->GetXaxis()->SetTitle("TCD Phase (ns)");
00143 graph2->GetYaxis()->SetTitle("Integral 100<ADC<2000");
00144 graph2->Draw("SP");
00145 West->Fill(gaus->GetParameter(1));
00146
00147 TLine *tl = new TLine(36.,0.,36.,1.e+07);
00148 tl->SetLineColor(2);
00149 tl->SetLineWidth(3);
00150 tl->Draw();
00151 Float_t gl=gaus->GetParameter(1);
00152 TLine *t2 = new TLine(gl,0.,gl,1.e+07);
00153 t2->SetLineColor(3);
00154 t2->SetLineWidth(3);
00155 t2->Draw();
00156
00157 }
00158 c2->cd(16);
00159 gStyle->SetOptStat(1);
00160 West->Draw();
00161 }