ATLAS Offline Software
Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
HWIdentifier Class Reference

#include <HWIdentifier.h>

Inheritance diagram for HWIdentifier:
Collaboration diagram for HWIdentifier:

Public Types

enum  bit_defs { NBITS = sizeof(value_type) * 8, MAX_BIT = (static_cast<value_type>(1) << (NBITS - 1)), ALL_BITS = ~(static_cast<value_type>(0)) }
 
typedef enum Identifier::bit_defs_enum bit_defs
 
typedef enum Identifier::max_value_type_enum max_value_type
 
enum  bit_defs_enum { NBITS = sizeof(value_type) * 8, MAX_BIT = (static_cast<value_type>(1) << (NBITS - 1)), ALL_BITS = ~(static_cast<value_type>(0)) }
 
enum  max_value_type_enum { max_value = ~(static_cast<value_type>(0)) }
 
using id_type = Identifier
 
using value_type = unsigned long long
 
typedef Long64_t value_type
 
using diff_type = long long
 
using size_type = unsigned long long
 

Public Member Functions

 HWIdentifier ()=default
 Default constructor. More...
 
 HWIdentifier (value_type value)
 Constructor from value_type. More...
 
 HWIdentifier (const Identifier &old)
 Constructor from Identifier. More...
 
 HWIdentifier (Identifier32::value_type value)
 Constructor from Identifier32 value_type (unsigned int) More...
 
 HWIdentifier (int value)
 
void set (const std::string &id)
 build from a string form - hexadecimal More...
 
void clear ()
 Reset to invalid state. More...
 
Identifierset_literal (value_type value)
 Set literal value. More...
 
Identifier32 get_identifier32 () const
 Get the 32-bit version Identifier, will be invalid if >32 bits needed. More...
 
value_type get_compact () const
 Get the compact id. More...
 
bool operator== (const Identifier &other) const =default
 
bool operator== (value_type other) const
 Comparison operators with value_type. More...
 
bool operator== (Identifier32::value_type other) const
 
bool operator== (int other) const
 
bool operator== (const Identifier &other) const
 
bool operator== (Identifier::value_type other) const
 
auto operator (const Identifier &other) const
 
bool is_valid () const
 Check if id is in a valid state. More...
 
std::string getString () const
 Provide a string form of the identifier - hexadecimal. More...
 
void show () const
 Print out in hex form. More...
 
 operator value_type () const
 
bool operator!= (const Identifier &other) const
 
bool operator!= (Identifier::value_type other) const
 
bool operator< (const Identifier &other) const
 
bool operator> (const Identifier &other) const
 
bool operator<= (const Identifier &other) const
 
bool operator>= (const Identifier &other) const
 

Private Types

enum  max_value_type { max_value = ~(static_cast<value_type>(0)) }
 

Private Member Functions

Identifieroperator|= (value_type value)
 Bitwise operations. More...
 
Identifieroperator&= (value_type value)
 
value_type extract (size_type shift, size_type mask) const
 extract field from identifier (shift first, then mask) More...
 
value_type extract (size_type shift) const
 extract field, no mask More...
 
value_type mask_shift (value_type mask, size_type shift) const
 extract field(s) by masking first, then shifting More...
 

Private Attributes

value_type m_id = max_value
 The only data member. More...
 

Detailed Description

Definition at line 13 of file HWIdentifier.h.

Member Typedef Documentation

◆ bit_defs

◆ diff_type

using Identifier::diff_type = long long
inherited

◆ id_type

using Identifier::id_type = Identifier
inherited

◆ max_value_type

◆ size_type

using Identifier::size_type = unsigned long long
inherited

◆ value_type [1/2]

typedef Long64_t Identifier::value_type
inherited

◆ value_type [2/2]

using Identifier::value_type = unsigned long long
inherited

Member Enumeration Documentation

◆ bit_defs

