ATLAS Offline Software
Loading...
Searching...
No Matches
RootAuxDynIO::FactoryTool Class Reference

#include <RootAuxDynIO.h>

Inheritance diagram for RootAuxDynIO::FactoryTool:
Collaboration diagram for RootAuxDynIO::FactoryTool:

Public Types

using Factory = Gaudi::PluginService::Factory< IFactoryTool*() >

Public Member Functions

virtual std::unique_ptr< IRootAuxDynReadergetBranchAuxDynReader (TTree *, TBranch *) const override final
virtual std::unique_ptr< IRootAuxDynWritergetBranchAuxDynWriter (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 TBranch immediately
virtual std::unique_ptr< IRNTupleAuxDynWritergetNTupleAuxDynWriter (TClass &tc) const override final
virtual std::unique_ptr< IRootAuxDynReadergetNTupleAuxDynReader (const std::string &field_name, const std::string &field_type, ROOT::RNTupleReader *reader) const override final
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
virtual bool hasAuxStoreIO (TClass *tc) const override final
 check if the type tc has IAuxStoreIO interface
virtual bool isAuxDynBranch (TBranch *branch) const override final
 Check is a branch holds AuxStore objects.

Detailed Description

Definition at line 43 of file RootAuxDynIO.h.

Member Typedef Documentation

◆ Factory

using RootAuxDynIO::FactoryTool::Factory = Gaudi::PluginService::Factory< IFactoryTool*() >

Definition at line 46 of file RootAuxDynIO.h.

Member Function Documentation

◆ getBranchAuxDynReader()

std::unique_ptr< IRootAuxDynReader > RootAuxDynIO::FactoryTool::getBranchAuxDynReader ( TTree * tree,
TBranch * branch ) const
finaloverridevirtual

Implements RootAuxDynIO::IFactoryTool.

Definition at line 111 of file RootAuxDynIO.cxx.

111 {
112 return std::make_unique<TBranchAuxDynReader>(tree, branch);
113 }
TChain * tree

◆ getBranchAuxDynWriter()

std::unique_ptr< RootAuxDynIO::IRootAuxDynWriter > RootAuxDynIO::FactoryTool::getBranchAuxDynWriter ( TTree & tree,
TClass & cl,
int bufferSize,
int splitLevel,
int offsettab_len,
bool do_branch_fill ) const
finaloverridevirtual

generate TBranchAuxDynWriter tree -> destination tree do_branch_fill -> flag telling to Fill each TBranch immediately

Implements RootAuxDynIO::IFactoryTool.

Definition at line 96 of file RootAuxDynIO.cxx.

97 {
98 return std::make_unique<TBranchAuxDynWriter>(tree, cl, bufferSize, splitLevel,
99 offsettab_len, do_branch_fill);
100 }

◆ getNTupleAuxDynReader()

std::unique_ptr< IRootAuxDynReader > RootAuxDynIO::FactoryTool::getNTupleAuxDynReader ( const std::string & field_name,
const std::string & field_type,
ROOT::RNTupleReader * reader ) const
finaloverridevirtual

Implements RootAuxDynIO::IFactoryTool.

Definition at line 116 of file RootAuxDynIO.cxx.

117 {
118 return std::make_unique<RNTupleAuxDynReader>(field_name, field_type, reader);
119 }

◆ getNTupleAuxDynWriter()

std::unique_ptr< RootAuxDynIO::IRNTupleAuxDynWriter > RootAuxDynIO::FactoryTool::getNTupleAuxDynWriter ( TClass & tc) const
finaloverridevirtual

Implements RootAuxDynIO::IFactoryTool.

Definition at line 103 of file RootAuxDynIO.cxx.

103 {
104 return std::make_unique<RNTupleAuxDynWriter>(tc);
105 }
static Double_t tc

◆ hasAuxStore()

bool RootAuxDynIO::FactoryTool::hasAuxStore ( std::string_view fieldname,
TClass * tc ) const
finaloverridevirtual

check if a field/branch with fieldname and type tc has IAuxStore interface

Implements RootAuxDynIO::IFactoryTool.

Definition at line 55 of file RootAuxDynIO.cxx.

56 {
57 // check the name first, and only if it does not match AUX_POSTFIX ask TClass
58 return endsWithAuxPostfix(fieldname)
59 or ( tc and ( tc->GetBaseClass("SG::IAuxStore")
60 // the IAuxStore property is used in DataModelTests
61 or RootType(tc).Properties().HasProperty("IAuxStore") ));
62 }
TTypeAdapter RootType
Definition RootType.h:211
bool endsWithAuxPostfix(std::string_view str)
Check if a string ends with AUX_POSTFIX.

◆ hasAuxStoreIO()

bool RootAuxDynIO::FactoryTool::hasAuxStoreIO ( TClass * tc) const
finaloverridevirtual

check if the type tc has IAuxStoreIO interface

Implements RootAuxDynIO::IFactoryTool.

Definition at line 66 of file RootAuxDynIO.cxx.

67 {
68 return tc and tc->GetBaseClass("SG::IAuxStoreIO");
69 }

◆ isAuxDynBranch()

bool RootAuxDynIO::FactoryTool::isAuxDynBranch ( TBranch * branch) const
finaloverridevirtual

Check is a branch holds AuxStore objects.

Parameters
branchTBranch to check

Implements RootAuxDynIO::IFactoryTool.

Definition at line 73 of file RootAuxDynIO.cxx.

74 {
75 const std::string bname = branch->GetName();
76 TClass *tc = 0;
77 EDataType type;
78 if( branch->GetExpectedType(tc, type) ) {
79 // error - not expecting this to happen ever, but better report
80 errorcheck::ReportMessage msg (MSG::WARNING, ERRORCHECK_ARGS, "RootAuxDynIO::isAuxDynBranch");
81 msg << "GetExpectedType() failed for branch: " << bname;
82 return false;
83 }
84 if( hasAuxStore(bname, tc) ) {
85 return tc->GetBaseClass("SG::IAuxStoreHolder") != nullptr;
86 }
87 return false;
88 }
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
MsgStream & msg
Definition testRead.cxx:32

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