| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #include "na64detID/trackID.hh" | ||
| 2 | |||
| 3 | #include "na64util/str-fmt.hh" | ||
| 4 | |||
| 5 | namespace na64dp { | ||
| 6 | |||
| 7 | void | ||
| 8 | 32 | TrackID::zones(ZoneID_t zoneID) { | |
| 9 | if(zoneID > zoneMax) { | ||
| 10 | NA64DP_RUNTIME_ERROR("Number value for zone ID exceeds limits:" | ||
| 11 | " requested %zu > max value is %zu" | ||
| 12 | , (size_t) zoneID, (size_t) zoneMax ); | ||
| 13 | } | ||
| 14 | 32 | code &= numberMax; | |
| 15 | 32 | code |= ((TrackID_t) zoneID) << numberBitlen; | |
| 16 | 32 | } | |
| 17 | |||
| 18 | void | ||
| 19 | 32 | TrackID::number(TrackID_t nm) { | |
| 20 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 32 times.
|
32 | if(nm > numberMax) { |
| 21 | ✗ | NA64DP_RUNTIME_ERROR("Number value for track ID exceeds limits:" | |
| 22 | " requested %zu > max value is %zu" | ||
| 23 | , (size_t) nm, (size_t) numberMax ); | ||
| 24 | } | ||
| 25 | 32 | code &= ~numberMax; | |
| 26 | 32 | code |= nm; | |
| 27 | 32 | } | |
| 28 | |||
| 29 | TrackID_t | ||
| 30 | 80 | TrackID::number() const { | |
| 31 | 80 | return code & numberMax; | |
| 32 | } | ||
| 33 | |||
| 34 | } // namespace na64dp | ||
| 35 | |||
| 36 |