enum Identifier::bit_defs
inherited
Enumerator
NBITS 
MAX_BIT 
ALL_BITS 

Definition at line 31 of file DetectorDescription/Identifier/Identifier/Identifier.h.

31  {
32  NBITS = sizeof(value_type) * 8, // bits per byte
33  MAX_BIT = (static_cast<value_type>(1) << (NBITS - 1)),
34  ALL_BITS = ~(static_cast<value_type>(0))
35  };

◆ bit_defs_enum

enum Identifier::bit_defs_enum
inherited
Enumerator
NBITS 
MAX_BIT 
ALL_BITS 

Definition at line 20 of file Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/Identifier/Identifier.h.

21  {
22  NBITS = sizeof(value_type) * 8, // bits per byte
23  MAX_BIT = (static_cast<value_type>(1) << (NBITS - 1)),
24  ALL_BITS = ~(static_cast<value_type>(0))
25  } bit_defs;

◆ max_value_type

enum Identifier::max_value_type
privateinherited
Enumerator
max_value 

Definition at line 128 of file DetectorDescription/Identifier/Identifier/Identifier.h.

128  {
129  max_value = ~(static_cast<value_type>(0))
130  };

◆ max_value_type_enum

Enumerator
max_value 

Definition at line 27 of file Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/Identifier/Identifier.h.

