ATLAS Offline Software
Loading...
Searching...
No Matches
RAuxStore.h
Go to the documentation of this file.
1// Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
2#ifndef XAODROOTACCESS_RAUXSTORE_H
3#define XAODROOTACCESS_RAUXSTORE_H
4
5// Local include(s).
7
8// ROOT include(s).
9#include <ROOT/REntry.hxx>
10#include <ROOT/RNTupleModel.hxx>
11#include <ROOT/RNTupleReader.hxx>
12#include <ROOT/RNTupleWriter.hxx>
13
14// System include(s).
15#include <cstdint>
16#include <memory>
17#include <string_view>
18
19// Make the RNTuple types available in the ROOT namespace
20// with all versions of ROOT.
21#if ROOT_VERSION_CODE < ROOT_VERSION(6, 35, 1)
22namespace ROOT {
23using Experimental::RNTupleReader;
24using Experimental::RNTupleWriter;
25using Experimental::REntry;
26} // namespace ROOT
27#endif // ROOT_VERSION_CODE < ROOT_VERSION(6, 36, 0)
28
29
30// Forward declaration(s):
31class EventContext;
32
33namespace xAOD {
34
42
43 public:
45 RAuxStore(const EventContext& ctx,
46 std::string_view prefix = "", bool topStore = true,
49 virtual ~RAuxStore();
50
52 virtual void setPrefix(std::string_view prefix) override;
53
55 StatusCode readFrom(ROOT::RNTupleReader& reader);
57 StatusCode writeTo(ROOT::RNTupleWriter& writer);
58
60 StatusCode getEntry(std::int64_t entry, int getall = 0);
62 StatusCode commitTo(ROOT::REntry& entry);
63
66
68 virtual void reset() override;
69
70 private:
72 virtual bool hasEntryFor(SG::auxid_t auxid) const override;
74 virtual StatusCode getEntryFor(SG::auxid_t auxid) override;
76 virtual bool hasOutput() const override;
77
79 virtual StatusCode setupInputData(SG::auxid_t auxid) override;
81 virtual StatusCode setupOutputData(SG::auxid_t auxid) override;
82
84 virtual const void* getInputObject(SG::auxid_t auxid) const override;
86 virtual const std::type_info* getInputType(SG::auxid_t auxid) const override;
87
89
91 struct impl;
93 std::unique_ptr<impl> m_impl;
94
95}; // class RAuxStore
96} // namespace xAOD
97
98#endif // XAODROOTACCESS_RAUXSTORE_H
std::shared_ptr< HepMC3::Writer > writer
StatusCode readFrom(ROOT::RNTupleReader &reader)
Connect the object to an input RNTuple.
virtual const std::type_info * getInputType(SG::auxid_t auxid) const override
Get the type of an input object, for getIOType().
StatusCode writeTo(ROOT::RNTupleWriter &writer)
Add the variables of the store to an output RNTuple.
StatusCode getEntry(std::int64_t entry, int getall=0)
Get entry from the input RNTuple.
virtual StatusCode setupInputData(SG::auxid_t auxid) override
Connect a variable to the input.
virtual StatusCode getEntryFor(SG::auxid_t auxid) override
Load a single variable from the input.
std::unique_ptr< impl > m_impl
Pointer to the internal object.
Definition RAuxStore.h:93
virtual const void * getInputObject(SG::auxid_t auxid) const override
Get a pointer to an input object, as it is in memory, for getIOData().
virtual bool hasEntryFor(SG::auxid_t auxid) const override
Check if a given variable is available from the input.
virtual void setPrefix(std::string_view prefix) override
Set the object name prefix.
RAuxStore(const EventContext &ctx, std::string_view prefix="", bool topStore=true, EStructMode mode=EStructMode::kUndefinedStore)
Constructor.
StatusCode commitTo(ROOT::REntry &entry)
Commit a new entry to the output RNTuple.
virtual StatusCode setupOutputData(SG::auxid_t auxid) override
Connect a variable to the output.
virtual bool hasOutput() const override
Check if an output is being written by the object.
virtual ~RAuxStore()
Destructor.
virtual void reset() override
Tell the object that all branches will need to be re-read.
Common base class for the auxiliary store implementations.
const std::string & prefix() const
Get the currently configured object name prefix.
EStructMode
"Structural" modes of the object
@ kUndefinedStore
The structure mode is not defined.
Selection rules: declare transient members.
Definition DataVector.h:581
size_t auxid_t
Identifier for a particular aux data item.
Definition AuxTypes.h:27
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.