ATLAS Offline Software
Loading...
Searching...
No Matches
GlobalSim::v1::Tower Class Reference

#include <Tower.h>

Inheritance diagram for GlobalSim::v1::Tower:
Collaboration diagram for GlobalSim::v1::Tower:

Public Types

using bitset_type
using BaseSpec

Public Member Functions

 DECLARE_FIELDS (ptt, eta, phi, flag_et_overflow, flag_error, flag_next_tob_same_et, flag_truncate)

Static Public Member Functions

static constexpr decltype(auto) field ()
static constexpr std::size_t numFields ()
static constexpr void forEachField (auto &&func)
static constexpr std::string json ()
static bitset_type packFields (const Fields &fields, const SG::AuxElement &obj)

Static Public Attributes

static const BitField< 0, 12, float > ptt {{.name="ptt", .auxvar="et", .description="Transverse energy", .scale=0.1, .centre=0}}
static const SignedBitField< 13, 22, float > eta {{.name="eta", .description="Eta coordinate",.scale=0.1}}
static const UnclampedBitField< 23, 31, float > phi {{.name="phi", .description="Phi coordinate",.scale=M_PI/32}}
static const BitField< 32, 32, uint8_t, bool > flag_et_overflow {"flag_et_overflow", "flags[0]","flag description placeholder"}
static const BitField< 33, 33, uint8_t, bool > flag_error {"flag_error", "flags[1]","flag description placeholder"}
static const BitField< 34, 34, uint8_t, bool > flag_next_tob_same_et {"flag_next_tob_same_et","flags[2]","flag description placeholder"}
static const BitField< 35, 35, uint8_t, bool > flag_truncate {"flag_truncate", "flags[3]","flag description placeholder"}
static constexpr std::size_t width

Static Protected Member Functions

static constexpr auto makeFields (Fields &... fields)
static constexpr auto allFields ()
static consteval bool validateFields ()

Static Private Member Functions

static consteval bool validateFieldList ()
static consteval bool validateField ()
static consteval bool checkOverlap ()

Detailed Description

Definition at line 13 of file Tower.h.

Member Typedef Documentation

◆ BaseSpec

using GlobalSim::BitSpec< Tower, N, NoBase >::BaseSpec
inherited

Definition at line 642 of file BitSpec.h.

◆ bitset_type

using GlobalSim::BitSpec< Tower, N, NoBase >::bitset_type
inherited

Definition at line 640 of file BitSpec.h.

Member Function Documentation

◆ allFields()

constexpr auto GlobalSim::BitSpec< Tower, N, NoBase >::allFields ( )
inlinestaticconstexprprotectedinherited

Definition at line 687 of file BitSpec.h.

688 {
689 return std::tuple_cat(
692 );
693 }

◆ checkOverlap()

consteval bool GlobalSim::BitSpec< Tower, N, NoBase >::checkOverlap ( )
inlinestaticconstevalprivateinherited

Definition at line 767 of file BitSpec.h.

767 {
768 if (A::lo <= B::hi && B::lo <= A::hi) {
769 return true;
770 }
771 return false;
772 }

◆ DECLARE_FIELDS()

GlobalSim::v1::Tower::DECLARE_FIELDS ( ptt ,
eta ,
phi ,
flag_et_overflow ,
flag_error ,
flag_next_tob_same_et ,
flag_truncate  )

◆ field()

constexpr decltype(auto) GlobalSim::BitSpec< Tower, N, NoBase >::field ( )
inlinestaticconstexprinherited

Definition at line 646 of file BitSpec.h.

646 {
648 }

◆ forEachField()

constexpr void GlobalSim::BitSpec< Tower, N, NoBase >::forEachField ( auto && func)
inlinestaticconstexprinherited

Definition at line 658 of file BitSpec.h.

658 {
659 std::apply([&](const auto *... field) { (func(*field), ...); }, Derived::allFields());
660 }

◆ json()

constexpr std::string GlobalSim::BitSpec< Tower, N, NoBase >::json ( )
inlinestaticconstexprinherited

Definition at line 663 of file BitSpec.h.

663 {
665 j["data_width"] = width;
666 j["fields"] = nlohmann::json::array();
667 forEachField([&](const auto &field) {
669 f["name"] = field.name;
670 f["description"] = field.description;
671 f["start"] = field.lo;
672 f["width"] = field.width;
673 j["fields"].push_back(f);
674 });
675 return j.dump(4);
676 }
static constexpr std::size_t width
Definition BitSpec.h:639
static constexpr void forEachField(auto &&func)
Definition BitSpec.h:658

◆ makeFields()

constexpr auto GlobalSim::BitSpec< Tower, N, NoBase >::makeFields ( Fields &... fields)
inlinestaticconstexprprotectedinherited

