The Gaudi Framework  master (9f3f8895)
Loading...
Searching...
No Matches
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 (const std::string &itemName, const std::string &blockName, const std::string &indexName, int indexRange, int arraySize, TYP minimum, TYP maximum, INTuple *tuple, bool hasRange)
 Add an item of a given type to the N tuple.
 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

◆ RootHistCnvH2DCnv

◆ RootHistCnvH3DCnv

◆ RootHistCnvP1DCnv

Definition at line 16 of file RHistogramCnv.cpp.

◆ RootHistCnvP2DCnv

Definition at line 27 of file RHistogramCnv.cpp.

Function Documentation

◆ createNTupleItem()

template<class TYP>
INTupleItem * RootHistCnv::createNTupleItem ( const std::string & itemName,
const std::string & blockName,
const std::string & indexName,
int indexRange,
int arraySize,
TYP min,
TYP max,
INTuple * ntup,
bool hasRange )

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

Definition at line 269 of file RNTupleCnv.cpp.

271 {
272
273 std::string varName;
274 if ( blockName != "" ) {
275 varName = blockName + "/" + itemName;
276 } else {
277 varName = itemName;
278 }
279
280 TYP null = 0;
281 INTupleItem* col = nullptr;
282
283 if ( !hasRange ) {
286 }
287
288 if ( indexName == "" ) {
289
290 if ( arraySize == 1 ) {
291 // simple items
292 col = NTuple::_Item<TYP>::create( ntup, varName, typeid( TYP ), min, max, null );
293
294 } else {
295 // Arrays of fixed size
296 col = NTuple::_Array<TYP>::create( ntup, varName, typeid( TYP ), "", arraySize, min, max, null );
297 }
298
299 } else {
300
301 if ( arraySize == 1 ) {
302 // Arrays of variable size
303 col = NTuple::_Array<TYP>::create( ntup, varName, typeid( TYP ), indexName, indexRange, min, max, null );
304 } else {
305 // Matrices
306 col = NTuple::_Matrix<TYP>::create( ntup, varName, typeid( TYP ), indexName, indexRange, arraySize, min, max,
307 null );
308 }
309 }
310
311 return col;
312 }
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.
static _Item * create(INTuple *tup, const std::string &name, const std::type_info &info, TYP min, TYP max, TYP def)
Create instance.
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.
static TYP min()
Minimal number of data.
Definition NTuple.h:84
static TYP max()
Maximal number of data.
Definition NTuple.h:86

◆ INSTANTIATE() [1/13]

RootHistCnv::INSTANTIATE ( bool )

◆ INSTANTIATE() [2/13]

RootHistCnv::INSTANTIATE ( char )

◆ INSTANTIATE() [3/13]

RootHistCnv::INSTANTIATE ( double )

◆ INSTANTIATE() [4/13]

RootHistCnv::INSTANTIATE ( float )

◆ INSTANTIATE() [5/13]

RootHistCnv::INSTANTIATE ( int )

◆ INSTANTIATE() [6/13]

RootHistCnv::INSTANTIATE ( long long )

◆ INSTANTIATE() [7/13]

RootHistCnv::INSTANTIATE ( long )

◆ INSTANTIATE() [8/13]

RootHistCnv::INSTANTIATE ( short )

◆ INSTANTIATE() [9/13]

RootHistCnv::INSTANTIATE ( unsigned char )

◆ INSTANTIATE() [10/13]

RootHistCnv::INSTANTIATE ( unsigned int )

◆ INSTANTIATE() [11/13]

RootHistCnv::INSTANTIATE ( unsigned long long )

◆ INSTANTIATE() [12/13]

RootHistCnv::INSTANTIATE ( unsigned long )

◆ INSTANTIATE() [13/13]

RootHistCnv::INSTANTIATE ( unsigned short )

◆ parseName()

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 = -1;
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}

◆ RootCd()

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

Definition at line 24 of file RootDirFcn.cpp.

26 {
27 int p, i = 1;
28
29 gDirectory->cd( "/" );
30 while ( ( p = full.find( "/", i ) ) != -1 ) {
31 auto sdir = full.substr( i, p - i );
32 if ( !gDirectory->GetKey( sdir.c_str() ) ) { return false; }
33 gDirectory->cd( sdir.c_str() );
34 i = p + 1;
35 }
36 gDirectory->cd( full.substr( i ).c_str() );
37 return true;
38 }

◆ RootMkdir()

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

Definition at line 41 of file RootDirFcn.cpp.

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

◆ RootPwd()

std::string RootHistCnv::RootPwd ( )

Definition at line 75 of file RootDirFcn.cpp.

77 {
78 std::string dir = gDirectory->GetPath();
79
80 return ( dir );
81 }

◆ RootTrimLeadingDir()

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

Definition at line 84 of file RootDirFcn.cpp.

86 {
87
88 if ( dir.compare( 0, 1, "/" ) != 0 ) { dir.insert( 0, "/" ); }
89
90 if ( dir.compare( dir.length() - 1, 1, "/" ) != 0 ) { dir += "/"; }
91
92 long ll = full.find( dir );
93 if ( ll != 0 ) { return false; }
94
95 full.erase( 0, dir.length() - 1 );
96
97 return true;
98 }