Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:45:36

0001 #include "Alignment/MuonAlignmentAlgorithms/interface/ReadPGInfo.h"
0002 
0003 /*
0004 static char mapping[][2][20] = {
0005   {"351010100300001", "351010100300001"},
0006   {"351010100300002", "351010100300002"},
0007   {"351010100300003", "351010100400003"},
0008   {"351010100300004", "351010100400004"},
0009   {"351010100300005", "351010100300005"},
0010   {"351010100300006", "351010100400006"},
0011   {"351010100300024", "351010100300024"},
0012   {"351010100300027", "351010100400027"},
0013   {"351010100300039", "351010100300039"},
0014   {"351010100300040", "351010100400040"},
0015   {"351010100300041", "351010100400041"},
0016   {"351010100300042", "351010100400042"},
0017   {"351010100300043", "351010100400043"},
0018   {"351010100300045", "351010100300045"},
0019   {"351010100300054", "351010100400054"},
0020   {"351010100300055", "351010100400055"},
0021   {"351010100300056", "351010100300056"},
0022   {"351010100300057", "351010100300057"},
0023   {"351010100300058", "351010100300058"},
0024   {"351010100300059", "351010100300059"},
0025   {"351010100300060", "351010100400060"},
0026   {"351010100300061", "351010100300061"},
0027   {"351010100300062", "351010100300062"},
0028   {"351010100300063", "351010100400063"},
0029   {"351010100300064", "351010100400064"},
0030   {"351010100300065", "351010100300065"},
0031   {"351010100300066", "351010100400066"},
0032   {"351010100300068", "351010100300068"},
0033   {"351010100300073", "351010100300073"},
0034   {"351010100300074", "351010100400074"},
0035   {"351010100100007", "351010100100007"},
0036   {"351010100100008", "351010100200008"},
0037   {"351010100100009", "351010100100009"},
0038   {"351010100100010", "351010100200010"},
0039   {"351010100100011", "351010100100011"},
0040   {"351010100100012", "351010100100012"},
0041   {"351010100100013", "351010100200013"},
0042   {"351010100100014", "351010100100014"},
0043   {"351010100100015", "351010100200015"},
0044   {"351010100100016", "351010100100016"},
0045   {"351010100100017", "351010100100017"},
0046   {"351010100100018", "351010100100018"},
0047   {"351010100100019", "351010100200019"},
0048   {"351010100100020", "351010100200020"},
0049   {"351010100100021", "351010100100021"},
0050   {"351010100100022", "351010100200022"},
0051   {"351010100100023", "351010100100023"},
0052   {"351010100100025", "351010100200025"},
0053   {"351010100100028", "351010100200028"},
0054   {"351010100100035", "351010100100035"},
0055   {"351010100100037", "351010100200037"},
0056   {"351010100100038", "351010100100038"},
0057   {"351010100100044", "351010100200044"},
0058   {"351010100100053", "351010100200053"},
0059   {"351010100100067", "351010100100067"},
0060   {"351010100100069", "351010100200069"},
0061   {"351010100100070", "351010100200070"},
0062   {"351010100100072", "351010100100072"},
0063   {"351010101500051", "351010101300051"},
0064   {"351010101500052", "351010101500052"},
0065   {"351010103500029", "351010103500029"},
0066   {"351010103500030", "351010103500030"},
0067   {"351010103500031", "351010103600031"},
0068   {"351010103500032", "351010103600032"},
0069   {"351010103500033", "351010103600033"},
0070   {"351010103500046", "351010103600046"},
0071   {"351010103500047", "351010103500047"},
0072   {"351010103500048", "351010103500048"},
0073   {"351010103500049", "351010103600049"},
0074   {"351010103500050", "351010103500050"},
0075   {"351010103500075", "351010103600075"},
0076   {"351030101700054", "351030101700054"},
0077   {"351030101900053", "351030101900053"},
0078   {"351030100700009", "351030100800009"},
0079   {"351030100700010", "351030100700010"},
0080   {"351030100700011", "351030100700011"},
0081   {"351030100700013", "351030100700013"},
0082   {"351030100700016", "351030100700016"},
0083   {"351030100700028", "351030100700028"},
0084   {"351030100700042", "351030100700042"},
0085   {"351030100700043", "351030100700043"},
0086   {"351030100700060", "351030100800060"},
0087   {"351030100700065", "351030100700065"},
0088   {"351030100700067", "351030100700067"},
0089   {"351030100700068", "351030100700068"},
0090   {"351030100700069", "351030100700069"},
0091   {"351030100700072", "351030100800072"},
0092   {"351030100700073", "351030100800073"},
0093   {"351030100700074", "351030100800074"},
0094   {"351030100800012", "351030100800012"},
0095   {"351030100800014", "351030100700014"},
0096   {"351030100800015", "351030100800015"},
0097   {"351030100800027", "351030100800027"},
0098   {"351030100800041", "351030100800041"},
0099   {"351030100800044", "351030100800044"},
0100   {"351030100800051", "351030100800051"},
0101   {"351030100800059", "351030100800059"},
0102   {"351030100800062", "351030100800062"},
0103   {"351030100800066", "351030100800066"},
0104   {"351030100800070", "351030100800070"},
0105   {"351030100800071", "351030100800071"},
0106   {"351030100500001", "351030100500001"},
0107   {"351030100500002", "351030100500002"},
0108   {"351030100500004", "351030100500004"},
0109   {"351030100500005", "351030100500005"},
0110   {"351030100500006", "351030100600006"},
0111   {"351030100500007", "351030100500007"},
0112   {"351030100500017", "351030100500017"},
0113   {"351030100500019", "351030100500019"},
0114   {"351030100500021", "351030100500021"},
0115   {"351030100500023", "351030100500023"},
0116   {"351030100500025", "351030100500025"},
0117   {"351030100500039", "351030100500039"},
0118   {"351030100500040", "351030100500040"},
0119   {"351030100500063", "351030100600063"},
0120   {"351030100500064", "351030100600064"},
0121   {"351030100600003", "351030100600003"},
0122   {"351030100600008", "351030100600008"},
0123   {"351030100600018", "351030100600018"},
0124   {"351030100600020", "351030100600020"},
0125   {"351030100600022", "351030100600022"},
0126   {"351030100600024", "351030100600024"},
0127   {"351030100600026", "351030100600026"},
0128   {"351030100600035", "351030100600035"},
0129   {"351030100600036", "351030100600036"},
0130   {"351030100600049", "351030100600049"},
0131   {"351030103700033", "351030103700033"},
0132   {"351030103800032", "351030103800032"},
0133   {"351030103800034", "351030103800034"},
0134   {"351030103800057", "351030103800057"},
0135   {"351030103900058", "351030103700058"},
0136   {"351030103700056", "351030103900056"},
0137   {"351030103900031", "351030103900031"},
0138   {"351030104000029", "351030104000029"},
0139   {"351030104000030", "351030104000030"},
0140   {"351030104000055", "351030104000055"},
0141   {"35102010xx00008", "351020101000008"},
0142   {"35102010xx00009", "351020101200009"},
0143   {"35102010yy00001", "351020101200001"},
0144   {"35102010yy00002", "351020100900002"},
0145   {"35102010yy00003", "351020101200003"},
0146   {"35102010yy00004", "351020101200004"},
0147   {"35102010yy00005", "351020101100005"},
0148   {"35102010yy00006", "351020101000006"},
0149   {"35102010yy00007", "351020101100007"},
0150   {"35102010yy00010", "351020100900010"},
0151   {"35102010yy00011", "351020101100011"},
0152   {"35102010yy00012", "351020101000012"},
0153   {"35102010yy00013", "351020101100013"},
0154   {"35102010yy00014", "351020100900014"},
0155   {"35102010yy00015", "351020101200015"},
0156   {"35102010yy00017", "351020101100017"},
0157   {"35102010yy00018", "351020101000018"},
0158   {"35102010yy00020", "351020101000020"},
0159   {"35102010yy00021", "351020101200021"},
0160   {"35102010yy00022", "351020100900022"},
0161   {"35102010yy00023", "351020101200023"},
0162   {"35102010yy00024", "351020100900024"},
0163   {"35102010yy00025", "351020101100025"},
0164   {"35102010yy00026", "351020101000026"},
0165   {"35102010yy00027", "351020101100027"},
0166   {"35102010yy00028", "351020100900028"},
0167   {"35102010yy00029", "351020101200029"},
0168   {"35102010yy00030", "351020100900030"},
0169   {"35102010yy00031", "351020101100031"},
0170   {"35102010yy00032", "351020101000032"},
0171   {"35102010yy00033", "351020101200033"},
0172   {"35102010yy00034", "351020100900034"},
0173   {"35102010yy00035", "351020101100035"},
0174   {"35102010yy00036", "351020101000036"},
0175   {"35102010yy00037", "351020101200037"},
0176   {"35102010yy00038", "351020100900038"},
0177   {"35102010yy00039", "351020101200039"},
0178   {"35102010yy00040", "351020100900040"},
0179   {"35102010yy00041", "351020101100041"},
0180   {"35102010yy00042", "351020101000042"},
0181   {"35102010yy00043", "351020101200043"},
0182   {"35102010yy00044", "351020101000044"},
0183   {"35102010yy00045", "351020101100045"},
0184   {"35102010yy00046", "351020100900046"},
0185   {"35102010yy00047", "351020101100047"},
0186   {"35102010yy00048", "351020100900048"},
0187   {"35102010yy00049", "351020101200049"},
0188   {"35102010yy00050", "351020101000050"},
0189   {"35102010yy00051", "351020101100051"},
0190   {"35102010yy00052", "351020100900052"},
0191   {"35102010yy00053", "351020101200053"},
0192   {"35102010yy00055", "351020101200055"},
0193   {"35102010yy00056", "351020101000056"},
0194   {"35102010yy00057", "351020101100057"},
0195   {"35102010yy00058", "351020101000058"},
0196   {"35102010yy00059", "351020101200059"},
0197   {"35102010yy00060", "351020100900060"},
0198   {"351040102500003", "351040102500003"},
0199   {"351040102500006", "351040102500006"},
0200   {"351040102500015", "351040102700015"},
0201   {"351040102500016", "351040102500016"},
0202   {"351040102500021", "351040102500021"},
0203   {"351040102500023", "351040102500023"},
0204   {"351040102500025", "351040102500025"},
0205   {"351040102600004", "351040102600004"},
0206   {"351040102600008", "351040102600008"},
0207   {"351040102600010", "351040102600010"},
0208   {"351040102600011", "351040102600011"},
0209   {"351040102600014", "351040102600014"},
0210   {"351040102600018", "351040102600018"},
0211   {"351040102600019", "351040102600019"},
0212   {"351040102600028", "351040102600028"},
0213   {"351040102600030", "351040102600030"},
0214   {"351040102700002", "351040102700002"},
0215   {"351040102700005", "351040102700005"},
0216   {"351040102700013", "351040102700013"},
0217   {"351040102700020", "351040102700020"},
0218   {"351040102700026", "351040102700026"},
0219   {"351040102700027", "351040102700027"},
0220   {"351040102700031", "351040102700031"},
0221   {"351040102800001", "351040102800001"},
0222   {"351040102800007", "351040102800007"},
0223   {"351040102800009", "351040102800009"},
0224   {"351040102800012", "351040102800012"},
0225   {"351040102800017", "351040102800017"},
0226   {"351040102800022", "351040102800022"},
0227   {"351040102800024", "351040102800024"},
0228   {"351040102800029", "351040102800029"},
0229   {"351040103100004", "351040103100004"},
0230   {"351040103100006", "351040103100006"},
0231   {"351040103100009", "351040103000009"},
0232   {"351040103100010", "351040103100010"},
0233   {"351040103200001", "351040103200001"},
0234   {"351040103200008", "351040103200008"},
0235   {"351040103300003", "351040103300003"},
0236   {"351040103300005", "351040103300005"},
0237   {"351040103400002", "351040103400002"},
0238   {"351040103400007", "351040103400007"},
0239   {"351040104100001", "351040104100001"}};
0240 
0241 */
0242 
0243 static char chambers[TOTALCHAMBERS][20] = {
0244     "351010100100009", "351010100100016", "351010100100014", "351010100100017", "351010100100011", "351010100100038",
0245     "351010100100035", "351010100100023", "351010100100036", "351010100100072", "351010100200013", "351010100200015",
0246     "351010100200020", "351010100200019", "351010100200010", "351010100200025", "351010100200037", "351010100200028",
0247     "351010100200034", "351010100200022", "351010100200070", "351010100300002", "351010100300061", "351030100500025",
0248     "351030100500019", "351030100500017", "351030100500021", "351030100500023", "351030100500038", "351030100500039",
0249     "351030100500047", "351030100500040", "351030100500001", "351030100600020", "351030100600026", "351030100600006",
0250     "351030100600024", "351030100600022", "351030100600018", "351030100600036", "351030100600035", "351030100600049",
0251     "351030100600046", "351030100600048", "351030100700014", "351030100710065", "351030100800009", "351020100900010",
0252     "351020100900014", "351020100900028", "351020100900030", "351020100900024", "351020100900022", "351020100900034",
0253     "351020100900040", "351020100900046", "351020101000018", "351020101000016", "351020101000008", "351020101000006",
0254     "351020101000012", "351020101000004", "351020101000032", "351020101000020", "351020101000026", "351020101000042",
0255     "351020101200001", "351010101300051", "351030101700054", "351020102100002", "351040102500003", "351040102500006",
0256     "351040102600004", "351040102600010", "351040102600030", "351040102700002", "351040102700005", "351040102700031",
0257     "351040102800001", "351040102800007", "351020103000004", "351020103000003", "351020103000009", "351040103100004",
0258     "351040103200001", "351040103300003", "351040103400002", "351010103600075", "351030103700033", "351030103800034",
0259     "351030103900031", "351030104000030", "351020104200001", "351020104200002", "351010100100018", "351010100100012",
0260     "351010100100007", "351010100100021", "351010100100067", "351010100200008", "351010100200053", "351010100200044",
0261     "351010100200069", "351010100200071", "351010100300005", "351010100300001", "351010100300024", "351010100300039",
0262     "351010100300045", "351010100300042", "351010100300056", "351010100300058", "351010100300059", "351010100300062",
0263     "351010100300065", "351010100300068", "351010100300073", "351010100300057", "351010100400003", "351010100400004",
0264     "351010100400006", "351010100400027", "351010100400026", "351010100400043", "351010100400041", "351010100400040",
0265     "351010100400055", "351010100400064", "351010100400060", "351010100400063", "351010100400054", "351010100400066",
0266     "351010100400074", "351030100500007", "351030100500005", "351030100500002", "351030100500004", "351030100500045",
0267     "351030100600008", "351030100600037", "351030100600003", "351030100600064", "351030100600063", "351030100700016",
0268     "351030100700028", "351030100700013", "351030100700010", "351030100700011", "351030100700042", "351030100700043",
0269     "351030100700050", "351030100700052", "351030100700061", "351030100700067", "351030100700068", "351030100700069",
0270     "351030100700065", "351030100800015", "351030100800027", "351030100800012", "351030100800041", "351030100800044",
0271     "351030100800051", "351030100800059", "351030100800060", "351030100800062", "351030100800066", "351030100800072",
0272     "351030100800073", "351030100800071", "351030100800074", "351030100800070", "351020100900002", "351020100900038",
0273     "351020100900048", "351020100900052", "351020100900060", "351020101000044", "351020101000036", "351020101000050",
0274     "351020101000056", "351020101000058", "351020101100005", "351020101100007", "351020101100011", "351020101100017",
0275     "351020101100013", "351020101100025", "351020101100027", "351020101100031", "351020101100035", "351020101100041",
0276     "351020101100045", "351020101100047", "351020101100051", "351020101100057", "351020101200009", "351020101200003",
0277     "351020101200021", "351020101200015", "351020101200023", "351020101200019", "351020101200033", "351020101200029",
0278     "351020101200037", "351020101200039", "351020101200049", "351020101200053", "351020101200055", "351020101200043",
0279     "351020101200059", "351010101500052", "351030101900053", "351020102300001", "351040102500016", "351040102500023",
0280     "351040102500021", "351040102500025", "351040102600008", "351040102600011", "351040102600014", "351040102600018",
0281     "351040102600019", "351040102600028", "351040102700013", "351040102700015", "351040102700026", "351040102700020",
0282     "351040102700027", "351040102800009", "351040102800012", "351040102800017", "351040102800024", "351040102800022",
0283     "351040102800029", "351020102900002", "351020102900001", "351020102900005", "351020102900006", "351020103000008",
0284     "351020103000007", "351040103100006", "351040103100010", "351040103200008", "351040103300005", "351040103300009",
0285     "351040103400007", "351010103500030", "351010103500029", "351010103500048", "351010103500050", "351010103500047",
0286     "351010103600031", "351010103600032", "351010103600033", "351010103600049", "351010103600046", "351030103700058",
0287     "351030103800032", "351030103800057", "351030103900056", "351030104000029", "351030104000055", "351040104100001"};
0288 
0289 static int position[TOTALCHAMBERS][3] = {
0290     {2, 3, 1},   {2, 5, 1},   {2, 9, 1},   {2, 11, 1},  {1, 2, 1},   {1, 6, 1},   {1, 12, 1},  {1, 10, 1},  {1, 8, 1},
0291     {0, 0, 0},   {2, 6, 1},   {2, 10, 1},  {2, 12, 1},  {1, 5, 1},   {2, 8, 1},   {1, 11, 1},  {1, 3, 1},   {2, 2, 1},
0292     {2, 4, 1},   {1, 9, 1},   {0, 0, 0},   {0, 0, 0},   {0, 0, 0},   {1, 8, 2},   {2, 5, 2},   {2, 11, 2},  {1, 12, 2},
0293     {2, 9, 2},   {1, 6, 2},   {1, 2, 2},   {2, 3, 2},   {1, 10, 2},  {0, 0, 0},   {1, 9, 2},   {2, 12, 2},  {0, 0, 0},
0294     {2, 10, 2},  {2, 8, 2},   {1, 11, 2},  {1, 5, 2},   {1, 3, 2},   {2, 6, 2},   {2, 2, 2},   {2, 4, 2},   {0, 0, 0},
0295     {0, 0, 0},   {0, 0, 0},   {1, 10, 3},  {2, 5, 3},   {1, 6, 3},   {2, 3, 3},   {2, 11, 3},  {1, 2, 3},   {2, 9, 3},
0296     {1, 8, 3},   {1, 12, 3},  {2, 2, 3},   {2, 12, 3},  {2, 8, 3},   {1, 5, 3},   {2, 10, 3},  {2, 6, 3},   {2, 4, 3},
0297     {1, 11, 3},  {1, 9, 3},   {1, 3, 3},   {0, 0, 0},   {1, 4, 1},   {1, 4, 2},   {1, 4, 3},   {2, 5, 4},   {1, 6, 4},
0298     {2, 6, 4},   {1, 5, 4},   {0, 0, 0},   {2, 3, 4},   {1, 2, 4},   {0, 0, 0},   {2, 2, 4},   {1, 3, 4},   {2, 4, 4},
0299     {2, 13, 4},  {0, 0, 0},   {1, 8, 4},   {2, 8, 4},   {1, 12, 4},  {2, 12, 4},  {0, 0, 0},   {1, 10, 4},  {2, 10, 4},
0300     {1, 14, 4},  {2, 14, 4},  {1, 13, 4},  {1, 4, 4},   {2, 7, 1},   {0, 11, 1},  {2, 1, 1},   {0, 3, 1},   {0, 7, 1},
0301     {0, 2, 1},   {0, 10, 1},  {0, 6, 1},   {1, 1, 1},   {1, 7, 1},   {0, 4, 1},   {-2, 8, 1},  {0, 8, 1},   {0, 12, 1},
0302     {-1, 11, 1}, {-2, 10, 1}, {-1, 9, 1},  {-2, 2, 1},  {-1, 5, 1},  {-2, 4, 1},  {-2, 6, 1},  {-1, 1, 1},  {-1, 7, 1},
0303     {-2, 12, 1}, {-1, 6, 1},  {-1, 4, 1},  {-1, 2, 1},  {-1, 8, 1},  {-2, 9, 1},  {-1, 10, 1}, {-2, 11, 1}, {-1, 12, 1},
0304     {0, 9, 1},   {0, 5, 1},   {-2, 7, 1},  {-2, 5, 1},  {-2, 3, 1},  {0, 1, 1},   {-2, 1, 1},  {0, 3, 2},   {0, 7, 2},
0305     {2, 7, 2},   {2, 1, 2},   {0, 11, 2},  {0, 2, 2},   {0, 10, 2},  {0, 6, 2},   {1, 7, 2},   {1, 1, 2},   {0, 4, 2},
0306     {-1, 11, 2}, {-2, 10, 2}, {-1, 5, 2},  {-2, 8, 2},  {0, 8, 2},   {0, 12, 2},  {-1, 9, 2},  {-2, 12, 2}, {-2, 2, 2},
0307     {-2, 6, 2},  {-1, 1, 2},  {-1, 7, 2},  {-2, 4, 2},  {-1, 10, 2}, {-2, 11, 2}, {-1, 2, 2},  {0, 5, 2},   {0, 9, 2},
0308     {-1, 8, 2},  {-1, 4, 2},  {-1, 12, 2}, {-1, 6, 2},  {-2, 5, 2},  {-2, 1, 2},  {-2, 7, 2},  {-2, 3, 2},  {0, 1, 2},
0309     {-2, 9, 2},  {2, 1, 3},   {0, 3, 3},   {0, 11, 3},  {2, 7, 3},   {0, 7, 3},   {0, 10, 3},  {0, 2, 3},   {0, 6, 3},
0310     {1, 1, 3},   {1, 7, 3},   {-1, 5, 3},  {-2, 8, 3},  {-1, 9, 3},  {0, 4, 3},   {-1, 1, 3},  {0, 8, 3},   {-2, 10, 3},
0311     {-1, 11, 3}, {0, 12, 3},  {-2, 12, 3}, {-2, 2, 3},  {-2, 4, 3},  {-2, 6, 3},  {-1, 7, 3},  {-1, 8, 3},  {-1, 4, 3},
0312     {-1, 2, 3},  {-1, 6, 3},  {0, 5, 3},   {-1, 12, 3}, {-1, 10, 3}, {-2, 11, 3}, {0, 9, 3},   {-2, 9, 3},  {-2, 5, 3},
0313     {0, 1, 3},   {-2, 1, 3},  {-2, 3, 3},  {-2, 7, 3},  {-1, 3, 1},  {-1, 3, 2},  {-1, 3, 3},  {2, 7, 4},   {-2, 2, 4},
0314     {0, 7, 4},   {-1, 1, 4},  {-2, 3, 4},  {0, 6, 4},   {-1, 2, 4},  {1, 7, 4},   {0, 1, 4},   {-2, 1, 4},  {0, 3, 4},
0315     {2, 1, 4},   {-2, 6, 4},  {-1, 5, 4},  {-1, 7, 4},  {0, 2, 4},   {0, 5, 4},   {1, 1, 4},   {-2, 5, 4},  {-1, 6, 4},
0316     {-2, 7, 4},  {0, 13, 4},  {0, 4, 4},   {-2, 13, 4}, {-2, 4, 4},  {-1, 13, 4}, {-1, 4, 4},  {0, 12, 4},  {-2, 12, 4},
0317     {-1, 12, 4}, {0, 8, 4},   {-2, 8, 4},  {-1, 8, 4},  {2, 11, 4},  {2, 9, 4},   {-1, 11, 4}, {0, 11, 4},  {-1, 9, 4},
0318     {-2, 9, 4},  {1, 9, 4},   {1, 11, 4},  {-2, 11, 4}, {0, 9, 4},   {-2, 14, 4}, {0, 10, 4},  {-1, 14, 4}, {-2, 10, 4},
0319     {0, 14, 4},  {-1, 10, 4}, {-1, 3, 4}};
0320 
0321 ReadPGInfo::ReadPGInfo(const char *name) {
0322   TDirectory *dirSave = gDirectory;
0323   rootFile = new TFile(name);
0324   dirSave->cd();
0325 }
0326 
0327 ReadPGInfo::~ReadPGInfo() { delete rootFile; }
0328 
0329 char *ReadPGInfo::getId(int wheel, int station, int sector) {
0330   for (int counter = 0; counter < TOTALCHAMBERS; ++counter) {
0331     if (wheel == position[counter][0] && sector == position[counter][1] && station == position[counter][2])
0332       return chambers[counter];
0333   }
0334   return nullptr;
0335 }
0336 
0337 TMatrixD ReadPGInfo::giveR(int wheel, int station, int sector) {
0338   TMatrixD *empty = new TMatrixD(0, 0);
0339   char *id = getId(wheel, station, sector);
0340   if (id == nullptr)
0341     return *empty;
0342   TDirectoryFile *myDir = (TDirectoryFile *)rootFile->Get(id);
0343   TDirectoryFile *myR = (TDirectoryFile *)myDir->Get("R");
0344   TMatrixD *R = (TMatrixD *)myR->Get("matrix");
0345   return *R;
0346 }
0347 
0348 TMatrixD ReadPGInfo::giveQCCal(int wheel, int station, int sector) {
0349   TMatrixD *mat = new TMatrixD(0, 0);
0350   TMatrixD qc = giveQC(wheel, station, sector);
0351   if (qc.GetNrows() == 0)
0352     return *mat;
0353   mat->ResizeTo(12, 2);
0354   int maxCount = 12;
0355   if (station == 4)
0356     maxCount = 8;
0357   for (int c = 0; c < maxCount; ++c) {
0358     float error;
0359     if (qc(c, 1) == 0 || qc(c, 3) == 0) {
0360       (*mat)(c, 0) = (qc(c, 0) + qc(c, 2)) / 2.0;
0361       (*mat)(c, 1) = 500;
0362     } else {
0363       error = 1.0 / (1.0 / (qc(c, 1) * qc(c, 1)) + 1.0 / (qc(c, 3) * qc(c, 3)));
0364       (*mat)(c, 0) = (qc(c, 0) / (qc(c, 1) * qc(c, 1)) + qc(c, 2) / (qc(c, 3) * qc(c, 3))) * error;
0365       (*mat)(c, 1) = TMath::Sqrt(error);
0366     }
0367   }
0368   return *mat;
0369 }
0370 
0371 TMatrixD ReadPGInfo::giveQC(int wheel, int station, int sector) {
0372   TMatrixD *empty = new TMatrixD(0, 0);
0373   char *id = getId(wheel, station, sector);
0374   if (id == nullptr)
0375     return *empty;
0376   TDirectoryFile *myDir = (TDirectoryFile *)rootFile->Get(id);
0377   TDirectoryFile *myQC = (TDirectoryFile *)myDir->Get("QCW");
0378   TMatrixD *QC;
0379   if (myQC == nullptr) {
0380     QC = new TMatrixD(0, 0);
0381   } else {
0382     QC = (TMatrixD *)myQC->Get("matrix");
0383   }
0384   return *QC;
0385 }
0386 
0387 TMatrixD ReadPGInfo::giveSurvey(int wheel, int station, int sector) {
0388   TMatrixD *empty = new TMatrixD(0, 0);
0389   char *id = getId(wheel, station, sector);
0390   if (id == nullptr)
0391     return *empty;
0392   TDirectoryFile *myDir = (TDirectoryFile *)rootFile->Get(id);
0393   TDirectoryFile *mySur = (TDirectoryFile *)myDir->Get("Survey");
0394   TMatrixD *Survey = (TMatrixD *)mySur->Get("matrix_layer");
0395   return *Survey;
0396 }