![]() |
Project
|
#include <DataContainer3D.h>
Public Member Functions | |
DataContainer3D (unsigned short nZ, unsigned short nR, unsigned short nPhi) | |
DataContainer3D ()=default | |
default constructor for Root I/O | |
const DataT & | operator[] (size_t i) const |
operator to directly access the values | |
DataT & | operator[] (size_t i) |
const auto & | getData () const |
auto & | getData () |
const DataT & | operator() (size_t iz, size_t ir, size_t iphi) const |
DataT & | operator() (size_t iz, size_t ir, size_t iphi) |
DataT | interpolate (const DataT z, const DataT r, const DataT phi, const o2::tpc::RegularGrid3D< DataT > &grid) const |
size_t | getDataIndex (const size_t iz, const size_t ir, const size_t iphi) const |
size_t | getNDataPoints () const |
unsigned short | getNZ () const |
unsigned short | getNR () const |
unsigned short | getNPhi () const |
size_t | getIndexZ (size_t index) const |
size_t | getIndexR (size_t index) const |
size_t | getIndexPhi (size_t index) const |
void | setGrid (unsigned short nZ, unsigned short nR, unsigned short nPhi, const bool resize) |
set the grid points | |
template<typename DataTOut = DataT> | |
int | writeToFile (TFile &outf, const char *name="data") const |
int | writeToFile (std::string_view file, std::string_view option, std::string_view name="data", const int nthreads=1) const |
template<typename DataTIn = DataT> | |
bool | initFromFile (TFile &inpf, const char *name="data") |
set values from file | |
bool | initFromFile (std::string_view file, std::string_view name="data", const int nthreads=1) |
void | print () const |
print the matrix | |
DataContainer3D< DataT > & | operator*= (const DataT value) |
operator overload | |
DataContainer3D< DataT > & | operator+= (const DataContainer3D< DataT > &other) |
DataContainer3D< DataT > & | operator*= (const DataContainer3D< DataT > &other) |
DataContainer3D< DataT > & | operator-= (const DataContainer3D< DataT > &other) |
Static Public Member Functions | |
static void | setAliases (TTree *tree) |
static void | setAliasesForDump (TTree *tree) |
static size_t | getIndexZ (size_t index, const int nz, const int nr, const int nphi) |
static size_t | getIndexR (size_t index, const int nz, const int nr, const int nphi) |
static size_t | getIndexPhi (size_t index, const int nz, const int nr, const int nphi) |
static DataContainer3D< DataT > * | loadFromFile (TFile &inpf, const char *name="data") |
get pointer to object from file (deprecated!) | |
static void | dumpSlice (std::string_view treename, std::string_view fileIn, std::string_view fileOut, std::string_view option, std::pair< unsigned short, unsigned short > rangeiR, std::pair< unsigned short, unsigned short > rangeiZ, std::pair< unsigned short, unsigned short > rangeiPhi, const int nthreads=1) |
static void | dumpInterpolation (std::string_view treename, std::string_view fileIn, std::string_view fileOut, std::string_view option, std::pair< float, float > rangeR, std::pair< float, float > rangeZ, std::pair< float, float > rangePhi, const int nR, const int nZ, const int nPhi, const int nthreads=1) |
static bool | getVertices (std::string_view treename, std::string_view fileIn, unsigned short &nR, unsigned short &nZ, unsigned short &nPhi) |
DataT | the type of data which is used during the calculations |
The DataContainer3D class represents a simple method to store values on a large 3-Dim grid with ROOT io functionality.
Definition at line 40 of file DataContainer3D.h.
|
inline |
< constructor
nZ | number of vertices in z direction |
nR | number of vertices in r direction |
nPhi | number of vertices in phi direction |
Definition at line 46 of file DataContainer3D.h.
|
default |
default constructor for Root I/O
|
static |
dump interpolations of stored values to TTree including indices for Drawing
treename | name of the TTree in the input file for which the slices will be dumped |
fileIn | input file |
fileOut | output file |
option | "RECREATE" or "UPDATE" the output file |
rangeR | range in radial direction |
rangeZ | range in z direction |
rangePhi | range in phi direction |
nR | number of points in radial direction which will be used to interpolate |
nZ | number of points in z direction which will be used to interpolate |
nPhi | number of points in phi direction which will be used to interpolate |
Definition at line 408 of file DataContainer3D.cxx.
|
static |
dump slices to TTree including indices for Drawing
treename | name of the TTree in the input file for which the slices will be dumped |
fileIn | input file |
fileOut | output file |
option | "RECREATE" or "UPDATE" the output file |
rangeiR | indices range in radial direction |
rangeiZ | indices range in z direction |
rangeiPhi | indices range in phi direction |
Definition at line 323 of file DataContainer3D.cxx.
|
inline |
Definition at line 56 of file DataContainer3D.h.
|
inline |
Definition at line 55 of file DataContainer3D.h.
|
inline |
iz | index in z dimension |
ir | index in r dimension |
iphi | index in phi dimension |
Definition at line 77 of file DataContainer3D.h.
|
inline |
Definition at line 121 of file DataContainer3D.h.
|
static |
index | global index |
nz | number of vertices in z |
nr | number of vertices in r |
nphi | number of vertices in phi |
Definition at line 276 of file DataContainer3D.cxx.
|
inline |
Definition at line 113 of file DataContainer3D.h.
|
static |
index | global index |
nz | number of vertices in z |
nr | number of vertices in r |
nphi | number of vertices in phi |
Definition at line 267 of file DataContainer3D.cxx.
|
inline |
Definition at line 105 of file DataContainer3D.h.
|
static |
index | global index |
nz | number of vertices in z |
nr | number of vertices in r |
nphi | number of vertices in phi |
Definition at line 258 of file DataContainer3D.cxx.
|
inline |
Definition at line 80 of file DataContainer3D.h.
|
inline |
Definition at line 89 of file DataContainer3D.h.
|
inline |
Definition at line 86 of file DataContainer3D.h.
|
inline |
Definition at line 83 of file DataContainer3D.h.
|
static |
sets vertices definition stored from object in file
treename | name of the TTree in the input file for which the slices will be dumped |
fileIn | input file |
nR | vertices in radial direction will be stored in this variable |
nZ | vertices in z direction will be stored in this variable |
nPhi | vertices in phi direction will be stored in this variable |
Definition at line 497 of file DataContainer3D.cxx.
bool DataContainer3D::initFromFile | ( | std::string_view | file, |
std::string_view | name = "data" , |
||
const int | nthreads = 1 |
||
) |
set values from file using RDataFrame
file | object is written to this file |
name | object is saved with this name |
nthreads | number of threads to use |
Definition at line 96 of file DataContainer3D.cxx.
bool DataContainer3D::initFromFile | ( | TFile & | inpf, |
const char * | name = "data" |
||
) |
set values from file
set values from file (deprecated!)
DataTOut | format of the input container (can be used to load the container with a different precission than the current object) |
Definition at line 139 of file DataContainer3D.cxx.
DataT DataContainer3D::interpolate | ( | const DataT | z, |
const DataT | r, | ||
const DataT | phi, | ||
const o2::tpc::RegularGrid3D< DataT > & | grid | ||
) | const |
Definition at line 401 of file DataContainer3D.cxx.
|
inlinestatic |
get pointer to object from file (deprecated!)
Definition at line 166 of file DataContainer3D.cxx.
|
inline |
iz | index in z dimension |
ir | index in r dimension |
iphi | index in phi dimension |
Definition at line 68 of file DataContainer3D.h.
|
inline |
iz | index in z dimension |
ir | index in r dimension |
iphi | index in phi dimension |
Definition at line 62 of file DataContainer3D.h.
DataContainer3D< DataT > & DataContainer3D::operator*= | ( | const DataContainer3D< DataT > & | other | ) |
Definition at line 251 of file DataContainer3D.cxx.
DataContainer3D< DataT > & DataContainer3D::operator*= | ( | const DataT | value | ) |
operator overload
Definition at line 230 of file DataContainer3D.cxx.
DataContainer3D< DataT > & DataContainer3D::operator+= | ( | const DataContainer3D< DataT > & | other | ) |
Definition at line 237 of file DataContainer3D.cxx.
DataContainer3D< DataT > & DataContainer3D::operator-= | ( | const DataContainer3D< DataT > & | other | ) |
Definition at line 244 of file DataContainer3D.cxx.
|
inline |
Definition at line 53 of file DataContainer3D.h.
|
inline |
operator to directly access the values
Definition at line 52 of file DataContainer3D.h.
print the matrix
Definition at line 183 of file DataContainer3D.cxx.
define aliases for TTree for drawing
input | TTree for which the aliases will be defined |
Definition at line 282 of file DataContainer3D.cxx.
define aliases for TTree for drawing which was created by dumpSlice() or dumpInterpolation()
tree | TTree for which the aliases will be defined |
Definition at line 293 of file DataContainer3D.cxx.
void DataContainer3D::setGrid | ( | unsigned short | nZ, |
unsigned short | nR, | ||
unsigned short | nPhi, | ||
const bool | resize | ||
) |
set the grid points
Definition at line 312 of file DataContainer3D.cxx.
int DataContainer3D::writeToFile | ( | std::string_view | file, |
std::string_view | option, | ||
std::string_view | name = "data" , |
||
const int | nthreads = 1 |
||
) | const |
write this object to a file using RDataFrame
file | object is written to this file |
option | "RECREATE" or "UPDATE" |
name | object is saved with this name |
nthreads | number of threads to use |
Definition at line 44 of file DataContainer3D.cxx.
int DataContainer3D::writeToFile | ( | TFile & | outf, |
const char * | name = "data" |
||
) | const |
write this object to a file (deprecated!)
outf | object is written to this file |
name | object is saved with this name |
DataTOut | format of the output container (can be used to store the container with a different precission than the current object) |
Definition at line 29 of file DataContainer3D.cxx.