ATLAS Offline Software
Loading...
Searching...
No Matches
SCT_SerialNumber.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef SCT_SerialNumber_h
6#define SCT_SerialNumber_h
11
12#include <string>
13
21
23public:
26
30 SCT_SerialNumber(const std::string& snString);
31
35 SCT_SerialNumber(const unsigned long long fullSerialNumber);
36
40 SCT_SerialNumber(const long long fullSerialNumber);
41
45 SCT_SerialNumber(const unsigned int truncatedSerialNumber);
46
50 SCT_SerialNumber(const int truncatedSerialNumber);
51
53
54
55 std::string str() const;
57 unsigned int to_uint() const;
59 unsigned long long to_ulonglong() const;
61 operator unsigned int() const;
63
64
69 bool isWellFormed() const;
70
72 bool is_valid() const{ return isWellFormed(); }
73
74private:
76 unsigned int m_truncatedNumber;
77};
78
79#endif
SCT_SerialNumber()
Default constructor produces an invalid serial number.
unsigned long long to_ulonglong() const
Full serial number as long long.
std::string str() const
Full serial number as a string.
bool isWellFormed() const
Cursory check on whether the serial number is well formed N.B.
unsigned int to_uint() const
Truncated serial number as unsigned int.
unsigned int m_truncatedNumber
The truncated number holds the integer part after the '20220' of the serial number.
bool is_valid() const
Until a better test is made, is_valid returns only whether its well formed.