| # Gaudi Framework, version v21r9 |

Home |  | Generated: 3 May 2010

# 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 | 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
bool | parseName (std::string full, std::string &blk, std::string &var)
template<class TYP>
INTupleItem * | createNTupleItem (std::string itemName, std::string blockName, std::string indexName, int indexRange, int arraySize, TYP min, TYP max, INTuple *ntup)
template<class TYP>
INTupleItem * | createNTupleItem (NTUPLEINFO &tags, long i, INTuple *tuple, TYP minimum, TYP maximum, long &size)
| Add an item of a given type to the N tuple.
bool | RootCd (const std::string &full)
bool | RootMkdir (const std::string &full)
std::string | RootPwd ()
bool | RootTrimLeadingDir (std::string &full, std::string dir)
## Variables
static std::string | stat_dir = "/stat"
static std::string | undefFileName = "UndefinedROOTOutputFileName"

## Typedef Documentation

typedef RHistogramCnv<TH1D,TH1,Gaudi::HistogramBase> RootHistCnv::RootHistCnvH1DCnv

Definition at line 24 of file RHistogramCnv.cpp.

typedef RHistogramCnv<TH2D,TH2,Gaudi::HistogramBase> RootHistCnv::RootHistCnvH2DCnv

Definition at line 32 of file RHistogramCnv.cpp.

typedef RootHistCnv::RHistogramCnv<TH3D,TH3,Gaudi::HistogramBase> RootHistCnv::RootHistCnvH3DCnv

Definition at line 40 of file RHistogramCnv.cpp.

typedef RHistogramCnv<TProfile,TProfile,Gaudi::HistogramBase> RootHistCnv::RootHistCnvP1DCnv

Definition at line 8 of file RHistogramCnv.cpp.

typedef RHistogramCnv<TProfile2D,TProfile2D,Gaudi::HistogramBase> RootHistCnv::RootHistCnvP2DCnv

Definition at line 16 of file RHistogramCnv.cpp.

## Function Documentation

template<class TYP>

INTupleItem* RootHistCnv::createNTupleItem | ( | NTUPLEINFO & | tags,
|  | long | i,
|  | INTuple * | tuple,
|  | TYP | minimum,
|  | TYP | maximum,
|  | long & | size |
| ) |  |  | `[inline]`

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 |
| ) |  |  | `[inline]`

Definition at line 267 of file RNTupleCnv.cpp.

    00271                                                 {
    00272
    00273     std::string varName;
    00274     if (blockName != "") {
    00275       varName = blockName + "/" + itemName;
    00276     } else {
    00277       varName = itemName;
    00278     }
    00279
    00280     TYP null = 0;
    00281     INTupleItem* col = 0;
    00282
    00283     if (min == 0 && max == 0) {
    00284       min = NTuple::Range<TYP>::min();
    00285       max = NTuple::Range<TYP>::max();
    00286     }
    00287
    00288
    00289     if (indexName == "") {
    00290
    00291       if (arraySize == 1) {
    00292         // simple items
    00293         col = NTuple::_Item<TYP>::create(ntup, varName,
    00294                                          typeid(TYP),
    00295                                          min, max, null);
    00296
    00297       } else {
    00298         // Arrays of fixed size
    00299         col = NTuple::_Array<TYP>::create(ntup, varName,
    00300                                            typeid(TYP),
    00301                                           "", arraySize,
    00302                                           min, max, null);
    00303       }
    00304
    00305     } else {
    00306
    00307       if (arraySize == 1) {
    00308         // Arrays of variable size
    00309         col = NTuple::_Array<TYP>::create(ntup, varName,
    00310                                            typeid(TYP),
    00311                                           indexName, indexRange,
    00312                                           min, max, null);
    00313       } else {
    00314         // Matrices
    00315         col = NTuple::_Matrix<TYP>::create(ntup, varName,
    00316                                            typeid(TYP),
    00317                                            indexName,
    00318                                            indexRange, arraySize,
    00319                                            min, max, null);
    00320       }
    00321
    00322     }
    00323
    00324     return col;
    00325
    00326   }

