| The Gaudi Framework v27r1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Namespace List
- Namespace Members

Classes | Typedefs | Functions
RootHistCnv Namespace Reference

## Classes
class | DirectoryCnv
class | PersSvc
| Persistency service - to store histograms in ROOT format. More...
class | RConverter
| Root Converter. More...
class | RCWNTupleCnv
| Converter of Column-wise NTuple into ROOT format. More...
class | RDirectoryCnv
| Create persistent and transient representations of data store directories. More...
class | RFileCnv
| NTuple converter class definition. More...
class | RHistogramCnv
| Generic converter to save/read AIDA_ROOT histograms using ROOT. More...
class | RNTupleCnv
| NTuple converter class definition. More...
class | RootCompressionSettings
| Simple class to decode a ROOT compression settings string, of the form '<Alg>:<level>' into the integer code to pass to ROOT. More...
class | RootObjAddress
class | RRWNTupleCnv
| Row wise NTuple converter class definition. More...

## Typedefs
typedef RHistogramCnv< TProfile, TProfile, Gaudi::HistogramBase > | RootHistCnvP1DCnv
typedef RHistogramCnv< TProfile2D, TProfile2D, Gaudi::HistogramBase > | RootHistCnvP2DCnv
typedef RHistogramCnv< TH1D, TH1, Gaudi::HistogramBase > | RootHistCnvH1DCnv
typedef RHistogramCnv< TH2D, TH2, Gaudi::HistogramBase > | RootHistCnvH2DCnv
typedef RootHistCnv::RHistogramCnv< TH3D, TH3, Gaudi::HistogramBase > | RootHistCnvH3DCnv

## Functions
template<class TYP >
INTupleItem * | createNTupleItem (std::string itemName, std::string blockName, std::string indexName, int indexRange, int arraySize, TYP min, TYP max, INTuple *ntup)
| INSTANTIATE (float)
| INSTANTIATE (double)
| INSTANTIATE (bool)
| INSTANTIATE (char)
| INSTANTIATE (int)
| INSTANTIATE (short)
| INSTANTIATE (long)
| INSTANTIATE (unsigned char)
| INSTANTIATE (unsigned long long)
template<class TYP >
INTupleItem * | createNTupleItem (NTUPLEINFO &tags, long i, INTuple *tuple, TYP minimum, TYP maximum, long &size)
| Add an item of a given type to the N tuple. More...
bool | parseName (const std::string &full, std::string &blk, std::string &var)
bool | RootCd (const std::string &full)
bool | RootMkdir (const std::string &full)
std::string | RootPwd ()
bool | RootTrimLeadingDir (std::string &full, std::string dir)

## Typedef Documentation

typedef RHistogramCnv<TH1D,TH1,Gaudi::HistogramBase> RootHistCnv::RootHistCnvH1DCnv

Definition at line 22 of file RHistogramCnv.cpp.

typedef RHistogramCnv<TH2D,TH2,Gaudi::HistogramBase> RootHistCnv::RootHistCnvH2DCnv

Definition at line 30 of file RHistogramCnv.cpp.

typedef RootHistCnv::RHistogramCnv<TH3D,TH3,Gaudi::HistogramBase> RootHistCnv::RootHistCnvH3DCnv

Definition at line 38 of file RHistogramCnv.cpp.

typedef RHistogramCnv<TProfile,TProfile,Gaudi::HistogramBase> RootHistCnv::RootHistCnvP1DCnv

Definition at line 6 of file RHistogramCnv.cpp.

typedef RHistogramCnv<TProfile2D,TProfile2D,Gaudi::HistogramBase> RootHistCnv::RootHistCnvP2DCnv

Definition at line 14 of file RHistogramCnv.cpp.

## Function Documentation

template<class TYP >

INTupleItem* RootHistCnv::createNTupleItem | ( | NTUPLEINFO & | tags,
|  | long | i,
|  | INTuple * | tuple,
|  | TYP | minimum,
|  | TYP | maximum,
|  | long & | size
| ) |  |

Add an item of a given type to the N tuple.

template<class TYP >

INTupleItem * RootHistCnv::createNTupleItem | ( | std::string | itemName,
|  | std::string | blockName,
|  | std::string | indexName,
|  | int | indexRange,
|  | int | arraySize,
|  | TYP | min,
|  | TYP | max,
|  | INTuple * | ntup
| ) |  |

Definition at line 268 of file RNTupleCnv.cpp.

272 {
273
274 std::string varName;
275 if (blockName != "") {
276 varName = blockName + "/" + itemName;
277 } else {
278 varName = itemName;
279 }
280
281 TYP null = 0;
282 INTupleItem* col = nullptr;
283
284 if (min == 0 && max == 0) {
285 min = NTuple::Range<TYP>::min();
286 max = NTuple::Range<TYP>::max();
287 }
288
289
290 if (indexName == "") {
291
292 if (arraySize == 1) {
293 // simple items
294 col = NTuple::_Item<TYP>::create(ntup, varName,
295 typeid(TYP),
296 min, max, null);
297
298 } else {
299 // Arrays of fixed size
300 col = NTuple::_Array<TYP>::create(ntup, varName,
301 typeid(TYP),
302 "", arraySize,
303 min, max, null);
304 }
305
306 } else {
307
308 if (arraySize == 1) {
309 // Arrays of variable size
310 col = NTuple::_Array<TYP>::create(ntup, varName,
311 typeid(TYP),
312 indexName, indexRange,
313 min, max, null);
314 } else {
315 // Matrices
316 col = NTuple::_Matrix<TYP>::create(ntup, varName,
317 typeid(TYP),
318 indexName,
319 indexRange, arraySize,
320 min, max, null);
321 }
322
323 }
324
325 return col;
326
327 }
NTuple::Range::min
static TYP min()
Minimal number of data.
Definition: NTuple.h:76
NTuple::_Array::create
static _Array * create(INTuple *tup, const std::string &name, const std::type_info &info, const std::string &index, long len, TYP min, TYP max, TYP def)
Create instance.
Definition: NTupleItems.cpp:32
std::string
STL class.
std::min
T min(T...args)
INTupleItem
NTuple interface class definition.
Definition: INTuple.h:26
NTuple::Range::max
static TYP max()
Maximal number of data.
Definition: NTuple.h:78
std::max
T max(T...args)
NTuple::_Item::create
static _Item * create(INTuple *tup, const std::string &name, const std::type_info &info, TYP min, TYP max, TYP def)
Create instance.
Definition: NTupleItems.cpp:26
NTuple::_Matrix::create
static _Matrix * create(INTuple *tup, const std::string &name, const std::type_info &info, const std::string &index, long ncol, long nrow, TYP min, TYP max, TYP def)
Create instance.
Definition: NTupleItems.cpp:38

