ndmspc
0.20250128.0
Loading...
Searching...
No Matches
HnSparse.h
1
#ifndef HnSparse_H
2
#define HnSparse_H
3
4
#include <TObject.h>
5
#include <TSystem.h>
6
#include <TTree.h>
7
#include <THnSparse.h>
8
9
namespace
Ndmspc {
10
namespace
Ndh {
11
18
19
class
HnSparse
:
public
THnSparse {
20
21
protected
:
22
HnSparse
();
23
HnSparse
(
const
char
* name,
const
char
* title, Int_t dim,
const
Int_t * nbins,
const
Double_t * xmin = 0,
24
const
Double_t * xmax = 0, Int_t chunksize = 1024 * 16);
25
26
public
:
27
Bool_t
Import
(std::vector<Int_t> r, TString filename, TString objname, TString cacheDir = gSystem->HomeDirectory());
28
30
void
SetOutputFileName
(
const
char
* fn) {
fOutputFileName
= fn; }
32
TString
GetOutputFileName
()
const
{
return
fOutputFileName
; }
33
34
void
ReserveBins
(Long64_t nBins);
35
36
protected
:
37
bool
RecursiveLoop
(THnSparse * s, Int_t level, Int_t * coord, Int_t * dims, std::vector<Int_t> & r);
38
39
private
:
40
TTree *
fTree
{
nullptr
};
41
TString
fOutputFileName
{
"ndh.root"
};
42
44
ClassDef(
HnSparse
, 1);
46
};
47
48
//______________________________________________________________________________
79
template
<
class
CONT>
80
class
HnSparseT
:
public
HnSparse
{
81
public
:
82
HnSparseT
() {}
83
HnSparseT
(
const
char
* name,
const
char
* title, Int_t dim,
const
Int_t * nbins,
const
Double_t * xmin =
nullptr
,
84
const
Double_t * xmax =
nullptr
, Int_t chunksize = 1024 * 16)
85
:
HnSparse
(name, title, dim, nbins, xmin, xmax, chunksize)
86
{
87
}
88
89
TArray * GenerateArray()
const override
{
return
new
CONT(GetChunkSize()); }
90
91
private
:
92
ClassDefOverride(
HnSparseT
, 1);
// Sparse n-dimensional histogram with templated content
93
};
94
95
typedef
HnSparseT<TArrayD>
HnSparseD
;
96
typedef
HnSparseT<TArrayF>
HnSparseF
;
97
#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 32, 0)
98
typedef
HnSparseT<TArrayL64>
HnSparseL
;
99
#else
100
typedef
HnSparseT<TArrayL>
HnSparseL
;
101
#endif
102
typedef
HnSparseT<TArrayI>
HnSparseI
;
103
typedef
HnSparseT<TArrayS>
HnSparseS
;
104
typedef
HnSparseT<TArrayC>
HnSparseC
;
105
106
}
// namespace Ndh
107
}
// namespace Ndmspc
108
109
#endif
/* HNSPARSE_H */
Ndmspc::Ndh::HnSparseT
Definition
HnSparse.h:80
Ndmspc::Ndh::HnSparse
HnSparse object.
Definition
HnSparse.h:19
Ndmspc::Ndh::HnSparse::fTree
TTree * fTree
Container.
Definition
HnSparse.h:40
Ndmspc::Ndh::HnSparse::HnSparse
HnSparse()
Definition
HnSparse.cxx:16
Ndmspc::Ndh::HnSparse::ReserveBins
void ReserveBins(Long64_t nBins)
Definition
HnSparse.cxx:145
Ndmspc::Ndh::HnSparse::SetOutputFileName
void SetOutputFileName(const char *fn)
Setting output file name.
Definition
HnSparse.h:30
Ndmspc::Ndh::HnSparse::Import
Bool_t Import(std::vector< Int_t > r, TString filename, TString objname, TString cacheDir=gSystem->HomeDirectory())
Definition
HnSparse.cxx:32
Ndmspc::Ndh::HnSparse::GetOutputFileName
TString GetOutputFileName() const
Returns output filename.
Definition
HnSparse.h:32
Ndmspc::Ndh::HnSparse::RecursiveLoop
bool RecursiveLoop(THnSparse *s, Int_t level, Int_t *coord, Int_t *dims, std::vector< Int_t > &r)
Definition
HnSparse.cxx:105
Ndmspc::Ndh::HnSparse::fOutputFileName
TString fOutputFileName
Output filename.
Definition
HnSparse.h:41
Ndh
HnSparse.h
Generated by
1.10.0