Jpp  18.2.1-ARCA-DF-PATCH
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | Private Attributes | List of all members
JROOT::JTreeWriter< T > Class Template Reference

Auxiliary class for template TTree writing. More...

#include <JTreeWriter.hh>

Inheritance diagram for JROOT::JTreeWriter< T >:
JROOT::JTreeParameters JROOT::JTreeCopyWriter< T >

Public Member Functions

 JTreeWriter (const JTreeParameters &parameters=JROOT::getTreeParameters< T >())
 Constructor. More...
 
const TBranch * GetBranch () const
 Get the pointer to the unique TBranch belonging this TTree. More...
 
Int_t Write (const T &object)
 Data object output equivalent of TTree::Fill(). More...
 
const JTreeParametersgetTreeParameters () const
 Get TTree parameters. More...
 
const TString & getTreeName () const
 Get TTree name. More...
 
const TString & getTreeTitle () const
 Get TTree title. More...
 
const TString & getBranchName () const
 Get TBranch name. More...
 
int getCompressionLevel () const
 Get compression level. More...
 
int getBasketSize () const
 Get basket size. More...
 
int getSplitLevel () const
 Get split level. More...
 

Protected Attributes

TString treeName
 TTree name. More...
 
TString treeTitle
 TTree title. More...
 
TString branchName
 TBranch name. More...
 
int compressionLevel
 TBranch compression level. More...
 
int basketSize
 TBranch basket size. More...
 
int splitLevel
 TBranch split level. More...
 

Private Attributes

TBranch * branch
 Pointer to unique branch belonging to this TTree. More...
 
const Taddress
 Pointer to unique object belonging to this TTree. More...
 

Detailed Description

template<class T>
class JROOT::JTreeWriter< T >

Auxiliary class for template TTree writing.

Definition at line 31 of file JTreeWriter.hh.

Constructor & Destructor Documentation

template<class T>
JROOT::JTreeWriter< T >::JTreeWriter ( const JTreeParameters parameters = JROOT::getTreeParameters<T>())
inline

Constructor.

Note that the default TTree parameters are obtained using method JROOT::getTreeParameters.

Parameters
parametersparameters of TTree

Definition at line 43 of file JTreeWriter.hh.

43  :
44  JTreeParameters(parameters),
45  address(NULL)
46  {
47  SetNameTitle(this->getTreeName(), this->getTreeTitle());
48 
49  branch = Branch(this->getBranchName(),
50  T::Class_Name(),
51  &address,
52  this->getBasketSize(),
53  this->getSplitLevel());
54 
55  branch->SetCompressionLevel(this->getCompressionLevel());
56  }
const TString & getBranchName() const
Get TBranch name.
JTreeParameters(const TString &treeName, const TString &treeTitle, const TString &branchName="", const int compressionLevel=1, const int basketSize=65536, const int splitLevel=1)
Constructor.
const T * address
Pointer to unique object belonging to this TTree.
Definition: JTreeWriter.hh:89
int getCompressionLevel() const
Get compression level.
int getSplitLevel() const
Get split level.
TBranch * branch
Pointer to unique branch belonging to this TTree.
Definition: JTreeWriter.hh:88
const TString & getTreeTitle() const
Get TTree title.
int getBasketSize() const
Get basket size.
const TString & getTreeName() const
Get TTree name.

Member Function Documentation

template<class T>
const TBranch* JROOT::JTreeWriter< T >::GetBranch ( ) const
inline

Get the pointer to the unique TBranch belonging this TTree.

Returns
pointer to TBranch

Definition at line 64 of file JTreeWriter.hh.

65  {
66  return branch;
67  }
TBranch * branch
Pointer to unique branch belonging to this TTree.
Definition: JTreeWriter.hh:88
template<class T>
Int_t JROOT::JTreeWriter< T >::Write ( const T object)
inline

Data object output equivalent of TTree::Fill().

Parameters
objectdata object
Returns
as TTree::Fill

Definition at line 76 of file JTreeWriter.hh.

77  {
78  address = &object;
79 
80  return this->Fill();
81  }
const T * address
Pointer to unique object belonging to this TTree.
Definition: JTreeWriter.hh:89
const JTreeParameters& JROOT::JTreeParameters::getTreeParameters ( ) const
inlineinherited

Get TTree parameters.

Returns
TTree parameters

Definition at line 63 of file JTreeParameters.hh.

64  {
65  return static_cast<const JTreeParameters&>(*this);
66  }
Data structure for TTree parameters.
const TString& JROOT::JTreeParameters::getTreeName ( ) const
inlineinherited

Get TTree name.

Returns
TTree name

Definition at line 74 of file JTreeParameters.hh.

75  {
76  return treeName;
77  }
TString treeName
TTree name.
const TString& JROOT::JTreeParameters::getTreeTitle ( ) const
inlineinherited

Get TTree title.

Returns
TTree title

Definition at line 85 of file JTreeParameters.hh.

86  {
87  return treeTitle;
88  }
TString treeTitle
TTree title.
const TString& JROOT::JTreeParameters::getBranchName ( ) const
inlineinherited

Get TBranch name.

Returns
TBranch name

Definition at line 96 of file JTreeParameters.hh.

97  {
98  return (branchName != "" ? branchName : treeName);
99  }
TString treeName
TTree name.
TString branchName
TBranch name.
int JROOT::JTreeParameters::getCompressionLevel ( ) const
inlineinherited

Get compression level.

Returns
compression level

Definition at line 107 of file JTreeParameters.hh.

108  {
109  return compressionLevel;
110  }
int compressionLevel
TBranch compression level.
int JROOT::JTreeParameters::getBasketSize ( ) const
inlineinherited

Get basket size.

Returns
basket size

Definition at line 118 of file JTreeParameters.hh.

119  {
120  return basketSize;
121  }
int basketSize
TBranch basket size.
int JROOT::JTreeParameters::getSplitLevel ( ) const
inlineinherited

Get split level.

Returns
split level

Definition at line 129 of file JTreeParameters.hh.

130  {
131  return splitLevel;
132  }
int splitLevel
TBranch split level.

Member Data Documentation

template<class T>
TBranch* JROOT::JTreeWriter< T >::branch
private

Pointer to unique branch belonging to this TTree.

Definition at line 88 of file JTreeWriter.hh.

template<class T>
const T* JROOT::JTreeWriter< T >::address
private

Pointer to unique object belonging to this TTree.

Definition at line 89 of file JTreeWriter.hh.

TString JROOT::JTreeParameters::treeName
protectedinherited

TTree name.

Definition at line 155 of file JTreeParameters.hh.

TString JROOT::JTreeParameters::treeTitle
protectedinherited

TTree title.

Definition at line 156 of file JTreeParameters.hh.

TString JROOT::JTreeParameters::branchName
protectedinherited

TBranch name.

Definition at line 157 of file JTreeParameters.hh.

int JROOT::JTreeParameters::compressionLevel
protectedinherited

TBranch compression level.

Definition at line 158 of file JTreeParameters.hh.

int JROOT::JTreeParameters::basketSize
protectedinherited

TBranch basket size.

Definition at line 159 of file JTreeParameters.hh.

int JROOT::JTreeParameters::splitLevel
protectedinherited

TBranch split level.

Definition at line 160 of file JTreeParameters.hh.


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