ATLAS Offline Software
IdDictFieldImplementation.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3  */
4 
12 #include <iostream>
13 #include <format>
14 #include <string>
15 #include <string_view>
16 
17 
18 
19 const IdDictRange*
21 
22 void
24  m_range = range;
25 }
26 
27 void
29  std::cout << show_to_string() << std::endl;
30 }
31 
33  // Build the indexes list once
34  const auto& idx = m_ored_field.get_indexes();
35  std::string indexes;
36  indexes.reserve(idx.size() * 3);
37  for (std::size_t i = 0; i < idx.size(); ++i) {
38  if (i) indexes.push_back(' ');
39  indexes += std::to_string(idx[i]);
40  }
41  // Mode string
42  std::string_view mode =
43  m_ored_field.isBounded() ? "both_bounded"
44  : m_ored_field.isEnumerated() ? "enumerated"
45  : "unknown";
46  try{
47  return std::format(
48  "decode {:d} vals {:<15} "
49  "mask/zero mask/shift/bits/offset {:<3x} {:<3x} {:<3} {:<3} {:<3} "
50  "indexes {:<20} mode {} ",
52  static_cast<std::string>(m_ored_field),
53  m_mask,
55  m_shift,
56  m_bits,
58  indexes,
59  mode);
60  } catch (std::format_error & ){
61  return {};
62  }
63 }
vtune_athena.format
format
Definition: vtune_athena.py:14
IdDictFieldImplementation::show_to_string
std::string show_to_string(void) const
Definition: IdDictFieldImplementation.cxx:32
MuonR4::to_string
std::string to_string(const SectorProjector proj)
Definition: MsTrackSeeder.cxx:74
IdDictFieldImplementation::m_decode_index
bool m_decode_index
Definition: IdDictFieldImplementation.h:116
IdDictFieldImplementation::m_range
const IdDictRange * m_range
Definition: IdDictFieldImplementation.h:108
IdDictFieldImplementation::m_bits_offset
size_type m_bits_offset
Definition: IdDictFieldImplementation.h:112
IdDictFieldImplementation::m_mask
size_type m_mask
Definition: IdDictFieldImplementation.h:113
IdentifierField::get_indexes
const index_vector & get_indexes() const
Definition: IdentifierField.h:141
lumiFormat.i
int i
Definition: lumiFormat.py:85
IdDictFieldImplementation::m_zeroing_mask
value_type m_zeroing_mask
Definition: IdDictFieldImplementation.h:114
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:194
Preparation.mode
mode
Definition: Preparation.py:107
IdentifierField::isEnumerated
bool isEnumerated() const
Definition: IdentifierField.h:185
IdDictFieldImplementation::range
const IdDictRange * range() const
Accessors.
Definition: IdDictFieldImplementation.cxx:20
IdDictFieldImplementation::show
void show(void) const
Definition: IdDictFieldImplementation.cxx:28
IdDictFieldImplementation::set_range
void set_range(const IdDictRange *range)
Modifiers.
Definition: IdDictFieldImplementation.cxx:23
IdDictFieldImplementation::m_bits
size_type m_bits
Definition: IdDictFieldImplementation.h:111
IdDictFieldImplementation.h
IdentifierField::isBounded
bool isBounded() const
Definition: IdentifierField.h:184
IdDictRange
Definition: IdDictRange.h:18
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
IdDictFieldImplementation::m_ored_field
Range::field m_ored_field
Definition: IdDictFieldImplementation.h:110
IdDictFieldImplementation::m_shift
size_type m_shift
Definition: IdDictFieldImplementation.h:115