ATLAS Offline Software
Loading...
Searching...
No Matches
CommonTOB.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
11
12#ifndef GLOBALSIM_COMMONTOB_H
13#define GLOBALSIM_COMMONTOB_H
14
17
18#include <bitset>
19
20namespace GlobalSim::IOBitwise{
22 class CommonTOB {
23
24 public:
25
26
28 static constexpr std::size_t s_et_width{13};
30 static constexpr std::size_t s_eta_width{10};
32 static constexpr std::size_t s_phi_width{9};
33
34 static constexpr std::size_t s_eFex_granularity{100}; // MeV
35
36 static constexpr ulong max_et{(1UL << s_et_width)-1};
37 // Errors if 0 or small
38 static_assert(max_et != 0 && max_et <(1ULL << 63),
39 "Overflow or UB detected!");
40
41
48 CommonTOB(const xAOD::eFexEMRoI& eFexTOB);
56
65 CommonTOB(const std::bitset<s_et_width>& et_bits,
66 const std::bitset<s_eta_width>& eta_bits,
67 const std::bitset<s_phi_width>& phi_bits);
68
70 virtual ~CommonTOB(){};
71
73 virtual std::bitset<s_et_width> et_bits() const;
75 virtual std::bitset<s_eta_width> eta_bits() const;
77 virtual std::bitset<s_phi_width> phi_bits() const;
78
79 virtual std::string to_string() const;
80 private:
82 std::bitset<s_et_width> m_et_bits;
84 std::bitset<s_eta_width> m_eta_bits;
86 std::bitset<s_phi_width> m_phi_bits;
87 };
88
89} //End of namespace
90
92
93#endif //GLOBALSIM_COMMONTOB_H
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
CommonTOB(const xAOD::eFexEMRoI &eFexTOB)
Constructor taking an eFexROITOB to initialise common bits.
Definition CommonTOB.cxx:10
static constexpr std::size_t s_eta_width
Size of the eta bitset.
Definition CommonTOB.h:30
virtual std::bitset< s_et_width > et_bits() const
Definition CommonTOB.cxx:28
std::bitset< s_et_width > m_et_bits
Property: eT bitset within the common TOB word.
Definition CommonTOB.h:82
static constexpr ulong max_et
Definition CommonTOB.h:36
CommonTOB(const std::bitset< s_et_width > &et_bits, const std::bitset< s_eta_width > &eta_bits, const std::bitset< s_phi_width > &phi_bits)
Constructor taking raw bitsets to initialise common bits.
static constexpr std::size_t s_et_width
Size of the eT bitset.
Definition CommonTOB.h:28
std::bitset< s_eta_width > m_eta_bits
Property: eta bitset within the common TOB word.
Definition CommonTOB.h:84
virtual std::bitset< s_eta_width > eta_bits() const
Definition CommonTOB.cxx:32
virtual std::bitset< s_phi_width > phi_bits() const
Definition CommonTOB.cxx:36
CommonTOB(const xAOD::eFexEMRoI &eFexTOB)
Constructor taking an eFexROITOB to initialise common bits.
Definition CommonTOB.cxx:10
static constexpr std::size_t s_eFex_granularity
Definition CommonTOB.h:34
virtual std::string to_string() const
Definition CommonTOB.cxx:40
static constexpr std::size_t s_phi_width
Size of the phi bitset.
Definition CommonTOB.h:32
std::bitset< s_phi_width > m_phi_bits
Property: phi bitset within the common TOB word.
Definition CommonTOB.h:86
eFexEMRoI_v1 eFexEMRoI
Define the latest version of the eFexEMRoI class.
Definition eFexEMRoI.h:17