1
|
{
|
2
|
|
3
|
gSystem->Load("libeloss");
|
4
|
|
5
|
TH2D *h_sq20 = new TH2D("h_sq20","sq20 thikness",8,1,9,15,1,16);
|
6
|
char dname[32];
|
7
|
int i,j;
|
8
|
double abc[10];
|
9
|
double a[8][15],d_sq20[8][15];
|
10
|
double de[8][15],e[8][15];
|
11
|
double sq20=18;
|
12
|
|
13
|
TELoss eloss(1,2.33);
|
14
|
eloss.AddEL(14,28);
|
15
|
eloss.SetZP(2,4);
|
16
|
eloss.SetEtab(1000,0.1,10);
|
17
|
FILE *pf1;
|
18
|
pf1=fopen("sq20_calib_03.txt","r");
|
19
|
|
20
|
for(j=0; j<15; j++)
|
21
|
{
|
22
|
|
23
|
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]);
|
24
|
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]);
|
25
|
|
26
|
}
|
27
|
fclose(pf1);
|
28
|
FILE *FW = fopen("sq20_de_04.txt","wt");
|
29
|
for(j=0; j<15; j++)
|
30
|
{
|
31
|
for(i=0; i<8; i++)
|
32
|
{
|
33
|
de[i][j]=7.63-a[i][j];
|
34
|
}
|
35
|
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]);
|
36
|
}
|
37
|
fclose(FW);
|
38
|
FILE *FW1 = fopen("sq20_thickness.txt","wt");
|
39
|
FILE *FW2 = fopen("sq20_list_04.txt","wt");
|
40
|
for(j=0; j<15; j++)
|
41
|
{
|
42
|
for(i=0; i<8; i++)
|
43
|
{
|
44
|
sq20=18;
|
45
|
do
|
46
|
{
|
47
|
e[i][j] = 7.63-eloss.GetE(7.63, sq20);
|
48
|
fprintf(FW2,"%lf %lf %lf %d %d\n",e[i][j],de[i][j],sq20,i,j);
|
49
|
sq20=sq20+0.01;
|
50
|
}while((e[i][j]-de[i][j])<=0.01);
|
51
|
d_sq20[i][j]=sq20;
|
52
|
h_sq20->SetBinContent(i+1,j+1,sq20);
|
53
|
|
54
|
}
|
55
|
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]);
|
56
|
|
57
|
}
|
58
|
FILE *FW3 = fopen("sq20_coef.txt","wt");
|
59
|
for(j=0; j<15; j++)
|
60
|
{
|
61
|
|
62
|
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]);
|
63
|
|
64
|
}
|
65
|
h_sq20->Draw("lego2z");
|
66
|
fclose(FW3);
|
67
|
fclose(FW2);
|
68
|
fclose(FW1);
|
69
|
|
70
|
}
|