The Gaudi Framework  master (594c33fa)
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 (std::string itemName, std::string blockName, 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 ( std::string  itemName,
std::string  blockName,
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.

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

◆ 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;
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)
max
EventIDBase max(const EventIDBase &lhs, const EventIDBase &rhs)
Definition: EventIDBase.h:225
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
min
EventIDBase min(const EventIDBase &lhs, const EventIDBase &rhs)
Definition: EventIDBase.h:212
INTupleItem
Definition: INTuple.h:37
NTuple::Range::max
static TYP max()
Maximal number of data.
Definition: NTuple.h:94
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
NTuple::Range::min
static TYP min()
Minimal number of data.
Definition: NTuple.h:92