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
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 void laser_2d_pos(int ftpc, int lsec,TString a,char *opt)
00038 {
00039
00040
00041 if (ftpc == 1 ) {
00042 if (lsec == 1) {
00043
00044 const Float_t lpos1=11.88;
00045 const Float_t lpos2=19.55;
00046 const Float_t lpos3=28.56;
00047 TH2F *hr1 = new TH2F("hr1","Laser I(west,lsec 1): nominal (11.88cm) - reconstructed position",12,-0.55,0.65,12,-0.45,0.75);
00048 TH2F *hr2 = new TH2F("hr2","Laser II(west,lsec 1): nominal (19.55cm) - reconstructed position",12,-0.55,0.65,12,-0.45,0.75);
00049 TH2F *hr3 = new TH2F("hr3","Laser III(west,lsec 1): nominal (28.56cm) - reconstructed position",12,-0.55,0.65,12,-0.45,0.75);
00050 cout<<"Initialized for ftpc = "<<ftpc<<"(west) lsec = "<<lsec<<endl;
00051 }
00052 else if (lsec == 2) {
00053
00054 const Float_t lpos1=11.68;
00055 const Float_t lpos2=19.45;
00056 const Float_t lpos3=28.51;
00057 TH2F *hr1 = new TH2F("hr1","Laser I(west,lsec 2): nominal (11.68cm) - reconstructed position",12,-0.55,0.65,12,-0.45,0.75);
00058 TH2F *hr2 = new TH2F("hr2","Laser II(west,lsec 2): nominal (19.45cm) - reconstructed position",12,-0.55,0.65,12,-0.45,0.75);
00059 TH2F *hr3 = new TH2F("hr3","Laser III(west,lsec 2): nominal (28.51cm) - reconstructed position",12,-0.55,0.65,12,-0.45,0.75);
00060 cout<<"Initialized for ftpc = "<<ftpc<<"(west) lsec = "<<lsec<<endl;
00061 }
00062 else if (lsec == 3) {
00063
00064 const Float_t lpos1=11.78;
00065 const Float_t lpos2=19.35;
00066 const Float_t lpos3=28.41;
00067 TH2F *hr1 = new TH2F("hr1","Laser I(west,lsec 3): nominal (11.78cm) - reconstructed position",12,-0.55,0.65,12,-0.45,0.75);
00068 TH2F *hr2 = new TH2F("hr2","Laser II(west,lsec 3): nominal (19.35cm) - reconstructed position",12,-0.55,0.65,12,-0.45,0.75);
00069 TH2F *hr3 = new TH2F("hr3","Laser III(west,lsec 3): nominal (28.41cm) - reconstructed position",12,-0.55,0.65,12,-0.45,0.75);
00070 cout<<"Initialized for ftpc = "<<ftpc<<"(west) lsec = "<<lsec<<endl;
00071 }
00072 else {
00073 cout<<"Invalid lsec for ftpc = "<<ftpc<<"(west) lsec = "<<lsec<<endl;
00074 exit(1);
00075 }
00076 }
00077
00078
00079 if (ftpc == 2 ) {
00080 if (lsec == 1) {
00081
00082 const Float_t lpos1=11.75;
00083 const Float_t lpos2=19.44;
00084 const Float_t lpos3=28.41;
00085 TH2F *hr1 = new TH2F("hr1","Laser I(east,lsec 1): nominal (11.75cm) - reconstructed position",12,-0.55,0.65,12,-0.45,0.75);
00086 TH2F *hr2 = new TH2F("hr2","Laser II(east,lsec 1): nominal (19.44cm) - reconstructed position",12,-0.55,0.65,12,-0.45,0.75);
00087 TH2F *hr3 = new TH2F("hr3","Laser III(east,lsec 1): nominal (28.41cm) - reconstructed position",12,-0.55,0.65,12,-0.45,0.75);
00088 cout<<"Initialized for ftpc = "<<ftpc<<"(east) lsec = "<<lsec<<endl;
00089 }
00090 else if (lsec == 2) {
00091
00092 const Float_t lpos1=11.85;
00093 const Float_t lpos2=19.44;
00094 const Float_t lpos3=28.41;
00095 TH2F *hr1 = new TH2F("hr1","Laser I(east,lsec 2): nominal (11.85cm) - reconstructed position",12,-0.55,0.65,12,-0.45,0.75);
00096 TH2F *hr2 = new TH2F("hr2","Laser II(east,lsec 2): nominal (19.44cm) - reconstructed position",12,-0.55,0.65,12,-0.45,0.75);
00097 TH2F *hr3 = new TH2F("hr3","Laser III(east,lsec 2): nominal (28.41cm) - reconstructed position",12,-0.55,0.65,12,-0.45,0.75);
00098 cout<<"Initialized for ftpc = "<<ftpc<<"(east) lsec = "<<lsec<<endl;
00099 }
00100 else if (lsec == 3) {
00101
00102 const Float_t lpos1=11.86;
00103 const Float_t lpos2=19.45;
00104 const Float_t lpos3=28.31;
00105 TH2F *hr1 = new TH2F("hr1","Laser I(east,lsec 3): nominal (11.86cm) - reconstructed position",12,-0.55,0.65,12,-0.45,0.75);
00106 TH2F *hr2 = new TH2F("hr2","Laser II(east,lsec 3): nominal (19.45cm) - reconstructed position",12,-0.55,0.65,12,-0.45,0.75);
00107 TH2F *hr3 = new TH2F("hr3","Laser III(east,lsec 3): nominal (28.31cm) - reconstructed position",12,-0.55,0.65,12,-0.45,0.75);
00108 cout<<"Initialized for ftpc = "<<ftpc<<"(east) lsec = "<<lsec<<endl;
00109 }
00110 else {
00111 cout<<"Invalid lsec for ftpc = "<<ftpc<<"(east) lsec = "<<lsec<<endl;
00112 exit(2);
00113 }
00114 }
00115
00116 TCanvas *c1 = new TCanvas("c1","ps",200,10,700,500);
00117
00118 gStyle->SetPalette(1);
00119 gStyle->SetOptStat(0);
00120 gStyle->SetOptFit(0);
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130 TH2F *hr0 = new TH2F("hr","",12,-0.55,0.65,12,-0.45,0.75);
00131 hr0->GetYaxis()->SetTitle("#Delta Ar [%]");
00132 hr0->GetXaxis()->SetTitle("#Delta t_{0}");
00133 hr1->GetYaxis()->SetTitle("#Delta Ar [%]");
00134 hr1->GetXaxis()->SetTitle("#Delta t_{0}");
00135 hr2->GetYaxis()->SetTitle("#Delta Ar [%]");
00136 hr2->GetXaxis()->SetTitle("#Delta t_{0}");
00137 hr3->GetYaxis()->SetTitle("#Delta Ar [%]");
00138 hr3->GetXaxis()->SetTitle("#Delta t_{0}");
00139
00140
00141 FILE *file1=fopen ("res.log","r");
00142
00143 Int_t datab1;
00144
00145
00146
00147 float resx,resy,resrad,resphi, t0, gas, T, c2,rad1,rad11, rad2, rad21, rad3, rad31, err;
00148
00149
00150 while(!feof(file1))
00151 {
00152 datab1 = fscanf(file1,"%f %f %f %f %f",&t0,&gas,&T,&resx,&c2);
00153 datab1 = fscanf(file1,"%f %f %f %f %f",&t0,&gas,&T,&resy,&c2);
00154 datab1 = fscanf(file1,"%f %f %f %f %f",&t0,&gas,&T,&resrad,&c2);
00155 datab1 = fscanf(file1,"%f %f %f %f %f",&t0,&gas,&T,&resphi,&c2);
00156 datab1 = fscanf(file1,"%f %f %f %f %f",&t0,&gas,&T,&rad1,&err);
00157 datab1 = fscanf(file1,"%f %f %f %f",&t0,&gas,&T,&rad11);
00158 datab1 = fscanf(file1,"%f %f %f %f %f",&t0,&gas,&T,&rad2,&err);
00159 datab1 = fscanf(file1,"%f %f %f %f",&t0,&gas,&T,&rad21);
00160 datab1 = fscanf(file1,"%f %f %f %f %f",&t0,&gas,&T,&rad3,&err);
00161 datab1 = fscanf(file1,"%f %f %f %f",&t0,&gas,&T,&rad31);
00162 if (feof(file1)) break;
00163
00164 if (a=='a')
00165 {
00166 hr0->Fill(t0,gas,lpos1-rad1);
00167 }
00168 else if (a=='b')
00169 {
00170 hr0->Fill(t0,gas,lpos2-rad2);
00171 }
00172 else if (a=='c')
00173 {
00174 hr0->Fill(t0,gas,lpos3-rad3);
00175 }
00176 else if (a=='d')
00177 {
00178 hr1->Fill(t0,gas,lpos1-rad1);
00179 hr2->Fill(t0,gas,lpos2-rad2);
00180 hr3->Fill(t0,gas,lpos3-rad3);
00181 }
00182 else
00183 {cout<<"Function not available !"<<endl;break;}
00184 }
00185 if (a=='d')
00186 {
00187 c1->Divide(2,2);
00188 c1->cd(1);
00189 hr1->DrawCopy(opt);
00190 c1->cd(2);
00191 hr2->DrawCopy(opt);
00192 c1->cd(3);
00193 hr3->DrawCopy(opt);
00194 }
00195 else
00196 hr0->DrawCopy(opt);
00197
00198
00199
00200
00201 c1->Update();
00202 if (fclose(file1) != 0)
00203 cout<<"Error closing input file"<<endl;
00204
00205 if(ftpc==1 && lsec==1)c1->SaveAs("w_lsec1_2d_Del_g-Del_t0.png");
00206 if(ftpc==1 && lsec==1)c1->SaveAs("w_lsec1_2d_Del_g-Del_t0.ps");
00207 if(ftpc==1 && lsec==2)c1->SaveAs("w_lsec2_2d_Del_g-Del_t0.png");
00208 if(ftpc==1 && lsec==2)c1->SaveAs("w_lsec2_2d_Del_g-Del_t0.ps");
00209 if(ftpc==1 && lsec==3)c1->SaveAs("w_lsec3_2d_Del_g-Del_t0.png");
00210 if(ftpc==1 && lsec==3)c1->SaveAs("w_lsec3_2d_Del_g-Del_t0.ps");
00211 if(ftpc==2 && lsec==1)c1->SaveAs("e_lsec1_2d_Del_g-Del_t0.png");
00212 if(ftpc==2 && lsec==1)c1->SaveAs("e_lsec1_2d_Del_g-Del_t0.ps");
00213 if(ftpc==2 && lsec==2)c1->SaveAs("e_lsec2_2d_Del_g-Del_t0.png");
00214 if(ftpc==2 && lsec==2)c1->SaveAs("e_lsec2_2d_Del_g-Del_t0.ps");
00215 if(ftpc==2 && lsec==3)c1->SaveAs("e_lsec3_2d_Del_g-Del_t0.png");
00216 if(ftpc==2 && lsec==3)c1->SaveAs("e_lsec3_2d_Del_g-Del_t0.ps");
00217 }