27  {
28  //max_value = 0xFFFFFFFFFFFFFFFFULL
29  max_value = ~(static_cast<value_type>(0))

Constructor & Destructor Documentation

◆ HWIdentifier() [1/5]

HWIdentifier::HWIdentifier ( )
default

Default constructor.

◆ HWIdentifier() [2/5]

HWIdentifier::HWIdentifier ( value_type  value)
inlineexplicit

Constructor from value_type.

Definition at line 45 of file HWIdentifier.h.

47 {}

◆ HWIdentifier() [3/5]

HWIdentifier::HWIdentifier ( const Identifier old)
inlineexplicit

Constructor from Identifier.

Definition at line 49 of file HWIdentifier.h.

51 {}

◆ HWIdentifier() [4/5]

HWIdentifier::HWIdentifier ( Identifier32::value_type  value)
inlineexplicit

Constructor from Identifier32 value_type (unsigned int)

Definition at line 53 of file HWIdentifier.h.

55 {}

◆ HWIdentifier() [5/5]

HWIdentifier::HWIdentifier ( int  value)
inlineexplicit

Definition at line 57 of file HWIdentifier.h.

59 {}

Member Function Documentation

◆ clear()

void Identifier::clear ( )
inherited

Reset to invalid state.

◆ extract() [1/2]

value_type Identifier::extract ( size_type  shift) const
privateinherited

extract field, no mask

◆ extract() [2/2]

value_type Identifier::extract ( size_type  shift,
size_type  mask 
) const
privateinherited

extract field from identifier (shift first, then mask)

◆ get_compact()

value_type Identifier::get_compact ( ) const
inherited

Get the compact id.

◆ get_identifier32()

Identifier32 Identifier::get_identifier32 ( ) const
inherited

Get the 32-bit version Identifier, will be invalid if >32 bits needed.

◆ getString()

std::string Identifier::getString ( ) const
inherited

Provide a string form of the identifier - hexadecimal.

Definition at line 25 of file Identifier.cxx.

25  {
26  return std::format("0x{:0x}", m_id);
27 }

◆ is_valid()

bool Identifier::is_valid ( ) const
inherited

Check if id is in a valid state.

◆ mask_shift()

value_type Identifier::mask_shift ( value_type  mask,
size_type  shift 
) const
privateinherited

extract field(s) by masking first, then shifting

◆ operator()

auto Identifier::operator ( const Identifier other) const
inlineinherited

Definition at line 92 of file DetectorDescription/Identifier/Identifier/Identifier.h.

92 {return m_id <=> other.m_id;}

◆ operator value_type()

Identifier::operator value_type ( ) const
inlineinherited

◆ operator!=() [1/2]

bool Identifier::operator!= ( const Identifier other) const
inlineinherited

◆ operator!=() [2/2]

bool Identifier::operator!= ( Identifier::value_type  other) const
inlineinherited

◆ operator&=()

Identifier& Identifier::operator&= ( value_type  value)
privateinherited

◆ operator<()

bool Identifier::operator< ( const Identifier other) const
inlineinherited

◆ operator<=()

bool Identifier::operator<= ( const Identifier other) const
inlineinherited

◆ operator==() [1/6]

bool Identifier::operator== ( const Identifier other) const
inlineinherited

◆ operator==() [2/6]

bool Identifier::operator== ( const Identifier other) const
defaultinherited

◆ operator==() [3/6]

bool Identifier::operator== ( Identifier32::value_type  other) const
inherited

◆ operator==() [4/6]

bool Identifier::operator== ( Identifier::value_type  other) const
inlineinherited

◆ operator==() [5/6]

bool Identifier::operator== ( int  other) const
inherited

◆ operator==() [6/6]

bool Identifier::operator== ( value_type  other) const
inherited

Comparison operators with value_type.

This is a hack, only because GeoAdaptors/GeoMuonHits wants to to compare explicitly with 0 as a test of whether the identifier has been constructed properly. But is_valid() here compares with max_value, not 0, since presumably it is possible to have a zero value - just not in muons.

◆ operator>()

bool Identifier::operator> ( const Identifier other) const
inlineinherited

◆ operator>=()

bool Identifier::operator>= ( const Identifier other) const
inlineinherited

◆ operator|=()

Identifier& Identifier::operator|= ( value_type  value)
privateinherited

Bitwise operations.

◆ set()

void Identifier::set ( const std::string &  id)
inherited

build from a string form - hexadecimal

Definition at line 12 of file Identifier.cxx.

12  {
13  const auto start = id.data();
14  const auto end = start + id.size();
15  static constexpr int base = 16;
16  //add 2 to start to get past the Ox prefix.
17  const auto [p,ec] = std::from_chars(start+2, end, m_id, base);
18  if (ec != std::errc()){
19  throw std::runtime_error("Number was not parsed in Identifier::set");
20  }
21 }

◆ set_literal()

Identifier& Identifier::set_literal ( value_type  value)
inherited

Set literal value.

◆ show()

void Identifier::show ( ) const
inherited

Print out in hex form.

Definition at line 30 of file Identifier.cxx.

30  {
31  const Identifier& me = *this;
32  std::cout << me.getString();
33 }

Member Data Documentation

◆ m_id

value_type Identifier::m_id = max_value
privateinherited

The only data member.

Definition at line 132 of file DetectorDescription/Identifier/Identifier/Identifier.h.


The documentation for this class was generated from the following file:
base
std::string base
Definition: hcg.cxx:78
vtune_athena.format
format
Definition: vtune_athena.py:14
Identifier::MAX_BIT
@ MAX_BIT
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:33
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
Identifier::max_value
@ max_value
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:129
athena.value
value
Definition: athena.py:124
Identifier::m_id
value_type m_id
The only data member.
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:132
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
Identifier::bit_defs
bit_defs
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:31
Identifier::ALL_BITS
@ ALL_BITS
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:34
Identifier::NBITS
@ NBITS
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
Identifier::getString
std::string getString() const
Provide a string form of the identifier - hexadecimal.
Definition: Identifier.cxx:25
Identifier::max_value_type
max_value_type
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:128
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
CSV_InDetExporter.old
old
Definition: CSV_InDetExporter.py:145
Identifier::value_type
unsigned long long value_type
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:27
value_type
Definition: EDM_MasterSearch.h:11
Identifier::Identifier
Identifier()=default
Default constructor.
Identifier
Definition: IdentifierFieldParser.cxx:14