Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
RootAuxDynIO.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ROOTAUXDYN_IO_H
6 #define ROOTAUXDYN_IO_H
7 
8 #include "Gaudi/PluginService.h"
9 
11 
12 namespace SG { class IAuxStoreIO; }
13 class TClass;
14 class TBranch;
15 
16 namespace RootAuxDynIO
17 {
18 
20  {
21  public:
22  AuxDynAttrAccess(TClass& tc);
23  bool hasAuxDynStore() const;
24 
25  protected:
26  int auxStoreOffset(TClass &tc);
27  SG::IAuxStoreIO* castIOStore(void *object);
28 
30  TClass& m_holderType;
33  };
34 
35 
40  std::string getKeyFromBranch(TBranch* branch);
41 
42 
43  class FactoryTool : public IFactoryTool
44  {
45  public:
46  using Factory = Gaudi::PluginService::Factory< IFactoryTool*() >;
47 
48  virtual std::unique_ptr<IRootAuxDynReader>
49  getBranchAuxDynReader(TTree*, TBranch*) const override final;
50 
51  virtual std::unique_ptr<IRootAuxDynWriter>
52  getBranchAuxDynWriter(TTree&, TClass&, int bufferSize, int splitLevel,
53  int offsettab_len, bool do_branch_fill) const override final;
54 
55  virtual std::unique_ptr<IRNTupleAuxDynWriter>
56  getNTupleAuxDynWriter(TClass &tc) const override final;
57 
58  virtual std::unique_ptr<IRootAuxDynReader>
59  getNTupleAuxDynReader(const std::string& field_name, const std::string& field_type,
60  ROOT::RNTupleReader* reader) const override final;
61 
63  virtual bool hasAuxStore(std::string_view fieldname, TClass *tc) const override final;
64 
66  virtual bool hasAuxStoreIO(TClass *tc) const override final;
67 
72  virtual bool isAuxDynBranch(TBranch *branch) const override final;
73  };
74 
75 }
76 
77 #endif
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
RootAuxDynIO::FactoryTool::hasAuxStoreIO
virtual bool hasAuxStoreIO(TClass *tc) const override final
check if the type tc has IAuxStoreIO interface
Definition: RootAuxDynIO.cxx:66
RootAuxDynIO::FactoryTool::getNTupleAuxDynWriter
virtual std::unique_ptr< IRNTupleAuxDynWriter > getNTupleAuxDynWriter(TClass &tc) const override final
Definition: RootAuxDynIO.cxx:103
SG::IAuxStoreIO
Interface providing I/O for a generic auxiliary store.
Definition: IAuxStoreIO.h:44
EFTrackingXrtAlgorithmConfig.bufferSize
bufferSize
Definition: EFTrackingXrtAlgorithmConfig.py:77
RootAuxDynIO::AuxDynAttrAccess
Definition: RootAuxDynIO.h:20
RootAuxDynIO::AuxDynAttrAccess::m_holderType
TClass & m_holderType
TClass of the type containing the AuxStore with attributes.
Definition: RootAuxDynIO.h:30
RootAuxDynIO::getKeyFromBranch
std::string getKeyFromBranch(TBranch *branch)
Exctract the Aux object SG Key from the branch name.
RootAuxDynIO::FactoryTool
Definition: RootAuxDynIO.h:44
RootAuxDynIO::AuxDynAttrAccess::auxStoreOffset
int auxStoreOffset(TClass &tc)
Definition: RootAuxDynIO.cxx:29
RootAuxDynIO::FactoryTool::isAuxDynBranch
virtual bool isAuxDynBranch(TBranch *branch) const override final
Check is a branch holds AuxStore objects.
Definition: RootAuxDynIO.cxx:73
RootAuxDynIO::AuxDynAttrAccess::m_ioStoreOffset
int m_ioStoreOffset
AuxStoreIO interface offset in the subclass type (for casting). negative means no inheritance.
Definition: RootAuxDynIO.h:32
RootAuxDynIO::AuxDynAttrAccess::castIOStore
SG::IAuxStoreIO * castIOStore(void *object)
Definition: RootAuxDynIO.cxx:45
RootAuxDynIO::FactoryTool::hasAuxStore
virtual bool hasAuxStore(std::string_view fieldname, TClass *tc) const override final
check if a field/branch with fieldname and type tc has IAuxStore interface
Definition: RootAuxDynIO.cxx:55
RootAuxDynIO::AuxDynAttrAccess::hasAuxDynStore
bool hasAuxDynStore() const
Definition: RootAuxDynIO.cxx:40
RootAuxDynIO::FactoryTool::getBranchAuxDynWriter
virtual std::unique_ptr< IRootAuxDynWriter > getBranchAuxDynWriter(TTree &, TClass &, int bufferSize, int splitLevel, int offsettab_len, bool do_branch_fill) const override final
generate TBranchAuxDynWriter tree -> destination tree do_branch_fill -> flag telling to Fill each TBr...
Definition: RootAuxDynIO.cxx:96
RootAuxDynIO
Specialization of RootAuxDynStore for reading Aux Dynamic attributes from RNTuple.
Definition: RNTupleContainer.h:26
RootAuxDynIO::FactoryTool::getNTupleAuxDynReader
virtual std::unique_ptr< IRootAuxDynReader > getNTupleAuxDynReader(const std::string &field_name, const std::string &field_type, ROOT::RNTupleReader *reader) const override final
Definition: RootAuxDynIO.cxx:116
RTTAlgmain.branch
branch
Definition: RTTAlgmain.py:61
RootAuxDynIO::AuxDynAttrAccess::AuxDynAttrAccess
AuxDynAttrAccess(TClass &tc)
Definition: RootAuxDynIO.cxx:24
collisions.reader
reader
read the goodrunslist xml file(s)
Definition: collisions.py:22
RootAuxDynIO::FactoryTool::Factory
Gaudi::PluginService::Factory< IFactoryTool *() > Factory
Definition: RootAuxDynIO.h:46
RootAuxDynIO::FactoryTool::getBranchAuxDynReader
virtual std::unique_ptr< IRootAuxDynReader > getBranchAuxDynReader(TTree *, TBranch *) const override final
Definition: RootAuxDynIO.cxx:111
IRootAuxDynIO.h
RootAuxDynIO::IFactoryTool
Definition: IRootAuxDynIO.h:90