ATLAS Offline Software
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
7 
12 #include <string>
13 
23 public:
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  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 
74 private:
76  unsigned int m_truncatedNumber;
77 };
78 
79 #endif
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
SCT_SerialNumber::str
std::string str() const
Full serial number as a string
Definition: SCT_SerialNumber.cxx:56
SCT_SerialNumber::to_ulonglong
unsigned long long to_ulonglong() const
Full serial number as long long.
Definition: SCT_SerialNumber.cxx:72
SCT_SerialNumber::to_uint
unsigned int to_uint() const
Truncated serial number as unsigned int.
Definition: SCT_SerialNumber.cxx:67
SCT_SerialNumber
Definition: SCT_SerialNumber.h:22
SCT_SerialNumber::m_truncatedNumber
unsigned int m_truncatedNumber
The truncated number holds the integer part after the '20220' of the serial number.
Definition: SCT_SerialNumber.h:76
SCT_SerialNumber::isWellFormed
bool isWellFormed() const
Cursory check on whether the serial number is well formed N.B.
Definition: SCT_SerialNumber.cxx:81
SCT_SerialNumber::SCT_SerialNumber
SCT_SerialNumber()
Default constructor produces an invalid serial number.
Definition: SCT_SerialNumber.cxx:17
SCT_SerialNumber::is_valid
bool is_valid() const
Until a better test is made, is_valid returns only whether its well formed.
Definition: SCT_SerialNumber.h:72