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 std::unique_ptr< IAuxDynSharegetAuxDynShare (const IAthenaSerializeSvc *serSvc, IAthenaIPCTool *ipcTool) 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

◆ getAuxDynShare()

std::unique_ptr< IAuxDynShare > RootAuxDynIO::FactoryTool::getAuxDynShare ( const IAthenaSerializeSvc * serSvc,
IAthenaIPCTool * ipcTool ) const
finaloverridevirtual

Implements RootAuxDynIO::IFactoryTool.

Definition at line 125 of file RootAuxDynIO.cxx.

125 {
126 return std::make_unique<AuxDiscoverySvc>(serSvc, ipcTool);
127 }

◆ getBranchAuxDynReader()

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

Implements RootAuxDynIO::IFactoryTool.

Definition at line 112 of file RootAuxDynIO.cxx.

112 {
113 return std::make_unique<TBranchAuxDynReader>(tree, branch);
114 }
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 97 of file RootAuxDynIO.cxx.

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

◆ 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 117 of file RootAuxDynIO.cxx.

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

◆ getNTupleAuxDynWriter()

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

Implements RootAuxDynIO::IFactoryTool.

Definition at line 104 of file RootAuxDynIO.cxx.

104 {
105 return std::make_unique<RNTupleAuxDynWriter>(tc);
106 }
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 56 of file RootAuxDynIO.cxx.

57 {
58 // check the name first, and only if it does not match AUX_POSTFIX ask TClass
59 return endsWithAuxPostfix(fieldname)
60 or ( tc and ( tc->GetBaseClass("SG::IAuxStore")
61 // the IAuxStore property is used in DataModelTests
62 or RootType(tc).Properties().HasProperty("IAuxStore") ));
63 }
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 67 of file RootAuxDynIO.cxx.

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

◆ 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 74 of file RootAuxDynIO.cxx.

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