ATLAS Offline Software
Public Member Functions | Static Public Attributes | Private Attributes | List of all members
GlobalSim::GenericTob Class Reference

#include <GenericTob.h>

Collaboration diagram for GlobalSim::GenericTob:

Public Member Functions

 GenericTob ()
 
 GenericTob (const eEmTob &in_tob)
 
 GenericTob (const eEmTobPtr &in_tob)
 
 GenericTob (const eTauTob &in_tob)
 
 GenericTob (const eTauTobPtr &in_tob)
 
 GenericTob (const std::string &)
 
const std::bitset< 13 > & Et_bits () const
 
const std::bitset< 9 > & Eta_bits () const
 
const std::bitset< 7 > & Phi_bits () const
 
const std::bitset< 2 > & Charge_bits () const
 
const std::bitset< 1 > & overflow_bits () const
 
std::bitset< 32 > as_bits () const
 
int Et () const
 
int Eta () const
 
int Phi () const
 
int Charge () const
 

Static Public Attributes

constexpr static std::size_t GenericEtBitWidth {13}
 
constexpr static std::size_t GenericEtaBitWidth {9}
 
constexpr static std::size_t GenericAbsoluteEtBitWidth {GenericEtaBitWidth-1}
 
constexpr static std::size_t GenericPhiBitWidth {7}
 
constexpr static std::size_t GenericMuonFlagBitWidth {2}
 
constexpr static std::size_t GenericOverflowWidth {1}
 
constexpr static std::size_t GenericTobWidth
 

Private Attributes

std::bitset< GenericEtBitWidthm_Et_bits
 
std::bitset< GenericEtaBitWidthm_Eta_bits
 
std::bitset< GenericPhiBitWidthm_Phi_bits
 
std::bitset< GenericMuonFlagBitWidthm_Charge_bits
 
std::bitset< 1 > m_Overflow_bits
 

Detailed Description

Definition at line 20 of file GenericTob.h.

Constructor & Destructor Documentation

◆ GenericTob() [1/6]

GlobalSim::GenericTob::GenericTob ( )
inline

Definition at line 39 of file GenericTob.h.

39 {};

◆ GenericTob() [2/6]

GlobalSim::GenericTob::GenericTob ( const eEmTob in_tob)

Definition at line 30 of file GenericTob.cxx.

30  {
31 
32  {
33  const auto& in = in_tob.Et_bits();
34  auto sz = in.size();
35  for (auto i = 0U; i != sz; ++i) {m_Et_bits[i] = in[i];}
36  }
37 
38 
39  {
40  const auto& in = in_tob.Eta_bits();
41 
42  // vhdl etaL to_signed(unsigned(-100 + in, GenericEtaBitWidth)
43  int val = (-0x64 + bitSetToInt(in));
44 
45  bool neg{val < 0};
46  m_Eta_bits = std::abs(val);
47  if (neg) {m_Eta_bits = m_Eta_bits.flip().to_ulong()+1;}
48  }
49 
50  {
51  const auto& in = in_tob.Phi_bits();
52  m_Phi_bits = 2*(bitSetToInt(in)+2);
53  }
54 
55  }

◆ GenericTob() [3/6]

GlobalSim::GenericTob::GenericTob ( const eEmTobPtr in_tob)

Definition at line 57 of file GenericTob.cxx.

57 : GenericTob(*in_tob){}

◆ GenericTob() [4/6]

GlobalSim::GenericTob::GenericTob ( const eTauTob in_tob)

Definition at line 60 of file GenericTob.cxx.

60  {
61 
62  const auto& etob_et = in_tob.Et_bits();
63  auto sz = etob_et.size();
64  for (auto i = 0U; i != sz; ++i) {m_Et_bits[i] = etob_et[i];}
65 
66 
67  const auto& etob_eta = in_tob.Eta_bits();
68  m_Eta_bits = genEtaFromTobEta(etob_eta);
69 
70  const auto& etob_phi = in_tob.Phi_bits();
71  m_Phi_bits = 2*(bitSetToInt(etob_phi)+2);
72 
73  }

◆ GenericTob() [5/6]

GlobalSim::GenericTob::GenericTob ( const eTauTobPtr in_tob)

Definition at line 75 of file GenericTob.cxx.

