The Gaudi Framework  master (37c0b60a)
RootHistCnv Namespace Reference

Classes

class  DirectoryCnv
 
class  PersSvc
 
class  RConverter
 
class  RCWNTupleCnv
 
class  RDirectoryCnv
 
class  RFileCnv
 
class  RHistogramCnv
 
class  RNTupleCnv
 
class  RootCompressionSettings
 
class  RootObjAddress
 
class  RRWNTupleCnv
 

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

267  {
268 
269  std::string varName;
270  if ( blockName != "" ) {
271  varName = blockName + "/" + itemName;
272  } else {
273  varName = itemName;
274  }
275 
276  TYP null = 0;
277  INTupleItem* col = nullptr;
278 
279  if ( !hasRange ) {
282  }
283 
284  if ( indexName == "" ) {
285 
286  if ( arraySize == 1 ) {
287  // simple items
288  col = NTuple::_Item<TYP>::create( ntup, varName, typeid( TYP ), min, max, null );
289 
290  } else {
291  // Arrays of fixed size
292  col = NTuple::_Array<TYP>::create( ntup, varName, typeid( TYP ), "", arraySize, min, max, null );
293  }
294 
295  } else {
296 
297  if ( arraySize == 1 ) {
298  // Arrays of variable size
299  col = NTuple::_Array<TYP>::create( ntup, varName, typeid( TYP ), indexName, indexRange, min, max, null );
300  } else {
301  // Matrices
302  col = NTuple::_Matrix<TYP>::create( ntup, varName, typeid( TYP ), indexName, indexRange, arraySize, min, max,
303  null );
304  }
305  }
306 
307  return col;
308  }

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

240  {
241  //-----------------------------------------------------------------------------
242  int sp = -1;
243  if ( ( sp = full.find( "/" ) ) != -1 ) {
244  blk = full.substr( 0, sp );
245  var = full.substr( sp + 1 );
246  return true;
247  } else {
248  blk = "AUTO_BLK";
249  var = full;
250  return false;
251  }
252 }

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

◆ 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  }
std::string
STL class.
Gaudi::Accumulators::atomicity::full
@ full
std::vector< std::string >
std::string::length
T length(T... args)
std::vector::push_back
T push_back(T... args)
compareOutputFiles.sp
sp
Definition: compareOutputFiles.py:506
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:36
std::string::compare
T compare(T... args)
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:50
INTupleItem
Definition: INTuple.h:37
NTuple::Range::max
static TYP max()
Maximal number of data.
Definition: NTuple.h:94
std::min
T min(T... args)
std::string::insert
T insert(T... args)
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:43
std::max
T max(T... args)
NTuple::Range::min
static TYP min()
Minimal number of data.
Definition: NTuple.h:92