ATLAS Offline Software
|
#include <SCT_OnlineId.h>
Public Types | |
enum | { FIRST_FIBRE =0, LAST_FIBRE =95, INVALID_FIBRE =255, INVALID_ROD =16777215, NUM_FIBRES =96, MAX_INDEX =19871, NUMBER_OF_INDICES =19872, INVALID_INDEX =0xFFFFFFFF, INVALID_ONLINE_ID =0xFFFFFFFF } |
Constants for evaluating hash indices of the online id. The hashing formula is in 'index()'. More... | |
Public Member Functions | |
SCT_OnlineId () | |
Default constructor produces an invalid serial number. More... | |
SCT_OnlineId (const std::uint32_t onlineId) | |
Construct from uint32. More... | |
SCT_OnlineId (const std::uint32_t rodId, const std::uint32_t fibre) | |
Construct from robId and fibre; a cursory check is made on validity of the input. More... | |
std::uint32_t | rod () const |
Return the rod/rob Id. More... | |
std::uint32_t | fibre () const |
Return the fibre. More... | |
operator unsigned int () const | |
Overload cast to uint. More... | |
bool | is_valid (const bool usingDbCabling) const |
Check whether the onlineId is valid, with flag to switch between validity from the database or text file cabling source. More... | |
bool | is_valid () const |
Check whether the onlineId is valid, without knowing the data source; this is a rough check. More... | |
unsigned int | index () const |
Return an index in the range 0-9215, calculated from parts of the onlineId. More... | |
SCT_OnlineId & | operator++ () |
Implement pre-increment and post-increment for iterating over fibres in a rod. More... | |
SCT_OnlineId | operator++ (int) |
Static Public Member Functions | |
static bool | rodIdInRange (std::uint32_t r) |
Is the rod in range? More... | |
Private Member Functions | |
bool | fibreInRange (std::uint32_t f) const |
Simple range check. More... | |
bool | couldBeValid (std::uint32_t r) |
Rough check on validity. More... | |
bool | rodIdInRange (std::uint32_t r, const bool usingDbCabling) const |
Check on validity. More... | |
Private Attributes | |
std::uint32_t | m_onlineId |
The underlying number. More... | |
SCT_OnlineId is a class to hold an online id number and provide check on validity, and conversions between the different formats. In general, an SCT online id has 32 bits composed of the robId (0-23) and the fibre number (24-31)
Definition at line 22 of file SCT_OnlineId.h.
anonymous enum |
Constants for evaluating hash indices of the online id. The hashing formula is in 'index()'.
Enumerator | |
---|---|
FIRST_FIBRE | |
LAST_FIBRE | |
INVALID_FIBRE | |
INVALID_ROD | |
NUM_FIBRES | |
MAX_INDEX | |
NUMBER_OF_INDICES | |
INVALID_INDEX | |
INVALID_ONLINE_ID |
Definition at line 56 of file SCT_OnlineId.h.
SCT_OnlineId::SCT_OnlineId | ( | ) |
Default constructor produces an invalid serial number.
Definition at line 23 of file SCT_OnlineId.cxx.
SCT_OnlineId::SCT_OnlineId | ( | const std::uint32_t | onlineId | ) |
Construct from uint32.
Definition at line 28 of file SCT_OnlineId.cxx.
Construct from robId and fibre; a cursory check is made on validity of the input.
Definition at line 32 of file SCT_OnlineId.cxx.
|
private |
Rough check on validity.
std::uint32_t SCT_OnlineId::fibre | ( | ) | const |
Return the fibre.
Definition at line 65 of file SCT_OnlineId.cxx.
|
private |
Simple range check.
Definition at line 88 of file SCT_OnlineId.cxx.
unsigned int SCT_OnlineId::index | ( | ) | const |
Return an index in the range 0-9215, calculated from parts of the onlineId.
if ((Z > 11) or (nibble<1>(m_onlineId)==1) ){//its montecarlo Y=1; possible Z values at this point are 12,13,14,15 (nibble 1 is zero) and 0,1,2,3,4,5 (nibble 1 is 1) so we map these onto 0-9 Z= (Z > 11) ? (Z-6) : Z; }
Definition at line 112 of file SCT_OnlineId.cxx.
bool SCT_OnlineId::is_valid | ( | ) | const |
Check whether the onlineId is valid, without knowing the data source; this is a rough check.
Definition at line 82 of file SCT_OnlineId.cxx.
bool SCT_OnlineId::is_valid | ( | const bool | usingDbCabling | ) | const |
Check whether the onlineId is valid, with flag to switch between validity from the database or text file cabling source.
Definition at line 76 of file SCT_OnlineId.cxx.
SCT_OnlineId::operator unsigned int | ( | ) | const |
Overload cast to uint.
Definition at line 70 of file SCT_OnlineId.cxx.
SCT_OnlineId & SCT_OnlineId::operator++ | ( | ) |
Implement pre-increment and post-increment for iterating over fibres in a rod.
Definition at line 43 of file SCT_OnlineId.cxx.
SCT_OnlineId SCT_OnlineId::operator++ | ( | int | ) |
Definition at line 50 of file SCT_OnlineId.cxx.
std::uint32_t SCT_OnlineId::rod | ( | ) | const |
Return the rod/rob Id.
Definition at line 59 of file SCT_OnlineId.cxx.
|
static |
|
private |
Check on validity.
Definition at line 100 of file SCT_OnlineId.cxx.
|
private |
The underlying number.
Definition at line 66 of file SCT_OnlineId.h.