Skip to content

Instantly share code, notes, and snippets.

@jdbrice
Created November 17, 2021 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdbrice/1a38f6e152f23e0c502776c6f1bdd3ae to your computer and use it in GitHub Desktop.
Save jdbrice/1a38f6e152f23e0c502776c6f1bdd3ae to your computer and use it in GitHub Desktop.
Hardware mapping class for VMM
Row_num FEB_num VMM_num VMM_ch strip_ch
0 1 4 49 0
0 1 4 48 1
0 1 4 47 2
0 1 4 46 3
0 1 4 45 4
0 1 4 44 5
0 1 4 43 6
0 1 4 42 7
0 1 4 41 8
0 1 4 40 9
0 1 4 39 10
0 1 4 38 11
0 1 4 37 12
0 1 4 36 13
0 1 4 35 14
0 1 4 34 15
0 1 4 33 16
0 1 4 32 17
0 1 4 31 18
0 1 4 30 19
0 1 4 29 20
0 1 4 28 21
0 1 4 27 22
0 1 4 26 23
0 1 4 25 24
0 1 4 24 25
0 1 4 23 26
0 1 4 22 27
0 1 4 21 28
0 1 4 20 29
0 1 4 19 30
0 1 4 18 31
0 1 4 17 32
0 1 4 16 33
0 1 4 15 34
0 1 4 14 35
0 1 4 13 36
0 1 4 12 37
0 1 4 11 38
0 1 4 10 39
0 1 4 9 40
0 1 4 8 41
0 1 4 7 42
0 1 4 6 43
0 1 4 5 44
0 1 4 4 45
0 1 4 3 46
0 1 4 2 47
0 1 4 1 48
0 1 4 0 49
0 1 3 57 50
0 1 3 56 51
0 1 3 55 52
0 1 3 54 53
0 1 3 53 54
0 1 3 52 55
0 1 3 51 56
0 1 3 50 57
0 1 3 49 58
0 1 3 48 59
0 1 3 47 60
0 1 3 46 61
0 1 3 45 62
0 1 3 44 63
0 1 3 43 64
0 1 3 42 65
0 1 3 41 66
0 1 3 40 67
0 1 3 39 68
0 1 3 38 69
0 1 3 37 70
0 1 3 36 71
0 1 3 35 72
0 1 3 34 73
0 1 3 33 74
0 1 3 32 75
0 1 3 31 76
0 1 3 30 77
0 1 3 29 78
0 1 3 28 79
0 1 3 27 80
0 1 3 26 81
0 1 3 25 82
0 1 3 24 83
0 1 3 23 84
0 1 3 22 85
0 1 3 21 86
0 1 3 20 87
0 1 3 19 88
0 1 3 18 89
0 1 3 17 90
0 1 3 16 91
0 1 3 15 92
0 1 3 14 93
0 1 3 13 94
0 1 3 12 95
0 1 3 11 96
0 1 3 10 97
0 1 3 9 98
0 1 3 8 99
0 1 3 7 100
0 1 3 6 101
0 1 3 5 102
0 1 3 4 103
0 1 3 3 104
0 1 3 2 105
0 1 2 55 106
0 1 2 54 107
0 1 2 53 108
0 1 2 52 109
0 1 2 51 110
0 1 2 50 111
0 1 2 49 112
0 1 2 48 113
0 1 2 47 114
0 1 2 46 115
0 1 2 45 116
0 1 2 44 117
0 1 2 43 118
0 1 2 42 119
0 1 2 41 120
0 1 2 40 121
0 1 2 39 122
0 1 2 38 123
0 1 2 37 124
0 1 2 36 125
0 1 2 35 126
0 1 2 34 127
0 1 2 33 128
0 1 2 32 129
0 1 2 31 130
0 1 2 30 131
0 1 2 29 132
0 1 2 28 133
0 1 2 27 134
0 1 2 26 135
0 1 2 25 136
0 1 2 24 137
0 1 2 23 138
0 1 2 22 139
0 1 2 21 140
0 1 2 20 141
0 1 2 19 142
0 1 2 18 143
0 1 2 17 144
0 1 2 16 145
0 1 2 15 146
0 1 2 14 147
0 1 2 13 148
0 1 2 12 149
0 1 2 11 150
0 1 2 10 151
0 1 2 9 152
0 1 2 8 153
0 1 2 7 154
0 1 2 6 155
0 1 2 5 156
0 1 2 4 157
0 1 2 3 158
0 1 2 2 159
0 1 2 1 160
0 1 2 0 161
0 1 1 49 162
0 1 1 48 163
0 1 1 47 164
0 1 1 46 165
0 1 1 45 166
1 5 2 54 0
1 5 2 55 1
1 5 3 2 2
1 5 3 3 3
1 5 3 4 4
1 5 3 5 5
1 5 3 6 6
1 5 3 7 7
1 5 3 8 8
1 5 3 9 9
1 5 3 10 10
1 5 3 11 11
1 5 3 12 12
1 5 3 13 13
1 5 3 14 14
1 5 3 15 15
1 5 3 16 16
1 5 3 17 17
1 5 3 18 18
1 5 3 19 19
1 5 3 20 20
1 5 3 21 21
1 5 3 22 22
1 5 3 23 23
1 5 3 24 24
1 5 3 25 25
1 5 3 26 26
1 5 3 27 27
1 5 3 28 28
1 5 3 29 29
1 5 3 30 30
1 5 3 31 31
1 5 3 32 32
1 5 3 33 33
1 5 3 34 34
1 5 3 35 35
1 5 3 36 36
1 5 3 37 37
1 5 3 38 38
1 5 3 39 39
1 5 3 40 40
1 5 3 41 41
1 5 3 42 42
1 5 3 43 43
1 5 3 44 44
1 5 3 45 45
1 5 3 46 46
1 5 3 47 47
1 5 3 48 48
1 5 3 49 49
1 5 3 50 50
1 5 3 51 51
1 5 3 52 52
1 5 3 53 53
1 5 3 54 54
1 5 3 55 55
1 5 3 56 56
1 5 3 57 57
1 5 4 0 58
1 5 4 1 59
1 5 4 2 60
1 5 4 3 61
1 5 4 4 62
1 5 4 5 63
1 5 4 6 64
1 5 4 7 65
1 5 4 8 66
1 5 4 9 67
1 5 4 10 68
1 5 4 11 69
1 5 4 12 70
1 5 4 13 71
1 5 4 14 72
1 5 4 15 73
1 5 4 16 74
1 5 4 17 75
1 5 4 18 76
1 5 4 19 77
1 5 4 20 78
1 5 4 21 79
1 5 4 22 80
1 5 4 23 81
1 5 4 24 82
1 5 4 25 83
1 5 4 26 84
1 5 4 27 85
1 5 4 28 86
1 5 4 29 87
1 5 4 30 88
1 5 4 31 89
1 5 4 32 90
1 5 4 33 91
1 5 4 34 92
1 5 4 35 93
1 5 4 36 94
1 5 4 37 95
1 5 4 38 96
1 5 4 39 97
1 5 4 40 98
1 5 4 41 99
1 5 4 42 100
1 5 4 43 101
1 5 4 44 102
1 5 4 45 103
1 5 4 46 104
1 5 4 47 105
1 5 4 48 106
1 5 4 49 107
1 1 1 0 108
1 1 1 1 109
1 1 1 2 110
1 1 1 3 111
1 1 1 4 112
1 1 1 5 113
1 1 1 6 114
1 1 1 7 115
1 1 1 8 116
1 1 1 9 117
1 1 1 10 118
1 1 1 11 119
1 1 1 12 120
1 1 1 13 121
1 1 1 14 122
1 1 1 15 123
1 1 1 16 124
1 1 1 17 125
1 1 1 18 126
1 1 1 19 127
1 1 1 20 128
1 1 1 21 129
1 1 1 22 130
1 1 1 23 131
1 1 1 24 132
1 1 1 25 133
1 1 1 26 134
1 1 1 27 135
1 1 1 28 136
1 1 1 29 137
1 1 1 30 138
1 1 1 31 139
1 1 1 32 140
1 1 1 33 141
1 1 1 34 142
1 1 1 35 143
1 1 1 36 144
1 1 1 37 145
1 1 1 38 146
1 1 1 39 147
1 1 1 40 148
1 1 1 41 149
1 1 1 42 150
1 1 1 43 151
1 1 1 44 152
2 5 1 10 0
2 5 1 11 1
2 5 1 12 2
2 5 1 13 3
2 5 1 14 4
2 5 1 15 5
2 5 1 16 6
2 5 1 17 7
2 5 1 18 8
2 5 1 19 9
2 5 1 20 10
2 5 1 21 11
2 5 1 22 12
2 5 1 23 13
2 5 1 24 14
2 5 1 25 15
2 5 1 26 16
2 5 1 27 17
2 5 1 28 18
2 5 1 29 19
2 5 1 30 20
2 5 1 31 21
2 5 1 32 22
2 5 1 33 23
2 5 1 34 24
2 5 1 35 25
2 5 1 36 26
2 5 1 37 27
2 5 1 38 28
2 5 1 39 29
2 5 1 40 30
2 5 1 41 31
2 5 1 42 32
2 5 1 43 33
2 5 1 44 34
2 5 1 45 35
2 5 1 46 36
2 5 1 47 37
2 5 1 48 38
2 5 1 49 39
2 5 2 0 40
2 5 2 1 41
2 5 2 2 42
2 5 2 3 43
2 5 2 4 44
2 5 2 5 45
2 5 2 6 46
2 5 2 7 47
2 5 2 8 48
2 5 2 9 49
2 5 2 10 50
2 5 2 11 51
2 5 2 12 52
2 5 2 13 53
2 5 2 14 54
2 5 2 15 55
2 5 2 16 56
2 5 2 17 57
2 5 2 18 58
2 5 2 19 59
2 5 2 20 60
2 5 2 21 61
2 5 2 22 62
2 5 2 23 63
2 5 2 24 64
2 5 2 25 65
2 5 2 26 66
2 5 2 27 67
2 5 2 28 68
2 5 2 29 69
2 5 2 30 70
2 5 2 31 71
2 5 2 32 72
2 5 2 33 73
2 5 2 34 74
2 5 2 35 75
2 5 2 36 76
2 5 2 37 77
2 5 2 38 78
2 5 2 39 79
2 5 2 40 80
2 5 2 41 81
2 5 2 42 82
2 5 2 43 83
2 5 2 44 84
2 5 2 45 85
2 5 2 46 86
2 5 2 47 87
2 5 2 48 88
2 5 2 49 89
2 5 2 50 90
2 5 2 51 91
2 5 2 52 92
2 5 2 53 93
3 3 4 47 1
3 3 4 46 2
3 3 4 45 3
3 3 4 44 4
3 3 4 43 5
3 3 4 42 6
3 3 4 41 7
3 3 4 40 8
3 3 4 39 9
3 3 4 38 10
3 3 4 37 11
3 3 4 36 12
3 3 4 35 13
3 3 4 34 14
3 3 4 33 15
3 3 4 32 16
3 3 4 31 17
3 3 4 30 18
3 3 4 29 19
3 3 4 28 20
3 3 4 27 21
3 3 4 26 22
3 3 4 25 23
3 3 4 24 24
3 3 4 23 25
3 3 4 22 26
3 3 4 21 27
3 3 4 20 28
3 3 4 19 29
3 3 4 18 30
3 3 4 17 31
3 3 4 16 32
3 3 4 15 33
3 3 4 14 34
3 3 4 13 35
3 3 4 12 36
3 3 4 11 37
3 3 4 10 38
3 3 4 9 39
3 3 4 8 40
3 3 4 7 41
3 3 4 6 42
3 3 4 5 43
3 3 4 4 44
3 3 4 3 45
3 3 4 2 46
3 3 4 1 47
3 3 4 0 48
3 3 3 57 49
3 3 3 56 50
3 3 3 55 51
3 3 3 54 52
3 3 3 53 53
3 3 3 52 54
3 3 3 51 55
3 3 3 50 56
3 3 3 49 57
3 3 3 48 58
3 3 3 47 59
3 3 3 46 60
3 3 3 45 61
3 3 3 44 62
3 3 3 43 63
3 3 3 42 64
3 3 3 41 65
3 3 3 40 66
3 3 3 39 67
3 3 3 38 68
3 3 3 37 69
3 3 3 36 70
3 3 3 35 71
3 3 3 34 72
3 3 3 33 73
3 3 3 32 74
3 3 3 31 75
3 3 3 30 76
3 3 3 29 77
3 3 3 28 78
3 3 3 27 79
3 3 3 26 80
3 3 3 25 81
3 3 3 24 82
3 3 3 23 83
3 3 3 22 84
3 3 3 21 85
3 3 3 20 86
3 3 3 19 87
3 3 3 18 88
3 3 3 17 89
3 3 3 16 90
3 3 3 15 91
3 3 3 14 92
3 3 3 13 93
3 3 3 12 94
3 3 3 11 95
3 3 3 10 96
3 3 3 9 97
3 3 3 8 98
3 3 3 7 99
3 3 3 6 100
3 3 3 5 101
3 3 3 4 102
3 3 3 3 103
3 3 3 2 104
3 3 2 55 105
3 3 2 54 106
3 3 2 53 107
3 3 2 52 108
3 3 2 51 109
3 3 2 50 110
3 3 2 49 111
3 3 2 48 112
3 3 2 47 113
3 3 2 46 114
3 3 2 45 115
3 3 2 44 116
3 3 2 43 117
3 3 2 42 118
3 3 2 41 119
3 3 2 40 120
3 3 2 39 121
3 3 2 38 122
3 3 2 37 123
3 3 2 36 124
3 3 2 35 125
3 3 2 34 126
3 3 2 33 127
3 3 2 32 128
3 3 2 31 129
3 3 2 30 130
3 3 2 29 131
3 3 2 28 132
3 3 2 27 133
3 3 2 26 134
3 3 2 25 135
3 3 2 24 136
3 3 2 23 137
3 3 2 22 138
3 3 2 21 139
3 3 2 20 140
3 3 2 19 141
3 3 2 18 142
3 3 2 17 143
3 3 2 16 144
3 3 2 15 145
3 3 2 14 146
3 3 2 13 147
3 3 2 12 148
3 3 2 11 149
3 3 2 10 150
3 3 2 9 151
4 3 1 0 0
4 3 1 1 1
4 3 1 2 2
4 3 1 3 3
4 3 1 4 4
4 3 1 5 5
4 3 1 6 6
4 3 1 7 7
4 3 1 8 8
4 3 1 9 9
4 3 1 10 10
4 3 1 11 11
4 3 1 12 12
4 3 1 13 13
4 3 1 14 14
4 3 1 15 15
4 3 1 16 16
4 3 1 17 17
4 3 1 18 18
4 3 1 19 19
4 3 1 20 20
4 3 1 21 21
4 3 1 22 22
4 3 1 23 23
4 3 1 24 24
4 3 1 25 25
4 3 1 26 26
4 3 1 27 27
4 3 1 28 28
4 3 1 29 29
4 3 1 30 30
4 3 1 31 31
4 3 1 32 32
4 3 1 33 33
4 3 1 34 34
4 3 1 35 35
4 3 1 36 36
4 3 1 37 37
4 3 1 38 38
4 3 1 39 39
4 3 1 40 40
4 3 1 41 41
4 3 1 42 42
4 3 1 43 43
4 3 1 44 44
4 3 1 45 45
4 3 1 46 46
4 3 1 47 47
4 3 1 48 48
4 3 1 49 49
4 3 2 0 50
4 3 2 1 51
4 3 2 2 52
4 3 2 3 53
4 3 2 4 54
4 3 2 5 55
4 3 2 6 56
4 3 2 7 57
4 3 2 8 58
0 6 1 0 0
0 6 1 1 1
0 6 1 2 2
0 6 1 3 3
0 6 1 4 4
0 6 1 5 5
0 6 1 6 6
0 6 1 7 7
0 6 1 8 8
0 6 1 9 9
0 6 1 10 10
0 6 1 11 11
0 6 1 12 12
0 6 1 13 13
0 6 1 14 14
0 6 1 15 15
0 6 1 16 16
0 6 1 17 17
0 6 1 18 18
0 6 1 19 19
0 6 1 20 20
0 6 1 21 21
0 6 1 22 22
0 6 1 23 23
0 6 1 24 24
0 6 1 25 25
0 6 1 26 26
0 6 1 27 27
0 6 1 28 28
0 6 1 29 29
0 6 1 30 30
0 6 1 31 31
0 6 1 32 32
0 6 1 33 33
0 6 1 34 34
0 6 1 35 35
0 6 1 36 36
0 6 1 37 37
0 6 1 38 38
0 6 1 39 39
0 6 1 40 40
0 6 1 41 41
0 6 1 42 42
0 6 1 43 43
0 6 1 44 44
0 6 1 45 45
0 6 1 46 46
0 6 1 47 47
0 6 1 48 48
0 6 1 49 49
0 6 2 0 50
0 6 2 1 51
0 6 2 2 52
0 6 2 3 53
0 6 2 4 54
0 6 2 5 55
0 6 2 6 56
0 6 2 7 57
0 6 2 8 58
0 6 2 9 59
0 6 2 10 60
0 6 2 11 61
0 6 2 12 62
0 6 2 13 63
0 6 2 14 64
0 6 2 15 65
0 6 2 16 66
0 6 2 17 67
0 6 2 18 68
0 6 2 19 69
0 6 2 20 70
0 6 2 21 71
0 6 2 22 72
0 6 2 23 73
0 6 2 24 74
0 6 2 25 75
0 6 2 26 76
0 6 2 27 77
0 6 2 28 78
0 6 2 29 79
0 6 2 30 80
0 6 2 31 81
0 6 2 32 82
0 6 2 33 83
0 6 2 34 84
0 6 2 35 85
0 6 2 36 86
0 6 2 37 87
0 6 2 38 88
0 6 2 39 89
0 6 2 40 90
0 6 2 41 91
0 6 2 42 92
0 6 2 43 93
0 6 2 44 94
0 6 2 45 95
0 6 2 46 96
0 6 2 47 97
0 6 2 48 98
0 6 2 49 99
0 6 2 50 100
0 6 2 51 101
0 6 2 52 102
0 6 2 53 103
0 6 2 54 104
0 6 2 55 105
0 6 3 2 106
0 6 3 3 107
0 6 3 4 108
0 6 3 5 109
0 6 3 6 110
0 6 3 7 111
0 6 3 8 112
0 6 3 9 113
0 6 3 10 114
0 6 3 11 115
0 6 3 12 116
0 6 3 13 117
0 6 3 14 118
0 6 3 15 119
0 6 3 16 120
0 6 3 17 121
0 6 3 18 122
0 6 3 19 123
0 6 3 20 124
0 6 3 21 125
0 6 3 22 126
0 6 3 23 127
0 6 3 24 128
0 6 3 25 129
0 6 3 26 130
0 6 3 27 131
0 6 3 28 132
0 6 3 29 133
0 6 3 30 134
0 6 3 31 135
0 6 3 32 136
0 6 3 33 137
0 6 3 34 138
0 6 3 35 139
0 6 3 36 140
0 6 3 37 141
0 6 3 38 142
0 6 3 39 143
0 6 3 40 144
0 6 3 41 145
0 6 3 42 146
0 6 3 43 147
0 6 3 44 148
0 6 3 45 149
0 6 3 46 150
0 6 3 47 151
0 6 3 48 152
0 6 3 49 153
0 6 3 50 154
0 6 3 51 155
0 6 3 52 156
0 6 3 53 157
0 6 3 54 158
0 6 3 55 159
0 6 3 56 160
0 6 3 57 161
0 6 4 0 162
0 6 4 1 163
0 6 4 2 164
0 6 4 3 165
0 6 4 4 166
1 2 3 3 0
1 2 3 2 1
1 2 2 55 2
1 2 2 54 3
1 2 2 53 4
1 2 2 52 5
1 2 2 51 6
1 2 2 50 7
1 2 2 49 8
1 2 2 48 9
1 2 2 47 10
1 2 2 46 11
1 2 2 45 12
1 2 2 44 13
1 2 2 43 14
1 2 2 42 15
1 2 2 41 16
1 2 2 40 17
1 2 2 39 18
1 2 2 38 19
1 2 2 37 20
1 2 2 36 21
1 2 2 35 22
1 2 2 34 23
1 2 2 33 24
1 2 2 32 25
1 2 2 31 26
1 2 2 30 27
1 2 2 29 28
1 2 2 28 29
1 2 2 27 30
1 2 2 26 31
1 2 2 25 32
1 2 2 24 33
1 2 2 23 34
1 2 2 22 35
1 2 2 21 36
1 2 2 20 37
1 2 2 19 38
1 2 2 18 39
1 2 2 17 40
1 2 2 16 41
1 2 2 15 42
1 2 2 14 43
1 2 2 13 44
1 2 2 12 45
1 2 2 11 46
1 2 2 10 47
1 2 2 9 48
1 2 2 8 49
1 2 2 7 50
1 2 2 6 51
1 2 2 5 52
1 2 2 4 53
1 2 2 3 54
1 2 2 2 55
1 2 2 1 56
1 2 2 0 57
1 2 1 49 58
1 2 1 48 59
1 2 1 47 60
1 2 1 46 61
1 2 1 45 62
1 2 1 44 63
1 2 1 43 64
1 2 1 42 65
1 2 1 41 66
1 2 1 40 67
1 2 1 39 68
1 2 1 38 69
1 2 1 37 70
1 2 1 36 71
1 2 1 35 72
1 2 1 34 73
1 2 1 33 74
1 2 1 32 75
1 2 1 31 76
1 2 1 30 77
1 2 1 29 78
1 2 1 28 79
1 2 1 27 80
1 2 1 26 81
1 2 1 25 82
1 2 1 24 83
1 2 1 23 84
1 2 1 22 85
1 2 1 21 86
1 2 1 20 87
1 2 1 19 88
1 2 1 18 89
1 2 1 17 90
1 2 1 16 91
1 2 1 15 92
1 2 1 14 93
1 2 1 13 94
1 2 1 12 95
1 2 1 11 96
1 2 1 10 97
1 2 1 9 98
1 2 1 8 99
1 2 1 7 100
1 2 1 6 101
1 2 1 5 102
1 2 1 4 103
1 2 1 3 104
1 2 1 2 105
1 2 1 1 106
1 2 1 0 107
1 6 4 49 108
1 6 4 48 109
1 6 4 47 110
1 6 4 46 111
1 6 4 45 112
1 6 4 44 113
1 6 4 43 114
1 6 4 42 115
1 6 4 41 116
1 6 4 40 117
1 6 4 39 118
1 6 4 38 119
1 6 4 37 120
1 6 4 36 121
1 6 4 35 122
1 6 4 34 123
1 6 4 33 124
1 6 4 32 125
1 6 4 31 126
1 6 4 30 127
1 6 4 29 128
1 6 4 28 129
1 6 4 27 130
1 6 4 26 131
1 6 4 25 132
1 6 4 24 133
1 6 4 23 134
1 6 4 22 135
1 6 4 21 136
1 6 4 20 137
1 6 4 19 138
1 6 4 18 139
1 6 4 17 140
1 6 4 16 141
1 6 4 15 142
1 6 4 14 143
1 6 4 13 144
1 6 4 12 145
1 6 4 11 146
1 6 4 10 147
1 6 4 9 148
1 6 4 8 149
1 6 4 7 150
1 6 4 6 151
1 6 4 5 152
2 2 4 39 0
2 2 4 38 1
2 2 4 37 2
2 2 4 36 3
2 2 4 35 4
2 2 4 34 5
2 2 4 33 6
2 2 4 32 7
2 2 4 31 8
2 2 4 30 9
2 2 4 29 10
2 2 4 28 11
2 2 4 27 12
2 2 4 26 13
2 2 4 25 14
2 2 4 24 15
2 2 4 23 16
2 2 4 22 17
2 2 4 21 18
2 2 4 20 19
2 2 4 19 20
2 2 4 18 21
2 2 4 17 22
2 2 4 16 23
2 2 4 15 24
2 2 4 14 25
2 2 4 13 26
2 2 4 12 27
2 2 4 11 28
2 2 4 10 29
2 2 4 9 30
2 2 4 8 31
2 2 4 7 32
2 2 4 6 33
2 2 4 5 34
2 2 4 4 35
2 2 4 3 36
2 2 4 2 37
2 2 4 1 38
2 2 4 0 39
2 2 3 57 40
2 2 3 56 41
2 2 3 55 42
2 2 3 54 43
2 2 3 53 44
2 2 3 52 45
2 2 3 51 46
2 2 3 50 47
2 2 3 49 48
2 2 3 48 49
2 2 3 47 50
2 2 3 46 51
2 2 3 45 52
2 2 3 44 53
2 2 3 43 54
2 2 3 42 55
2 2 3 41 56
2 2 3 40 57
2 2 3 39 58
2 2 3 38 59
2 2 3 37 60
2 2 3 36 61
2 2 3 35 62
2 2 3 34 63
2 2 3 33 64
2 2 3 32 65
2 2 3 31 66
2 2 3 30 67
2 2 3 29 68
2 2 3 28 69
2 2 3 27 70
2 2 3 26 71
2 2 3 25 72
2 2 3 24 73
2 2 3 23 74
2 2 3 22 75
2 2 3 21 76
2 2 3 20 77
2 2 3 19 78
2 2 3 18 79
2 2 3 17 80
2 2 3 16 81
2 2 3 15 82
2 2 3 14 83
2 2 3 13 84
2 2 3 12 85
2 2 3 11 86
2 2 3 10 87
2 2 3 9 88
2 2 3 8 89
2 2 3 7 90
2 2 3 6 91
2 2 3 5 92
2 2 3 4 93
3 4 1 2 1
3 4 1 3 2
3 4 1 4 3
3 4 1 5 4
3 4 1 6 5
3 4 1 7 6
3 4 1 8 7
3 4 1 9 8
3 4 1 10 9
3 4 1 11 10
3 4 1 12 11
3 4 1 13 12
3 4 1 14 13
3 4 1 15 14
3 4 1 16 15
3 4 1 17 16
3 4 1 18 17
3 4 1 19 18
3 4 1 20 19
3 4 1 21 20
3 4 1 22 21
3 4 1 23 22
3 4 1 24 23
3 4 1 25 24
3 4 1 26 25
3 4 1 27 26
3 4 1 28 27
3 4 1 29 28
3 4 1 30 29
3 4 1 31 30
3 4 1 32 31
3 4 1 33 32
3 4 1 34 33
3 4 1 35 34
3 4 1 36 35
3 4 1 37 36
3 4 1 38 37
3 4 1 39 38
3 4 1 40 39
3 4 1 41 40
3 4 1 42 41
3 4 1 43 42
3 4 1 44 43
3 4 1 45 44
3 4 1 46 45
3 4 1 47 46
3 4 1 48 47
3 4 1 49 48
3 4 2 0 49
3 4 2 1 50
3 4 2 2 51
3 4 2 3 52
3 4 2 4 53
3 4 2 5 54
3 4 2 6 55
3 4 2 7 56
3 4 2 8 57
3 4 2 9 58
3 4 2 10 59
3 4 2 11 60
3 4 2 12 61
3 4 2 13 62
3 4 2 14 63
3 4 2 15 64
3 4 2 16 65
3 4 2 17 66
3 4 2 18 67
3 4 2 19 68
3 4 2 20 69
3 4 2 21 70
3 4 2 22 71
3 4 2 23 72
3 4 2 24 73
3 4 2 25 74
3 4 2 26 75
3 4 2 27 76
3 4 2 28 77
3 4 2 29 78
3 4 2 30 79
3 4 2 31 80
3 4 2 32 81
3 4 2 33 82
3 4 2 34 83
3 4 2 35 84
3 4 2 36 85
3 4 2 37 86
3 4 2 38 87
3 4 2 39 88
3 4 2 40 89
3 4 2 41 90
3 4 2 42 91
3 4 2 43 92
3 4 2 44 93
3 4 2 45 94
3 4 2 46 95
3 4 2 47 96
3 4 2 48 97
3 4 2 49 98
3 4 2 50 99
3 4 2 51 100
3 4 2 52 101
3 4 2 53 102
3 4 2 54 103
3 4 2 55 104
3 4 3 2 105
3 4 3 3 106
3 4 3 4 107
3 4 3 5 108
3 4 3 6 109
3 4 3 7 110
3 4 3 8 111
3 4 3 9 112
3 4 3 10 113
3 4 3 11 114
3 4 3 12 115
3 4 3 13 116
3 4 3 14 117
3 4 3 15 118
3 4 3 16 119
3 4 3 17 120
3 4 3 18 121
3 4 3 19 122
3 4 3 20 123
3 4 3 21 124
3 4 3 22 125
3 4 3 23 126
3 4 3 24 127
3 4 3 25 128
3 4 3 26 129
3 4 3 27 130
3 4 3 28 131
3 4 3 29 132
3 4 3 30 133
3 4 3 31 134
3 4 3 32 135
3 4 3 33 136
3 4 3 34 137
3 4 3 35 138
3 4 3 36 139
3 4 3 37 140
3 4 3 38 141
3 4 3 39 142
3 4 3 40 143
3 4 3 41 144
3 4 3 42 145
3 4 3 43 146
3 4 3 44 147
3 4 3 45 148
3 4 3 46 149
3 4 3 47 150
3 4 3 48 151
4 4 4 49 0
4 4 4 48 1
4 4 4 47 2
4 4 4 46 3
4 4 4 45 4
4 4 4 44 5
4 4 4 43 6
4 4 4 42 7
4 4 4 41 8
4 4 4 40 9
4 4 4 39 10
4 4 4 38 11
4 4 4 37 12
4 4 4 36 13
4 4 4 35 14
4 4 4 34 15
4 4 4 33 16
4 4 4 32 17
4 4 4 31 18
4 4 4 30 19
4 4 4 29 20
4 4 4 28 21
4 4 4 27 22
4 4 4 26 23
4 4 4 25 24
4 4 4 24 25
4 4 4 23 26
4 4 4 22 27
4 4 4 21 28
4 4 4 20 29
4 4 4 19 30
4 4 4 18 31
4 4 4 17 32
4 4 4 16 33
4 4 4 15 34
4 4 4 14 35
4 4 4 13 36
4 4 4 12 37
4 4 4 11 38
4 4 4 10 39
4 4 4 9 40
4 4 4 8 41
4 4 4 7 42
4 4 4 6 43
4 4 4 5 44
4 4 4 4 45
4 4 4 3 46
4 4 4 2 47
4 4 4 1 48
4 4 4 0 49
4 4 3 57 50
4 4 3 56 51
4 4 3 55 52
4 4 3 54 53
4 4 3 53 54
4 4 3 52 55
4 4 3 51 56
4 4 3 50 57
4 4 3 49 58
#include <assert.h>
#include <fstream>
/*********************************************************/
// class for mapping the VMM electronics
//
// Some terminology
// in the raw data from Tonko we have (SEC, RDO, FEB ...)
// these correspond to our sTGC naming as:
//
// SEC = Plane (1, 2, 3, 4)
// RDO = Fiber # = ROB
// RDO = 1 - 4 for each Plane
// Fiber and ROB = 1 - 16; RDO + (4 * SEC)
// FEB = FOB
class VMMHardwareMap {
public:
VMMHardwareMap() {}
VMMHardwareMap( std::string mapfile ){
loadMap( mapfile );
}
~VMMHardwareMap(){}
uint16_t packKey( int feb, int vmm, int ch ){
// feb = [1 - 6] = 3 bits
// vmm = [1 - 4] = 3 bits
// ch = [1 - 64] = 7 bits
return feb + (vmm << 3) + (ch << 6);
}
void unpackKey( int key, int &feb, int &vmm, int &ch ){
feb = key & 0b111;
vmm = (key >> 3) & 0b111;
ch = (key >> 6) & 0b1111111;
return;
}
uint16_t packVal( int row, int strip ){
// row = [1 - 4] = 3 bits
// strip = [1 - 152] = 8 bits
return row + ( strip << 3 );
}
void unpackVal( int val, int &row, int &strip ){
row = val & 0b111; // 3 bits
strip = (val >> 3) & 0b11111111; // 8 bit
return;
}
void loadMap( std::string fn ){
std::ifstream inf;
inf.open( fn.c_str() );
if ( !inf ) return;
mMap.clear();
string hs0, hs1, hs2, hs3, hs4;
// HEADER:
// Row_num FEB_num VMM_num VMM_ch strip_ch
inf >> hs0 >> hs1 >> hs2 >> hs3 >> hs4;
if ( DEBUG ){
printf( "Map Header: %s, %s, %s, %s, %s", hs0.c_str(), hs1.c_str(), hs2.c_str(), hs3.c_str(), hs4.c_str() );
puts("");
}
uint16_t row, feb, vmm, ch, strip;
while( inf >> row >> feb >> vmm >> ch >> strip ){
// pack the key (feb, vmm, ch)
uint16_t key = packKey( feb, vmm, ch );
uint16_t val = packVal( row, strip );
mMap[ key ] = val;
if ( DEBUG ){
printf( "in=(feb=%d, vmm=%d, ch=%d)\n", feb, vmm, ch );
int ufeb, uvmm, uch;
unpackKey( key, ufeb, uvmm, uch );
printf( "key=(feb=%d, vmm=%d, ch=%d)\n", ufeb, uvmm, uch ); puts("");
assert( feb == ufeb && vmm == uvmm && ch == uch );
int urow, ustrip;
unpackVal( val, urow, ustrip );
assert( row == urow && strip == ustrip );
}
}
inf.close();
}
// Enum for strip orientation in descriptive terms
enum class StripOrientation: int {
Horizontal = 0,
Vertical = 1,
Diagonal = 2,
Unknown = 3
};
// need non-class enum to get CINT to work
enum Quadrant {
A = 0,
B = 1,
C = 2,
D = 3
};
static constexpr double stripPitch = 3.2; // mm
static constexpr double rowLength = 180; // mm
// same for all planes
// we have quadrants like:
//
// D | A
// ------
// C | B
// Row 3 and 4 are always diagonal
// odd (even) FOB are horizontal (vertical) for A and C (B and D)
// even (odd) FOB are vertical (horizontal) for A and C (B and D)
StripOrientation getOrientation( int rob, int feb, int vmm, int row ) {
if ( DEBUG ) {
printf( "getOrientation( %d, %d, %d, %d )", rob, feb, vmm, row ); puts("");
}
if ( 3 == row || 4 == row ){
return StripOrientation::Diagonal;
}
if ( rob % 2 == 0 ){ // even rob
if ( feb % 2 != 0 ) { // odd
return StripOrientation::Horizontal;
}
// even
return StripOrientation::Vertical;
} else { // odd rob
if ( feb % 2 != 0 ) { // odd
return StripOrientation::Vertical;
}
// even
return StripOrientation::Horizontal;
}
// should never get here!
return StripOrientation::Unknown;
}
/* get
* returns the mapping for a given input
*
* input:
* rob: 1 - 16
* feb: 1 - 6
* vmm: 1 - 4
* ch : 1 - 64
*
* output:
* row: 0 - 4
* strip: 0 - 162
* orientation: one of {Horizontal, Vertical, Diagonal, Unknown}
*
*/
bool get( int rob, int feb, int vmm, int ch, int &row, int &strip, StripOrientation &orientation ){
uint16_t key = packKey( feb, vmm, ch );
if ( mMap.count( key ) ){
uint16_t val = mMap[ key ];
unpackVal( val, row, strip );
orientation = getOrientation( rob, feb, vmm, row );
return true;
}
return false;
}
static const int DEBUG=0;
std :: map< uint16_t , uint16_t > mMap;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment