19#if !defined(GPUCA_NO_ROOT) && !defined(GPUCA_GPUCODE)
33#if !defined(GPUCA_NO_ROOT) && !defined(GPUCA_GPUCODE)
37struct internal_Branch {
38 template <
typename... Args>
39 static void Branch(
S* p, Args... args)
44struct internal_Branch<TTree> {
45 template <
typename... Args>
46 static void Branch(TTree* p, Args... args)
53template <
typename... Args>
56template <
class T,
typename... Args>
60 template <
typename... Names>
63 static GPUROOTDump<T, Args...> instance(name1, names...);
66 template <
typename... Names>
72 void Fill(
const T& o,
const Args&... args)
75 FillInternal(o, args...);
86 template <
typename... Names>
90 mTree->Branch(name1, &mObj);
101 void write()
override { mTree->Write(); }
111 if (nameTree ==
nullptr) {
115 mTree =
new TTree(nameTree, nameTree);
117 TTree* mTree =
nullptr;
134 void write()
override { mNTuple->Write(); }
136 template <
typename... Args>
140 mNTuple->Fill(args...);
147 mNTuple =
new TNtuple(
name,
name, options);
152template <
typename... Args>
156 template <
typename... Names>
157 GPUd() static
void Fill(Args... args)
160 template <
typename... Names>
161 GPUd() static GPUROOTDump<Args...>& get(Args... args)
163 return GPUROOTDump<Args...>();
165 template <
typename... Names>
166 GPUd() static GPUROOTDump<Args...>& getNew(Args... args)
168 return GPUROOTDump<Args...>();
static std::atomic_flag mMutex
static GPUROOTDump< TNtuple > getNew(const char *name, const char *options)
static GPUROOTDump< TNtuple > & get(const char *name, const char *options)
void Fill(const Args &... args)
void FillInternal(const T &o, const Args &... args)
GPUROOTDump(const char *name1, Names... names)
static GPUROOTDump< T, Args... > & get(const char *name1, Names... names)
static GPUROOTDump< T, Args... > getNew(const char *name1, Names... names)
void Fill(const T &o, const Args &... args)
GPUROOTDump(const char *name1, const char *nameTree=nullptr)
GLuint const GLchar * name
GPUd() const expr uint32_t MultivariatePolynomialHelper< Dim