Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
InttFelixMap.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file InttFelixMap.cc
1 #include "InttFelixMap.h"
2 
3 int INTT_Felix::FelixMap(int const& felix, int const& felix_channel, struct Ladder_s& ladder_struct)
4 {
5  switch(felix)
6  {
7  case 0:
8  switch(felix_channel)
9  {
10  case 0:
11  ladder_struct.barrel = 1;
12  ladder_struct.layer = 1;
13  ladder_struct.ladder = 1;
14  return EXIT_SUCCESS;
15  case 1:
16  ladder_struct.barrel = 0;
17  ladder_struct.layer = 1;
18  ladder_struct.ladder = 1;
19  return EXIT_SUCCESS;
20  case 2:
21  ladder_struct.barrel = 1;
22  ladder_struct.layer = 0;
23  ladder_struct.ladder = 1;
24  return EXIT_SUCCESS;
25  case 3:
26  ladder_struct.barrel = 1;
27  ladder_struct.layer = 0;
28  ladder_struct.ladder = 0;
29  return EXIT_SUCCESS;
30  case 4:
31  ladder_struct.barrel = 1;
32  ladder_struct.layer = 1;
33  ladder_struct.ladder = 0;
34  return EXIT_SUCCESS;
35  case 5:
36  ladder_struct.barrel = 0;
37  ladder_struct.layer = 0;
38  ladder_struct.ladder = 0;
39  return EXIT_SUCCESS;
40  case 6:
41  ladder_struct.barrel = 0;
42  ladder_struct.layer = 1;
43  ladder_struct.ladder = 0;
44  return EXIT_SUCCESS;
45  case 7:
46  ladder_struct.barrel = 1;
47  ladder_struct.layer = 1;
48  ladder_struct.ladder = 3;
49  return EXIT_SUCCESS;
50  case 8:
51  ladder_struct.barrel = 0;
52  ladder_struct.layer = 0;
53  ladder_struct.ladder = 2;
54  return EXIT_SUCCESS;
55  case 9:
56  ladder_struct.barrel = 0;
57  ladder_struct.layer = 0;
58  ladder_struct.ladder = 1;
59  return EXIT_SUCCESS;
60  case 10:
61  ladder_struct.barrel = 1;
62  ladder_struct.layer = 0;
63  ladder_struct.ladder = 2;
64  return EXIT_SUCCESS;
65  case 11:
66  ladder_struct.barrel = 1;
67  ladder_struct.layer = 1;
68  ladder_struct.ladder = 2;
69  return EXIT_SUCCESS;
70  case 12:
71  ladder_struct.barrel = 0;
72  ladder_struct.layer = 1;
73  ladder_struct.ladder = 2;
74  return EXIT_SUCCESS;
75  case 13:
76  ladder_struct.barrel = 1;
77  ladder_struct.layer = 0;
78  ladder_struct.ladder = 3;
79  return EXIT_SUCCESS;
80  default:
81  ladder_struct.barrel = -1;
82  ladder_struct.layer = -1;
83  ladder_struct.ladder = -1;
84  return EXIT_FAILURE;
85  }
86  case 1:
87  switch(felix_channel)
88  {
89  case 0:
90  ladder_struct.barrel = 1;
91  ladder_struct.layer = 1;
92  ladder_struct.ladder = 5;
93  return EXIT_SUCCESS;
94  case 1:
95  ladder_struct.barrel = 0;
96  ladder_struct.layer = 1;
97  ladder_struct.ladder = 4;
98  return EXIT_SUCCESS;
99  case 2:
100  ladder_struct.barrel = 0;
101  ladder_struct.layer = 1;
102  ladder_struct.ladder = 3;
103  return EXIT_SUCCESS;
104  case 3:
105  ladder_struct.barrel = 1;
106  ladder_struct.layer = 0;
107  ladder_struct.ladder = 4;
108  return EXIT_SUCCESS;
109  case 4:
110  ladder_struct.barrel = 1;
111  ladder_struct.layer = 1;
112  ladder_struct.ladder = 4;
113  return EXIT_SUCCESS;
114  case 5:
115  ladder_struct.barrel = 0;
116  ladder_struct.layer = 0;
117  ladder_struct.ladder = 3;
118  return EXIT_SUCCESS;
119  case 6:
120  ladder_struct.barrel = 1;
121  ladder_struct.layer = 0;
122  ladder_struct.ladder = 5;
123  return EXIT_SUCCESS;
124  case 7:
125  ladder_struct.barrel = 1;
126  ladder_struct.layer = 1;
127  ladder_struct.ladder = 7;
128  return EXIT_SUCCESS;
129  case 8:
130  ladder_struct.barrel = 0;
131  ladder_struct.layer = 0;
132  ladder_struct.ladder = 5;
133  return EXIT_SUCCESS;
134  case 9:
135  ladder_struct.barrel = 0;
136  ladder_struct.layer = 0;
137  ladder_struct.ladder = 4;
138  return EXIT_SUCCESS;
139  case 10:
140  ladder_struct.barrel = 1;
141  ladder_struct.layer = 0;
142  ladder_struct.ladder = 6;
143  return EXIT_SUCCESS;
144  case 11:
145  ladder_struct.barrel = 1;
146  ladder_struct.layer = 1;
147  ladder_struct.ladder = 6;
148  return EXIT_SUCCESS;
149  case 12:
150  ladder_struct.barrel = 0;
151  ladder_struct.layer = 1;
152  ladder_struct.ladder = 5;
153  return EXIT_SUCCESS;
154  case 13:
155  ladder_struct.barrel = 1;
156  ladder_struct.layer = 0;
157  ladder_struct.ladder = 7;
158  return EXIT_SUCCESS;
159  default:
160  ladder_struct.barrel = -1;
161  ladder_struct.layer = -1;
162  ladder_struct.ladder = -1;
163  return EXIT_FAILURE;
164  }
165  case 2:
166  switch(felix_channel)
167  {
168  case 0:
169  ladder_struct.barrel = 0;
170  ladder_struct.layer = 1;
171  ladder_struct.ladder = 6;
172  return EXIT_SUCCESS;
173  case 1:
174  ladder_struct.barrel = 0;
175  ladder_struct.layer = 0;
176  ladder_struct.ladder = 6;
177  return EXIT_SUCCESS;
178  case 2:
179  ladder_struct.barrel = 0;
180  ladder_struct.layer = 1;
181  ladder_struct.ladder = 7;
182  return EXIT_SUCCESS;
183  case 3:
184  ladder_struct.barrel = 1;
185  ladder_struct.layer = 1;
186  ladder_struct.ladder = 8;
187  return EXIT_SUCCESS;
188  case 4:
189  ladder_struct.barrel = 1;
190  ladder_struct.layer = 0;
191  ladder_struct.ladder = 8;
192  return EXIT_SUCCESS;
193  case 5:
194  ladder_struct.barrel = 1;
195  ladder_struct.layer = 1;
196  ladder_struct.ladder = 9;
197  return EXIT_SUCCESS;
198  case 6:
199  ladder_struct.barrel = 1;
200  ladder_struct.layer = 0;
201  ladder_struct.ladder = 9;
202  return EXIT_SUCCESS;
203  case 7:
204  ladder_struct.barrel = 0;
205  ladder_struct.layer = 0;
206  ladder_struct.ladder = 7;
207  return EXIT_SUCCESS;
208  case 8:
209  ladder_struct.barrel = 0;
210  ladder_struct.layer = 1;
211  ladder_struct.ladder = 8;
212  return EXIT_SUCCESS;
213  case 9:
214  ladder_struct.barrel = 0;
215  ladder_struct.layer = 0;
216  ladder_struct.ladder = 8;
217  return EXIT_SUCCESS;
218  case 10:
219  ladder_struct.barrel = 1;
220  ladder_struct.layer = 1;
221  ladder_struct.ladder = 10;
222  return EXIT_SUCCESS;
223  case 11:
224  ladder_struct.barrel = 1;
225  ladder_struct.layer = 0;
226  ladder_struct.ladder = 10;
227  return EXIT_SUCCESS;
228  case 12:
229  ladder_struct.barrel = 1;
230  ladder_struct.layer = 1;
231  ladder_struct.ladder = 11;
232  return EXIT_SUCCESS;
233  case 13:
234  ladder_struct.barrel = 1;
235  ladder_struct.layer = 0;
236  ladder_struct.ladder = 11;
237  return EXIT_SUCCESS;
238  default:
239  ladder_struct.barrel = -1;
240  ladder_struct.layer = -1;
241  ladder_struct.ladder = -1;
242  return EXIT_FAILURE;
243  }
244  case 3:
245  switch(felix_channel)
246  {
247  case 0:
248  ladder_struct.barrel = 0;
249  ladder_struct.layer = 1;
250  ladder_struct.ladder = 9;
251  return EXIT_SUCCESS;
252  case 1:
253  ladder_struct.barrel = 0;
254  ladder_struct.layer = 0;
255  ladder_struct.ladder = 9;
256  return EXIT_SUCCESS;
257  case 2:
258  ladder_struct.barrel = 0;
259  ladder_struct.layer = 1;
260  ladder_struct.ladder = 10;
261  return EXIT_SUCCESS;
262  case 3:
263  ladder_struct.barrel = 1;
264  ladder_struct.layer = 1;
265  ladder_struct.ladder = 12;
266  return EXIT_SUCCESS;
267  case 4:
268  ladder_struct.barrel = 1;
269  ladder_struct.layer = 0;
270  ladder_struct.ladder = 12;
271  return EXIT_SUCCESS;
272  case 5:
273  ladder_struct.barrel = 1;
274  ladder_struct.layer = 1;
275  ladder_struct.ladder = 13;
276  return EXIT_SUCCESS;
277  case 6:
278  ladder_struct.barrel = 1;
279  ladder_struct.layer = 0;
280  ladder_struct.ladder = 13;
281  return EXIT_SUCCESS;
282  case 7:
283  ladder_struct.barrel = 0;
284  ladder_struct.layer = 0;
285  ladder_struct.ladder = 10;
286  return EXIT_SUCCESS;
287  case 8:
288  ladder_struct.barrel = 0;
289  ladder_struct.layer = 1;
290  ladder_struct.ladder = 11;
291  return EXIT_SUCCESS;
292  case 9:
293  ladder_struct.barrel = 0;
294  ladder_struct.layer = 0;
295  ladder_struct.ladder = 11;
296  return EXIT_SUCCESS;
297  case 10:
298  ladder_struct.barrel = 1;
299  ladder_struct.layer = 1;
300  ladder_struct.ladder = 14;
301  return EXIT_SUCCESS;
302  case 11:
303  ladder_struct.barrel = 1;
304  ladder_struct.layer = 0;
305  ladder_struct.ladder = 14;
306  return EXIT_SUCCESS;
307  case 12:
308  ladder_struct.barrel = 1;
309  ladder_struct.layer = 1;
310  ladder_struct.ladder = 15;
311  return EXIT_SUCCESS;
312  case 13:
313  ladder_struct.barrel = 1;
314  ladder_struct.layer = 0;
315  ladder_struct.ladder = 15;
316  return EXIT_SUCCESS;
317  default:
318  ladder_struct.barrel = -1;
319  ladder_struct.layer = -1;
320  ladder_struct.ladder = -1;
321  return EXIT_FAILURE;
322  }
323  case 4:
324  switch(felix_channel)
325  {
326  case 0:
327  ladder_struct.barrel = 1;
328  ladder_struct.layer = 1;
329  ladder_struct.ladder = 1;
330  return EXIT_SUCCESS;
331  case 1:
332  ladder_struct.barrel = 0;
333  ladder_struct.layer = 0;
334  ladder_struct.ladder = 0;
335  return EXIT_SUCCESS;
336  case 2:
337  ladder_struct.barrel = 0;
338  ladder_struct.layer = 1;
339  ladder_struct.ladder = 0;
340  return EXIT_SUCCESS;
341  case 3:
342  ladder_struct.barrel = 1;
343  ladder_struct.layer = 0;
344  ladder_struct.ladder = 1;
345  return EXIT_SUCCESS;
346  case 4:
347  ladder_struct.barrel = 0;
348  ladder_struct.layer = 1;
349  ladder_struct.ladder = 1;
350  return EXIT_SUCCESS;
351  case 5:
352  ladder_struct.barrel = 1;
353  ladder_struct.layer = 0;
354  ladder_struct.ladder = 0;
355  return EXIT_SUCCESS;
356  case 6:
357  ladder_struct.barrel = 1;
358  ladder_struct.layer = 1;
359  ladder_struct.ladder = 0;
360  return EXIT_SUCCESS;
361  case 7:
362  ladder_struct.barrel = 0;
363  ladder_struct.layer = 0;
364  ladder_struct.ladder = 2;
365  return EXIT_SUCCESS;
366  case 8:
367  ladder_struct.barrel = 0;
368  ladder_struct.layer = 1;
369  ladder_struct.ladder = 2;
370  return EXIT_SUCCESS;
371  case 9:
372  ladder_struct.barrel = 0;
373  ladder_struct.layer = 0;
374  ladder_struct.ladder = 1;
375  return EXIT_SUCCESS;
376  case 10:
377  ladder_struct.barrel = 1;
378  ladder_struct.layer = 0;
379  ladder_struct.ladder = 3;
380  return EXIT_SUCCESS;
381  case 11:
382  ladder_struct.barrel = 1;
383  ladder_struct.layer = 1;
384  ladder_struct.ladder = 3;
385  return EXIT_SUCCESS;
386  case 12:
387  ladder_struct.barrel = 1;
388  ladder_struct.layer = 0;
389  ladder_struct.ladder = 2;
390  return EXIT_SUCCESS;
391  case 13:
392  ladder_struct.barrel = 1;
393  ladder_struct.layer = 1;
394  ladder_struct.ladder = 2;
395  return EXIT_SUCCESS;
396  default:
397  ladder_struct.barrel = -1;
398  ladder_struct.layer = -1;
399  ladder_struct.ladder = -1;
400  return EXIT_FAILURE;
401  }
402  case 5:
403  switch(felix_channel)
404  {
405  case 0:
406  ladder_struct.barrel = 0;
407  ladder_struct.layer = 0;
408  ladder_struct.ladder = 3;
409  return EXIT_SUCCESS;
410  case 1:
411  ladder_struct.barrel = 0;
412  ladder_struct.layer = 1;
413  ladder_struct.ladder = 4;
414  return EXIT_SUCCESS;
415  case 2:
416  ladder_struct.barrel = 0;
417  ladder_struct.layer = 1;
418  ladder_struct.ladder = 3;
419  return EXIT_SUCCESS;
420  case 3:
421  ladder_struct.barrel = 1;
422  ladder_struct.layer = 0;
423  ladder_struct.ladder = 4;
424  return EXIT_SUCCESS;
425  case 4:
426  ladder_struct.barrel = 1;
427  ladder_struct.layer = 0;
428  ladder_struct.ladder = 5;
429  return EXIT_SUCCESS;
430  case 5:
431  ladder_struct.barrel = 1;
432  ladder_struct.layer = 1;
433  ladder_struct.ladder = 4;
434  return EXIT_SUCCESS;
435  case 6:
436  ladder_struct.barrel = 1;
437  ladder_struct.layer = 1;
438  ladder_struct.ladder = 5;
439  return EXIT_SUCCESS;
440  case 7:
441  ladder_struct.barrel = 1;
442  ladder_struct.layer = 1;
443  ladder_struct.ladder = 7;
444  return EXIT_SUCCESS;
445  case 8:
446  ladder_struct.barrel = 1;
447  ladder_struct.layer = 0;
448  ladder_struct.ladder = 7;
449  return EXIT_SUCCESS;
450  case 9:
451  ladder_struct.barrel = 1;
452  ladder_struct.layer = 0;
453  ladder_struct.ladder = 6;
454  return EXIT_SUCCESS;
455  case 10:
456  ladder_struct.barrel = 1;
457  ladder_struct.layer = 1;
458  ladder_struct.ladder = 6;
459  return EXIT_SUCCESS;
460  case 11:
461  ladder_struct.barrel = 0;
462  ladder_struct.layer = 0;
463  ladder_struct.ladder = 5;
464  return EXIT_SUCCESS;
465  case 12:
466  ladder_struct.barrel = 0;
467  ladder_struct.layer = 1;
468  ladder_struct.ladder = 5;
469  return EXIT_SUCCESS;
470  case 13:
471  ladder_struct.barrel = 0;
472  ladder_struct.layer = 0;
473  ladder_struct.ladder = 4;
474  return EXIT_SUCCESS;
475  default:
476  ladder_struct.barrel = -1;
477  ladder_struct.layer = -1;
478  ladder_struct.ladder = -1;
479  return EXIT_FAILURE;
480  }
481  case 6:
482  switch(felix_channel)
483  {
484  case 0:
485  ladder_struct.barrel = 0;
486  ladder_struct.layer = 1;
487  ladder_struct.ladder = 6;
488  return EXIT_SUCCESS;
489  case 1:
490  ladder_struct.barrel = 0;
491  ladder_struct.layer = 0;
492  ladder_struct.ladder = 6;
493  return EXIT_SUCCESS;
494  case 2:
495  ladder_struct.barrel = 0;
496  ladder_struct.layer = 1;
497  ladder_struct.ladder = 7;
498  return EXIT_SUCCESS;
499  case 3:
500  ladder_struct.barrel = 1;
501  ladder_struct.layer = 1;
502  ladder_struct.ladder = 8;
503  return EXIT_SUCCESS;
504  case 4:
505  ladder_struct.barrel = 1;
506  ladder_struct.layer = 0;
507  ladder_struct.ladder = 8;
508  return EXIT_SUCCESS;
509  case 5:
510  ladder_struct.barrel = 1;
511  ladder_struct.layer = 1;
512  ladder_struct.ladder = 9;
513  return EXIT_SUCCESS;
514  case 6:
515  ladder_struct.barrel = 1;
516  ladder_struct.layer = 0;
517  ladder_struct.ladder = 9;
518  return EXIT_SUCCESS;
519  case 7:
520  ladder_struct.barrel = 0;
521  ladder_struct.layer = 0;
522  ladder_struct.ladder = 7;
523  return EXIT_SUCCESS;
524  case 8:
525  ladder_struct.barrel = 0;
526  ladder_struct.layer = 1;
527  ladder_struct.ladder = 8;
528  return EXIT_SUCCESS;
529  case 9:
530  ladder_struct.barrel = 0;
531  ladder_struct.layer = 0;
532  ladder_struct.ladder = 8;
533  return EXIT_SUCCESS;
534  case 10:
535  ladder_struct.barrel = 1;
536  ladder_struct.layer = 1;
537  ladder_struct.ladder = 10;
538  return EXIT_SUCCESS;
539  case 11:
540  ladder_struct.barrel = 1;
541  ladder_struct.layer = 0;
542  ladder_struct.ladder = 10;
543  return EXIT_SUCCESS;
544  case 12:
545  ladder_struct.barrel = 1;
546  ladder_struct.layer = 1;
547  ladder_struct.ladder = 11;
548  return EXIT_SUCCESS;
549  case 13:
550  ladder_struct.barrel = 1;
551  ladder_struct.layer = 0;
552  ladder_struct.ladder = 11;
553  return EXIT_SUCCESS;
554  default:
555  ladder_struct.barrel = -1;
556  ladder_struct.layer = -1;
557  ladder_struct.ladder = -1;
558  return EXIT_FAILURE;
559  }
560  case 7:
561  switch(felix_channel)
562  {
563  case 0:
564  ladder_struct.barrel = 0;
565  ladder_struct.layer = 1;
566  ladder_struct.ladder = 9;
567  return EXIT_SUCCESS;
568  case 1:
569  ladder_struct.barrel = 0;
570  ladder_struct.layer = 0;
571  ladder_struct.ladder = 9;
572  return EXIT_SUCCESS;
573  case 2:
574  ladder_struct.barrel = 0;
575  ladder_struct.layer = 1;
576  ladder_struct.ladder = 10;
577  return EXIT_SUCCESS;
578  case 3:
579  ladder_struct.barrel = 1;
580  ladder_struct.layer = 1;
581  ladder_struct.ladder = 12;
582  return EXIT_SUCCESS;
583  case 4:
584  ladder_struct.barrel = 1;
585  ladder_struct.layer = 0;
586  ladder_struct.ladder = 12;
587  return EXIT_SUCCESS;
588  case 5:
589  ladder_struct.barrel = 1;
590  ladder_struct.layer = 1;
591  ladder_struct.ladder = 13;
592  return EXIT_SUCCESS;
593  case 6:
594  ladder_struct.barrel = 1;
595  ladder_struct.layer = 0;
596  ladder_struct.ladder = 13;
597  return EXIT_SUCCESS;
598  case 7:
599  ladder_struct.barrel = 0;
600  ladder_struct.layer = 0;
601  ladder_struct.ladder = 10;
602  return EXIT_SUCCESS;
603  case 8:
604  ladder_struct.barrel = 0;
605  ladder_struct.layer = 1;
606  ladder_struct.ladder = 11;
607  return EXIT_SUCCESS;
608  case 9:
609  ladder_struct.barrel = 0;
610  ladder_struct.layer = 0;
611  ladder_struct.ladder = 11;
612  return EXIT_SUCCESS;
613  case 10:
614  ladder_struct.barrel = 1;
615  ladder_struct.layer = 1;
616  ladder_struct.ladder = 14;
617  return EXIT_SUCCESS;
618  case 11:
619  ladder_struct.barrel = 1;
620  ladder_struct.layer = 0;
621  ladder_struct.ladder = 14;
622  return EXIT_SUCCESS;
623  case 12:
624  ladder_struct.barrel = 1;
625  ladder_struct.layer = 1;
626  ladder_struct.ladder = 15;
627  return EXIT_SUCCESS;
628  case 13:
629  ladder_struct.barrel = 1;
630  ladder_struct.layer = 0;
631  ladder_struct.ladder = 15;
632  return EXIT_SUCCESS;
633  default:
634  ladder_struct.barrel = -1;
635  ladder_struct.layer = -1;
636  ladder_struct.ladder = -1;
637  return EXIT_FAILURE;
638  }
639  default:
640  ladder_struct.barrel = -1;
641  ladder_struct.layer = -1;
642  ladder_struct.ladder = -1;
643  return EXIT_FAILURE;
644  }
645  return EXIT_FAILURE;
646 }