ATLAS Offline Software
Loading...
Searching...
No Matches
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
11
12#ifndef GLOBALSIM_ICOMMONTOB_H
13#define GLOBALSIM_ICOMMONTOB_H
14
15#include <bitset>
16#include <ostream>
18
19namespace GlobalSim::IOBitwise{
26
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
61
62} //End of namespace
63
64std::ostream& operator << (std::ostream&,
66
69
70#endif //GLOBALSIM_ICOMMONTOB_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
std::ostream & operator<<(std::ostream &, const GlobalSim::IOBitwise::ICommonTOB &)
Class to hold common (eta/eta/phi) TOB bits.
Definition ICommonTOB.h:27
virtual std::bitset< s_et_width > et_bits() const =0
Returns the eT bits of this TOB.
virtual std::string to_string() const =0
print out contents to string
static constexpr std::size_t s_eta_width
Size of the eta bitset.
Definition ICommonTOB.h:37
static constexpr ulong max_et
Definition ICommonTOB.h:43
static constexpr std::size_t s_phi_width
Size of the phi bitset.
Definition ICommonTOB.h:39
virtual ~ICommonTOB()
Destructor.
Definition ICommonTOB.h:32
static constexpr std::size_t s_et_width
Size of the eT bitset.
Definition ICommonTOB.h:35
static constexpr std::size_t s_eFex_granularity
Definition ICommonTOB.h:41
virtual std::bitset< s_eta_width > eta_bits() const =0
Returns the eta bits of this TOB.
virtual std::bitset< s_phi_width > phi_bits() const =0
Returns the phi bits of this TOB.
std::vector< std::shared_ptr< ICommonTOB > > ICommonTOBContainer
Definition ICommonTOB.h:58
AlgTool that to test whether expected the TIP values generated by data supplied by eEmMultTestBench c...