6 #include "EEname2Index.h"
9 void EEindexRange(
int secID,
int &ix1,
int &ix2){
20 void EEindex2Name(
int ix,
char *name){
22 assert(ix<EEindexMax);
25 assert(sec>0 && sec<=12);
34 case 0: ckey=
'T';
break;
35 case 1: ckey=
'P';
break;
36 case 2: ckey=
'Q';
break;
37 case 3: ckey=
'R';
break;
40 case 6: ckey=
'U';
break;
43 case 9: ckey=
'V';
break;
45 printf(
"EEindex2Name() Logical Error1: invalid index=%d\n",ix);
58 assert(sub>=
'A' && sub<=
'E');
60 assert(eta>0 && eta <=12);
61 sprintf(name,
"%2.2d%c%c%2.2d",sec,ckey,sub,eta);
67 assert(strip>0 && strip<=288);
68 sprintf(name,
"%2.2d%c%3.3d",sec,ckey,strip);
72 printf(
"EEindex2Name() Logical Error2: invalid index=%d\n",ix);
82 int EEname2Index(
const char *name){
87 assert(sec>0 && sec<=12);
91 if(sec<10 && name[0]!=
'0') name--;
100 assert(sub>=
'A' && sub<=
'E');
101 int eta=atoi(name+4);
102 assert(eta>0 && eta <=12);
103 index+=(sub-
'A')*12 +eta;
105 case 'V': index+=300;
106 case 'U': {index+=400;
107 int strip=atoi(name+3);
108 assert(strip>0 && strip<=288);
113 printf(
"EEname2Index('%s') Logical Error3: invalid index=%d\n",name,index);
120 assert(index<EEindexMax);