| # Gaudi Framework, version v20r2
Generated: 18 Jul 2008

- Main Page
- Namespaces
- Classes
- Files
- Directories
- Related Pages

- Search for |

- Namespace List
- Namespace Members

# HbookCnv Namespace Reference

## Classes
class | ConvSvc
class | DirectoryCnv
class | H1DCnv
class | H2DCnv
class | HConverter
| Generic HBook converter class definition. More...
class | HCWNTupleCnv
| NTuple converter class definition. More...
class | HDirectoryCnv
| Create persistent and transient representations of data store directories. More...
class | HFileCnv
| NTuple file converter class definition. More...
class | HNTupleCnv
| NTuple converter class definition. More...
class | HRWNTupleCnv
| Row wise NTuple converter class definition. More...
class | PersSvc
## Functions
bool | parseName (std::string full, std::string &blk, std::string &var)
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.
INTupleItem * | createNTupleItem (NTUPLEINFO &tags, long i, INTuple *tuple, IOpaqueAddress *, IOpaqueAddress *, long &size)

## Function Documentation

INTupleItem* HbookCnv::createNTupleItem | ( | NTUPLEINFO & | tags,
|  | long | i,
|  | INTuple * | tuple,
|  | IOpaqueAddress * | ,
|  | IOpaqueAddress * | ,
|  | long & | size |
| ) |  |  |

Definition at line 246 of file HNTupleCnv.cpp.

References NTuple::_Array< TYP >::create(), and NTuple::_Item< TYP >::create().

    00246                                                                                                                                                          {
    00247     size = 0;
    00248     INTupleItem* col = 0;
    00249     long ind = tags.getIndex(tags.index[i]);
    00250     long dim1 = 1, dim2 = 1;
    00251
    00252     std::string varname;
    00253     std::string blkname = tags.block[i];
    00254
    00255     if (blkname != "AUTO_BLK") {
    00256       varname = blkname + "/" + tags.name[i];
    00257     } else {
    00258       varname = tags.name[i];
    00259     }
    00260
    00261     switch( tags.dim[i] )   {
    00262     case 0:
    00263       col = NTuple::_Item<IOpaqueAddress*>::create (tuple, varname,typeid(IOpaqueAddress*), 0,(IOpaqueAddress*)0xffffffff,0);
    00264       break;
    00265     case 1:
    00266       dim1 = (ind>=0) ? tags.idist(ind) : tags.theDim[i][0];
    00267       col = NTuple::_Array<IOpaqueAddress*>::create (tuple, varname,typeid(IOpaqueAddress*),
    00268                                                      tags.index[i], dim1, 0,(IOpaqueAddress*)0xffffffff,0);
    00269       break;
    00270     case 2:
    00271       dim1 = (ind>=0) ? tags.idist(ind) : tags.theDim[i][0];
    00272       dim2 = (ind>=0) ? tags.theDim[i][0] : tags.theDim[i][1];
    00273       col = NTuple::_Matrix<IOpaqueAddress*>::create (tuple, varname,typeid(IOpaqueAddress*),
    00274                                                       tags.index[i],dim1,dim2,0,(IOpaqueAddress*)0xffffffff,0);
    00275       break;
    00276     default:
    00277       break;
    00278     }
    00279     size += dim1 * dim2 * ((sizeof(IOpaqueAddress*) < 4) ? 4 : sizeof(IOpaqueAddress*));
    00280     return col;
    00281   }

template<class TYP>

INTupleItem * HbookCnv::createNTupleItem | ( | NTUPLEINFO & | tags,
|  | long | i,
|  | INTuple * | tuple,
|  | TYP | minimum,
|  | TYP | maximum,
|  | long & | size |
| ) |  |  |

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

Definition at line 193 of file HNTupleCnv.cpp.

Referenced by HbookCnv::HCWNTupleCnv::load().

    00193                                                                                                                                 {
    00194     size = 0;
    00195     INTupleItem* col = 0;
    00196
    00197     std::string varname;
    00198     std::string blkname = tags.block[i];
    00199
    00200     if (blkname != "AUTO_BLK") {
    00201       varname = blkname + "/" + tags.name[i];
    00202     } else {
    00203       varname = tags.name[i];
    00204     }
    00205
    00206     //if ( tags.isRangeWithin(i, minimum,maximum))
    00207     {
    00208       long ind = tags.getIndex(tags.index[i]);
    00209       long dim1 = 1, dim2 = 1;
    00210       TYP min, max, null;
    00211       tags.getBounds(i, min, max, null);
    00212       switch( tags.dim[i] )   {
    00213       case 0:
    00214         col = NTuple::_Item<TYP>::create (tuple, varname, typeid(TYP), min, max, null);
    00215         break;
    00216       case 1:
    00217         dim1 = (ind>=0) ? tags.idist(ind) : tags.theDim[i][0];
    00218           col = NTuple::_Array<TYP>::create (tuple, varname,typeid(TYP),tags.index[i],dim1,min,max,null);
    00219         break;
    00220       case 2:
    00221         dim1 = (ind>=0) ? tags.idist(ind) : tags.theDim[i][0];
    00222         dim2 = (ind>=0) ? tags.theDim[i][0] : tags.theDim[i][1];
    00223         col = NTuple::_Matrix<TYP>::create (tuple, varname,typeid(TYP),tags.index[i],dim1,dim2,min,max,null);
    00224         break;
    00225       default:
    00226         break;
    00227       }
    00228       size += dim1 * dim2 * ((sizeof(TYP) < 4) ? 4 : sizeof(TYP));
    00229     }
    00230     return col;
    00231   }

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

Definition at line 168 of file HNTupleCnv.cpp.

References std::basic_string< _CharT, _Traits, _Alloc >::find(), std::basic_string< _CharT, _Traits, _Alloc >::length(), and std::basic_string< _CharT, _Traits, _Alloc >::substr().

Referenced by analyzeItem().

    00171 {
    00172   int sp;
    00173   if ( (sp=full.find("/")) != -1 ) {
    00174     blk = full.substr(0,sp);
    00175     var = full.substr(sp+1,full.length());
    00176     return true;
    00177   }
    00178   else {
    00179     blk = "AUTO_BLK";
    00180     var = full;
    00181     return false;
    00182   }
    00183 }