All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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::HistogramBase
RootHistCnvP1DCnv
 
typedef RHistogramCnv
< TProfile2D, TProfile2D,
Gaudi::HistogramBase
RootHistCnvP2DCnv
 
typedef RHistogramCnv< TH1D,
TH1, Gaudi::HistogramBase
RootHistCnvH1DCnv
 
typedef RHistogramCnv< TH2D,
TH2, Gaudi::HistogramBase
RootHistCnvH2DCnv
 
typedef
RootHistCnv::RHistogramCnv
< TH3D, TH3,
Gaudi::HistogramBase
RootHistCnvH3DCnv
 

Functions

template<class TYP >
INTupleItemcreateNTupleItem (std::string itemName, std::string blockName, std::string indexName, int indexRange, int arraySize, TYP min, TYP max, INTuple *ntup)
 
 INSTANTIATE (float)
 
 INSTANTIATE (double)
 
 INSTANTIATE (bool)
 
 INSTANTIATE (char)
 
 INSTANTIATE (int)
 
 INSTANTIATE (short)
 
 INSTANTIATE (long)
 
 INSTANTIATE (unsigned char)
 
 INSTANTIATE (unsigned long long)
 
template<class TYP >
INTupleItemcreateNTupleItem (NTUPLEINFO &tags, long i, INTuple *tuple, TYP minimum, TYP maximum, long &size)
 Add an item of a given type to the N tuple. More...
 
bool parseName (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 14 of file RHistogramCnv.cpp.

Function Documentation

template<class TYP >
INTupleItem* RootHistCnv::createNTupleItem ( NTUPLEINFO &  tags,
long  i,
INTuple tuple,
TYP  minimum,
TYP  maximum,
long &  size 
)

Add an item of a given type to the N tuple.

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 
)

Definition at line 275 of file RNTupleCnv.cpp.

279  {
280 
281  std::string varName;
282  if (blockName != "") {
283  varName = blockName + "/" + itemName;
284  } else {
285  varName = itemName;
286  }
287 
288  TYP null = 0;
289  INTupleItem* col = 0;
290 
291  if (min == 0 && max == 0) {
293  max = NTuple::Range<TYP>::max();
294  }
295 
296 
297  if (indexName == "") {
298 
299  if (arraySize == 1) {
300  // simple items
301  col = NTuple::_Item<TYP>::create(ntup, varName,
302  typeid(TYP),
303  min, max, null);
304 
305  } else {
306  // Arrays of fixed size
307  col = NTuple::_Array<TYP>::create(ntup, varName,
308  typeid(TYP),
309  "", arraySize,
310  min, max, null);
311  }
312 
313  } else {
314 
315  if (arraySize == 1) {
316  // Arrays of variable size
317  col = NTuple::_Array<TYP>::create(ntup, varName,
318  typeid(TYP),
319  indexName, indexRange,
320  min, max, null);
321  } else {
322  // Matrices
323  col = NTuple::_Matrix<TYP>::create(ntup, varName,
324  typeid(TYP),
325  indexName,
326  indexRange, arraySize,
327  min, max, null);
328  }
329 
330  }
331 
332  return col;
333 
334  }
static TYP min()
Minimal number of data.
Definition: NTuple.h:77
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
NTuple interface class definition.
Definition: INTuple.h:27
static TYP max()
Maximal number of data.
Definition: NTuple.h:79
#define min(a, b)
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:27
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:41
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 ( std::string  full,
std::string &  blk,
std::string &  var 
)

Definition at line 251 of file RNTupleCnv.cpp.

251  {
252  //-----------------------------------------------------------------------------
253  int sp;
254  if ( (sp=full.find("/")) != -1 ) {
255  blk = full.substr(0,sp);
256  var = full.substr(sp+1,full.length());
257  return true;
258  } else {
259  blk = "AUTO_BLK";
260  var = full;
261  return false;
262  }
263 
264 }
bool RootHistCnv::RootCd ( const std::string &  full)

Definition at line 16 of file RootDirFcn.cpp.

18 {
19  int p,i=1;
20  std::string cur,sdir;
21 
22  gDirectory->cd("/");
23  while ( (p = full.find("/",i)) != -1) {
24  sdir = full.substr(i,p-i);
25  if (! gDirectory->GetKey(sdir.c_str()) ) {
26  return false;
27  }
28  gDirectory->cd(sdir.c_str());
29 
30  i = p+1;
31  }
32  gDirectory->cd( full.substr(i,full.length()-i).c_str() );
33 
34  return true;
35 
36 }
list i
Definition: ana.py:128
bool RootHistCnv::RootMkdir ( const std::string &  full)

Definition at line 40 of file RootDirFcn.cpp.

42 {
43 
44  int p,i;
45  std::string fil,cur,s;
46  TDirectory *gDir;
47 
48  gDir = gDirectory;
49 
50  std::list<std::string> lpath;
51  i = 1;
52 
53  if ( (p=full.find(":",0)) != -1 ) {
54  fil = full.substr(0,p);
55  i = p+1;
56  fil += ":/";
57  gDirectory->cd(fil.c_str());
58  }
59 
60  while ( (p = full.find("/",i)) != -1) {
61  s = full.substr(i,p-i);
62  lpath.push_back(s);
63  i = p+1;
64  }
65  lpath.push_back( full.substr(i,full.length()-i) );
66 
67  if ( full.substr(0,1) == "/") {
68  gDirectory->cd("/");
69  }
70 
71  std::list<std::string>::const_iterator litr;
72  for(litr=lpath.begin(); litr!=lpath.end(); ++litr) {
73  cur = *litr;
74  if (! gDirectory->GetKey(litr->c_str()) ) {
75  gDirectory->mkdir(litr->c_str());
76  }
77  gDirectory->cd(litr->c_str());
78  }
79 
80  gDirectory = gDir;
81 
82  return true;
83 }
string s
Definition: gaudirun.py:210
list i
Definition: ana.py:128
std::string RootHistCnv::RootPwd ( )

Definition at line 86 of file RootDirFcn.cpp.

88 {
89  std::string dir = gDirectory->GetPath();
90 
91  return (dir);
92 }
bool RootHistCnv::RootTrimLeadingDir ( std::string &  full,
std::string  dir 
)

Definition at line 95 of file RootDirFcn.cpp.

97 {
98 
99  if (dir.substr(0,1) != "/") {
100  dir.insert(0,"/");
101  }
102 
103  if (dir.substr(dir.length()-1,1) != "/") {
104  dir += "/";
105  }
106 
107  long ll = full.find(dir);
108  if (ll != 0) {
109  return false;
110  }
111 
112  full.erase(0,dir.length()-1);
113 
114  return true;
115 
116 }