75 : GenericTob(*in_tob) {}

◆ GenericTob() [6/6]

GlobalSim::GenericTob::GenericTob ( const std::string &  bit_string)

Definition at line 78 of file GenericTob.cxx.

78  {
79  if(bit_string.size() != GenericTobWidth) {
80  std::stringstream ss;
81  ss << "GenericTob ctr expected " << GenericTobWidth
82  << " bits, received " << bit_string.size();
83  throw std::out_of_range(ss.str());
84  }
85 
86  auto bitstream = std::stringstream(bit_string);
87  bitstream >> m_Overflow_bits;
88  bitstream >> m_Charge_bits;
89  bitstream >> m_Phi_bits;
90  bitstream >> m_Eta_bits;
91  bitstream >> m_Et_bits;
92 
93  }

Member Function Documentation

◆ as_bits()

std::bitset< 32 > GlobalSim::GenericTob::as_bits ( ) const

Definition at line 95 of file GenericTob.cxx.

95  {
96 
97  auto result = std::bitset<32>();
98 
99  std::size_t begin = 0;
100  std::size_t end = GenericEtBitWidth;;
101 
102 
103  for(std::size_t i = begin; i != end; ++i) {
104  result[i] = m_Et_bits[i];
105  }
106 
107  begin = end;
109 
110  for(std::size_t i = 0; i != GenericEtaBitWidth; ++i) {
111  result[begin+i] = m_Eta_bits[i];
112  }
113 
114  begin = end;
116 
117  for(std::size_t i = 0; i != GenericPhiBitWidth; ++i) {
118  result[begin+i] = m_Phi_bits[i];
119  }
120 
121 
122  begin = end;
124 
125  for(std::size_t i = 0; i != GenericMuonFlagBitWidth; ++i) {
126  result[begin+i] = m_Phi_bits[i];
127  }
128 
129  begin = end;
131 
132  for(std::size_t i = 0; i != GenericOverflowWidth; ++i) {
134  }
135 
136  return result;
137 
138  }

◆ Charge()

int GlobalSim::GenericTob::Charge ( ) const
inline

Definition at line 57 of file GenericTob.h.

57 {return bitSetToInt(m_Charge_bits);}

◆ Charge_bits()

const std::bitset<2>& GlobalSim::GenericTob::Charge_bits ( ) const
inline

Definition at line 50 of file GenericTob.h.

50 {return m_Charge_bits;}

◆ Et()

int GlobalSim::GenericTob::Et ( ) const
inline

Definition at line 54 of file GenericTob.h.

54 {return bitSetToInt(m_Et_bits);}

◆ Et_bits()

const std::bitset<13>& GlobalSim::GenericTob::Et_bits ( ) const
inline

Definition at line 47 of file GenericTob.h.

47 {return m_Et_bits;}

◆ Eta()

int GlobalSim::GenericTob::Eta ( ) const
inline

Definition at line 55 of file GenericTob.h.

55 {return bitSetToInt(m_Eta_bits);}

◆ Eta_bits()

const std::bitset<9>& GlobalSim::GenericTob::Eta_bits ( ) const
inline

Definition at line 48 of file GenericTob.h.

48 {return m_Eta_bits;}

◆ overflow_bits()

const std::bitset<1>& GlobalSim::GenericTob::overflow_bits ( ) const
inline

Definition at line 51 of file GenericTob.h.

51 {return m_Overflow_bits;}

◆ Phi()

int GlobalSim::GenericTob::Phi ( ) const
inline

Definition at line 56 of file GenericTob.h.

56 {return bitSetToInt(m_Phi_bits);}

◆ Phi_bits()

const std::bitset<7>& GlobalSim::GenericTob::Phi_bits ( ) const
inline

Definition at line 49 of file GenericTob.h.

49 {return m_Phi_bits;}

Member Data Documentation

◆ GenericAbsoluteEtBitWidth

constexpr static std::size_t GlobalSim::GenericTob::GenericAbsoluteEtBitWidth {GenericEtaBitWidth-1}
staticconstexpr

Definition at line 28 of file GenericTob.h.

◆ GenericEtaBitWidth

constexpr static std::size_t GlobalSim::GenericTob::GenericEtaBitWidth {9}
staticconstexpr

