CMS 3D CMS Logo

TkAlMapDesign_phase1_cfg.py
Go to the documentation of this file.
1 
2 M_X = 1.
3 M_Y = 2.5
4 M_T = .2
5 
6 PIX_D_W = 10.
7 PIX_L_W = 20.
8 PIX_L_H = 10.
9 
10 STR_D_W = 10.
11 STR_TID_D_W = 5.5
12 STR_L_W = 24.
13 STR_L_H = 12.
14 
15 TkMap_GEO = {
16  'pixel' : {
17  'BPIX': {
18  'L1': {
19  'file': 'Relative_TPolyLine_Pixel_phase1_BPIX_L1.txt',
20  'x_off': -2*PIX_L_W - 2*M_X,
21  'y_off': -PIX_L_H,
22  'x_scale': PIX_L_W,
23  'y_scale': PIX_L_H,
24  },
25  'L2': {
26  'file': 'Relative_TPolyLine_Pixel_phase1_BPIX_L2.txt',
27  'x_off': -PIX_L_W - M_X,
28  'y_off': -PIX_L_H,
29  'x_scale': PIX_L_W,
30  'y_scale': PIX_L_H,
31  },
32  'L3': {
33  'file': 'Relative_TPolyLine_Pixel_phase1_BPIX_L3.txt',
34  'x_off': -2*PIX_L_W - 2*M_X,
35  'y_off': M_Y,
36  'x_scale': PIX_L_W,
37  'y_scale': PIX_L_H,
38  },
39  'L4': {
40  'file': 'Relative_TPolyLine_Pixel_phase1_BPIX_L4.txt',
41  'x_off': -PIX_L_W - M_X,
42  'y_off': M_Y,
43  'x_scale': PIX_L_W,
44  'y_scale': PIX_L_H,
45  },
46  },
47  'FPIX-': {
48  '-1': {
49  'file': 'Relative_TPolyLine_Pixel_phase1_FPIX_-1.txt',
50  'x_off': -2*PIX_L_W - 2*M_X,
51  'y_off': -PIX_L_H - M_Y - PIX_D_W,
52  'x_scale': PIX_D_W,
53  'y_scale': PIX_D_W,
54  },
55  '-2': {
56  'file': 'Relative_TPolyLine_Pixel_phase1_FPIX_-2.txt',
57  'x_off': -PIX_L_W - M_X - PIX_L_W/4. - M_X/2.,
58  'y_off': -PIX_L_H - M_Y - PIX_D_W,
59  'x_scale': PIX_D_W,
60  'y_scale': PIX_D_W,
61  },
62  '-3': {
63  'file': 'Relative_TPolyLine_Pixel_phase1_FPIX_-3.txt',
64  'x_off': -PIX_D_W - M_X,
65  'y_off': -PIX_L_H - M_Y - PIX_D_W,
66  'x_scale': PIX_D_W,
67  'y_scale': PIX_D_W,
68  },
69  },
70  'FPIX+': {
71  '+1': {
72  'file': 'Relative_TPolyLine_Pixel_phase1_FPIX_+1.txt',
73  'x_off': -2*PIX_L_W - 2*M_X,
74  'y_off': PIX_L_H + 2*M_Y,
75  'x_scale': PIX_D_W,
76  'y_scale': PIX_D_W,
77  },
78  '+2': {
79  'file': 'Relative_TPolyLine_Pixel_phase1_FPIX_+2.txt',
80  'x_off': -PIX_L_W - M_X - PIX_L_W/4. - M_X/2.,
81  'y_off': PIX_L_H + 2*M_Y,
82  'x_scale': PIX_D_W,
83  'y_scale': PIX_D_W,
84  },
85  '+3': {
86  'file': 'Relative_TPolyLine_Pixel_phase1_FPIX_+3.txt',
87  'x_off': -PIX_D_W- M_X,
88  'y_off': PIX_L_H + 2*M_Y,
89  'x_scale': PIX_D_W,
90  'y_scale': PIX_D_W,
91  },
92  },
93  },
94  'strips': {
95  'TIB': {
96  'L1': {
97  'file': 'Relative_TPolyLine_Strips_TIB_L1.txt',
98  'x_off': M_X,
99  'y_off': -STR_L_H,
100  'x_scale': STR_L_W,
101  'y_scale': STR_L_H,
102  },
103  'L2': {
104  'file': 'Relative_TPolyLine_Strips_TIB_L2.txt',
105  'x_off': 2*M_X + STR_L_W,
106  'y_off': -STR_L_H,
107  'x_scale': STR_L_W,
108  'y_scale': STR_L_H,
109  },
110  'L3': {
111  'file': 'Relative_TPolyLine_Strips_TIB_L3.txt',
112  'x_off': M_X,
113  'y_off': M_Y,
114  'x_scale': STR_L_W,
115  'y_scale': STR_L_H,
116  },
117  'L4': {
118  'file': 'Relative_TPolyLine_Strips_TIB_L4.txt',
119  'x_off': 2*M_X + STR_L_W,
120  'y_off': M_Y,
121  'x_scale': STR_L_W,
122  'y_scale': STR_L_H,
123  },
124  },
125  'TOB': {
126  'L1': {
127  'file': 'Relative_TPolyLine_Strips_TOB_L1.txt',
128  'x_off': 3*M_X + 2*STR_L_W,
129  'y_off': -STR_L_H - M_Y - STR_L_H/2. + M_Y/2.,
130  'x_scale': STR_L_W,
131  'y_scale': STR_L_H,
132  },
133  'L2': {
134  'file': 'Relative_TPolyLine_Strips_TOB_L2.txt',
135  'x_off': 4*M_X + 3*STR_L_W,
136  'y_off': -STR_L_H - M_Y - STR_L_H/2. + M_Y/2.,
137  'x_scale': STR_L_W,
138  'y_scale': STR_L_H,
139  },
140  'L3': {
141  'file': 'Relative_TPolyLine_Strips_TOB_L3.txt',
142  'x_off': 3*M_X + 2*STR_L_W,
143  'y_off': - STR_L_H/2. + M_Y/2.,
144  'x_scale': STR_L_W,
145  'y_scale': STR_L_H,
146  },
147  'L4': {
148  'file': 'Relative_TPolyLine_Strips_TOB_L4.txt',
149  'x_off': 4*M_X + 3*STR_L_W,
150  'y_off': - STR_L_H/2. + M_Y/2.,
151  'x_scale': STR_L_W,
152  'y_scale': STR_L_H,
153  },
154  'L5': {
155  'file': 'Relative_TPolyLine_Strips_TOB_L5.txt',
156  'x_off': 3*M_X + 2*STR_L_W,
157  'y_off': STR_L_H/2. + M_Y + M_Y/2.,
158  'x_scale': STR_L_W,
159  'y_scale': STR_L_H,
160  },
161  'L6': {
162  'file': 'Relative_TPolyLine_Strips_TOB_L6.txt',
163  'x_off': 4*M_X + 3*STR_L_W,
164  'y_off': STR_L_H/2. + M_Y + M_Y/2.,
165  'x_scale': STR_L_W,
166  'y_scale': STR_L_H,
167  },
168  },
169  'TID-': {
170  '-1': {
171  'file': 'Relative_TPolyLine_Strips_TID_-1.txt',
172  'x_off': M_X + (STR_L_W + M_X)/2.,
173  'y_off': - STR_L_H - M_Y - STR_TID_D_W,
174  'x_scale': STR_TID_D_W,
175  'y_scale': STR_TID_D_W,
176  },
177  '-2': {
178  'file': 'Relative_TPolyLine_Strips_TID_-2.txt',
179  'x_off': M_X + STR_L_W/2. - STR_TID_D_W/2. + (STR_L_W + M_X)/2.,
180  'y_off': - STR_L_H - M_Y - STR_TID_D_W,
181  'x_scale': STR_TID_D_W,
182  'y_scale': STR_TID_D_W,
183  },
184  '-3': {
185  'file': 'Relative_TPolyLine_Strips_TID_-3.txt',
186  'x_off': M_X + STR_L_W - STR_TID_D_W + (STR_L_W + M_X)/2.,
187  'y_off': - STR_L_H - M_Y - STR_TID_D_W,
188  'x_scale': STR_TID_D_W,
189  'y_scale': STR_TID_D_W,
190  },
191  },
192  'TID+': {
193  '+1': {
194  'file': 'Relative_TPolyLine_Strips_TID_+1.txt',
195  'x_off': M_X + (STR_L_W + M_X)/2.,
196  'y_off': STR_L_H +2*M_Y,
197  'x_scale': STR_TID_D_W,
198  'y_scale': STR_TID_D_W,
199  },
200  '+2': {
201  'file': 'Relative_TPolyLine_Strips_TID_+2.txt',
202  'x_off': M_X + STR_L_W/2. - STR_TID_D_W/2. + (STR_L_W + M_X)/2.,
203  'y_off': STR_L_H +2*M_Y,
204  'x_scale': STR_TID_D_W,
205  'y_scale': STR_TID_D_W,
206  },
207  '+3': {
208  'file': 'Relative_TPolyLine_Strips_TID_+3.txt',
209  'x_off': M_X + STR_L_W - STR_TID_D_W + (STR_L_W + M_X)/2.,
210  'y_off': STR_L_H +2*M_Y,
211  'x_scale': STR_TID_D_W,
212  'y_scale': STR_TID_D_W,
213  },
214  },
215  'TEC-': {
216  '-1': {
217  'file': 'Relative_TPolyLine_Strips_TEC_-1.txt',
218  'x_off': M_X,
219  'y_off': -STR_L_H - M_Y - STR_L_H/2. + M_Y/2. - M_Y - STR_D_W,
220  'x_scale': STR_D_W,
221  'y_scale': STR_D_W,
222  },
223  '-2': {
224  'file': 'Relative_TPolyLine_Strips_TEC_-2.txt',
225  'x_off': M_X +((4*STR_L_W + 3*M_X - 9*STR_D_W)/8. + STR_D_W),
226  'y_off': -STR_L_H - M_Y - STR_L_H/2. + M_Y/2. - M_Y - STR_D_W,
227  'x_scale': STR_D_W,
228  'y_scale': STR_D_W,
229  },
230  '-3': {
231  'file': 'Relative_TPolyLine_Strips_TEC_-3.txt',
232  'x_off': M_X + 2*((4*STR_L_W + 3*M_X - 9*STR_D_W)/8. + STR_D_W),
233  'y_off': -STR_L_H - M_Y - STR_L_H/2. + M_Y/2. - M_Y - STR_D_W,
234  'x_scale': STR_D_W,
235  'y_scale': STR_D_W,
236  },
237  '-4': {
238  'file': 'Relative_TPolyLine_Strips_TEC_-4.txt',
239  'x_off': M_X + 3*((4*STR_L_W + 3*M_X - 9*STR_D_W)/8. + STR_D_W),
240  'y_off': -STR_L_H - M_Y - STR_L_H/2. + M_Y/2. - M_Y - STR_D_W,
241  'x_scale': STR_D_W,
242  'y_scale': STR_D_W,
243  },
244  '-5': {
245  'file': 'Relative_TPolyLine_Strips_TEC_-5.txt',
246  'x_off': M_X + 4*((4*STR_L_W + 3*M_X - 9*STR_D_W)/8. + STR_D_W),
247  'y_off': -STR_L_H - M_Y - STR_L_H/2. + M_Y/2. - M_Y - STR_D_W,
248  'x_scale': STR_D_W,
249  'y_scale': STR_D_W,
250  },
251  '-6': {
252  'file': 'Relative_TPolyLine_Strips_TEC_-6.txt',
253  'x_off': M_X + 5*((4*STR_L_W + 3*M_X - 9*STR_D_W)/8. + STR_D_W),
254  'y_off': -STR_L_H - M_Y - STR_L_H/2. + M_Y/2. - M_Y - STR_D_W,
255  'x_scale': STR_D_W,
256  'y_scale': STR_D_W,
257  },
258  '-7': {
259  'file': 'Relative_TPolyLine_Strips_TEC_-7.txt',
260  'x_off': M_X + 6*((4*STR_L_W + 3*M_X - 9*STR_D_W)/8. + STR_D_W),
261  'y_off': -STR_L_H - M_Y - STR_L_H/2. + M_Y/2. - M_Y - STR_D_W,
262  'x_scale': STR_D_W,
263  'y_scale': STR_D_W,
264  },
265  '-8': {
266  'file': 'Relative_TPolyLine_Strips_TEC_-8.txt',
267  'x_off': M_X + 7*((4*STR_L_W + 3*M_X - 9*STR_D_W)/8. + STR_D_W),
268  'y_off': -STR_L_H - M_Y - STR_L_H/2. + M_Y/2. - M_Y - STR_D_W,
269  'x_scale': STR_D_W,
270  'y_scale': STR_D_W,
271  },
272  '-9': {
273  'file': 'Relative_TPolyLine_Strips_TEC_-9.txt',
274  'x_off': M_X + 8*((4*STR_L_W + 3*M_X - 9*STR_D_W)/8. + STR_D_W),
275  'y_off': -STR_L_H - M_Y - STR_L_H/2. + M_Y/2. - M_Y - STR_D_W,
276  'x_scale': STR_D_W,
277  'y_scale': STR_D_W,
278  },
279  },
280  'TEC+': {
281  '+1': {
282  'file': 'Relative_TPolyLine_Strips_TEC_+1.txt',
283  'x_off': M_X,
284  'y_off': STR_L_H + STR_L_H/2. + M_Y/2. + 2*M_Y,
285  'x_scale': STR_D_W,
286  'y_scale': STR_D_W,
287  },
288  '+2': {
289  'file': 'Relative_TPolyLine_Strips_TEC_+2.txt',
290  'x_off': M_X + ((4*STR_L_W + 3*M_X - 9*STR_D_W)/8. + STR_D_W),
291  'y_off': STR_L_H + STR_L_H/2. + M_Y/2. + 2*M_Y,
292  'x_scale': STR_D_W,
293  'y_scale': STR_D_W,
294  },
295  '+3': {
296  'file': 'Relative_TPolyLine_Strips_TEC_+3.txt',
297  'x_off': M_X + 2*((4*STR_L_W + 3*M_X - 9*STR_D_W)/8. + STR_D_W),
298  'y_off': STR_L_H + STR_L_H/2. + M_Y/2. + 2*M_Y,
299  'x_scale': STR_D_W,
300  'y_scale': STR_D_W,
301  },
302  '+4': {
303  'file': 'Relative_TPolyLine_Strips_TEC_+4.txt',
304  'x_off': M_X + 3*((4*STR_L_W + 3*M_X - 9*STR_D_W)/8. + STR_D_W),
305  'y_off': STR_L_H + STR_L_H/2. + M_Y/2. + 2*M_Y,
306  'x_scale': STR_D_W,
307  'y_scale': STR_D_W,
308  },
309  '+5': {
310  'file': 'Relative_TPolyLine_Strips_TEC_+5.txt',
311  'x_off': M_X + 4*((4*STR_L_W + 3*M_X - 9*STR_D_W)/8. + STR_D_W),
312  'y_off': STR_L_H + STR_L_H/2. + M_Y/2. + 2*M_Y,
313  'x_scale': STR_D_W,
314  'y_scale': STR_D_W,
315  },
316  '+6': {
317  'file': 'Relative_TPolyLine_Strips_TEC_+6.txt',
318  'x_off': M_X + 5*((4*STR_L_W + 3*M_X - 9*STR_D_W)/8. + STR_D_W),
319  'y_off': STR_L_H + STR_L_H/2. + M_Y/2. + 2*M_Y,
320  'x_scale': STR_D_W,
321  'y_scale': STR_D_W,
322  },
323  '+7': {
324  'file': 'Relative_TPolyLine_Strips_TEC_+7.txt',
325  'x_off': M_X + 6*((4*STR_L_W + 3*M_X - 9*STR_D_W)/8. + STR_D_W),
326  'y_off': STR_L_H + STR_L_H/2. + M_Y/2. + 2*M_Y,
327  'x_scale': STR_D_W,
328  'y_scale': STR_D_W,
329  },
330  '+8': {
331  'file': 'Relative_TPolyLine_Strips_TEC_+8.txt',
332  'x_off': M_X + 7*((4*STR_L_W + 3*M_X - 9*STR_D_W)/8. + STR_D_W),
333  'y_off': STR_L_H + STR_L_H/2. + M_Y/2. + 2*M_Y,
334  'x_scale': STR_D_W,
335  'y_scale': STR_D_W,
336  },
337  '+9': {
338  'file': 'Relative_TPolyLine_Strips_TEC_+9.txt',
339  'x_off': M_X + 8*((4*STR_L_W + 3*M_X - 9*STR_D_W)/8. + STR_D_W),
340  'y_off': STR_L_H + STR_L_H/2. + M_Y/2. + 2*M_Y,
341  'x_scale': STR_D_W,
342  'y_scale': STR_D_W,
343  },
344  },
345  },
346 }
347 
348 # Add text
349 for layer in TkMap_GEO['pixel']['BPIX']:
350  TkMap_GEO['pixel']['BPIX'][layer]['latex'] = {
351  'text': 'BPIX '+layer,
352  'x': TkMap_GEO['pixel']['BPIX'][layer]['x_off'],
353  'y': TkMap_GEO['pixel']['BPIX'][layer]['y_off'] + PIX_L_H + M_T,
354  'alignment': 11,
355  }
356 
357 for z in ['-', '+']:
358  TkMap_GEO['pixel']['FPIX'+z]['latex'] = {
359  'text': 'FPIX',
360  'x': TkMap_GEO['pixel']['FPIX'+z][z+'1']['x_off'],
361  'y': TkMap_GEO['pixel']['FPIX'+z][z+'1']['y_off'] + PIX_D_W + M_T,
362  'alignment': 11,
363  }
364  for disc in TkMap_GEO['pixel']['FPIX'+z]:
365  if disc == 'latex': continue
366  TkMap_GEO['pixel']['FPIX'+z][disc]['latex'] = {
367  'text': disc,
368  'x': TkMap_GEO['pixel']['FPIX'+z][disc]['x_off'] + PIX_D_W,
369  'y': TkMap_GEO['pixel']['FPIX'+z][disc]['y_off'] + PIX_D_W,
370  #'alignment': 33,
371  'alignment': 23,
372  }
373 for det in ['TIB', 'TOB']:
374  for layer in TkMap_GEO['strips'][det]:
375  TkMap_GEO['strips'][det][layer]['latex'] = {
376  'text': det+' '+layer,
377  'x': TkMap_GEO['strips'][det][layer]['x_off'],
378  'y': TkMap_GEO['strips'][det][layer]['y_off'] + STR_L_H + M_T,
379  'alignment': 11,
380  }
381 
382 for z in ['-', '+']:
383  TkMap_GEO['strips']['TEC'+z]['latex'] = {
384  'text': 'TEC',
385  'x': TkMap_GEO['strips']['TEC'+z][z+'1']['x_off'],
386  'y': TkMap_GEO['strips']['TEC'+z][z+'1']['y_off'] + STR_D_W + M_T,
387  'alignment': 11,
388  }
389  for disc in TkMap_GEO['strips']['TEC'+z]:
390  if disc == 'latex': continue
391  TkMap_GEO['strips']['TEC'+z][disc]['latex'] = {
392  'text': disc,
393  'x': TkMap_GEO['strips']['TEC'+z][disc]['x_off'] + STR_D_W,
394  'y': TkMap_GEO['strips']['TEC'+z][disc]['y_off'] + STR_D_W,
395  #'alignment': 33,
396  'alignment': 23,
397  }
398 
399 # TID
400 for z in ['-', '+']:
401  TkMap_GEO['strips']['TID'+z]['latex'] = {
402  'text': 'TID',
403  #'x': TkMap_GEO['strips']['TID'+z][z+'1']['x_off'],
404  'x': TkMap_GEO['strips']['TID'+z][z+'1']['x_off'] - 2*M_T,
405  #'y': TkMap_GEO['strips']['TID'+z][z+'1']['y_off'] + STR_TID_D_W + M_T,
406  'y': TkMap_GEO['strips']['TID'+z][z+'1']['y_off'] + STR_TID_D_W/2.,
407  #'alignment': 11,
408  'alignment': 32,
409  }
410  for disc in TkMap_GEO['strips']['TID'+z]:
411  if disc == 'latex': continue
412  TkMap_GEO['strips']['TID'+z][disc]['latex'] = {
413  'text': disc,
414  'x': TkMap_GEO['strips']['TID'+z][disc]['x_off'] + STR_TID_D_W,
415  'y': TkMap_GEO['strips']['TID'+z][disc]['y_off'] + STR_TID_D_W,
416  'alignment': 13,
417  }
418 
419 def read_TPLfile(file_name):
420  o_file = open(file_name, 'r')
421  lines = o_file.readlines()
422  o_file.close()
423 
424  TPL_dict = {}
425  for line in lines:
426  if '#' in line: continue
427  splt_line = line.replace('\n', '').split(' ')
428  det_id = int(splt_line[0])
429  x = []
430  y = []
431  for idx,coo in enumerate(splt_line[1:]):
432  #print(coo)
433  try:
434  val = float(coo)
435  if (idx%2) == 0:
436  y.append(val)
437  else:
438  x.append(val)
439  except ValueError:
440  continue
441  TPL_dict[det_id] = {}
442  TPL_dict[det_id]['x'] = x
443  TPL_dict[det_id]['y'] = y
444  return TPL_dict
445 
446 
447 
448 if __name__ == '__main__':
449  import ROOT
450  from array import array
451  #TPL_dict = read_TPLfile('Relative_TPolyLine_Pixel_phase1_BPIX_L1.txt')
452  #print(TPL_dict)
453 
454  def test_draw(w, h):
455  canvas = ROOT.TCanvas('canvas', 'detector canvas', w, h)
456 
457  # Load all modules in absolute positions
458  # Find max x and y to rescale later for window
459  all_modules = {}
460  all_text = {}
461  x_max = -9999.
462  y_max = -9999.
463  x_min = 9999.
464  y_min = 9999.
465  for det in TkMap_GEO:
466  for sub in TkMap_GEO[det]:
467  for part in TkMap_GEO[det][sub]:
468  if part == 'latex':
469  all_text[det+'_'+sub] = TkMap_GEO[det][sub][part]
470  continue
471  if 'latex' in TkMap_GEO[det][sub][part]:
472  all_text[det+'_'+sub+'_'+part] = TkMap_GEO[det][sub][part]['latex']
473  TPL_dict = read_TPLfile(TkMap_GEO[det][sub][part]['file'])
474  for module in TPL_dict:
475  x_canv = []
476  y_canv = []
477  for idx in range(len(TPL_dict[module]['x'])):
478  x_canv.append(TPL_dict[module]['x'][idx]*TkMap_GEO[det][sub][part]['x_scale'] + TkMap_GEO[det][sub][part]['x_off'])
479  y_canv.append(TPL_dict[module]['y'][idx]*TkMap_GEO[det][sub][part]['y_scale'] + TkMap_GEO[det][sub][part]['y_off'])
480  if max(x_canv) > x_max: x_max = max(x_canv)
481  if max(y_canv) > y_max: y_max = max(y_canv)
482  if min(x_canv) < x_min: x_min = min(x_canv)
483  if min(y_canv) < y_min: y_min = min(y_canv)
484  TPL_dict[module]['x'] = x_canv
485  TPL_dict[module]['y'] = y_canv
486  all_modules.update(TPL_dict)
487 
488  r_margin = 1
489  l_margin = 1
490  t_margin = 1
491  b_margin = 1
492 
493  x_max += r_margin
494  x_min -= l_margin
495  y_max += t_margin
496  y_min -= b_margin
497 
498  x_range = x_max - x_min
499  y_range = y_max - y_min
500  if (x_range + 0.)/(w + 0.) > (y_range + 0.)/(h + 0.):
501  x_scale = x_range
502  y_scale = (h + 0.)/(w + 0.)*x_range
503  else:
504  y_scale = y_range
505  x_scale = (w + 0.)/(h + 0.)*y_range
506  TPL = {}
507  for module in all_modules:
508  x = array('d', [])
509  y = array('d', [])
510  for idx in range(len(all_modules[module]['x'])):
511  x.append((all_modules[module]['x'][idx] - x_min + 0.)/(x_scale + 0.))
512  y.append((all_modules[module]['y'][idx] - y_min + 0.)/(y_scale + 0.))
513  # Begin point is end point
514  x.append((all_modules[module]['x'][0] - x_min + 0.)/(x_scale + 0.))
515  y.append((all_modules[module]['y'][0] - y_min + 0.)/(y_scale + 0.))
516  #print(x, y)
517  TPL[module] = ROOT.TPolyLine(len(x), x, y)
518  #TPL[module].SetFillColor(1)
519  TPL[module].SetLineColor(1)
520  TPL[module].Draw('f')
521  TPL[module].Draw()
522  TL = ROOT.TLatex()
523  TL.SetTextSize(0.025)
524  for key in all_text:
525  x = (all_text[key]['x'] - x_min + 0.)/(x_scale + 0.)
526  y = (all_text[key]['y'] - y_min + 0.)/(y_scale + 0.)
527  TL.SetTextAlign(all_text[key]['alignment'])
528  TL.DrawLatex(x, y, all_text[key]['text'])
529  #TL.SetTextSize(0.025)
530  #TL.SetTextAlign(11)
531  #TL.DrawLatex(0.1, 0.1, 'bottom')
532  #TL.SetTextAlign(13)
533  #TL.DrawLatex(0.1, 0.1, 'top')
534  canvas.Update()
535  raw_input('exit')
536 
537  test_draw(1500, 750)
538  #test_draw(125, 500)
539  #test_draw(500, 500)
540  #raw_input('exit')
541 
542