{ gSystem->Load("libeloss"); // Loading of the library for the calculating of the energy losses in the matter. TH2D *h_sq20 = new TH2D("h_sq20","sq20 thikness",8,1,9,15,1,16); char dname[32]; int i,j; double abc[10]; double a[8][15],d_sq20[8][15]; double de[8][15],e[8][15]; double sq20=18; TELoss eloss(1,2.33); // TELoss eloss.AddEL(14,28); // TELoss. -- Si eloss.SetZP(2,4); // (Z) (A) eloss.SetEtab(1000,0.1,10); // 1000 0.1 10 FILE *pf1; pf1=fopen("sq20_calib_03.txt","r");//File with positions of the 7.63 alpha peak after passing through the 20mkm of Si for(j=0; j<15; j++) { fscanf(pf1,"%lf %lf %lf %lf %lf %lf %lf %lf\n",&a[0][j],&a[1][j],&a[2][j],&a[3][j],&a[4][j],&a[5][j],&a[6][j],&a[7][j]); printf("%lf %lf %lf %lf %lf %lf %lf %lf\n",a[0][j],a[1][j],a[2][j],a[3][j],a[4][j],a[5][j],a[6][j],a[7][j]); } fclose(pf1); FILE *FW = fopen("sq20_de_04.txt","wt"); // File with dE of the 7.63 alpha after passing through the 20mkm of Si for(j=0; j<15; j++) { for(i=0; i<8; i++) { de[i][j]=7.63-a[i][j]; } fprintf(FW,"%lf %lf %lf %lf %lf %lf %lf %lf\n",de[0][j],de[1][j],de[2][j],de[3][j],de[4][j],de[5][j],de[6][j],de[7][j]); } fclose(FW); FILE *FW1 = fopen("sq20_thickness.txt","wt"); // File with thicknesses of SQ20 FILE *FW2 = fopen("sq20_list_04.txt","wt"); // List of calculations for(j=0; j<15; j++) { for(i=0; i<8; i++) { sq20=18; do { e[i][j] = 7.63-eloss.GetE(7.63, sq20); fprintf(FW2,"%lf %lf %lf %d %d\n",e[i][j],de[i][j],sq20,i,j); sq20=sq20+0.01; }while((e[i][j]-de[i][j])<=0.01); d_sq20[i][j]=sq20; h_sq20->SetBinContent(i+1,j+1,sq20); } fprintf(FW1,"%lf %lf %lf %lf %lf %lf %lf %lf\n",d_sq20[0][j],d_sq20[1][j],d_sq20[2][j],d_sq20[3][j],d_sq20[4][j],d_sq20[5][j],d_sq20[6][j],d_sq20[7][j]); } FILE *FW3 = fopen("sq20_coef.txt","wt"); // File with coefficients from thickness for(j=0; j<15; j++) { fprintf(FW3,"%lf %lf %lf %lf %lf %lf %lf %lf\n",22/d_sq20[0][j],22/d_sq20[1][j],22/d_sq20[2][j],22/d_sq20[3][j],22/d_sq20[4][j],22/d_sq20[5][j],22/d_sq20[6][j],22/d_sq20[7][j]); } h_sq20->Draw("lego2z"); fclose(FW3); fclose(FW2); fclose(FW1); }