ATLAS Offline Software
Loading...
Searching...
No Matches
Object.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3 */
4
5#ifndef GLOBALSIM_OBJECT_H
6#define GLOBALSIM_OBJECT_H
7
10
11namespace GlobalSim {
12
13 template<typename Spec>
14 class Object : public Spec::ObjectAcc {
15 public:
16 static constexpr Spec spec{}; // allows access to the BitSpec with obj.spec. syntax
17
18
19 explicit Object(const SG::AuxElement &obj) : Spec::ObjectAcc(obj) {
20
21 }
22
23 explicit Object() : Object([]() -> const SG::AuxElement & {
24 auto out = (new SG::AuxElement);
25 out->makePrivateStore();
26 return *out;
27 }()) {
28 // should remove this constructor in time ...
29 }
30
31 // ------------------------------------------------------------------------
32 // Complete packed representation.
33 // ------------------------------------------------------------------------
34
35 Spec::bitset_type bits() const {
36 return Spec::packFields(Spec::fields, Spec::ObjectAcc::m_obj);
37 }
38
39 void operator=(const Spec::bitset_type &bits) {
40 std::apply([&](const auto *... field) {
41 (field->decodeAndAssignFrom(bits, const_cast<SG::AuxElement &>(Spec::ObjectAcc::m_obj)), ...);
42 },
43 Spec::fields);
44 }
45
46 public:
47 const SG::AuxElement *objectPtr() const {
48 return &this->Spec::ObjectAcc::m_obj;
49 }
50
51 void dump() const {
53 }
54
55
56 };
57
58}
59
60#endif
Base class for elements of a container that can have aux data.
const SG::AuxElement * objectPtr() const
Definition Object.h:47
void dump() const
Definition Object.h:51
static constexpr Spec spec
Definition Object.h:16
Object(const SG::AuxElement &obj)
Definition Object.h:19
void operator=(const Spec::bitset_type &bits)
Definition Object.h:39
Spec::bitset_type bits() const
Definition Object.h:35
AlgTool to read in LArStripNeighborhoods, and run the BDT Algorithm.
Definition BitSpec.h:23
Forward declaration.
AuxElement(SG::AuxVectorData *container, size_t index)
Base class for elements of a container that can have aux data.
void dump(const SG::AuxElement &obj)
Helper function for dumping xAOD objects on the screen in PyROOT.