16 {
17
18
19 if ((iVolume == 9) || (iVolume == 16)) {
20 return iVolume * 100 + iLayer;
21 }
22
23 unsigned int outerEndsCapVolumes[6] = {13, 14, 15, 18, 19, 20};
24
25
26 if (std::find(std::begin(outerEndsCapVolumes), std::end(outerEndsCapVolumes),
27 iVolume) != std::end(outerEndsCapVolumes)) {
28 return iVolume * 100;
29 }
30
31 unsigned int innerEndsCapVolumes[2] = {8, 10};
32
33
34 unsigned int layerIDBins[4] = {0, 30, 40, 60};
35
36
37
38 if (std::find(std::begin(innerEndsCapVolumes), std::end(innerEndsCapVolumes),
39 iVolume) != std::end(innerEndsCapVolumes)) {
40 auto it = std::upper_bound(std::begin(layerIDBins), std::end(layerIDBins),
41 iLayer);
42
43
44 if (it == std::begin(layerIDBins)) {
45
46 return iVolume * 100;
47 }
48 if (it == std::end(layerIDBins)) {
49
50 return iVolume * 100 + (std::size(layerIDBins) - 1);
51 }
52
53
54 std::size_t layerIDBin = std::distance(std::begin(layerIDBins), it) - 1;
55 return iVolume * 100 + layerIDBin;
56 }
57 return 0;
58}