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