CMS 3D CMS Logo

ReadPGInfo.cc
Go to the documentation of this file.
2 
3 /*
4 static char mapping[][2][20] = {
5  {"351010100300001", "351010100300001"},
6  {"351010100300002", "351010100300002"},
7  {"351010100300003", "351010100400003"},
8  {"351010100300004", "351010100400004"},
9  {"351010100300005", "351010100300005"},
10  {"351010100300006", "351010100400006"},
11  {"351010100300024", "351010100300024"},
12  {"351010100300027", "351010100400027"},
13  {"351010100300039", "351010100300039"},
14  {"351010100300040", "351010100400040"},
15  {"351010100300041", "351010100400041"},
16  {"351010100300042", "351010100400042"},
17  {"351010100300043", "351010100400043"},
18  {"351010100300045", "351010100300045"},
19  {"351010100300054", "351010100400054"},
20  {"351010100300055", "351010100400055"},
21  {"351010100300056", "351010100300056"},
22  {"351010100300057", "351010100300057"},
23  {"351010100300058", "351010100300058"},
24  {"351010100300059", "351010100300059"},
25  {"351010100300060", "351010100400060"},
26  {"351010100300061", "351010100300061"},
27  {"351010100300062", "351010100300062"},
28  {"351010100300063", "351010100400063"},
29  {"351010100300064", "351010100400064"},
30  {"351010100300065", "351010100300065"},
31  {"351010100300066", "351010100400066"},
32  {"351010100300068", "351010100300068"},
33  {"351010100300073", "351010100300073"},
34  {"351010100300074", "351010100400074"},
35  {"351010100100007", "351010100100007"},
36  {"351010100100008", "351010100200008"},
37  {"351010100100009", "351010100100009"},
38  {"351010100100010", "351010100200010"},
39  {"351010100100011", "351010100100011"},
40  {"351010100100012", "351010100100012"},
41  {"351010100100013", "351010100200013"},
42  {"351010100100014", "351010100100014"},
43  {"351010100100015", "351010100200015"},
44  {"351010100100016", "351010100100016"},
45  {"351010100100017", "351010100100017"},
46  {"351010100100018", "351010100100018"},
47  {"351010100100019", "351010100200019"},
48  {"351010100100020", "351010100200020"},
49  {"351010100100021", "351010100100021"},
50  {"351010100100022", "351010100200022"},
51  {"351010100100023", "351010100100023"},
52  {"351010100100025", "351010100200025"},
53  {"351010100100028", "351010100200028"},
54  {"351010100100035", "351010100100035"},
55  {"351010100100037", "351010100200037"},
56  {"351010100100038", "351010100100038"},
57  {"351010100100044", "351010100200044"},
58  {"351010100100053", "351010100200053"},
59  {"351010100100067", "351010100100067"},
60  {"351010100100069", "351010100200069"},
61  {"351010100100070", "351010100200070"},
62  {"351010100100072", "351010100100072"},
63  {"351010101500051", "351010101300051"},
64  {"351010101500052", "351010101500052"},
65  {"351010103500029", "351010103500029"},
66  {"351010103500030", "351010103500030"},
67  {"351010103500031", "351010103600031"},
68  {"351010103500032", "351010103600032"},
69  {"351010103500033", "351010103600033"},
70  {"351010103500046", "351010103600046"},
71  {"351010103500047", "351010103500047"},
72  {"351010103500048", "351010103500048"},
73  {"351010103500049", "351010103600049"},
74  {"351010103500050", "351010103500050"},
75  {"351010103500075", "351010103600075"},
76  {"351030101700054", "351030101700054"},
77  {"351030101900053", "351030101900053"},
78  {"351030100700009", "351030100800009"},
79  {"351030100700010", "351030100700010"},
80  {"351030100700011", "351030100700011"},
81  {"351030100700013", "351030100700013"},
82  {"351030100700016", "351030100700016"},
83  {"351030100700028", "351030100700028"},
84  {"351030100700042", "351030100700042"},
85  {"351030100700043", "351030100700043"},
86  {"351030100700060", "351030100800060"},
87  {"351030100700065", "351030100700065"},
88  {"351030100700067", "351030100700067"},
89  {"351030100700068", "351030100700068"},
90  {"351030100700069", "351030100700069"},
91  {"351030100700072", "351030100800072"},
92  {"351030100700073", "351030100800073"},
93  {"351030100700074", "351030100800074"},
94  {"351030100800012", "351030100800012"},
95  {"351030100800014", "351030100700014"},
96  {"351030100800015", "351030100800015"},
97  {"351030100800027", "351030100800027"},
98  {"351030100800041", "351030100800041"},
99  {"351030100800044", "351030100800044"},
100  {"351030100800051", "351030100800051"},
101  {"351030100800059", "351030100800059"},
102  {"351030100800062", "351030100800062"},
103  {"351030100800066", "351030100800066"},
104  {"351030100800070", "351030100800070"},
105  {"351030100800071", "351030100800071"},
106  {"351030100500001", "351030100500001"},
107  {"351030100500002", "351030100500002"},
108  {"351030100500004", "351030100500004"},
109  {"351030100500005", "351030100500005"},
110  {"351030100500006", "351030100600006"},
111  {"351030100500007", "351030100500007"},
112  {"351030100500017", "351030100500017"},
113  {"351030100500019", "351030100500019"},
114  {"351030100500021", "351030100500021"},
115  {"351030100500023", "351030100500023"},
116  {"351030100500025", "351030100500025"},
117  {"351030100500039", "351030100500039"},
118  {"351030100500040", "351030100500040"},
119  {"351030100500063", "351030100600063"},
120  {"351030100500064", "351030100600064"},
121  {"351030100600003", "351030100600003"},
122  {"351030100600008", "351030100600008"},
123  {"351030100600018", "351030100600018"},
124  {"351030100600020", "351030100600020"},
125  {"351030100600022", "351030100600022"},
126  {"351030100600024", "351030100600024"},
127  {"351030100600026", "351030100600026"},
128  {"351030100600035", "351030100600035"},
129  {"351030100600036", "351030100600036"},
130  {"351030100600049", "351030100600049"},
131  {"351030103700033", "351030103700033"},
132  {"351030103800032", "351030103800032"},
133  {"351030103800034", "351030103800034"},
134  {"351030103800057", "351030103800057"},
135  {"351030103900058", "351030103700058"},
136  {"351030103700056", "351030103900056"},
137  {"351030103900031", "351030103900031"},
138  {"351030104000029", "351030104000029"},
139  {"351030104000030", "351030104000030"},
140  {"351030104000055", "351030104000055"},
141  {"35102010xx00008", "351020101000008"},
142  {"35102010xx00009", "351020101200009"},
143  {"35102010yy00001", "351020101200001"},
144  {"35102010yy00002", "351020100900002"},
145  {"35102010yy00003", "351020101200003"},
146  {"35102010yy00004", "351020101200004"},
147  {"35102010yy00005", "351020101100005"},
148  {"35102010yy00006", "351020101000006"},
149  {"35102010yy00007", "351020101100007"},
150  {"35102010yy00010", "351020100900010"},
151  {"35102010yy00011", "351020101100011"},
152  {"35102010yy00012", "351020101000012"},
153  {"35102010yy00013", "351020101100013"},
154  {"35102010yy00014", "351020100900014"},
155  {"35102010yy00015", "351020101200015"},
156  {"35102010yy00017", "351020101100017"},
157  {"35102010yy00018", "351020101000018"},
158  {"35102010yy00020", "351020101000020"},
159  {"35102010yy00021", "351020101200021"},
160  {"35102010yy00022", "351020100900022"},
161  {"35102010yy00023", "351020101200023"},
162  {"35102010yy00024", "351020100900024"},
163  {"35102010yy00025", "351020101100025"},
164  {"35102010yy00026", "351020101000026"},
165  {"35102010yy00027", "351020101100027"},
166  {"35102010yy00028", "351020100900028"},
167  {"35102010yy00029", "351020101200029"},
168  {"35102010yy00030", "351020100900030"},
169  {"35102010yy00031", "351020101100031"},
170  {"35102010yy00032", "351020101000032"},
171  {"35102010yy00033", "351020101200033"},
172  {"35102010yy00034", "351020100900034"},
173  {"35102010yy00035", "351020101100035"},
174  {"35102010yy00036", "351020101000036"},
175  {"35102010yy00037", "351020101200037"},
176  {"35102010yy00038", "351020100900038"},
177  {"35102010yy00039", "351020101200039"},
178  {"35102010yy00040", "351020100900040"},
179  {"35102010yy00041", "351020101100041"},
180  {"35102010yy00042", "351020101000042"},
181  {"35102010yy00043", "351020101200043"},
182  {"35102010yy00044", "351020101000044"},
183  {"35102010yy00045", "351020101100045"},
184  {"35102010yy00046", "351020100900046"},
185  {"35102010yy00047", "351020101100047"},
186  {"35102010yy00048", "351020100900048"},
187  {"35102010yy00049", "351020101200049"},
188  {"35102010yy00050", "351020101000050"},
189  {"35102010yy00051", "351020101100051"},
190  {"35102010yy00052", "351020100900052"},
191  {"35102010yy00053", "351020101200053"},
192  {"35102010yy00055", "351020101200055"},
193  {"35102010yy00056", "351020101000056"},
194  {"35102010yy00057", "351020101100057"},
195  {"35102010yy00058", "351020101000058"},
196  {"35102010yy00059", "351020101200059"},
197  {"35102010yy00060", "351020100900060"},
198  {"351040102500003", "351040102500003"},
199  {"351040102500006", "351040102500006"},
200  {"351040102500015", "351040102700015"},
201  {"351040102500016", "351040102500016"},
202  {"351040102500021", "351040102500021"},
203  {"351040102500023", "351040102500023"},
204  {"351040102500025", "351040102500025"},
205  {"351040102600004", "351040102600004"},
206  {"351040102600008", "351040102600008"},
207  {"351040102600010", "351040102600010"},
208  {"351040102600011", "351040102600011"},
209  {"351040102600014", "351040102600014"},
210  {"351040102600018", "351040102600018"},
211  {"351040102600019", "351040102600019"},
212  {"351040102600028", "351040102600028"},
213  {"351040102600030", "351040102600030"},
214  {"351040102700002", "351040102700002"},
215  {"351040102700005", "351040102700005"},
216  {"351040102700013", "351040102700013"},
217  {"351040102700020", "351040102700020"},
218  {"351040102700026", "351040102700026"},
219  {"351040102700027", "351040102700027"},
220  {"351040102700031", "351040102700031"},
221  {"351040102800001", "351040102800001"},
222  {"351040102800007", "351040102800007"},
223  {"351040102800009", "351040102800009"},
224  {"351040102800012", "351040102800012"},
225  {"351040102800017", "351040102800017"},
226  {"351040102800022", "351040102800022"},
227  {"351040102800024", "351040102800024"},
228  {"351040102800029", "351040102800029"},
229  {"351040103100004", "351040103100004"},
230  {"351040103100006", "351040103100006"},
231  {"351040103100009", "351040103000009"},
232  {"351040103100010", "351040103100010"},
233  {"351040103200001", "351040103200001"},
234  {"351040103200008", "351040103200008"},
235  {"351040103300003", "351040103300003"},
236  {"351040103300005", "351040103300005"},
237  {"351040103400002", "351040103400002"},
238  {"351040103400007", "351040103400007"},
239  {"351040104100001", "351040104100001"}};
240 
241 */
242 
243 static char chambers[TOTALCHAMBERS][20] = {
244  "351010100100009",
245  "351010100100016",
246  "351010100100014",
247  "351010100100017",
248  "351010100100011",
249  "351010100100038",
250  "351010100100035",
251  "351010100100023",
252  "351010100100036",
253  "351010100100072",
254  "351010100200013",
255  "351010100200015",
256  "351010100200020",
257  "351010100200019",
258  "351010100200010",
259  "351010100200025",
260  "351010100200037",
261  "351010100200028",
262  "351010100200034",
263  "351010100200022",
264  "351010100200070",
265  "351010100300002",
266  "351010100300061",
267  "351030100500025",
268  "351030100500019",
269  "351030100500017",
270  "351030100500021",
271  "351030100500023",
272  "351030100500038",
273  "351030100500039",
274  "351030100500047",
275  "351030100500040",
276  "351030100500001",
277  "351030100600020",
278  "351030100600026",
279  "351030100600006",
280  "351030100600024",
281  "351030100600022",
282  "351030100600018",
283  "351030100600036",
284  "351030100600035",
285  "351030100600049",
286  "351030100600046",
287  "351030100600048",
288  "351030100700014",
289  "351030100710065",
290  "351030100800009",
291  "351020100900010",
292  "351020100900014",
293  "351020100900028",
294  "351020100900030",
295  "351020100900024",
296  "351020100900022",
297  "351020100900034",
298  "351020100900040",
299  "351020100900046",
300  "351020101000018",
301  "351020101000016",
302  "351020101000008",
303  "351020101000006",
304  "351020101000012",
305  "351020101000004",
306  "351020101000032",
307  "351020101000020",
308  "351020101000026",
309  "351020101000042",
310  "351020101200001",
311  "351010101300051",
312  "351030101700054",
313  "351020102100002",
314  "351040102500003",
315  "351040102500006",
316  "351040102600004",
317  "351040102600010",
318  "351040102600030",
319  "351040102700002",
320  "351040102700005",
321  "351040102700031",
322  "351040102800001",
323  "351040102800007",
324  "351020103000004",
325  "351020103000003",
326  "351020103000009",
327  "351040103100004",
328  "351040103200001",
329  "351040103300003",
330  "351040103400002",
331  "351010103600075",
332  "351030103700033",
333  "351030103800034",
334  "351030103900031",
335  "351030104000030",
336  "351020104200001",
337  "351020104200002",
338  "351010100100018",
339  "351010100100012",
340  "351010100100007",
341  "351010100100021",
342  "351010100100067",
343  "351010100200008",
344  "351010100200053",
345  "351010100200044",
346  "351010100200069",
347  "351010100200071",
348  "351010100300005",
349  "351010100300001",
350  "351010100300024",
351  "351010100300039",
352  "351010100300045",
353  "351010100300042",
354  "351010100300056",
355  "351010100300058",
356  "351010100300059",
357  "351010100300062",
358  "351010100300065",
359  "351010100300068",
360  "351010100300073",
361  "351010100300057",
362  "351010100400003",
363  "351010100400004",
364  "351010100400006",
365  "351010100400027",
366  "351010100400026",
367  "351010100400043",
368  "351010100400041",
369  "351010100400040",
370  "351010100400055",
371  "351010100400064",
372  "351010100400060",
373  "351010100400063",
374  "351010100400054",
375  "351010100400066",
376  "351010100400074",
377  "351030100500007",
378  "351030100500005",
379  "351030100500002",
380  "351030100500004",
381  "351030100500045",
382  "351030100600008",
383  "351030100600037",
384  "351030100600003",
385  "351030100600064",
386  "351030100600063",
387  "351030100700016",
388  "351030100700028",
389  "351030100700013",
390  "351030100700010",
391  "351030100700011",
392  "351030100700042",
393  "351030100700043",
394  "351030100700050",
395  "351030100700052",
396  "351030100700061",
397  "351030100700067",
398  "351030100700068",
399  "351030100700069",
400  "351030100700065",
401  "351030100800015",
402  "351030100800027",
403  "351030100800012",
404  "351030100800041",
405  "351030100800044",
406  "351030100800051",
407  "351030100800059",
408  "351030100800060",
409  "351030100800062",
410  "351030100800066",
411  "351030100800072",
412  "351030100800073",
413  "351030100800071",
414  "351030100800074",
415  "351030100800070",
416  "351020100900002",
417  "351020100900038",
418  "351020100900048",
419  "351020100900052",
420  "351020100900060",
421  "351020101000044",
422  "351020101000036",
423  "351020101000050",
424  "351020101000056",
425  "351020101000058",
426  "351020101100005",
427  "351020101100007",
428  "351020101100011",
429  "351020101100017",
430  "351020101100013",
431  "351020101100025",
432  "351020101100027",
433  "351020101100031",
434  "351020101100035",
435  "351020101100041",
436  "351020101100045",
437  "351020101100047",
438  "351020101100051",
439  "351020101100057",
440  "351020101200009",
441  "351020101200003",
442  "351020101200021",
443  "351020101200015",
444  "351020101200023",
445  "351020101200019",
446  "351020101200033",
447  "351020101200029",
448  "351020101200037",
449  "351020101200039",
450  "351020101200049",
451  "351020101200053",
452  "351020101200055",
453  "351020101200043",
454  "351020101200059",
455  "351010101500052",
456  "351030101900053",
457  "351020102300001",
458  "351040102500016",
459  "351040102500023",
460  "351040102500021",
461  "351040102500025",
462  "351040102600008",
463  "351040102600011",
464  "351040102600014",
465  "351040102600018",
466  "351040102600019",
467  "351040102600028",
468  "351040102700013",
469  "351040102700015",
470  "351040102700026",
471  "351040102700020",
472  "351040102700027",
473  "351040102800009",
474  "351040102800012",
475  "351040102800017",
476  "351040102800024",
477  "351040102800022",
478  "351040102800029",
479  "351020102900002",
480  "351020102900001",
481  "351020102900005",
482  "351020102900006",
483  "351020103000008",
484  "351020103000007",
485  "351040103100006",
486  "351040103100010",
487  "351040103200008",
488  "351040103300005",
489  "351040103300009",
490  "351040103400007",
491  "351010103500030",
492  "351010103500029",
493  "351010103500048",
494  "351010103500050",
495  "351010103500047",
496  "351010103600031",
497  "351010103600032",
498  "351010103600033",
499  "351010103600049",
500  "351010103600046",
501  "351030103700058",
502  "351030103800032",
503  "351030103800057",
504  "351030103900056",
505  "351030104000029",
506  "351030104000055",
507  "351040104100001"};
508 
509 static int position[TOTALCHAMBERS][3] = {
510  {2, 3, 1},
511  {2, 5, 1},
512  {2, 9, 1},
513  {2, 11, 1},
514  {1, 2, 1},
515  {1, 6, 1},
516  {1, 12, 1},
517  {1, 10, 1},
518  {1, 8, 1},
519  {0, 0, 0},
520  {2, 6, 1},
521  {2, 10, 1},
522  {2, 12, 1},
523  {1, 5, 1},
524  {2, 8, 1},
525  {1, 11, 1},
526  {1, 3, 1},
527  {2, 2, 1},
528  {2, 4, 1},
529  {1, 9, 1},
530  {0, 0, 0},
531  {0, 0, 0},
532  {0, 0, 0},
533  {1, 8, 2},
534  {2, 5, 2},
535  {2, 11, 2},
536  {1, 12, 2},
537  {2, 9, 2},
538  {1, 6, 2},
539  {1, 2, 2},
540  {2, 3, 2},
541  {1, 10, 2},
542  {0, 0, 0},
543  {1, 9, 2},
544  {2, 12, 2},
545  {0, 0, 0},
546  {2, 10, 2},
547  {2, 8, 2},
548  {1, 11, 2},
549  {1, 5, 2},
550  {1, 3, 2},
551  {2, 6, 2},
552  {2, 2, 2},
553  {2, 4, 2},
554  {0, 0, 0},
555  {0, 0, 0},
556  {0, 0, 0},
557  {1, 10, 3},
558  {2, 5, 3},
559  {1, 6, 3},
560  {2, 3, 3},
561  {2, 11, 3},
562  {1, 2, 3},
563  {2, 9, 3},
564  {1, 8, 3},
565  {1, 12, 3},
566  {2, 2, 3},
567  {2, 12, 3},
568  {2, 8, 3},
569  {1, 5, 3},
570  {2, 10, 3},
571  {2, 6, 3},
572  {2, 4, 3},
573  {1, 11, 3},
574  {1, 9, 3},
575  {1, 3, 3},
576  {0, 0, 0},
577  {1, 4, 1},
578  {1, 4, 2},
579  {1, 4, 3},
580  {2, 5, 4},
581  {1, 6, 4},
582  {2, 6, 4},
583  {1, 5, 4},
584  {0, 0, 0},
585  {2, 3, 4},
586  {1, 2, 4},
587  {0, 0, 0},
588  {2, 2, 4},
589  {1, 3, 4},
590  {2, 4, 4},
591  {2, 13, 4},
592  {0, 0, 0},
593  {1, 8, 4},
594  {2, 8, 4},
595  {1, 12, 4},
596  {2, 12, 4},
597  {0, 0, 0},
598  {1, 10, 4},
599  {2, 10, 4},
600  {1, 14, 4},
601  {2, 14, 4},
602  {1, 13, 4},
603  {1, 4, 4},
604  {2, 7, 1},
605  {0, 11, 1},
606  {2, 1, 1},
607  {0, 3, 1},
608  {0, 7, 1},
609  {0, 2, 1},
610  {0, 10, 1},
611  {0, 6, 1},
612  {1, 1, 1},
613  {1, 7, 1},
614  {0, 4, 1},
615  {-2, 8, 1},
616  {0, 8, 1},
617  {0, 12, 1},
618  {-1, 11, 1},
619  {-2, 10, 1},
620  {-1, 9, 1},
621  {-2, 2, 1},
622  {-1, 5, 1},
623  {-2, 4, 1},
624  {-2, 6, 1},
625  {-1, 1, 1},
626  {-1, 7, 1},
627  {-2, 12, 1},
628  {-1, 6, 1},
629  {-1, 4, 1},
630  {-1, 2, 1},
631  {-1, 8, 1},
632  {-2, 9, 1},
633  {-1, 10, 1},
634  {-2, 11, 1},
635  {-1, 12, 1},
636  {0, 9, 1},
637  {0, 5, 1},
638  {-2, 7, 1},
639  {-2, 5, 1},
640  {-2, 3, 1},
641  {0, 1, 1},
642  {-2, 1, 1},
643  {0, 3, 2},
644  {0, 7, 2},
645  {2, 7, 2},
646  {2, 1, 2},
647  {0, 11, 2},
648  {0, 2, 2},
649  {0, 10, 2},
650  {0, 6, 2},
651  {1, 7, 2},
652  {1, 1, 2},
653  {0, 4, 2},
654  {-1, 11, 2},
655  {-2, 10, 2},
656  {-1, 5, 2},
657  {-2, 8, 2},
658  {0, 8, 2},
659  {0, 12, 2},
660  {-1, 9, 2},
661  {-2, 12, 2},
662  {-2, 2, 2},
663  {-2, 6, 2},
664  {-1, 1, 2},
665  {-1, 7, 2},
666  {-2, 4, 2},
667  {-1, 10, 2},
668  {-2, 11, 2},
669  {-1, 2, 2},
670  {0, 5, 2},
671  {0, 9, 2},
672  {-1, 8, 2},
673  {-1, 4, 2},
674  {-1, 12, 2},
675  {-1, 6, 2},
676  {-2, 5, 2},
677  {-2, 1, 2},
678  {-2, 7, 2},
679  {-2, 3, 2},
680  {0, 1, 2},
681  {-2, 9, 2},
682  {2, 1, 3},
683  {0, 3, 3},
684  {0, 11, 3},
685  {2, 7, 3},
686  {0, 7, 3},
687  {0, 10, 3},
688  {0, 2, 3},
689  {0, 6, 3},
690  {1, 1, 3},
691  {1, 7, 3},
692  {-1, 5, 3},
693  {-2, 8, 3},
694  {-1, 9, 3},
695  {0, 4, 3},
696  {-1, 1, 3},
697  {0, 8, 3},
698  {-2, 10, 3},
699  {-1, 11, 3},
700  {0, 12, 3},
701  {-2, 12, 3},
702  {-2, 2, 3},
703  {-2, 4, 3},
704  {-2, 6, 3},
705  {-1, 7, 3},
706  {-1, 8, 3},
707  {-1, 4, 3},
708  {-1, 2, 3},
709  {-1, 6, 3},
710  {0, 5, 3},
711  {-1, 12, 3},
712  {-1, 10, 3},
713  {-2, 11, 3},
714  {0, 9, 3},
715  {-2, 9, 3},
716  {-2, 5, 3},
717  {0, 1, 3},
718  {-2, 1, 3},
719  {-2, 3, 3},
720  {-2, 7, 3},
721  {-1, 3, 1},
722  {-1, 3, 2},
723  {-1, 3, 3},
724  {2, 7, 4},
725  {-2, 2, 4},
726  {0, 7, 4},
727  {-1, 1, 4},
728  {-2, 3, 4},
729  {0, 6, 4},
730  {-1, 2, 4},
731  {1, 7, 4},
732  {0, 1, 4},
733  {-2, 1, 4},
734  {0, 3, 4},
735  {2, 1, 4},
736  {-2, 6, 4},
737  {-1, 5, 4},
738  {-1, 7, 4},
739  {0, 2, 4},
740  {0, 5, 4},
741  {1, 1, 4},
742  {-2, 5, 4},
743  {-1, 6, 4},
744  {-2, 7, 4},
745  {0, 13, 4},
746  {0, 4, 4},
747  {-2, 13, 4},
748  {-2, 4, 4},
749  {-1, 13, 4},
750  {-1, 4, 4},
751  {0, 12, 4},
752  {-2, 12, 4},
753  {-1, 12, 4},
754  {0, 8, 4},
755  {-2, 8, 4},
756  {-1, 8, 4},
757  {2, 11, 4},
758  {2, 9, 4},
759  {-1, 11, 4},
760  {0, 11, 4},
761  {-1, 9, 4},
762  {-2, 9, 4},
763  {1, 9, 4},
764  {1, 11, 4},
765  {-2, 11, 4},
766  {0, 9, 4},
767  {-2, 14, 4},
768  {0, 10, 4},
769  {-1, 14, 4},
770  {-2, 10, 4},
771  {0, 14, 4},
772  {-1, 10, 4},
773  {-1, 3, 4}};
774 
776  TDirectory * dirSave = gDirectory;
777  rootFile = new TFile(name);
778  dirSave->cd();
779 }
780 
782 
783 char * ReadPGInfo::getId(int wheel, int station, int sector) {
784  for(int counter = 0; counter < TOTALCHAMBERS; ++counter) {
785  if(wheel == position[counter][0] && sector == position[counter][1] && station == position[counter][2])
786  return chambers[counter];
787  }
788  return nullptr;
789 }
790 
791 
792 TMatrixD ReadPGInfo::giveR(int wheel, int station, int sector) {
793  TMatrixD *empty = new TMatrixD(0,0);
794  char *id = getId(wheel, station, sector);
795  if(id == nullptr) return *empty;
796  TDirectoryFile *myDir = (TDirectoryFile *)rootFile->Get(id);
797  TDirectoryFile *myR = (TDirectoryFile *)myDir->Get("R");
798  TMatrixD *R = (TMatrixD *)myR->Get("matrix");
799  return *R;
800 }
801 
802 
803 TMatrixD ReadPGInfo::giveQCCal(int wheel, int station, int sector) {
804  TMatrixD *mat = new TMatrixD(0,0);
805  TMatrixD qc = giveQC(wheel, station, sector);
806  if(qc.GetNrows() == 0) return *mat;
807  mat->ResizeTo(12,2);
808  int maxCount = 12;
809  if(station == 4) maxCount = 8;
810  for(int c = 0; c < maxCount; ++c) {
811  float error;
812  if(qc(c,1) == 0 || qc(c,3) == 0) {
813  (*mat)(c,0) = (qc(c,0)+qc(c,2)) /2.0;
814  (*mat)(c,1) = 500;
815  } else {
816  error = 1.0/(1.0/(qc(c,1)*qc(c,1))+1.0/(qc(c,3)*qc(c,3)));
817  (*mat)(c, 0) = (qc(c,0)/(qc(c,1)*qc(c,1))+qc(c,2)/(qc(c,3)*qc(c,3)))*error;
818  (*mat)(c, 1) = TMath::Sqrt(error);
819  }
820  }
821  return *mat;
822 }
823 
824 TMatrixD ReadPGInfo::giveQC(int wheel, int station, int sector) {
825  TMatrixD *empty = new TMatrixD(0,0);
826  char *id = getId(wheel, station, sector);
827  if(id == nullptr) return *empty;
828  TDirectoryFile *myDir = (TDirectoryFile *)rootFile->Get(id);
829  TDirectoryFile *myQC = (TDirectoryFile *)myDir->Get("QCW");
830  TMatrixD *QC;
831  if(myQC == nullptr) {
832  QC = new TMatrixD(0,0);
833  } else {
834  QC = (TMatrixD *)myQC->Get("matrix");
835  }
836  return *QC;
837 }
838 
839 
840 TMatrixD ReadPGInfo::giveSurvey(int wheel, int station, int sector) {
841  TMatrixD *empty = new TMatrixD(0,0);
842  char *id = getId(wheel, station, sector);
843  if(id == nullptr) return *empty;
844  TDirectoryFile *myDir = (TDirectoryFile *)rootFile->Get(id);
845  TDirectoryFile *mySur = (TDirectoryFile *)myDir->Get("Survey");
846  TMatrixD *Survey = (TMatrixD *)mySur->Get("matrix_layer");
847  return *Survey;
848 }
849 
850 
851 
852 
853 
#define TOTALCHAMBERS
Definition: ReadPGInfo.h:14
TMatrixD giveQCCal(int, int, int)
Definition: ReadPGInfo.cc:803
TFile * rootFile
Definition: ReadPGInfo.h:29
char * getId(int, int, int)
Definition: ReadPGInfo.cc:783
TMatrixD giveQC(int, int, int)
Definition: ReadPGInfo.cc:824
ReadPGInfo(const char *name)
Definition: ReadPGInfo.cc:775
TMatrixD giveSurvey(int, int, int)
Definition: ReadPGInfo.cc:840
static std::atomic< unsigned int > counter
static int position[264][3]
Definition: ReadPGInfo.cc:509
static char chambers[264][20]
Definition: ReadPGInfo.cc:243
TMatrixD giveR(int, int, int)
Definition: ReadPGInfo.cc:792