The Gaudi Framework  v30r3 (a5ef0a68)
RootHistCnv Namespace Reference

Namespaces

 RootHistCnvConf
 

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::HistogramBaseRootHistCnvP1DCnv
 
typedef RHistogramCnv< TProfile2D, TProfile2D, Gaudi::HistogramBaseRootHistCnvP2DCnv
 
typedef RHistogramCnv< TH1D, TH1, Gaudi::HistogramBaseRootHistCnvH1DCnv
 
typedef RHistogramCnv< TH2D, TH2, Gaudi::HistogramBaseRootHistCnvH2DCnv
 
typedef RootHistCnv::RHistogramCnv< TH3D, TH3, Gaudi::HistogramBaseRootHistCnvH3DCnv
 

Functions

template<class TYP >
INTupleItemcreateNTupleItem (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 (unsigned char)
 
 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

Definition at line 33 of file RHistogramCnv.cpp.

Definition at line 46 of file RHistogramCnv.cpp.

Definition at line 7 of file RHistogramCnv.cpp.

Definition at line 20 of file RHistogramCnv.cpp.

Function Documentation

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 272 of file RNTupleCnv.cpp.

274  {
275 
276  std::string varName;
277  if ( blockName != "" ) {
278  varName = blockName + "/" + itemName;
279  } else {
280  varName = itemName;
281  }
282 
283  TYP null = 0;
284  INTupleItem* col = nullptr;
285 
286  if ( min == 0 && max == 0 ) {
289  }
290 
291  if ( indexName == "" ) {
292 
293  if ( arraySize == 1 ) {
294  // simple items
295  col = NTuple::_Item<TYP>::create( ntup, varName, typeid( TYP ), min, max, null );
296 
297  } else {
298  // Arrays of fixed size
299  col = NTuple::_Array<TYP>::create( ntup, varName, typeid( TYP ), "", arraySize, min, max, null );
300  }
301 
302  } else {
303 
304  if ( arraySize == 1 ) {
305  // Arrays of variable size
306  col = NTuple::_Array<TYP>::create( ntup, varName, typeid( TYP ), indexName, indexRange, min, max, null );
307  } else {
308  // Matrices
309  col = NTuple::_Matrix<TYP>::create( ntup, varName, typeid( TYP ), indexName, indexRange, arraySize, min, max,
310  null );
311  }
312  }
313 
314  return col;
315  }
static TYP min()
Minimal number of data.
Definition: NTuple.h:85
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:34
STL class.
T min(T...args)
NTuple interface class definition.
Definition: INTuple.h:27
static TYP max()
Maximal number of data.
Definition: NTuple.h:87
T max(T...args)
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
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:42
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 245 of file RNTupleCnv.cpp.

246 {
247  //-----------------------------------------------------------------------------
248  int sp;
249  if ( ( sp = full.find( "/" ) ) != -1 ) {
250  blk = full.substr( 0, sp );
251  var = full.substr( sp + 1 );
252  return true;
253  } else {
254  blk = "AUTO_BLK";
255  var = full;
256  return false;
257  }
258 }
T find(T...args)
T substr(T...args)
bool RootHistCnv::RootCd ( const std::string full)

Definition at line 15 of file RootDirFcn.cpp.

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

Definition at line 34 of file RootDirFcn.cpp.

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

Definition at line 70 of file RootDirFcn.cpp.

72  {
73  std::string dir = gDirectory->GetPath();
74 
75  return ( dir );
76  }
STL class.
bool RootHistCnv::RootTrimLeadingDir ( std::string full,
std::string  dir 
)

Definition at line 79 of file RootDirFcn.cpp.

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