7 outfile =
open(
"SCNT.sql",
"wt")
8 outfile.write(
"SET echo OFF;\n")
9 outfile.write(
"set linesize 132;\n")
12 outfile.write(
"create table SCNT_data (\n")
13 outfile.write(
"SCNT_data_id number(10),\n")
14 outfile.write(
"ITEM number(10),\n")
15 outfile.write(
"DR float(63),\n")
16 outfile.write(
"RC float(63),\n")
17 outfile.write(
"ZP float(63),\n")
18 outfile.write(
"DRW float(63),\n")
19 outfile.write(
"DT float(63),\n")
20 outfile.write(
"DTW float(63),\n")
21 outfile.write(
"DPHI float(63) \n")
22 outfile.write(
") ;\n")
24 outfile.write(
"alter table SCNT_data add constraint SCNT_data_pk\n")
25 outfile.write(
"primary key (SCNT_data_id);\n")
27 outfile.write(
"create table SCNT_data2tag (\n")
28 outfile.write(
" SCNT_vers varchar2(255),\n")
29 outfile.write(
" SCNT_data_id number(10)\n")
30 outfile.write(
") ;\n")
37 outfile =
open(
"SCNT.sql",
"awt")
39 outfile.write(
"comment on column SCNT_data.SCNT_data_id is 'TileCal SCNT, Section';\n")
40 outfile.write(
"comment on column SCNT_data.ITEM is 'Scintillator number:")
41 outfile.write(
" 1-bar,2-ext,3-ITC1,4-ITC2,5-Gap,6-Crack';\n")
42 outfile.write(
"comment on column SCNT_data.DR is 'Dimension along R';\n")
43 outfile.write(
"comment on column SCNT_data.RC is 'R position with respect to the lower edge of module';\n")
44 outfile.write(
"comment on column SCNT_data.ZP is 'Z position';\n")
45 outfile.write(
"comment on column SCNT_data.DRW is 'Radial space for wrapping';\n")
46 outfile.write(
"comment on column SCNT_data.DT is 'Scintillator thickness in Z';\n")
47 outfile.write(
"comment on column SCNT_data.DTW is 'Wrapping thickness in Z';\n")
48 outfile.write(
"comment on column SCNT_data.DPHI is 'Distance between scintillator and absorber edge in phi';\n")
55 inpfile =
open(
"SCNT-GEO-03",
"rt")
56 outfile =
open(
"SCNT.sql",
"awt")
57 line =modname =comment =volline =cindx =
' '
60 r3 =r4 =r5 =r6 =r7 =r8 =r9 =0.0
66 line = inpfile.readline()
72 name = string.split(line)
93 volline = volline+
","+
str(r6)+
","+
str(r7)+
","+
str(r8)
95 outfile.write(
"insert into SCNT_data (SCNT_data_id, ITEM, DR,RC,ZP,DRW,DT,DTW,DPHI) values (\n")
96 outfile.write(volline)
98 outfile.write(
"insert into SCNT_data2tag values ('SCNT-GEO-03', ")
100 outfile.write(
");\n")
103 print ' IndexError : ',nmax,
' ',name
110 print 'Tile SCNT wirh python '
112 print ' Tile Values ',
SCNT(
'SCNT-GEO-03')