Definition at line 682 of file BitSpec.h.

682 {
683 return std::tuple{&fields...};
684 }

◆ numFields()

constexpr std::size_t GlobalSim::BitSpec< Tower, N, NoBase >::numFields ( )
inlinestaticconstexprinherited

Definition at line 653 of file BitSpec.h.

653 {
655 }

◆ packFields()

bitset_type GlobalSim::BitSpec< Tower, N, NoBase >::packFields ( const Fields & fields,
const SG::AuxElement & obj )
inlinestaticinherited

Definition at line 701 of file BitSpec.h.

701 {
703
705 [&](const auto *... field) {
706 (field->pack(result, obj), ...);
707 },
708 fields);
709
710 return result;
711 }

◆ validateField()

consteval bool GlobalSim::BitSpec< Tower, N, NoBase >::validateField ( )
inlinestaticconstevalprivateinherited

Definition at line 758 of file BitSpec.h.

758 {
759 return Field::lo <= Field::hi && Field::hi < N;
760 }

◆ validateFieldList()

consteval bool GlobalSim::BitSpec< Tower, N, NoBase >::validateFieldList ( )
inlinestaticconstevalprivateinherited

Definition at line 742 of file BitSpec.h.

743 {
744 if constexpr (sizeof...(Rest) == 0)
745 {
746 return validateField<First>();
747 }
748 else
749 {
750 return validateField<First>() &&
751 (validateField<Rest>() && ...) &&
752 ((!checkOverlap<First, Rest>()) && ...) &&
754 }
755 }
static consteval bool validateField()
Definition BitSpec.h:758
static consteval bool checkOverlap()
Definition BitSpec.h:767

◆ validateFields()

consteval bool GlobalSim::BitSpec< Tower, N, NoBase >::validateFields ( )
inlinestaticconstevalprotectedinherited

Definition at line 725 of file BitSpec.h.

726 {
727 return std::apply(
728 []<typename... FieldPtrs>(FieldPtrs... field) {
729 return validateFieldList<
730 std::remove_cvref_t<decltype(*field)>...
731 >();
732 },
734 }

Member Data Documentation

◆ eta

const SignedBitField<13, 22, float> GlobalSim::v1::Tower::eta {{.name="eta", .description="Eta coordinate",.scale=0.1}}
inlinestatic

Definition at line 24 of file Tower.h.

24{{.name="eta", .description="Eta coordinate",.scale=0.1}};

◆ flag_error

const BitField<33, 33, uint8_t, bool> GlobalSim::v1::Tower::flag_error {"flag_error", "flags[1]","flag description placeholder"}
inlinestatic

Definition at line 28 of file Tower.h.

28{"flag_error", "flags[1]","flag description placeholder"};

◆ flag_et_overflow

const BitField<32, 32, uint8_t, bool> GlobalSim::v1::Tower::flag_et_overflow {"flag_et_overflow", "flags[0]","flag description placeholder"}
inlinestatic

Definition at line 27 of file Tower.h.

27{"flag_et_overflow", "flags[0]","flag description placeholder"};

◆ flag_next_tob_same_et

const BitField<34, 34, uint8_t, bool> GlobalSim::v1::Tower::flag_next_tob_same_et {"flag_next_tob_same_et","flags[2]","flag description placeholder"}
inlinestatic

Definition at line 29 of file Tower.h.

29{"flag_next_tob_same_et","flags[2]","flag description placeholder"};

◆ flag_truncate

const BitField<35, 35, uint8_t, bool> GlobalSim::v1::Tower::flag_truncate {"flag_truncate", "flags[3]","flag description placeholder"}
inlinestatic

Definition at line 30 of file Tower.h.

30{"flag_truncate", "flags[3]","flag description placeholder"};

◆ phi

const UnclampedBitField<23, 31, float> GlobalSim::v1::Tower::phi {{.name="phi", .description="Phi coordinate",.scale=M_PI/32}}
inlinestatic

Definition at line 25 of file Tower.h.

25{{.name="phi", .description="Phi coordinate",.scale=M_PI/32}};
#define M_PI

◆ ptt

const BitField<0, 12, float> GlobalSim::v1::Tower::ptt {{.name="ptt", .auxvar="et", .description="Transverse energy", .scale=0.1, .centre=0}}
inlinestatic

Definition at line 23 of file Tower.h.

23{{.name="ptt", .auxvar="et", .description="Transverse energy", .scale=0.1/*GeV*/, .centre=0}};

◆ width

std::size_t GlobalSim::BitSpec< Tower, N, NoBase >::width
staticconstexprinherited

Definition at line 639 of file BitSpec.h.


The documentation for this class was generated from the following file: