The Gaudi Framework  v31r0 (aeb156f0)
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 (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 6 of file RHistogramCnv.cpp.

Definition at line 17 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 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 ) {
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  }
EventIDBase min(const EventIDBase &lhs, const EventIDBase &rhs)
Definition: EventIDBase.h:202
static TYP min()
Minimal number of data.
Definition: NTuple.h:82
EventIDBase max(const EventIDBase &lhs, const EventIDBase &rhs)
Definition: EventIDBase.h:215
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
STL class.
NTuple interface class definition.
Definition: INTuple.h:27
static TYP max()
Maximal number of data.
Definition: NTuple.h:84
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:40
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 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 }
T find(T...args)
T substr(T...args)
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  }
T find(T...args)
T substr(T...args)
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 
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  }
T push_back(T...args)
T find(T...args)
T substr(T...args)
T compare(T...args)
std::string RootHistCnv::RootPwd ( )

Definition at line 65 of file RootDirFcn.cpp.

67  {
68  std::string dir = gDirectory->GetPath();
69 
70  return ( dir );
71  }
STL class.
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  }
T erase(T...args)
T insert(T...args)
T find(T...args)
T length(T...args)
T compare(T...args)