00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include "Gtypes.h"
00027 #include "iostream.h"
00028
00029 float calc_min(float b1,float b2)
00030 {
00031 return -b1/(2*b2);
00032 }
00033
00034 void res_laser()
00035 {
00036 TCanvas *c1 = new TCanvas("c1","ps",200,10,700,500);
00037 TStyle *plain = new TStyle("Plain","Plain Style (no colors/fill areas)");
00038 plain->SetTitleOffset(1.25);
00039 plain->SetCanvasBorderMode(0);
00040 plain->SetPadBorderMode(0);
00041 plain->SetPadColor(0);
00042 plain->SetCanvasColor(0);
00043 plain->SetTitleColor(0);
00044 plain->SetStatColor(0);
00045 plain->SetPalette(1);
00046 plain->SetOptStat(0000000);
00047 plain->SetOptFit(00000000);
00048
00049 TH2F *hr = new TH2F("hr","",10,-0.5,0.5,10,0.0,0.1);
00050 hr->SetTitle("#sigma_{res} vs. #Delta Argon");
00051 hr->GetYaxis()->SetTitleOffset(1.2);
00052 hr->GetYaxis()->SetTitle("#sigma_{res}");
00053 hr->GetXaxis()->SetTitleOffset(1.2);
00054 hr->GetXaxis()->SetTitle("#Delta Argon");
00055 hr->SetStats(0);
00056 hr->DrawCopy();
00057
00058
00059 FILE *file1=fopen ("res.log","r");
00060 Int_t datab1,datab0;
00061
00062 const int nhits=160;
00063
00064 float resx[nhits],resy[nhits],resrad[nhits],resphi[nhits], t0[nhits], gas[nhits];
00065
00066 float gas_temp, t0_temp, T, c2,rad, err, resphi_temp, resrad_temp;
00067
00068 int ihits==0;
00069 while(!feof(file1))
00070 {
00071
00072 datab1 = fscanf(file1,"%f %f %f %f %f",&t0_temp,&gas_temp,&T,&resx,&c2);
00073 datab1 = fscanf(file1,"%f %f %f %f %f",&t0_temp,&gas_temp,&T,&resy,&c2);
00074 datab1 = fscanf(file1,"%f %f %f %f %f",&t0_temp,&gas_temp,&T,&resrad_temp,&c2);
00075 datab1 = fscanf(file1,"%f %f %f %f %f",&t0_temp,&gas_temp,&T,&resphi_temp,&c2);
00076 datab1 = fscanf(file1,"%f %f %f %f %f",&t0_temp,&gas_temp,&T,&rad,&err);
00077 datab1 = fscanf(file1,"%f %f %f %f",&t0_temp,&gas_temp,&T,&rad);
00078 datab1 = fscanf(file1,"%f %f %f %f %f",&t0_temp,&gas_temp,&T,&rad,&err);
00079 datab1 = fscanf(file1,"%f %f %f %f",&t0_temp,&gas_temp,&T,&rad);
00080 datab1 = fscanf(file1,"%f %f %f %f %f",&t0_temp,&gas_temp,&T,&rad,&err);
00081 datab1 = fscanf(file1,"%f %f %f %f",&t0_temp,&gas_temp,&T,&rad);
00082
00083
00084
00085 {
00086 t0[ihits]=t0_temp;
00087 gas[ihits]=gas_temp;
00088 resphi[ihits]=resphi_temp;
00089 resrad[ihits]=resrad_temp;
00090 cout<<ihits<<" t0["<<ihits<<"] = "<<t0_temp<<" gas["<<ihits<<"] = "<<gas_temp<<" resphi["<<ihits<<"] = "<<resphi_temp<<" resrad["<<ihits<<"] = "<<resrad_temp<<endl;
00091 ihits++;
00092 }
00093 }
00094
00095 TF1 *g=new TF1("g","[0]+[1]*x^2",0,0.6);
00096 g->SetParameters(0.01,0.001);
00097 g->SetLineColor(kRed);
00098
00099 TGraph *gerad = new TGraph(ihits,gas,resphi);
00100 gerad->SetMarkerStyle(22);
00101 gerad->SetMarkerColor(kRed);
00102 gerad->SetMarkerSize(1);
00103 gerad->Draw("P");
00104
00105
00106
00107
00108 TGraph *gerad1 = new TGraph(ihits,gas,resrad);
00109 gerad1->SetMarkerStyle(23);
00110 gerad1->SetMarkerColor(kGreen);
00111 gerad1->SetMarkerSize(1);
00112 gerad1->Draw("P");
00113
00114
00115
00116
00117
00118
00119 leg = new TLegend(0.66,0.82,0.92,0.96);
00120 leg->SetTextSize(0.05);
00121 leg->AddEntry(gerad,"#sigma_{res,#phi}","P");
00122 leg->AddEntry(gerad1,"#sigma_{res,r}","P");
00123
00124
00125
00126
00127 leg->SetFillColor(0);
00128 leg->Draw();
00129
00130 c1->Update();
00131
00132 }