Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Functions
CUTS Namespace Reference

Functions

def CUTSHeader (num)
 
def CUTSComments (num)
 
def CUTS (num)
 

Function Documentation

◆ CUTS()

def CUTS.CUTS (   num)

Definition at line 52 of file CUTS.py.

52 def CUTS(num):
53  import string
54  inpfile = open("CUTS-00","rt")
55  outfile = open("CUTS.sql","awt")
56  line =volname =modname =comment =volline =cindx =' '
57  nmax =0
58  n1 =0
59  volname =' '
60  r3 =r4 =r5 =r6 =r7 =r8 =r9 =0.0
61 
62  outfile.write("\n")
63 
64  indx = -1
65  while 1 :
66  line = inpfile.readline()
67  indx = indx + 1
68  cindx = str(indx)
69  if line == "":
70  break
71 
72  name = string.split(line)
73  nmax = len(name)
74  try:
75  if nmax < 1:
76  raise IndexError
77  if nmax > 9:
78  raise IndexError
79 
80  if name[0] == "###":
81  break
82 
83  volname = name[1]
84  r2 = float(name[2])
85  r3 = float(name[3])
86  r4 = float(name[4])
87  r5 = float(name[5])
88  r6 = float(name[6])
89  r7 = float(name[7])
90  r8 = float(name[8])
91 
92  volline = str(indx)+",'"+volname+"',"+str(r2)+","+str(r3)+","+str(r4)+","+str(r5)
93  volline = volline+","+str(r6)+","+str(r7)+","+str(r8)
94 
95  outfile.write("insert into CUTS_data (CUTS_data_id, volume,dX1,dX2,dY1,dY2,dZ1,Xpos,Ypos) values (\n")
96  outfile.write(volline)
97  outfile.write(");\n")
98  outfile.write("insert into CUTS_data2tag values ('CUTS-00', ")
99  outfile.write(cindx)
100  outfile.write(");\n")
101 
102  except IndexError: # coments are in line
103  print ' IndexError : ',nmax,' ',name
104 
105  inpfile.close()
106  outfile.close()
107  return num
108 
109 # ---------------------------------------------------------------------------------------------------------------

◆ CUTSComments()

def CUTS.CUTSComments (   num)

Definition at line 36 of file CUTS.py.

36 def CUTSComments(num):
37  outfile = open("CUTS.sql","awt")
38  outfile.write("\n")
39  outfile.write("comment on column CUTS_data.CUTS_data_id is 'TileCal CUTS, Section';\n")
40  outfile.write("comment on column CUTS_data.volume is 'Volume name';\n")
41  outfile.write("comment on column CUTS_data.dX1 is 'TRD shape, dX1/2 [mm]';\n")
42  outfile.write("comment on column CUTS_data.dX2 is 'TRD shape, dX2/2 [mm]';\n")
43  outfile.write("comment on column CUTS_data.dY1 is 'TRD shape, dY1/2 [mm]';\n")
44  outfile.write("comment on column CUTS_data.dY2 is 'TRD shape, dY2/2 [mm]';\n")
45  outfile.write("comment on column CUTS_data.dZ1 is 'TRD shape, dZ1/2 [mm]';\n")
46  outfile.write("comment on column CUTS_data.Xpos is 'X Position [mm]';\n")
47  outfile.write("comment on column CUTS_data.Ypos is 'Y Position [mm]';\n")
48  outfile.close()
49  return num
50 
51 # ---------------------------------------------------------------------------------------------------------------

◆ CUTSHeader()

def CUTS.CUTSHeader (   num)

CUTS.sql generator

Definition at line 6 of file CUTS.py.

6 def CUTSHeader(num):
7  outfile = open("CUTS.sql","wt")
8  outfile.write("SET echo OFF;\n")
9  outfile.write("set linesize 132;\n")
10 # outfile.write("drop table CUTS_data2tag cascade constraints;\n")
11 # outfile.write("drop table CUTS_data cascade constraints;\n")
12  outfile.write("create table CUTS_data (\n")
13  outfile.write("CUTS_data_id number(10),\n")
14  outfile.write("volume varchar2(255),\n")
15  outfile.write("dX1 float(63),\n")
16  outfile.write("dX2 float(63),\n")
17  outfile.write("dY1 float(63),\n")
18  outfile.write("dY2 float(63),\n")
19  outfile.write("dZ1 float(63),\n")
20  outfile.write("Xpos float(63),\n")
21  outfile.write("Ypos float(63) \n")
22  outfile.write(") ;\n")
23  outfile.write("\n")
24  outfile.write("alter table CUTS_data add constraint CUTS_data_pk\n")
25  outfile.write("primary key (CUTS_data_id);\n")
26  outfile.write("\n")
27  outfile.write("create table CUTS_data2tag (\n")
28  outfile.write(" CUTS_vers varchar2(255),\n")
29  outfile.write(" CUTS_data_id number(10)\n")
30  outfile.write(") ;\n")
31 
32  outfile.close()
33  return num
34 
35 # ---------------------------------------------------------------------------------------------------------------
CUTS.CUTS
def CUTS(num)
Definition: CUTS.py:52
CUTS.CUTSComments
def CUTSComments(num)
Definition: CUTS.py:36
Trk::open
@ open
Definition: BinningType.h:40
str
Definition: BTagTrackIpAccessor.cxx:11
CUTS.CUTSHeader
def CUTSHeader(num)
Definition: CUTS.py:6
python.LArMinBiasAlgConfig.float
float
Definition: LArMinBiasAlgConfig.py:65