CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_1/src/DataFormats/EcalDetId/src/ESDetId.cc

Go to the documentation of this file.
00001 #include "DataFormats/EcalDetId/interface/ESDetId.h"
00002 #include "FWCore/Utilities/interface/Exception.h"
00003 
00004 #include <ostream>
00005 
00006 ESDetId::ESDetId() : DetId() 
00007 {
00008 }
00009   
00010 ESDetId::ESDetId( uint32_t rawid ) : 
00011    DetId( rawid ) 
00012 {
00013 }
00014   
00015 ESDetId::ESDetId( int strip,
00016                   int ixs,
00017                   int iys,
00018                   int plane,
00019                   int iz     ) :
00020    DetId( Ecal, EcalPreshower ) 
00021 {
00022    if( !validDetId( strip, ixs, iys, plane, iz) )
00023       throw cms::Exception("InvalidDetId") 
00024          << "ESDetId:  Cannot create object.  Indexes out of bounds \n" 
00025          << " strip = " << strip << " x = " << ixs << " y = " << iys << "\n" 
00026          << " plane = " << plane << " z = " << iz
00027          << " hxy = " << (1==plane?hxy1[ixs-1][iys-1]:hxy2[ixs-1][iys-1])
00028          << "\n";
00029 
00030    id_ |=
00031       (strip&0x3F) |
00032       ((ixs&0x3F)<<6) |
00033       ((iys&0x3F)<<12) |
00034       (((plane-1)&0x1)<<18) |
00035       ((iz>0)?(1<<19):(0));
00036 }
00037   
00038 ESDetId::ESDetId( const DetId& gen ) 
00039 {
00040    if( !gen.null() && 
00041        ( gen.det()      != Ecal          ||
00042          gen.subdetId() != EcalPreshower    ) ) 
00043    {
00044       throw cms::Exception("InvalidDetId");
00045    }
00046    id_ = gen.rawId() ;
00047 }
00048 
00049 bool 
00050 ESDetId::validDetId( int istrip, 
00051                      int ixs, 
00052                      int iys, 
00053                      int iplane, 
00054                      int iz      ) 
00055 {
00056   return ( !( ( istrip < ISTRIP_MIN ) ||
00057               ( istrip > ISTRIP_MAX ) ||
00058               ( ixs    < IX_MIN     ) || 
00059               ( ixs    > IX_MAX     ) ||
00060               ( iys    < IY_MIN     ) ||
00061               ( iys    > IY_MAX     ) ||
00062               ( abs( iz ) != 1      ) ||
00063               ( iplane < PLANE_MIN  ) ||
00064               ( iplane > PLANE_MAX  ) ||
00065               ( ( 1 == iplane ) &&
00066                 0 == hxy1[ixs-1][iys-1]  ) ||
00067               ( ( 2 == iplane ) &&
00068                 0 == hxy2[ixs-1][iys-1]  )    ) ) ;
00069 }
00070   
00071 ESDetId& 
00072 ESDetId::operator=( const DetId& gen ) 
00073 {
00074    if (!gen.null() &&
00075        ( gen.det()      != Ecal          ||
00076          gen.subdetId() != EcalPreshower    ) ) 
00077    {
00078       throw cms::Exception("InvalidDetId");
00079    }
00080    id_=gen.rawId();
00081    return *this;
00082 }
00083 
00084 int 
00085 ESDetId::hashedIndex() const 
00086 {
00087    const int ia ( 1 == zside() ? 2 : 1 ) ;
00088    const int ib ( plane() ) ;
00089    const int ix ( six() ) ;
00090    const int iy ( siy() ) ;
00091    const int ic ( 1 == ib ?
00092                   hxy1[ ix - 1 ][ iy - 1 ] :
00093                   hxy2[ ix - 1 ][ iy - 1 ] ) ;
00094    const int id ( strip() ) ;
00095 
00096    return ( ( ia - 1 )*kLb +
00097             ( ib - 1 )*kLc +
00098             ( ic - 1 )*kLd + 
00099             id             - 1 ) ;
00100 }
00101 
00102 ESDetId 
00103 ESDetId::unhashIndex( int hi ) 
00104 {
00105    if( validHashIndex( hi ) )
00106    {
00107       const int id ( hi%kLd + 1 ) ;
00108       const int nd ( hi - id + 1 ) ;
00109       const int ic ( ( nd%kLc )/kLd + 1 ) ;
00110       const int nc ( nd - ( ic - 1 )*kLd ) ;
00111       const int ib ( ( nc%kLb )/kLc + 1 ) ;
00112       const int nb ( nc - ( ib - 1 )*kLc ) ;
00113       const int ia ( nb/kLb + 1 );// + 1 ) ;
00114 
00115       const int st    ( id ) ;
00116       const int pl    ( ib ) ;
00117       int ix ;
00118       int iy ;
00119       const int ic1 ( ic - 1 ) ;
00120       if( 1 == pl )
00121       {
00122          ix = hx1[ ic1 ] ;
00123          iy = hy1[ ic1 ] ;
00124       }
00125       else
00126       {
00127          ix = hx2[ ic1 ] ;
00128          iy = hy2[ ic1 ] ;
00129       }
00130       const int iz ( 1 == ia ? -1 : 1 ) ;
00131 
00132       return ESDetId( st, ix, iy, pl, iz ) ;
00133    }
00134    else
00135    {
00136       return ESDetId() ;
00137    }
00138 }
00139   
00140 std::ostream& operator<<(std::ostream& s,const ESDetId& id) 
00141 {
00142    return s << "(ES z=" << id.zside() 
00143             << "  plane " << id.plane() 
00144             << " " 
00145             << id.six() 
00146             << ':' 
00147             << id.siy() 
00148             << " " 
00149             << id.strip() 
00150             << ')'           
00151             << " hashIndex = ";
00152 //          << id.hashedIndex() ;
00153 }
00154 
00155 
00156 const unsigned short ESDetId::hxy1[ kXMAX ][ kYMAX ] = {
00157 {    0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
00158      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
00159      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
00160      0,     0,     0,     0,     0,     0,     0,     0,     0,     0 } , //1
00161 {    0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
00162      0,     0,     0,     0,     1,     2,     3,     4,     5,     6,
00163      7,     8,     9,    10,    11,    12,     0,     0,     0,     0,
00164      0,     0,     0,     0,     0,     0,     0,     0,     0,     0 } , //2
00165 {    0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
00166      0,     0,    13,    14,    15,    16,    17,    18,    19,    20,
00167     21,    22,    23,    24,    25,    26,    27,    28,     0,     0,
00168      0,     0,     0,     0,     0,     0,     0,     0,     0,     0 } , //3
00169 {    0,     0,     0,     0,     0,     0,     0,     0,     0,    29,
00170     30,    31,    32,    33,    34,    35,    36,    37,    38,    39,
00171     40,    41,    42,    43,    44,    45,    46,    47,    48,    49,
00172     50,     0,     0,     0,     0,     0,     0,     0,     0,     0 } ,
00173 {    0,     0,     0,     0,     0,     0,     0,     0,    51,    52,
00174     53,    54,    55,    56,    57,    58,    59,    60,    61,    62,
00175     63,    64,    65,    66,    67,    68,    69,    70,    71,    72,
00176     73,    74,     0,     0,     0,     0,     0,     0,     0,     0 } ,
00177 {    0,     0,     0,     0,     0,     0,     0,    75,    76,    77,
00178     78,    79,    80,    81,    82,    83,    84,    85,    86,    87,
00179     88,    89,    90,    91,    92,    93,    94,    95,    96,    97,
00180     98,    99,   100,     0,     0,     0,     0,     0,     0,     0 } ,//6
00181 {    0,     0,     0,     0,     0,     0,   101,   102,   103,   104,
00182    105,   106,   107,   108,   109,   110,   111,   112,   113,   114,
00183    115,   116,   117,   118,   119,   120,   121,   122,   123,   124,
00184    125,   126,   127,   128,     0,     0,     0,     0,     0,     0 } ,
00185 {    0,     0,     0,     0,   129,   130,   131,   132,   133,   134,
00186    135,   136,   137,   138,   139,   140,   141,   142,   143,   144,
00187    145,   146,   147,   148,   149,   150,   151,   152,   153,   154,
00188    155,   156,   157,   158,   159,   160,     0,     0,     0,     0 } ,
00189 {    0,     0,     0,     0,   161,   162,   163,   164,   165,   166,
00190    167,   168,   169,   170,   171,   172,   173,   174,   175,   176,
00191    177,   178,   179,   180,   181,   182,   183,   184,   185,   186,
00192    187,   188,   189,   190,   191,   192,     0,     0,     0,     0 } ,
00193 {    0,     0,     0,   193,   194,   195,   196,   197,   198,   199,
00194    200,   201,   202,   203,   204,   205,   206,   207,   208,   209,
00195    210,   211,   212,   213,   214,   215,   216,   217,   218,   219,
00196    220,   221,   222,   223,   224,   225,   226,     0,     0,     0 } ,//10
00197 {    0,     0,   227,   228,   229,   230,   231,   232,   233,   234,
00198    235,   236,   237,   238,   239,   240,   241,   242,   243,   244,
00199    245,   246,   247,   248,   249,   250,   251,   252,   253,   254,
00200    255,   256,   257,   258,   259,   260,   261,   262,     0,     0 } ,
00201 {    0,     0,   263,   264,   265,   266,   267,   268,   269,   270,
00202    271,   272,   273,   274,   275,   276,   277,   278,   279,   280,
00203    281,   282,   283,   284,   285,   286,   287,   288,   289,   290,
00204    291,   292,   293,   294,   295,   296,   297,   298,     0,     0 } ,
00205 {    0,     0,   299,   300,   301,   302,   303,   304,   305,   306,
00206    307,   308,   309,   310,   311,   312,   313,   314,   315,   316,
00207    317,   318,   319,   320,   321,   322,   323,   324,   325,   326,
00208    327,   328,   329,   330,   331,   332,   333,   334,     0,     0 } ,
00209 {    0,   335,   336,   337,   338,   339,   340,   341,   342,   343,
00210    344,   345,   346,   347,   348,   349,   350,   351,     0,     0,
00211      0,     0,   352,   353,   354,   355,   356,   357,   358,   359,
00212    360,   361,   362,   363,   364,   365,   366,   367,   368,     0 } ,
00213 {    0,   369,   370,   371,   372,   373,   374,   375,   376,   377,
00214    378,   379,   380,   381,   382,   383,     0,     0,     0,     0,
00215      0,     0,     0,     0,   384,   385,   386,   387,   388,   389,
00216    390,   391,   392,   393,   394,   395,   396,   397,   398,     0 } ,//15
00217 {  399,   400,   401,   402,   403,   404,   405,   406,   407,   408,
00218    409,   410,   411,   412,   413,     0,     0,     0,     0,     0,
00219      0,     0,     0,     0,     0,   414,   415,   416,   417,   418,
00220    419,   420,   421,   422,   423,   424,   425,   426,   427,   428 } ,
00221 {  429,   430,   431,   432,   433,   434,   435,   436,   437,   438,
00222    439,   440,   441,   442,     0,     0,     0,     0,     0,     0,
00223      0,     0,     0,     0,     0,     0,   443,   444,   445,   446,
00224    447,   448,   449,   450,   451,   452,   453,   454,   455,   456 } ,
00225 {  457,   458,   459,   460,   461,   462,   463,   464,   465,   466,
00226    467,   468,   469,   470,     0,     0,     0,     0,     0,     0,
00227      0,     0,     0,     0,     0,     0,   471,   472,   473,   474,
00228    475,   476,   477,   478,   479,   480,   481,   482,   483,   484 } ,
00229 {  485,   486,   487,   488,   489,   490,   491,   492,   493,   494,
00230    495,   496,   497,     0,     0,     0,     0,     0,     0,     0,
00231      0,     0,     0,     0,     0,     0,     0,   498,   499,   500,
00232    501,   502,   503,   504,   505,   506,   507,   508,   509,   510 } ,
00233 {  511,   512,   513,   514,   515,   516,   517,   518,   519,   520,
00234    521,   522,   523,     0,     0,     0,     0,     0,     0,     0,
00235      0,     0,     0,     0,     0,     0,     0,   524,   525,   526,
00236    527,   528,   529,   530,   531,   532,   533,   534,   535,   536 } ,
00237 {  537,   538,   539,   540,   541,   542,   543,   544,   545,   546,
00238    547,   548,   549,     0,     0,     0,     0,     0,     0,     0,
00239      0,     0,     0,     0,     0,     0,     0,   550,   551,   552,
00240    553,   554,   555,   556,   557,   558,   559,   560,   561,   562 } ,
00241 {  563,   564,   565,   566,   567,   568,   569,   570,   571,   572,
00242    573,   574,   575,     0,     0,     0,     0,     0,     0,     0,
00243      0,     0,     0,     0,     0,     0,     0,   576,   577,   578,
00244    579,   580,   581,   582,   583,   584,   585,   586,   587,   588 } ,
00245 {  589,   590,   591,   592,   593,   594,   595,   596,   597,   598,
00246    599,   600,   601,   602,     0,     0,     0,     0,     0,     0,
00247      0,     0,     0,     0,     0,     0,   603,   604,   605,   606,
00248    607,   608,   609,   610,   611,   612,   613,   614,   615,   616 } ,
00249 {  617,   618,   619,   620,   621,   622,   623,   624,   625,   626,
00250    627,   628,   629,   630,     0,     0,     0,     0,     0,     0,
00251      0,     0,     0,     0,     0,     0,   631,   632,   633,   634,
00252    635,   636,   637,   638,   639,   640,   641,   642,   643,   644 } ,
00253 {  645,   646,   647,   648,   649,   650,   651,   652,   653,   654,
00254    655,   656,   657,   658,   659,     0,     0,     0,     0,     0,
00255      0,     0,     0,     0,     0,   660,   661,   662,   663,   664,
00256    665,   666,   667,   668,   669,   670,   671,   672,   673,   674 } ,
00257 {    0,   675,   676,   677,   678,   679,   680,   681,   682,   683,
00258    684,   685,   686,   687,   688,   689,     0,     0,     0,     0,
00259      0,     0,     0,     0,   690,   691,   692,   693,   694,   695,
00260    696,   697,   698,   699,   700,   701,   702,   703,   704,     0 } ,
00261 {    0,   705,   706,   707,   708,   709,   710,   711,   712,   713,
00262    714,   715,   716,   717,   718,   719,   720,   721,     0,     0,
00263      0,     0,   722,   723,   724,   725,   726,   727,   728,   729,
00264    730,   731,   732,   733,   734,   735,   736,   737,   738,     0 } ,
00265 {    0,     0,   739,   740,   741,   742,   743,   744,   745,   746,
00266    747,   748,   749,   750,   751,   752,   753,   754,   755,   756,
00267    757,   758,   759,   760,   761,   762,   763,   764,   765,   766,
00268    767,   768,   769,   770,   771,   772,   773,   774,     0,     0 } ,
00269 {    0,     0,   775,   776,   777,   778,   779,   780,   781,   782,
00270    783,   784,   785,   786,   787,   788,   789,   790,   791,   792,
00271    793,   794,   795,   796,   797,   798,   799,   800,   801,   802,
00272    803,   804,   805,   806,   807,   808,   809,   810,     0,     0 } ,
00273 {    0,     0,   811,   812,   813,   814,   815,   816,   817,   818,
00274    819,   820,   821,   822,   823,   824,   825,   826,   827,   828,
00275    829,   830,   831,   832,   833,   834,   835,   836,   837,   838,
00276    839,   840,   841,   842,   843,   844,   845,   846,     0,     0 } ,
00277 {    0,     0,     0,   847,   848,   849,   850,   851,   852,   853,
00278    854,   855,   856,   857,   858,   859,   860,   861,   862,   863,
00279    864,   865,   866,   867,   868,   869,   870,   871,   872,   873,
00280    874,   875,   876,   877,   878,   879,   880,     0,     0,     0 } ,
00281 {    0,     0,     0,     0,   881,   882,   883,   884,   885,   886,
00282    887,   888,   889,   890,   891,   892,   893,   894,   895,   896,
00283    897,   898,   899,   900,   901,   902,   903,   904,   905,   906,
00284    907,   908,   909,   910,   911,   912,     0,     0,     0,     0 } ,
00285 {    0,     0,     0,     0,   913,   914,   915,   916,   917,   918,
00286    919,   920,   921,   922,   923,   924,   925,   926,   927,   928,
00287    929,   930,   931,   932,   933,   934,   935,   936,   937,   938,
00288    939,   940,   941,   942,   943,   944,     0,     0,     0,     0 } ,
00289 {    0,     0,     0,     0,     0,     0,   945,   946,   947,   948,
00290    949,   950,   951,   952,   953,   954,   955,   956,   957,   958,
00291    959,   960,   961,   962,   963,   964,   965,   966,   967,   968,
00292    969,   970,   971,   972,     0,     0,     0,     0,     0,     0 } ,
00293 {    0,     0,     0,     0,     0,     0,     0,   973,   974,   975,
00294    976,   977,   978,   979,   980,   981,   982,   983,   984,   985,
00295    986,   987,   988,   989,   990,   991,   992,   993,   994,   995,
00296    996,   997,   998,     0,     0,     0,     0,     0,     0,     0 } ,
00297 {    0,     0,     0,     0,     0,     0,     0,     0,   999,  1000,
00298   1001,  1002,  1003,  1004,  1005,  1006,  1007,  1008,  1009,  1010,
00299   1011,  1012,  1013,  1014,  1015,  1016,  1017,  1018,  1019,  1020,
00300   1021,  1022,     0,     0,     0,     0,     0,     0,     0,     0 } ,
00301 {    0,     0,     0,     0,     0,     0,     0,     0,     0,  1023,
00302   1024,  1025,  1026,  1027,  1028,  1029,  1030,  1031,  1032,  1033,
00303   1034,  1035,  1036,  1037,  1038,  1039,  1040,  1041,  1042,  1043,
00304   1044,     0,     0,     0,     0,     0,     0,     0,     0,     0 } ,
00305 {    0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
00306      0,     0,  1045,  1046,  1047,  1048,  1049,  1050,  1051,  1052,
00307   1053,  1054,  1055,  1056,  1057,  1058,  1059,  1060,     0,     0,
00308      0,     0,     0,     0,     0,     0,     0,     0,     0,     0 } ,
00309 {    0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
00310      0,     0,     0,     0,  1061,  1062,  1063,  1064,  1065,  1066,
00311   1067,  1068,  1069,  1070,  1071,  1072,     0,     0,     0,     0,
00312      0,     0,     0,     0,     0,     0,     0,     0,     0,     0 } ,
00313 {    0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
00314      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
00315      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
00316      0,     0,     0,     0,     0,     0,     0,     0,     0,     0 } 
00317 };
00318 
00319 const unsigned short ESDetId::hxy2[ kXMAX ][ kYMAX ] = {
00320 {    0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
00321      0,     0,     0,     0,     0,     1,     2,     3,     4,     5,
00322      6,     7,     8,     9,    10,     0,     0,     0,     0,     0,
00323      0,     0,     0,     0,     0,     0,     0,     0,     0,     0 } ,
00324 {    0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
00325      0,     0,     0,    11,    12,    13,    14,    15,    16,    17,
00326     18,    19,    20,    21,    22,    23,    24,     0,     0,     0,
00327      0,     0,     0,     0,     0,     0,     0,     0,     0,     0 } ,
00328 {    0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
00329     25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
00330     35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
00331      0,     0,     0,     0,     0,     0,     0,     0,     0,     0 } ,
00332 {    0,     0,     0,     0,     0,     0,     0,     0,     0,    45,
00333     46,    47,    48,    49,    50,    51,    52,    53,    54,    55,
00334     56,    57,    58,    59,    60,    61,    62,    63,    64,    65,
00335     66,     0,     0,     0,     0,     0,     0,     0,     0,     0 } ,
00336 {    0,     0,     0,     0,     0,     0,     0,    67,    68,    69,
00337     70,    71,    72,    73,    74,    75,    76,    77,    78,    79,
00338     80,    81,    82,    83,    84,    85,    86,    87,    88,    89,
00339     90,    91,    92,     0,     0,     0,     0,     0,     0,     0 } ,
00340 {    0,     0,     0,     0,     0,     0,     0,    93,    94,    95,
00341     96,    97,    98,    99,   100,   101,   102,   103,   104,   105,
00342    106,   107,   108,   109,   110,   111,   112,   113,   114,   115,
00343    116,   117,   118,     0,     0,     0,     0,     0,     0,     0 } ,
00344 {    0,     0,     0,     0,     0,     0,   119,   120,   121,   122,
00345    123,   124,   125,   126,   127,   128,   129,   130,   131,   132,
00346    133,   134,   135,   136,   137,   138,   139,   140,   141,   142,
00347    143,   144,   145,   146,     0,     0,     0,     0,     0,     0 } ,
00348 {    0,     0,     0,     0,     0,   147,   148,   149,   150,   151,
00349    152,   153,   154,   155,   156,   157,   158,   159,   160,   161,
00350    162,   163,   164,   165,   166,   167,   168,   169,   170,   171,
00351    172,   173,   174,   175,   176,     0,     0,     0,     0,     0 } ,
00352 {    0,     0,     0,     0,   177,   178,   179,   180,   181,   182,
00353    183,   184,   185,   186,   187,   188,   189,   190,   191,   192,
00354    193,   194,   195,   196,   197,   198,   199,   200,   201,   202,
00355    203,   204,   205,   206,   207,   208,     0,     0,     0,     0 } ,
00356 {    0,     0,     0,   209,   210,   211,   212,   213,   214,   215,
00357    216,   217,   218,   219,   220,   221,   222,   223,   224,   225,
00358    226,   227,   228,   229,   230,   231,   232,   233,   234,   235,
00359    236,   237,   238,   239,   240,   241,   242,     0,     0,     0 } ,
00360 {    0,     0,     0,   243,   244,   245,   246,   247,   248,   249,
00361    250,   251,   252,   253,   254,   255,   256,   257,   258,   259,
00362    260,   261,   262,   263,   264,   265,   266,   267,   268,   269,
00363    270,   271,   272,   273,   274,   275,   276,     0,     0,     0 } ,
00364 {    0,     0,     0,   277,   278,   279,   280,   281,   282,   283,
00365    284,   285,   286,   287,   288,   289,   290,   291,   292,   293,
00366    294,   295,   296,   297,   298,   299,   300,   301,   302,   303,
00367    304,   305,   306,   307,   308,   309,   310,     0,     0,     0 } ,
00368 {    0,     0,   311,   312,   313,   314,   315,   316,   317,   318,
00369    319,   320,   321,   322,   323,   324,   325,   326,   327,   328,
00370    329,   330,   331,   332,   333,   334,   335,   336,   337,   338,
00371    339,   340,   341,   342,   343,   344,   345,   346,     0,     0 } ,
00372 {    0,     0,   347,   348,   349,   350,   351,   352,   353,   354,
00373    355,   356,   357,   358,   359,   360,   361,   362,     0,     0,
00374      0,     0,   363,   364,   365,   366,   367,   368,   369,   370,
00375    371,   372,   373,   374,   375,   376,   377,   378,     0,     0 } ,
00376 {    0,   379,   380,   381,   382,   383,   384,   385,   386,   387,
00377    388,   389,   390,   391,   392,   393,     0,     0,     0,     0,
00378      0,     0,     0,     0,   394,   395,   396,   397,   398,   399,
00379    400,   401,   402,   403,   404,   405,   406,   407,   408,     0 } ,
00380 {    0,   409,   410,   411,   412,   413,   414,   415,   416,   417,
00381    418,   419,   420,   421,   422,     0,     0,     0,     0,     0,
00382      0,     0,     0,     0,     0,   423,   424,   425,   426,   427,
00383    428,   429,   430,   431,   432,   433,   434,   435,   436,     0 } ,
00384 {    0,   437,   438,   439,   440,   441,   442,   443,   444,   445,
00385    446,   447,   448,   449,     0,     0,     0,     0,     0,     0,
00386      0,     0,     0,     0,     0,     0,   450,   451,   452,   453,
00387    454,   455,   456,   457,   458,   459,   460,   461,   462,     0 } ,
00388 {    0,   463,   464,   465,   466,   467,   468,   469,   470,   471,
00389    472,   473,   474,   475,     0,     0,     0,     0,     0,     0,
00390      0,     0,     0,     0,     0,     0,   476,   477,   478,   479,
00391    480,   481,   482,   483,   484,   485,   486,   487,   488,     0 } ,
00392 {    0,   489,   490,   491,   492,   493,   494,   495,   496,   497,
00393    498,   499,   500,     0,     0,     0,     0,     0,     0,     0,
00394      0,     0,     0,     0,     0,     0,     0,   501,   502,   503,
00395    504,   505,   506,   507,   508,   509,   510,   511,   512,     0 } ,
00396 {    0,   513,   514,   515,   516,   517,   518,   519,   520,   521,
00397    522,   523,   524,     0,     0,     0,     0,     0,     0,     0,
00398      0,     0,     0,     0,     0,     0,     0,   525,   526,   527,
00399    528,   529,   530,   531,   532,   533,   534,   535,   536,     0 } ,
00400 {    0,   537,   538,   539,   540,   541,   542,   543,   544,   545,
00401    546,   547,   548,     0,     0,     0,     0,     0,     0,     0,
00402      0,     0,     0,     0,     0,     0,     0,   549,   550,   551,
00403    552,   553,   554,   555,   556,   557,   558,   559,   560,     0 } ,
00404 {    0,   561,   562,   563,   564,   565,   566,   567,   568,   569,
00405    570,   571,   572,     0,     0,     0,     0,     0,     0,     0,
00406      0,     0,     0,     0,     0,     0,     0,   573,   574,   575,
00407    576,   577,   578,   579,   580,   581,   582,   583,   584,     0 } ,
00408 {    0,   585,   586,   587,   588,   589,   590,   591,   592,   593,
00409    594,   595,   596,   597,     0,     0,     0,     0,     0,     0,
00410      0,     0,     0,     0,     0,     0,   598,   599,   600,   601,
00411    602,   603,   604,   605,   606,   607,   608,   609,   610,     0 } ,
00412 {    0,   611,   612,   613,   614,   615,   616,   617,   618,   619,
00413    620,   621,   622,   623,     0,     0,     0,     0,     0,     0,
00414      0,     0,     0,     0,     0,     0,   624,   625,   626,   627,
00415    628,   629,   630,   631,   632,   633,   634,   635,   636,     0 } ,
00416 {    0,   637,   638,   639,   640,   641,   642,   643,   644,   645,
00417    646,   647,   648,   649,   650,     0,     0,     0,     0,     0,
00418      0,     0,     0,     0,     0,   651,   652,   653,   654,   655,
00419    656,   657,   658,   659,   660,   661,   662,   663,   664,     0 } ,
00420 {    0,   665,   666,   667,   668,   669,   670,   671,   672,   673,
00421    674,   675,   676,   677,   678,   679,     0,     0,     0,     0,
00422      0,     0,     0,     0,   680,   681,   682,   683,   684,   685,
00423    686,   687,   688,   689,   690,   691,   692,   693,   694,     0 } ,
00424 {    0,     0,   695,   696,   697,   698,   699,   700,   701,   702,
00425    703,   704,   705,   706,   707,   708,   709,   710,     0,     0,
00426      0,     0,   711,   712,   713,   714,   715,   716,   717,   718,
00427    719,   720,   721,   722,   723,   724,   725,   726,     0,     0 } ,
00428 {    0,     0,   727,   728,   729,   730,   731,   732,   733,   734,
00429    735,   736,   737,   738,   739,   740,   741,   742,   743,   744,
00430    745,   746,   747,   748,   749,   750,   751,   752,   753,   754,
00431    755,   756,   757,   758,   759,   760,   761,   762,     0,     0 } ,
00432 {    0,     0,     0,   763,   764,   765,   766,   767,   768,   769,
00433    770,   771,   772,   773,   774,   775,   776,   777,   778,   779,
00434    780,   781,   782,   783,   784,   785,   786,   787,   788,   789,
00435    790,   791,   792,   793,   794,   795,   796,     0,     0,     0 } ,
00436 {    0,     0,     0,   797,   798,   799,   800,   801,   802,   803,
00437    804,   805,   806,   807,   808,   809,   810,   811,   812,   813,
00438    814,   815,   816,   817,   818,   819,   820,   821,   822,   823,
00439    824,   825,   826,   827,   828,   829,   830,     0,     0,     0 } ,
00440 {    0,     0,     0,   831,   832,   833,   834,   835,   836,   837,
00441    838,   839,   840,   841,   842,   843,   844,   845,   846,   847,
00442    848,   849,   850,   851,   852,   853,   854,   855,   856,   857,
00443    858,   859,   860,   861,   862,   863,   864,     0,     0,     0 } ,
00444 {    0,     0,     0,     0,   865,   866,   867,   868,   869,   870,
00445    871,   872,   873,   874,   875,   876,   877,   878,   879,   880,
00446    881,   882,   883,   884,   885,   886,   887,   888,   889,   890,
00447    891,   892,   893,   894,   895,   896,     0,     0,     0,     0 } ,
00448 {    0,     0,     0,     0,     0,   897,   898,   899,   900,   901,
00449    902,   903,   904,   905,   906,   907,   908,   909,   910,   911,
00450    912,   913,   914,   915,   916,   917,   918,   919,   920,   921,
00451    922,   923,   924,   925,   926,     0,     0,     0,     0,     0 } ,
00452 {    0,     0,     0,     0,     0,     0,   927,   928,   929,   930,
00453    931,   932,   933,   934,   935,   936,   937,   938,   939,   940,
00454    941,   942,   943,   944,   945,   946,   947,   948,   949,   950,
00455    951,   952,   953,   954,     0,     0,     0,     0,     0,     0 } ,
00456 {    0,     0,     0,     0,     0,     0,     0,   955,   956,   957,
00457    958,   959,   960,   961,   962,   963,   964,   965,   966,   967,
00458    968,   969,   970,   971,   972,   973,   974,   975,   976,   977,
00459    978,   979,   980,     0,     0,     0,     0,     0,     0,     0 } ,
00460 {    0,     0,     0,     0,     0,     0,     0,   981,   982,   983,
00461    984,   985,   986,   987,   988,   989,   990,   991,   992,   993,
00462    994,   995,   996,   997,   998,   999,  1000,  1001,  1002,  1003,
00463   1004,  1005,  1006,     0,     0,     0,     0,     0,     0,     0 } ,
00464 {    0,     0,     0,     0,     0,     0,     0,     0,     0,  1007,
00465   1008,  1009,  1010,  1011,  1012,  1013,  1014,  1015,  1016,  1017,
00466   1018,  1019,  1020,  1021,  1022,  1023,  1024,  1025,  1026,  1027,
00467   1028,     0,     0,     0,     0,     0,     0,     0,     0,     0 } ,
00468 {    0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
00469   1029,  1030,  1031,  1032,  1033,  1034,  1035,  1036,  1037,  1038,
00470   1039,  1040,  1041,  1042,  1043,  1044,  1045,  1046,  1047,  1048,
00471      0,     0,     0,     0,     0,     0,     0,     0,     0,     0 } ,
00472 {    0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
00473      0,     0,     0,  1049,  1050,  1051,  1052,  1053,  1054,  1055,
00474   1056,  1057,  1058,  1059,  1060,  1061,  1062,     0,     0,     0,
00475      0,     0,     0,     0,     0,     0,     0,     0,     0,     0 } ,
00476 {    0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
00477      0,     0,     0,     0,     0,  1063,  1064,  1065,  1066,  1067,
00478   1068,  1069,  1070,  1071,  1072,     0,     0,     0,     0,     0,
00479      0,     0,     0,     0,     0,     0,     0,     0,     0,     0 } 
00480 };
00481 
00482 const unsigned short ESDetId::hx1[ kXYMAX ] = {
00483     2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
00484     2,    2,    3,    3,    3,    3,    3,    3,    3,    3,
00485     3,    3,    3,    3,    3,    3,    3,    3,    4,    4,
00486     4,    4,    4,    4,    4,    4,    4,    4,    4,    4,
00487     4,    4,    4,    4,    4,    4,    4,    4,    4,    4,
00488     5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
00489     5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
00490     5,    5,    5,    5,    6,    6,    6,    6,    6,    6,
00491     6,    6,    6,    6,    6,    6,    6,    6,    6,    6,
00492     6,    6,    6,    6,    6,    6,    6,    6,    6,    6,
00493     7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
00494     7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
00495     7,    7,    7,    7,    7,    7,    7,    7,    8,    8,
00496     8,    8,    8,    8,    8,    8,    8,    8,    8,    8,
00497     8,    8,    8,    8,    8,    8,    8,    8,    8,    8,
00498     8,    8,    8,    8,    8,    8,    8,    8,    8,    8,
00499     9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
00500     9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
00501     9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
00502     9,    9,   10,   10,   10,   10,   10,   10,   10,   10,
00503    10,   10,   10,   10,   10,   10,   10,   10,   10,   10,
00504    10,   10,   10,   10,   10,   10,   10,   10,   10,   10,
00505    10,   10,   10,   10,   10,   10,   11,   11,   11,   11,
00506    11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
00507    11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
00508    11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
00509    11,   11,   12,   12,   12,   12,   12,   12,   12,   12,
00510    12,   12,   12,   12,   12,   12,   12,   12,   12,   12,
00511    12,   12,   12,   12,   12,   12,   12,   12,   12,   12,
00512    12,   12,   12,   12,   12,   12,   12,   12,   13,   13,
00513    13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
00514    13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
00515    13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
00516    13,   13,   13,   13,   14,   14,   14,   14,   14,   14,
00517    14,   14,   14,   14,   14,   14,   14,   14,   14,   14,
00518    14,   14,   14,   14,   14,   14,   14,   14,   14,   14,
00519    14,   14,   14,   14,   14,   14,   14,   14,   15,   15,
00520    15,   15,   15,   15,   15,   15,   15,   15,   15,   15,
00521    15,   15,   15,   15,   15,   15,   15,   15,   15,   15,
00522    15,   15,   15,   15,   15,   15,   15,   15,   16,   16,
00523    16,   16,   16,   16,   16,   16,   16,   16,   16,   16,
00524    16,   16,   16,   16,   16,   16,   16,   16,   16,   16,
00525    16,   16,   16,   16,   16,   16,   16,   16,   17,   17,
00526    17,   17,   17,   17,   17,   17,   17,   17,   17,   17,
00527    17,   17,   17,   17,   17,   17,   17,   17,   17,   17,
00528    17,   17,   17,   17,   17,   17,   18,   18,   18,   18,
00529    18,   18,   18,   18,   18,   18,   18,   18,   18,   18,
00530    18,   18,   18,   18,   18,   18,   18,   18,   18,   18,
00531    18,   18,   18,   18,   19,   19,   19,   19,   19,   19,
00532    19,   19,   19,   19,   19,   19,   19,   19,   19,   19,
00533    19,   19,   19,   19,   19,   19,   19,   19,   19,   19,
00534    20,   20,   20,   20,   20,   20,   20,   20,   20,   20,
00535    20,   20,   20,   20,   20,   20,   20,   20,   20,   20,
00536    20,   20,   20,   20,   20,   20,   21,   21,   21,   21,
00537    21,   21,   21,   21,   21,   21,   21,   21,   21,   21,
00538    21,   21,   21,   21,   21,   21,   21,   21,   21,   21,
00539    21,   21,   22,   22,   22,   22,   22,   22,   22,   22,
00540    22,   22,   22,   22,   22,   22,   22,   22,   22,   22,
00541    22,   22,   22,   22,   22,   22,   22,   22,   23,   23,
00542    23,   23,   23,   23,   23,   23,   23,   23,   23,   23,
00543    23,   23,   23,   23,   23,   23,   23,   23,   23,   23,
00544    23,   23,   23,   23,   23,   23,   24,   24,   24,   24,
00545    24,   24,   24,   24,   24,   24,   24,   24,   24,   24,
00546    24,   24,   24,   24,   24,   24,   24,   24,   24,   24,
00547    24,   24,   24,   24,   25,   25,   25,   25,   25,   25,
00548    25,   25,   25,   25,   25,   25,   25,   25,   25,   25,
00549    25,   25,   25,   25,   25,   25,   25,   25,   25,   25,
00550    25,   25,   25,   25,   26,   26,   26,   26,   26,   26,
00551    26,   26,   26,   26,   26,   26,   26,   26,   26,   26,
00552    26,   26,   26,   26,   26,   26,   26,   26,   26,   26,
00553    26,   26,   26,   26,   27,   27,   27,   27,   27,   27,
00554    27,   27,   27,   27,   27,   27,   27,   27,   27,   27,
00555    27,   27,   27,   27,   27,   27,   27,   27,   27,   27,
00556    27,   27,   27,   27,   27,   27,   27,   27,   28,   28,
00557    28,   28,   28,   28,   28,   28,   28,   28,   28,   28,
00558    28,   28,   28,   28,   28,   28,   28,   28,   28,   28,
00559    28,   28,   28,   28,   28,   28,   28,   28,   28,   28,
00560    28,   28,   28,   28,   29,   29,   29,   29,   29,   29,
00561    29,   29,   29,   29,   29,   29,   29,   29,   29,   29,
00562    29,   29,   29,   29,   29,   29,   29,   29,   29,   29,
00563    29,   29,   29,   29,   29,   29,   29,   29,   29,   29,
00564    30,   30,   30,   30,   30,   30,   30,   30,   30,   30,
00565    30,   30,   30,   30,   30,   30,   30,   30,   30,   30,
00566    30,   30,   30,   30,   30,   30,   30,   30,   30,   30,
00567    30,   30,   30,   30,   30,   30,   31,   31,   31,   31,
00568    31,   31,   31,   31,   31,   31,   31,   31,   31,   31,
00569    31,   31,   31,   31,   31,   31,   31,   31,   31,   31,
00570    31,   31,   31,   31,   31,   31,   31,   31,   31,   31,
00571    32,   32,   32,   32,   32,   32,   32,   32,   32,   32,
00572    32,   32,   32,   32,   32,   32,   32,   32,   32,   32,
00573    32,   32,   32,   32,   32,   32,   32,   32,   32,   32,
00574    32,   32,   33,   33,   33,   33,   33,   33,   33,   33,
00575    33,   33,   33,   33,   33,   33,   33,   33,   33,   33,
00576    33,   33,   33,   33,   33,   33,   33,   33,   33,   33,
00577    33,   33,   33,   33,   34,   34,   34,   34,   34,   34,
00578    34,   34,   34,   34,   34,   34,   34,   34,   34,   34,
00579    34,   34,   34,   34,   34,   34,   34,   34,   34,   34,
00580    34,   34,   35,   35,   35,   35,   35,   35,   35,   35,
00581    35,   35,   35,   35,   35,   35,   35,   35,   35,   35,
00582    35,   35,   35,   35,   35,   35,   35,   35,   36,   36,
00583    36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
00584    36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
00585    36,   36,   37,   37,   37,   37,   37,   37,   37,   37,
00586    37,   37,   37,   37,   37,   37,   37,   37,   37,   37,
00587    37,   37,   37,   37,   38,   38,   38,   38,   38,   38,
00588    38,   38,   38,   38,   38,   38,   38,   38,   38,   38,
00589    39,   39,   39,   39,   39,   39,   39,   39,   39,   39,
00590    39,   39
00591 };
00592 
00593 const unsigned short ESDetId::hy1[ kXYMAX ] = {
00594    15,   16,   17,   18,   19,   20,   21,   22,   23,   24,
00595    25,   26,   13,   14,   15,   16,   17,   18,   19,   20,
00596    21,   22,   23,   24,   25,   26,   27,   28,   10,   11,
00597    12,   13,   14,   15,   16,   17,   18,   19,   20,   21,
00598    22,   23,   24,   25,   26,   27,   28,   29,   30,   31,
00599     9,   10,   11,   12,   13,   14,   15,   16,   17,   18,
00600    19,   20,   21,   22,   23,   24,   25,   26,   27,   28,
00601    29,   30,   31,   32,    8,    9,   10,   11,   12,   13,
00602    14,   15,   16,   17,   18,   19,   20,   21,   22,   23,
00603    24,   25,   26,   27,   28,   29,   30,   31,   32,   33,
00604     7,    8,    9,   10,   11,   12,   13,   14,   15,   16,
00605    17,   18,   19,   20,   21,   22,   23,   24,   25,   26,
00606    27,   28,   29,   30,   31,   32,   33,   34,    5,    6,
00607     7,    8,    9,   10,   11,   12,   13,   14,   15,   16,
00608    17,   18,   19,   20,   21,   22,   23,   24,   25,   26,
00609    27,   28,   29,   30,   31,   32,   33,   34,   35,   36,
00610     5,    6,    7,    8,    9,   10,   11,   12,   13,   14,
00611    15,   16,   17,   18,   19,   20,   21,   22,   23,   24,
00612    25,   26,   27,   28,   29,   30,   31,   32,   33,   34,
00613    35,   36,    4,    5,    6,    7,    8,    9,   10,   11,
00614    12,   13,   14,   15,   16,   17,   18,   19,   20,   21,
00615    22,   23,   24,   25,   26,   27,   28,   29,   30,   31,
00616    32,   33,   34,   35,   36,   37,    3,    4,    5,    6,
00617     7,    8,    9,   10,   11,   12,   13,   14,   15,   16,
00618    17,   18,   19,   20,   21,   22,   23,   24,   25,   26,
00619    27,   28,   29,   30,   31,   32,   33,   34,   35,   36,
00620    37,   38,    3,    4,    5,    6,    7,    8,    9,   10,
00621    11,   12,   13,   14,   15,   16,   17,   18,   19,   20,
00622    21,   22,   23,   24,   25,   26,   27,   28,   29,   30,
00623    31,   32,   33,   34,   35,   36,   37,   38,    3,    4,
00624     5,    6,    7,    8,    9,   10,   11,   12,   13,   14,
00625    15,   16,   17,   18,   19,   20,   21,   22,   23,   24,
00626    25,   26,   27,   28,   29,   30,   31,   32,   33,   34,
00627    35,   36,   37,   38,    2,    3,    4,    5,    6,    7,
00628     8,    9,   10,   11,   12,   13,   14,   15,   16,   17,
00629    18,   23,   24,   25,   26,   27,   28,   29,   30,   31,
00630    32,   33,   34,   35,   36,   37,   38,   39,    2,    3,
00631     4,    5,    6,    7,    8,    9,   10,   11,   12,   13,
00632    14,   15,   16,   25,   26,   27,   28,   29,   30,   31,
00633    32,   33,   34,   35,   36,   37,   38,   39,    1,    2,
00634     3,    4,    5,    6,    7,    8,    9,   10,   11,   12,
00635    13,   14,   15,   26,   27,   28,   29,   30,   31,   32,
00636    33,   34,   35,   36,   37,   38,   39,   40,    1,    2,
00637     3,    4,    5,    6,    7,    8,    9,   10,   11,   12,
00638    13,   14,   27,   28,   29,   30,   31,   32,   33,   34,
00639    35,   36,   37,   38,   39,   40,    1,    2,    3,    4,
00640     5,    6,    7,    8,    9,   10,   11,   12,   13,   14,
00641    27,   28,   29,   30,   31,   32,   33,   34,   35,   36,
00642    37,   38,   39,   40,    1,    2,    3,    4,    5,    6,
00643     7,    8,    9,   10,   11,   12,   13,   28,   29,   30,
00644    31,   32,   33,   34,   35,   36,   37,   38,   39,   40,
00645     1,    2,    3,    4,    5,    6,    7,    8,    9,   10,
00646    11,   12,   13,   28,   29,   30,   31,   32,   33,   34,
00647    35,   36,   37,   38,   39,   40,    1,    2,    3,    4,
00648     5,    6,    7,    8,    9,   10,   11,   12,   13,   28,
00649    29,   30,   31,   32,   33,   34,   35,   36,   37,   38,
00650    39,   40,    1,    2,    3,    4,    5,    6,    7,    8,
00651     9,   10,   11,   12,   13,   28,   29,   30,   31,   32,
00652    33,   34,   35,   36,   37,   38,   39,   40,    1,    2,
00653     3,    4,    5,    6,    7,    8,    9,   10,   11,   12,
00654    13,   14,   27,   28,   29,   30,   31,   32,   33,   34,
00655    35,   36,   37,   38,   39,   40,    1,    2,    3,    4,
00656     5,    6,    7,    8,    9,   10,   11,   12,   13,   14,
00657    27,   28,   29,   30,   31,   32,   33,   34,   35,   36,
00658    37,   38,   39,   40,    1,    2,    3,    4,    5,    6,
00659     7,    8,    9,   10,   11,   12,   13,   14,   15,   26,
00660    27,   28,   29,   30,   31,   32,   33,   34,   35,   36,
00661    37,   38,   39,   40,    2,    3,    4,    5,    6,    7,
00662     8,    9,   10,   11,   12,   13,   14,   15,   16,   25,
00663    26,   27,   28,   29,   30,   31,   32,   33,   34,   35,
00664    36,   37,   38,   39,    2,    3,    4,    5,    6,    7,
00665     8,    9,   10,   11,   12,   13,   14,   15,   16,   17,
00666    18,   23,   24,   25,   26,   27,   28,   29,   30,   31,
00667    32,   33,   34,   35,   36,   37,   38,   39,    3,    4,
00668     5,    6,    7,    8,    9,   10,   11,   12,   13,   14,
00669    15,   16,   17,   18,   19,   20,   21,   22,   23,   24,
00670    25,   26,   27,   28,   29,   30,   31,   32,   33,   34,
00671    35,   36,   37,   38,    3,    4,    5,    6,    7,    8,
00672     9,   10,   11,   12,   13,   14,   15,   16,   17,   18,
00673    19,   20,   21,   22,   23,   24,   25,   26,   27,   28,
00674    29,   30,   31,   32,   33,   34,   35,   36,   37,   38,
00675     3,    4,    5,    6,    7,    8,    9,   10,   11,   12,
00676    13,   14,   15,   16,   17,   18,   19,   20,   21,   22,
00677    23,   24,   25,   26,   27,   28,   29,   30,   31,   32,
00678    33,   34,   35,   36,   37,   38,    4,    5,    6,    7,
00679     8,    9,   10,   11,   12,   13,   14,   15,   16,   17,
00680    18,   19,   20,   21,   22,   23,   24,   25,   26,   27,
00681    28,   29,   30,   31,   32,   33,   34,   35,   36,   37,
00682     5,    6,    7,    8,    9,   10,   11,   12,   13,   14,
00683    15,   16,   17,   18,   19,   20,   21,   22,   23,   24,
00684    25,   26,   27,   28,   29,   30,   31,   32,   33,   34,
00685    35,   36,    5,    6,    7,    8,    9,   10,   11,   12,
00686    13,   14,   15,   16,   17,   18,   19,   20,   21,   22,
00687    23,   24,   25,   26,   27,   28,   29,   30,   31,   32,
00688    33,   34,   35,   36,    7,    8,    9,   10,   11,   12,
00689    13,   14,   15,   16,   17,   18,   19,   20,   21,   22,
00690    23,   24,   25,   26,   27,   28,   29,   30,   31,   32,
00691    33,   34,    8,    9,   10,   11,   12,   13,   14,   15,
00692    16,   17,   18,   19,   20,   21,   22,   23,   24,   25,
00693    26,   27,   28,   29,   30,   31,   32,   33,    9,   10,
00694    11,   12,   13,   14,   15,   16,   17,   18,   19,   20,
00695    21,   22,   23,   24,   25,   26,   27,   28,   29,   30,
00696    31,   32,   10,   11,   12,   13,   14,   15,   16,   17,
00697    18,   19,   20,   21,   22,   23,   24,   25,   26,   27,
00698    28,   29,   30,   31,   13,   14,   15,   16,   17,   18,
00699    19,   20,   21,   22,   23,   24,   25,   26,   27,   28,
00700    15,   16,   17,   18,   19,   20,   21,   22,   23,   24,
00701    25,   26
00702 };
00703 
00704 const unsigned short ESDetId::hx2[ kXYMAX ] = {
00705     1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00706     2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
00707     2,    2,    2,    2,    3,    3,    3,    3,    3,    3,
00708     3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
00709     3,    3,    3,    3,    4,    4,    4,    4,    4,    4,
00710     4,    4,    4,    4,    4,    4,    4,    4,    4,    4,
00711     4,    4,    4,    4,    4,    4,    5,    5,    5,    5,
00712     5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
00713     5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
00714     5,    5,    6,    6,    6,    6,    6,    6,    6,    6,
00715     6,    6,    6,    6,    6,    6,    6,    6,    6,    6,
00716     6,    6,    6,    6,    6,    6,    6,    6,    7,    7,
00717     7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
00718     7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
00719     7,    7,    7,    7,    7,    7,    8,    8,    8,    8,
00720     8,    8,    8,    8,    8,    8,    8,    8,    8,    8,
00721     8,    8,    8,    8,    8,    8,    8,    8,    8,    8,
00722     8,    8,    8,    8,    8,    8,    9,    9,    9,    9,
00723     9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
00724     9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
00725     9,    9,    9,    9,    9,    9,    9,    9,   10,   10,
00726    10,   10,   10,   10,   10,   10,   10,   10,   10,   10,
00727    10,   10,   10,   10,   10,   10,   10,   10,   10,   10,
00728    10,   10,   10,   10,   10,   10,   10,   10,   10,   10,
00729    10,   10,   11,   11,   11,   11,   11,   11,   11,   11,
00730    11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
00731    11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
00732    11,   11,   11,   11,   11,   11,   12,   12,   12,   12,
00733    12,   12,   12,   12,   12,   12,   12,   12,   12,   12,
00734    12,   12,   12,   12,   12,   12,   12,   12,   12,   12,
00735    12,   12,   12,   12,   12,   12,   12,   12,   12,   12,
00736    13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
00737    13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
00738    13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
00739    13,   13,   13,   13,   13,   13,   14,   14,   14,   14,
00740    14,   14,   14,   14,   14,   14,   14,   14,   14,   14,
00741    14,   14,   14,   14,   14,   14,   14,   14,   14,   14,
00742    14,   14,   14,   14,   14,   14,   14,   14,   15,   15,
00743    15,   15,   15,   15,   15,   15,   15,   15,   15,   15,
00744    15,   15,   15,   15,   15,   15,   15,   15,   15,   15,
00745    15,   15,   15,   15,   15,   15,   15,   15,   16,   16,
00746    16,   16,   16,   16,   16,   16,   16,   16,   16,   16,
00747    16,   16,   16,   16,   16,   16,   16,   16,   16,   16,
00748    16,   16,   16,   16,   16,   16,   17,   17,   17,   17,
00749    17,   17,   17,   17,   17,   17,   17,   17,   17,   17,
00750    17,   17,   17,   17,   17,   17,   17,   17,   17,   17,
00751    17,   17,   18,   18,   18,   18,   18,   18,   18,   18,
00752    18,   18,   18,   18,   18,   18,   18,   18,   18,   18,
00753    18,   18,   18,   18,   18,   18,   18,   18,   19,   19,
00754    19,   19,   19,   19,   19,   19,   19,   19,   19,   19,
00755    19,   19,   19,   19,   19,   19,   19,   19,   19,   19,
00756    19,   19,   20,   20,   20,   20,   20,   20,   20,   20,
00757    20,   20,   20,   20,   20,   20,   20,   20,   20,   20,
00758    20,   20,   20,   20,   20,   20,   21,   21,   21,   21,
00759    21,   21,   21,   21,   21,   21,   21,   21,   21,   21,
00760    21,   21,   21,   21,   21,   21,   21,   21,   21,   21,
00761    22,   22,   22,   22,   22,   22,   22,   22,   22,   22,
00762    22,   22,   22,   22,   22,   22,   22,   22,   22,   22,
00763    22,   22,   22,   22,   23,   23,   23,   23,   23,   23,
00764    23,   23,   23,   23,   23,   23,   23,   23,   23,   23,
00765    23,   23,   23,   23,   23,   23,   23,   23,   23,   23,
00766    24,   24,   24,   24,   24,   24,   24,   24,   24,   24,
00767    24,   24,   24,   24,   24,   24,   24,   24,   24,   24,
00768    24,   24,   24,   24,   24,   24,   25,   25,   25,   25,
00769    25,   25,   25,   25,   25,   25,   25,   25,   25,   25,
00770    25,   25,   25,   25,   25,   25,   25,   25,   25,   25,
00771    25,   25,   25,   25,   26,   26,   26,   26,   26,   26,
00772    26,   26,   26,   26,   26,   26,   26,   26,   26,   26,
00773    26,   26,   26,   26,   26,   26,   26,   26,   26,   26,
00774    26,   26,   26,   26,   27,   27,   27,   27,   27,   27,
00775    27,   27,   27,   27,   27,   27,   27,   27,   27,   27,
00776    27,   27,   27,   27,   27,   27,   27,   27,   27,   27,
00777    27,   27,   27,   27,   27,   27,   28,   28,   28,   28,
00778    28,   28,   28,   28,   28,   28,   28,   28,   28,   28,
00779    28,   28,   28,   28,   28,   28,   28,   28,   28,   28,
00780    28,   28,   28,   28,   28,   28,   28,   28,   28,   28,
00781    28,   28,   29,   29,   29,   29,   29,   29,   29,   29,
00782    29,   29,   29,   29,   29,   29,   29,   29,   29,   29,
00783    29,   29,   29,   29,   29,   29,   29,   29,   29,   29,
00784    29,   29,   29,   29,   29,   29,   30,   30,   30,   30,
00785    30,   30,   30,   30,   30,   30,   30,   30,   30,   30,
00786    30,   30,   30,   30,   30,   30,   30,   30,   30,   30,
00787    30,   30,   30,   30,   30,   30,   30,   30,   30,   30,
00788    31,   31,   31,   31,   31,   31,   31,   31,   31,   31,
00789    31,   31,   31,   31,   31,   31,   31,   31,   31,   31,
00790    31,   31,   31,   31,   31,   31,   31,   31,   31,   31,
00791    31,   31,   31,   31,   32,   32,   32,   32,   32,   32,
00792    32,   32,   32,   32,   32,   32,   32,   32,   32,   32,
00793    32,   32,   32,   32,   32,   32,   32,   32,   32,   32,
00794    32,   32,   32,   32,   32,   32,   33,   33,   33,   33,
00795    33,   33,   33,   33,   33,   33,   33,   33,   33,   33,
00796    33,   33,   33,   33,   33,   33,   33,   33,   33,   33,
00797    33,   33,   33,   33,   33,   33,   34,   34,   34,   34,
00798    34,   34,   34,   34,   34,   34,   34,   34,   34,   34,
00799    34,   34,   34,   34,   34,   34,   34,   34,   34,   34,
00800    34,   34,   34,   34,   35,   35,   35,   35,   35,   35,
00801    35,   35,   35,   35,   35,   35,   35,   35,   35,   35,
00802    35,   35,   35,   35,   35,   35,   35,   35,   35,   35,
00803    36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
00804    36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
00805    36,   36,   36,   36,   36,   36,   37,   37,   37,   37,
00806    37,   37,   37,   37,   37,   37,   37,   37,   37,   37,
00807    37,   37,   37,   37,   37,   37,   37,   37,   38,   38,
00808    38,   38,   38,   38,   38,   38,   38,   38,   38,   38,
00809    38,   38,   38,   38,   38,   38,   38,   38,   39,   39,
00810    39,   39,   39,   39,   39,   39,   39,   39,   39,   39,
00811    39,   39,   40,   40,   40,   40,   40,   40,   40,   40,
00812    40,   40
00813 };
00814 
00815 const unsigned short ESDetId::hy2[ kXYMAX ] = {
00816    16,   17,   18,   19,   20,   21,   22,   23,   24,   25,
00817    14,   15,   16,   17,   18,   19,   20,   21,   22,   23,
00818    24,   25,   26,   27,   11,   12,   13,   14,   15,   16,
00819    17,   18,   19,   20,   21,   22,   23,   24,   25,   26,
00820    27,   28,   29,   30,   10,   11,   12,   13,   14,   15,
00821    16,   17,   18,   19,   20,   21,   22,   23,   24,   25,
00822    26,   27,   28,   29,   30,   31,    8,    9,   10,   11,
00823    12,   13,   14,   15,   16,   17,   18,   19,   20,   21,
00824    22,   23,   24,   25,   26,   27,   28,   29,   30,   31,
00825    32,   33,    8,    9,   10,   11,   12,   13,   14,   15,
00826    16,   17,   18,   19,   20,   21,   22,   23,   24,   25,
00827    26,   27,   28,   29,   30,   31,   32,   33,    7,    8,
00828     9,   10,   11,   12,   13,   14,   15,   16,   17,   18,
00829    19,   20,   21,   22,   23,   24,   25,   26,   27,   28,
00830    29,   30,   31,   32,   33,   34,    6,    7,    8,    9,
00831    10,   11,   12,   13,   14,   15,   16,   17,   18,   19,
00832    20,   21,   22,   23,   24,   25,   26,   27,   28,   29,
00833    30,   31,   32,   33,   34,   35,    5,    6,    7,    8,
00834     9,   10,   11,   12,   13,   14,   15,   16,   17,   18,
00835    19,   20,   21,   22,   23,   24,   25,   26,   27,   28,
00836    29,   30,   31,   32,   33,   34,   35,   36,    4,    5,
00837     6,    7,    8,    9,   10,   11,   12,   13,   14,   15,
00838    16,   17,   18,   19,   20,   21,   22,   23,   24,   25,
00839    26,   27,   28,   29,   30,   31,   32,   33,   34,   35,
00840    36,   37,    4,    5,    6,    7,    8,    9,   10,   11,
00841    12,   13,   14,   15,   16,   17,   18,   19,   20,   21,
00842    22,   23,   24,   25,   26,   27,   28,   29,   30,   31,
00843    32,   33,   34,   35,   36,   37,    4,    5,    6,    7,
00844     8,    9,   10,   11,   12,   13,   14,   15,   16,   17,
00845    18,   19,   20,   21,   22,   23,   24,   25,   26,   27,
00846    28,   29,   30,   31,   32,   33,   34,   35,   36,   37,
00847     3,    4,    5,    6,    7,    8,    9,   10,   11,   12,
00848    13,   14,   15,   16,   17,   18,   19,   20,   21,   22,
00849    23,   24,   25,   26,   27,   28,   29,   30,   31,   32,
00850    33,   34,   35,   36,   37,   38,    3,    4,    5,    6,
00851     7,    8,    9,   10,   11,   12,   13,   14,   15,   16,
00852    17,   18,   23,   24,   25,   26,   27,   28,   29,   30,
00853    31,   32,   33,   34,   35,   36,   37,   38,    2,    3,
00854     4,    5,    6,    7,    8,    9,   10,   11,   12,   13,
00855    14,   15,   16,   25,   26,   27,   28,   29,   30,   31,
00856    32,   33,   34,   35,   36,   37,   38,   39,    2,    3,
00857     4,    5,    6,    7,    8,    9,   10,   11,   12,   13,
00858    14,   15,   26,   27,   28,   29,   30,   31,   32,   33,
00859    34,   35,   36,   37,   38,   39,    2,    3,    4,    5,
00860     6,    7,    8,    9,   10,   11,   12,   13,   14,   27,
00861    28,   29,   30,   31,   32,   33,   34,   35,   36,   37,
00862    38,   39,    2,    3,    4,    5,    6,    7,    8,    9,
00863    10,   11,   12,   13,   14,   27,   28,   29,   30,   31,
00864    32,   33,   34,   35,   36,   37,   38,   39,    2,    3,
00865     4,    5,    6,    7,    8,    9,   10,   11,   12,   13,
00866    28,   29,   30,   31,   32,   33,   34,   35,   36,   37,
00867    38,   39,    2,    3,    4,    5,    6,    7,    8,    9,
00868    10,   11,   12,   13,   28,   29,   30,   31,   32,   33,
00869    34,   35,   36,   37,   38,   39,    2,    3,    4,    5,
00870     6,    7,    8,    9,   10,   11,   12,   13,   28,   29,
00871    30,   31,   32,   33,   34,   35,   36,   37,   38,   39,
00872     2,    3,    4,    5,    6,    7,    8,    9,   10,   11,
00873    12,   13,   28,   29,   30,   31,   32,   33,   34,   35,
00874    36,   37,   38,   39,    2,    3,    4,    5,    6,    7,
00875     8,    9,   10,   11,   12,   13,   14,   27,   28,   29,
00876    30,   31,   32,   33,   34,   35,   36,   37,   38,   39,
00877     2,    3,    4,    5,    6,    7,    8,    9,   10,   11,
00878    12,   13,   14,   27,   28,   29,   30,   31,   32,   33,
00879    34,   35,   36,   37,   38,   39,    2,    3,    4,    5,
00880     6,    7,    8,    9,   10,   11,   12,   13,   14,   15,
00881    26,   27,   28,   29,   30,   31,   32,   33,   34,   35,
00882    36,   37,   38,   39,    2,    3,    4,    5,    6,    7,
00883     8,    9,   10,   11,   12,   13,   14,   15,   16,   25,
00884    26,   27,   28,   29,   30,   31,   32,   33,   34,   35,
00885    36,   37,   38,   39,    3,    4,    5,    6,    7,    8,
00886     9,   10,   11,   12,   13,   14,   15,   16,   17,   18,
00887    23,   24,   25,   26,   27,   28,   29,   30,   31,   32,
00888    33,   34,   35,   36,   37,   38,    3,    4,    5,    6,
00889     7,    8,    9,   10,   11,   12,   13,   14,   15,   16,
00890    17,   18,   19,   20,   21,   22,   23,   24,   25,   26,
00891    27,   28,   29,   30,   31,   32,   33,   34,   35,   36,
00892    37,   38,    4,    5,    6,    7,    8,    9,   10,   11,
00893    12,   13,   14,   15,   16,   17,   18,   19,   20,   21,
00894    22,   23,   24,   25,   26,   27,   28,   29,   30,   31,
00895    32,   33,   34,   35,   36,   37,    4,    5,    6,    7,
00896     8,    9,   10,   11,   12,   13,   14,   15,   16,   17,
00897    18,   19,   20,   21,   22,   23,   24,   25,   26,   27,
00898    28,   29,   30,   31,   32,   33,   34,   35,   36,   37,
00899     4,    5,    6,    7,    8,    9,   10,   11,   12,   13,
00900    14,   15,   16,   17,   18,   19,   20,   21,   22,   23,
00901    24,   25,   26,   27,   28,   29,   30,   31,   32,   33,
00902    34,   35,   36,   37,    5,    6,    7,    8,    9,   10,
00903    11,   12,   13,   14,   15,   16,   17,   18,   19,   20,
00904    21,   22,   23,   24,   25,   26,   27,   28,   29,   30,
00905    31,   32,   33,   34,   35,   36,    6,    7,    8,    9,
00906    10,   11,   12,   13,   14,   15,   16,   17,   18,   19,
00907    20,   21,   22,   23,   24,   25,   26,   27,   28,   29,
00908    30,   31,   32,   33,   34,   35,    7,    8,    9,   10,
00909    11,   12,   13,   14,   15,   16,   17,   18,   19,   20,
00910    21,   22,   23,   24,   25,   26,   27,   28,   29,   30,
00911    31,   32,   33,   34,    8,    9,   10,   11,   12,   13,
00912    14,   15,   16,   17,   18,   19,   20,   21,   22,   23,
00913    24,   25,   26,   27,   28,   29,   30,   31,   32,   33,
00914     8,    9,   10,   11,   12,   13,   14,   15,   16,   17,
00915    18,   19,   20,   21,   22,   23,   24,   25,   26,   27,
00916    28,   29,   30,   31,   32,   33,   10,   11,   12,   13,
00917    14,   15,   16,   17,   18,   19,   20,   21,   22,   23,
00918    24,   25,   26,   27,   28,   29,   30,   31,   11,   12,
00919    13,   14,   15,   16,   17,   18,   19,   20,   21,   22,
00920    23,   24,   25,   26,   27,   28,   29,   30,   14,   15,
00921    16,   17,   18,   19,   20,   21,   22,   23,   24,   25,
00922    26,   27,   16,   17,   18,   19,   20,   21,   22,   23,
00923    24,   25
00924 };