The Gaudi Framework  v33r1 (b1225454)
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::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 (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 ( 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 271 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 ) {
287  }
288 
289  if ( indexName == "" ) {
290 
291  if ( arraySize == 1 ) {
292  // simple items
293  col = NTuple::_Item<TYP>::create( ntup, varName, typeid( TYP ), min, max, null );
294 
295  } else {
296  // Arrays of fixed size
297  col = NTuple::_Array<TYP>::create( ntup, varName, typeid( TYP ), "", arraySize, min, max, null );
298  }
299 
300  } else {
301 
302  if ( arraySize == 1 ) {
303  // Arrays of variable size
304  col = NTuple::_Array<TYP>::create( ntup, varName, typeid( TYP ), indexName, indexRange, min, max, null );
305  } else {
306  // Matrices
307  col = NTuple::_Matrix<TYP>::create( ntup, varName, typeid( TYP ), indexName, indexRange, arraySize, min, max,
308  null );
309  }
310  }
311 
312  return col;
313  }
EventIDBase min(const EventIDBase &lhs, const EventIDBase &rhs)
Definition: EventIDBase.h:212
static TYP min()
Minimal number of data.
Definition: NTuple.h:92
EventIDBase max(const EventIDBase &lhs, const EventIDBase &rhs)
Definition: EventIDBase.h:225
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:43
STL class.
NTuple interface class definition.
Definition: INTuple.h:37
static TYP max()
Maximal number of data.
Definition: NTuple.h:94
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:36
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:50

◆ 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 246 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 }

◆ 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 
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  }
T push_back(T... args)

◆ 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  }
STL class.

◆ 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  }
T insert(T... args)
T length(T... args)
T compare(T... args)