bool RootHistCnv::parseName | ( | std::string | full,
|  | std::string & | blk,
|  | std::string & | var |
| ) |  |  |

Definition at line 243 of file RNTupleCnv.cpp.

    00243                                                                           {
    00244 //-----------------------------------------------------------------------------
    00245   int sp;
    00246   if ( (sp=full.find("/")) != -1 ) {
    00247     blk = full.substr(0,sp);
    00248     var = full.substr(sp+1,full.length());
    00249     return true;
    00250   } else {
    00251     blk = "AUTO_BLK";
    00252     var = full;
    00253     return false;
    00254   }
    00255
    00256 }

bool RootHistCnv::RootCd | ( | const std::string & | full | ) |

Definition at line 17 of file RootDirFcn.cpp.

    00019 {
    00020   int p,i=1;
    00021   std::string cur,sdir;
    00022
    00023   gDirectory->cd("/");
    00024   while ( (p = full.find("/",i)) != -1) {
    00025     sdir = full.substr(i,p-i);
    00026     if (! gDirectory->GetKey(sdir.c_str()) ) {
    00027       return false;
    00028     }
    00029     gDirectory->cd(sdir.c_str());
    00030
    00031     i = p+1;
    00032   }
    00033   gDirectory->cd( full.substr(i,full.length()-i).c_str() );
    00034
    00035   return true;
    00036
    00037 }

bool RootHistCnv::RootMkdir | ( | const std::string & | full | ) |

Definition at line 41 of file RootDirFcn.cpp.

    00043 {
    00044
    00045   int p,i;
    00046   std::string fil,cur,s;
    00047   TDirectory *gDir;
    00048
    00049   gDir = gDirectory;
    00050
    00051   std::list<std::string> lpath;
    00052   i = 1;
    00053
    00054   if ( (p=full.find(":",0)) != -1 ) {
    00055     fil = full.substr(0,p);
    00056     i = p+1;
    00057     fil += ":/";
    00058     gDirectory->cd(fil.c_str());
    00059   }
    00060
    00061   while ( (p = full.find("/",i)) != -1) {
    00062     s = full.substr(i,p-i);
    00063     lpath.push_back(s);
    00064     i = p+1;
    00065   }
    00066   lpath.push_back( full.substr(i,full.length()-i) );
    00067
    00068   if ( full.substr(0,1) == "/") {
    00069     gDirectory->cd("/");
    00070   }
    00071
    00072   std::list<std::string>::const_iterator litr;
    00073   for(litr=lpath.begin(); litr!=lpath.end(); ++litr) {
    00074     cur = *litr;
    00075     if (! gDirectory->GetKey(litr->c_str()) ) {
    00076       gDirectory->mkdir(litr->c_str());
    00077     }
    00078     gDirectory->cd(litr->c_str());
    00079   }
    00080
    00081   gDirectory = gDir;
    00082
    00083   return true;
    00084 }

std::string RootHistCnv::RootPwd | ( |  | ) |

Definition at line 87 of file RootDirFcn.cpp.

    00089 {
    00090   std::string dir = gDirectory->GetPath();
    00091
    00092   return (dir);
    00093 }

bool RootHistCnv::RootTrimLeadingDir | ( | std::string & | full,
|  | std::string | dir |
| ) |  |  |

Definition at line 96 of file RootDirFcn.cpp.

    00098 {
    00099
    00100   if (dir.substr(0,1) != "/") {
    00101     dir.insert(0,"/");
    00102   }
    00103
    00104   if (dir.substr(dir.length()-1,1) != "/") {
    00105     dir += "/";
    00106   }
    00107
    00108   long ll = full.find(dir);
    00109   if (ll != 0) {
    00110     return false;
    00111   }
    00112
    00113   full.erase(0,dir.length()-1);
    00114
    00115   return true;
    00116
    00117 }

## Variable Documentation

std::string RootHistCnv::stat_dir = "/stat"`[static]`

Definition at line 28 of file PersSvc.cpp.

std::string RootHistCnv::undefFileName = "UndefinedROOTOutputFileName"`[static]`

Definition at line 29 of file PersSvc.cpp.