RootHistCnv::INSTANTIATE | ( | float |  | ) |

RootHistCnv::INSTANTIATE | ( | double |  | ) |

RootHistCnv::INSTANTIATE | ( | bool |  | ) |

RootHistCnv::INSTANTIATE | ( | char |  | ) |

RootHistCnv::INSTANTIATE | ( | int |  | ) |

RootHistCnv::INSTANTIATE | ( | short |  | ) |

RootHistCnv::INSTANTIATE | ( | long |  | ) |

RootHistCnv::INSTANTIATE | ( | unsigned | char | ) |

RootHistCnv::INSTANTIATE | ( | unsigned long | long | ) |

bool RootHistCnv::parseName | ( | const std::string & | full,
|  | std::string & | blk,
|  | std::string & | var
| ) |  |

Definition at line 244 of file RNTupleCnv.cpp.

244 {
245 //-----------------------------------------------------------------------------
246 int sp;
247 if ( (sp=full.find("/")) != -1 ) {
248 blk = full.substr(0,sp);
249 var = full.substr(sp+1);
250 return true;
251 } else {
252 blk = "AUTO_BLK";
253 var = full;
254 return false;
255 }
256
257 }
compareOutputFiles.sp
tuple sp
Definition: compareOutputFiles.py:416
std::string::find
T find(T...args)
std::string::substr
T substr(T...args)

bool RootHistCnv::RootCd | ( | const std::string & | full | ) |

Definition at line 16 of file RootDirFcn.cpp.

18 {
19 int p,i=1;
20
21 gDirectory->cd("/");
22 while ( (p = full.find("/",i)) != -1) {
23 auto sdir = full.substr(i,p-i);
24 if (! gDirectory->GetKey(sdir.c_str()) ) {
25 return false;
26 }
27 gDirectory->cd(sdir.c_str());
28 i = p+1;
29 }
30 gDirectory->cd( full.substr(i).c_str() );
31 return true;
32
33 }
std::string::find
T find(T...args)
std::string::substr
T substr(T...args)
ana.i
list i
Definition: ana.py:128

bool RootHistCnv::RootMkdir | ( | const std::string & | full | ) |

Definition at line 37 of file RootDirFcn.cpp.

39 {
40
41 TDirectory *gDir = gDirectory;
42
43 int i = 1;
44 auto p=full.find(":",0);
45 if ( p != std::string::npos ) {
46 auto fil = full.substr(0,p);
47 i = p+1;
48 fil += ":/";
49 gDirectory->cd(fil.c_str());
50 }
51
52 std::vector<std::string> lpath;
53 while ( (p = full.find("/",i)) != std::string::npos ) {
54 lpath.push_back(full.substr(i,p-i));
55 i = p+1;
56 }
57 lpath.push_back( full.substr(i) );
58
59 if ( full.compare(0,1,"/") == 0 ) gDirectory->cd("/");
60
61 for(const auto& lp : lpath) {
62 if (! gDirectory->GetKey(lp.c_str()) ) {
63 gDirectory->mkdir(lp.c_str());
64 }
65 gDirectory->cd(lp.c_str());
66 }
67 gDirectory = gDir;
68
69 return true;
70 }
std::vector::push_back
T push_back(T...args)
std::string::find
T find(T...args)
std::vector< std::string >
std::string::substr
T substr(T...args)
ana.i
list i
Definition: ana.py:128
std::string::compare
T compare(T...args)

std::string RootHistCnv::RootPwd | ( |  | ) |

Definition at line 73 of file RootDirFcn.cpp.

75 {
76 std::string dir = gDirectory->GetPath();
77
78 return (dir);
79 }
std::string
STL class.

bool RootHistCnv::RootTrimLeadingDir | ( | std::string & | full,
|  | std::string | dir
| ) |  |

Definition at line 82 of file RootDirFcn.cpp.

84 {
85
86 if (dir.compare(0,1,"/") != 0) {
87 dir.insert(0,"/");
88 }
89
90 if (dir.compare(dir.length()-1,1,"/") != 0) {
91 dir += "/";
92 }
93
94 long ll = full.find(dir);
95 if (ll != 0) {
96 return false;
97 }
98
99 full.erase(0,dir.length()-1);
100
101 return true;
102
103 }
std::string::erase
T erase(T...args)
std::string::insert
T insert(T...args)
std::string::find
T find(T...args)
std::string::length
T length(T...args)
std::string::compare
T compare(T...args)