ATLAS Offline Software
ICommonTOB.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
12 #ifndef GLOBALSIM_ICOMMONTOB_H
13 #define GLOBALSIM_ICOMMONTOB_H
14 
15 #include <bitset>
16 #include <ostream>
17 #include "AthenaKernel/CLASS_DEF.h"
18 
19 namespace GlobalSim::IOBitwise{
27  class ICommonTOB {
28 
29  public:
30 
32  virtual ~ICommonTOB(){}
33 
35  static constexpr std::size_t s_et_width{13};
37  static constexpr std::size_t s_eta_width{10};
39  static constexpr std::size_t s_phi_width{9};
40 
41  static constexpr std::size_t s_eFex_granularity{100}; // MeV
42 
43  static constexpr ulong max_et{(1UL << s_et_width)-1};
44  // Errors if 0 or small
45  static_assert(max_et != 0 && max_et <(1ULL << 63),
46  "Overflow or UB detected!");
47 
49  virtual std::bitset<s_et_width> et_bits() const = 0;
51  virtual std::bitset<s_eta_width> eta_bits() const = 0;
53  virtual std::bitset<s_phi_width> phi_bits() const = 0;
55  virtual std::string to_string() const = 0;
56  };
57 
58  using ICommonTOBContainer = std::vector<std::shared_ptr<ICommonTOB>>;
59 
62 } //End of namespace
63 
64 std::ostream& operator << (std::ostream&,
66 
68 CLASS_DEF( GlobalSim::IOBitwise::ICommonTOBContainer , 1229615490 , 1 )
69 
70 #endif //GLOBALSIM_ICOMMONTOB_H
GlobalSim::IOBitwise::ICommonTOB::s_eFex_granularity
static constexpr std::size_t s_eFex_granularity
Definition: ICommonTOB.h:41
GlobalSim::IOBitwise::ICommonTOB::to_string
virtual std::string to_string() const =0
print out contents to string
Definition: ICommonTOB.cxx:11
GlobalSim::IOBitwise::ICommonTOB::s_phi_width
static constexpr std::size_t s_phi_width
Size of the phi bitset.
Definition: ICommonTOB.h:39
GlobalSim::IOBitwise::ICommonTOB
Class to hold common (eta/eta/phi) TOB bits.
Definition: ICommonTOB.h:27
GlobalSim::IOBitwise::ICommonTOB::s_et_width
static constexpr std::size_t s_et_width
Size of the eT bitset.
Definition: ICommonTOB.h:35
GlobalSim
AlgTool that to test whether expected the TIP values generated by data supplied by eEmMultTestBench c...
Definition: CommonSelector.cxx:8
GlobalSim::IOBitwise::ICommonTOB::s_eta_width
static constexpr std::size_t s_eta_width
Size of the eta bitset.
Definition: ICommonTOB.h:37
GlobalSim::IOBitwise::ICommonTOBContainer
std::vector< std::shared_ptr< ICommonTOB > > ICommonTOBContainer
Definition: ICommonTOB.h:58
GlobalSim::IOBitwise
Definition: eEmMultAlgTool.h:18
GlobalSim::IOBitwise::ICommonTOB::eta_bits
virtual std::bitset< s_eta_width > eta_bits() const =0
Returns the eta bits of this TOB.
operator<<
std::ostream & operator<<(std::ostream &, const GlobalSim::IOBitwise::ICommonTOB &)
Definition: ICommonTOB.cxx:27
GlobalSim::IOBitwise::ICommonTOB::~ICommonTOB
virtual ~ICommonTOB()
Destructor.
Definition: ICommonTOB.h:32
GlobalSim::IOBitwise::ICommonTOB::et_bits
virtual std::bitset< s_et_width > et_bits() const =0
Returns the eT bits of this TOB.
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition: Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:67
GlobalSim::IOBitwise::ICommonTOB::max_et
static constexpr ulong max_et
Definition: ICommonTOB.h:43
GlobalSim::IOBitwise::ICommonTOB::phi_bits
virtual std::bitset< s_phi_width > phi_bits() const =0
Returns the phi bits of this TOB.
CLASS_DEF.h
macros to associate a CLID to a type