Belle II Software
prerelease-10-00-00a
PyObjROOTUtils.h
1
/**************************************************************************
2
* basf2 (Belle II Analysis Software Framework) *
3
* Author: The Belle II Collaboration *
4
* *
5
* See git log for contributors and copyright holders. *
6
* This file is licensed under LGPL-3.0, see LICENSE.md. *
7
**************************************************************************/
8
9
#pragma once
10
#include <boost/python/object.hpp>
11
#include <TPython.h>
12
13
namespace
Belle2
{
25
template
<
class
T>
26
boost::python::object
createROOTObjectPyCopy
(
const
T& instance)
27
{
28
const
char
* classname = instance.IsA()->GetName();
29
void
* addr =
new
T(instance);
30
PyObject* obj = TPython::CPPInstance_FromVoidPtr(addr, classname,
true
);
31
return
boost::python::object(boost::python::handle<>(obj));
32
}
33
34
}
Belle2::createROOTObjectPyCopy
boost::python::object createROOTObjectPyCopy(const T &instance)
Create a python wrapped copy from a class instance which has a ROOT dictionary.
Definition
PyObjROOTUtils.h:26
Belle2
Abstract base class for different kinds of events.
Definition
MillepedeAlgorithm.h:17
framework
core
include
PyObjROOTUtils.h
Generated on Wed Jul 2 2025 03:30:34 for Belle II Software by
1.13.2