ATLAS Offline Software
Public Types | Public Member Functions | List of all members
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 More...
 
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 More...
 
virtual bool hasAuxStoreIO (TClass *tc) const override final
 check if the type tc has IAuxStoreIO interface More...
 
virtual bool isAuxDynBranch (TBranch *branch) const override final
 Check is a branch holds AuxStore objects. More...
 

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  }

◆ 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  }

◆ 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  }

◆ 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  }

The documentation for this class was generated from the following files:
RunTileMonitoring.bufferSize
bufferSize
Definition: RunTileMonitoring.py:298
TrigInDetValidation_menu_test.tc
tc
Definition: TrigInDetValidation_menu_test.py:8
tree
TChain * tree
Definition: tile_monitor.h:30
errorcheck::ReportMessage
Helper class to use to report a message.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:173
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
RootAuxDynIO::endsWithAuxPostfix
bool endsWithAuxPostfix(std::string_view str)
Check if a string ends with AUX_POSTFIX.
Definition: RootAuxDynDefs.h:21
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
RTTAlgmain.branch
branch
Definition: RTTAlgmain.py:61
collisions.reader
reader
read the goodrunslist xml file(s)
Definition: collisions.py:22
ERRORCHECK_ARGS
#define ERRORCHECK_ARGS
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:323
dq_make_web_display.cl
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
Definition: dq_make_web_display.py:25
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
TScopeAdapter
Definition: RootType.h:119