The Gaudi Framework
v38r2 (5b3c9e4d)
BranchWrapper.h
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 2024 CERN for the benefit of the LHCb and ATLAS collaborations *
3
* *
4
* This software is distributed under the terms of the Apache version 2 licence, *
5
* copied verbatim in the file "LICENSE". *
6
* *
7
* In applying this licence, CERN does not waive the privileges and immunities *
8
* granted to it by virtue of its status as an Intergovernmental Organization *
9
* or submit itself to any jurisdiction. *
10
\***********************************************************************************/
11
#pragma once
12
13
#include <
Gaudi/Algorithm.h
>
14
#include <
GaudiKernel/DataObjectHandle.h
>
15
#include <TTree.h>
16
#include <gsl/pointers>
17
#include <string>
18
19
namespace
Gaudi
{
20
namespace
details
{
25
struct
BranchWrapper
{
26
27
private
:
28
void
*
m_dataBuffer
=
nullptr
;
// Data buffer for branch creation
29
AnyDataWrapperBase
*
baseWrapper
=
nullptr
;
// Pointer to the base wrapper for type-safe access to data
30
TBranch*
m_branch
=
nullptr
;
// TBranch object
31
std::string
m_className
;
// Class name of the data
32
std::string
m_branchName
;
// Branch name in the TTree
33
std::string
m_location
;
// Location of the data in the data store
34
const
Gaudi::Algorithm
&
m_algRef
;
// Reference to the Gaudi algorithm using this wrapper
35
void ( *
setBranchAddress
)( gsl::not_null<TBranch*>,
36
void
** );
// Function pointer for the method used to set the address of the data
37
// buffer
38
39
public
:
40
BranchWrapper
(
const
gsl::not_null<TTree*> tree,
const
std::string
& className,
const
std::string
& branchName,
41
const
std::string
&
location
,
const
Gaudi::Algorithm
& algRef );
42
43
void
setDataPtr
(
void
* dataPtr );
44
45
void
setBranchData
(
const
gsl::not_null<DataObject*> pObj );
46
47
std::string
getLocation
()
const
;
48
49
std::string
getClassName
()
const
;
50
};
51
52
}
// namespace details
53
}
// namespace Gaudi
Gaudi::details::BranchWrapper::setDataPtr
void setDataPtr(void *dataPtr)
Definition:
BranchWrapper.cpp:65
std::string
STL class.
Gaudi::details::BranchWrapper::m_location
std::string m_location
Definition:
BranchWrapper.h:33
GaudiAlg.HistoUtils.location
location
Definition:
HistoUtils.py:964
Gaudi::details::BranchWrapper::baseWrapper
AnyDataWrapperBase * baseWrapper
Definition:
BranchWrapper.h:29
Gaudi::details::BranchWrapper::getClassName
std::string getClassName() const
Definition:
BranchWrapper.cpp:85
Gaudi::details::BranchWrapper::m_branch
TBranch * m_branch
Definition:
BranchWrapper.h:30
Gaudi::details::BranchWrapper::setBranchData
void setBranchData(const gsl::not_null< DataObject * > pObj)
Definition:
BranchWrapper.cpp:72
Gaudi::details::BranchWrapper::getLocation
std::string getLocation() const
Definition:
BranchWrapper.cpp:83
Gaudi::details::BranchWrapper::m_dataBuffer
void * m_dataBuffer
Definition:
BranchWrapper.h:28
AnyDataWrapperBase
Definition:
AnyDataWrapper.h:29
Gaudi::details::BranchWrapper::m_branchName
std::string m_branchName
Definition:
BranchWrapper.h:32
Gaudi::details::BranchWrapper::setBranchAddress
void(* setBranchAddress)(gsl::not_null< TBranch * >, void **)
Definition:
BranchWrapper.h:35
Gaudi::details::BranchWrapper::m_className
std::string m_className
Definition:
BranchWrapper.h:31
details
Definition:
AnyDataWrapper.h:18
Gaudi::Algorithm
Base class from which all concrete algorithm classes should be derived.
Definition:
Algorithm.h:90
Algorithm.h
Gaudi
Header file for std:chrono::duration-based Counters.
Definition:
__init__.py:1
Gaudi::details::BranchWrapper::m_algRef
const Gaudi::Algorithm & m_algRef
Definition:
BranchWrapper.h:34
Gaudi::details::BranchWrapper::BranchWrapper
BranchWrapper(const gsl::not_null< TTree * > tree, const std::string &className, const std::string &branchName, const std::string &location, const Gaudi::Algorithm &algRef)
Definition:
BranchWrapper.cpp:35
Gaudi::details::BranchWrapper
Encapsulates a branch within a ROOT TTree, managing the data and interaction with the TTree.
Definition:
BranchWrapper.h:25
DataObjectHandle.h
GaudiUtils
include
Gaudi
details
BranchWrapper.h
Generated on Thu May 16 2024 12:46:15 for The Gaudi Framework by
1.8.18