| The Gaudi Framework v32r1 (f65d50dc)

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 minimum, TYP maximum, INTuple *tuple)
| Add an item of a given type to the N tuple. More...
| INSTANTIATE (float)
| INSTANTIATE (double)
| INSTANTIATE (bool)
| INSTANTIATE (char)
| INSTANTIATE (int)
| INSTANTIATE (short)
| INSTANTIATE (long)
| INSTANTIATE (long long)
| INSTANTIATE (unsigned char)
| INSTANTIATE (unsigned int)
| INSTANTIATE (unsigned short)
| INSTANTIATE (unsigned long)
| INSTANTIATE (unsigned long long)
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

## ◆ RootHistCnvH1DCnv

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

Definition at line 28 of file RHistogramCnv.cpp.

## ◆ RootHistCnvH2DCnv

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

Definition at line 39 of file RHistogramCnv.cpp.

## ◆ RootHistCnvH3DCnv

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

Definition at line 50 of file RHistogramCnv.cpp.

## ◆ RootHistCnvP1DCnv

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

Definition at line 6 of file RHistogramCnv.cpp.

## ◆ RootHistCnvP2DCnv

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

Definition at line 17 of file RHistogramCnv.cpp.

## Function Documentation

## ◆ createNTupleItem()

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
| ) |  |

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

Definition at line 261 of file RNTupleCnv.cpp.

262 {
263
264 std::string varName;
265 if ( blockName != "" ) {
266 varName = blockName + "/" + itemName;
267 } else {
268 varName = itemName;
269 }
270
271 TYP null = 0;
272 INTupleItem* col = nullptr;
273
274 if ( min == 0 && max == 0 ) {
275 min = NTuple::Range<TYP>::min();
276 max = NTuple::Range<TYP>::max();
277 }
278
279 if ( indexName == "" ) {
280
281 if ( arraySize == 1 ) {
282 // simple items
283 col = NTuple::_Item<TYP>::create( ntup, varName, typeid( TYP ), min, max, null );
284
285 } else {
286 // Arrays of fixed size
287 col = NTuple::_Array<TYP>::create( ntup, varName, typeid( TYP ), "", arraySize, min, max, null );
288 }
289
290 } else {
291
292 if ( arraySize == 1 ) {
293 // Arrays of variable size
294 col = NTuple::_Array<TYP>::create( ntup, varName, typeid( TYP ), indexName, indexRange, min, max, null );
295 } else {
296 // Matrices
297 col = NTuple::_Matrix<TYP>::create( ntup, varName, typeid( TYP ), indexName, indexRange, arraySize, min, max,
298 null );
299 }
300 }
301
302 return col;
303 }
min
EventIDBase min(const EventIDBase &lhs, const EventIDBase &rhs)
Definition: EventIDBase.h:202
NTuple::Range::min
static TYP min()
Minimal number of data.
Definition: NTuple.h:82
max
EventIDBase max(const EventIDBase &lhs, const EventIDBase &rhs)
Definition: EventIDBase.h:215
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:33
std::string
STL class.
INTupleItem
NTuple interface class definition.
Definition: INTuple.h:27
NTuple::Range::max
static TYP max()
Maximal number of data.
Definition: NTuple.h:84
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:40

## ◆ INSTANTIATE() [1/13]

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

## ◆ INSTANTIATE() [2/13]

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

## ◆ INSTANTIATE() [3/13]

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

## ◆ INSTANTIATE() [4/13]

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

## ◆ INSTANTIATE() [5/13]

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

## ◆ INSTANTIATE() [6/13]

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

## ◆ INSTANTIATE() [7/13]

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

## ◆ INSTANTIATE() [8/13]

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

## ◆ INSTANTIATE() [9/13]

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

## ◆ INSTANTIATE() [10/13]

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

## ◆ INSTANTIATE() [11/13]

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

## ◆ INSTANTIATE() [12/13]

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

## ◆ INSTANTIATE() [13/13]

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

## ◆ parseName()

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

Definition at line 236 of file RNTupleCnv.cpp.

236 {
237 //-----------------------------------------------------------------------------
238 int sp;
239 if ( ( sp = full.find( "/" ) ) != -1 ) {
240 blk = full.substr( 0, sp );
241 var = full.substr( sp + 1 );
242 return true;
243 } else {
244 blk = "AUTO_BLK";
245 var = full;
246 return false;
247 }
248 }
compareOutputFiles.sp
sp
Definition: compareOutputFiles.py:494
boost::spirit
Definition: iter_pos.hpp:14
Gaudi::Accumulators::atomicity::full

## ◆ RootCd()

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

Definition at line 14 of file RootDirFcn.cpp.

16 {
17 int p, i = 1;
18
19 gDirectory->cd( "/" );
20 while ( ( p = full.find( "/", i ) ) != -1 ) {
21 auto sdir = full.substr( i, p - i );
22 if ( !gDirectory->GetKey( sdir.c_str() ) ) { return false; }
23 gDirectory->cd( sdir.c_str() );
24 i = p + 1;
25 }
26 gDirectory->cd( full.substr( i ).c_str() );
27 return true;
28 }
Gaudi::Accumulators::atomicity::full

## ◆ RootMkdir()

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

Definition at line 31 of file RootDirFcn.cpp.

33 {
34
35 TDirectory* gDir = gDirectory;
36
37 int i = 1;
38 auto p = full.find( ":", 0 );
39 if ( p != std::string::npos ) {
40 auto fil = full.substr( 0, p );
41 i = p + 1;
42 fil += ":/";
43 gDirectory->cd( fil.c_str() );
44 }
45
46 std::vector<std::string> lpath;
47 while ( ( p = full.find( "/", i ) ) != std::string::npos ) {
48 lpath.push_back( full.substr( i, p - i ) );
49 i = p + 1;
50 }
51 lpath.push_back( full.substr( i ) );
52
53 if ( full.compare( 0, 1, "/" ) == 0 ) gDirectory->cd( "/" );
54
55 for ( const auto& lp : lpath ) {
56 if ( !gDirectory->GetKey( lp.c_str() ) ) { gDirectory->mkdir( lp.c_str() ); }
57 gDirectory->cd( lp.c_str() );
58 }
59 gDirectory = gDir;
60
61 return true;
62 }
std::vector::push_back
T push_back(T... args)
Gaudi::Accumulators::atomicity::full
std::vector< std::string >

## ◆ RootPwd()

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

Definition at line 65 of file RootDirFcn.cpp.

67 {
68 std::string dir = gDirectory->GetPath();
69
70 return ( dir );
71 }
std::string
STL class.

## ◆ RootTrimLeadingDir()

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

Definition at line 74 of file RootDirFcn.cpp.

76 {
77
78 if ( dir.compare( 0, 1, "/" ) != 0 ) { dir.insert( 0, "/" ); }
79
80 if ( dir.compare( dir.length() - 1, 1, "/" ) != 0 ) { dir += "/"; }
81
82 long ll = full.find( dir );
83 if ( ll != 0 ) { return false; }
84
85 full.erase( 0, dir.length() - 1 );
86
87 return true;
88 }
std::string::insert
T insert(T... args)
std::string::length
T length(T... args)
Gaudi::Accumulators::atomicity::full
std::string::compare
T compare(T... args)