Definition at line 25 of file GenericTob.h.

◆ GenericEtBitWidth

constexpr static std::size_t GlobalSim::GenericTob::GenericEtBitWidth {13}
staticconstexpr

Definition at line 24 of file GenericTob.h.

◆ GenericMuonFlagBitWidth

constexpr static std::size_t GlobalSim::GenericTob::GenericMuonFlagBitWidth {2}
staticconstexpr

Definition at line 31 of file GenericTob.h.

◆ GenericOverflowWidth

constexpr static std::size_t GlobalSim::GenericTob::GenericOverflowWidth {1}
staticconstexpr

Definition at line 32 of file GenericTob.h.

◆ GenericPhiBitWidth

constexpr static std::size_t GlobalSim::GenericTob::GenericPhiBitWidth {7}
staticconstexpr

Definition at line 30 of file GenericTob.h.

◆ GenericTobWidth

constexpr static std::size_t GlobalSim::GenericTob::GenericTobWidth
staticconstexpr

◆ m_Charge_bits

std::bitset<GenericMuonFlagBitWidth> GlobalSim::GenericTob::m_Charge_bits
private

Definition at line 67 of file GenericTob.h.

◆ m_Et_bits

std::bitset<GenericEtBitWidth> GlobalSim::GenericTob::m_Et_bits
private

Definition at line 64 of file GenericTob.h.

◆ m_Eta_bits

std::bitset<GenericEtaBitWidth> GlobalSim::GenericTob::m_Eta_bits
private

Definition at line 65 of file GenericTob.h.

◆ m_Overflow_bits

std::bitset<1> GlobalSim::GenericTob::m_Overflow_bits
private

Definition at line 68 of file GenericTob.h.

◆ m_Phi_bits

std::bitset<GenericPhiBitWidth> GlobalSim::GenericTob::m_Phi_bits
private

Definition at line 66 of file GenericTob.h.


The documentation for this class was generated from the following files:
GlobalSim::GenericTob::GenericEtBitWidth
constexpr static std::size_t GenericEtBitWidth
Definition: GenericTob.h:24
GlobalSim::GenericTob::m_Phi_bits
std::bitset< GenericPhiBitWidth > m_Phi_bits
Definition: GenericTob.h:66
GlobalSim::GenericTob::m_Charge_bits
std::bitset< GenericMuonFlagBitWidth > m_Charge_bits
Definition: GenericTob.h:67
fitman.sz
sz
Definition: fitman.py:527
get_generator_info.result
result
Definition: get_generator_info.py:21
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
GlobalSim::GenericTob::m_Eta_bits
std::bitset< GenericEtaBitWidth > m_Eta_bits
Definition: GenericTob.h:65
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
GlobalSim::bitSetToInt
int bitSetToInt(BITSET bitset)
Definition: AlgoDataTypes.h:19
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:92
GlobalSim::GenericTob::GenericMuonFlagBitWidth
constexpr static std::size_t GenericMuonFlagBitWidth
Definition: GenericTob.h:31
lumiFormat.i
int i
Definition: lumiFormat.py:85
GlobalSim::GenericTob::m_Overflow_bits
std::bitset< 1 > m_Overflow_bits
Definition: GenericTob.h:68
GlobalSim::GenericTob::GenericOverflowWidth
constexpr static std::size_t GenericOverflowWidth
Definition: GenericTob.h:32
GlobalSim::GenericTob::GenericTobWidth
constexpr static std::size_t GenericTobWidth
Definition: GenericTob.h:34
GlobalSim::GenericTob::GenericTob
GenericTob()
Definition: GenericTob.h:39
GlobalSim::GenericTob::GenericEtaBitWidth
constexpr static std::size_t GenericEtaBitWidth
Definition: GenericTob.h:25
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
GlobalSim::GenericTob::m_Et_bits
std::bitset< GenericEtBitWidth > m_Et_bits
Definition: GenericTob.h:64
GlobalSim::GenericTob::GenericPhiBitWidth
constexpr static std::size_t GenericPhiBitWidth
Definition: GenericTob.h:30
GlobalSim::genEtaFromTobEta
std::bitset< 9 > genEtaFromTobEta(const std::bitset< 8 > &in_eta)
Definition: GenericTob.cxx:12