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

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

- Search for |

- File List
- File Members

# HCWNTupleCnv.cpp File Reference

`#include <cstdio>`
`#include "GaudiKernel/xtoa.h"`
`#include "GaudiKernel/CnvFactory.h"`
`#include "GaudiKernel/DataTypeInfo.h"`
`#include "GaudiKernel/INTupleSvc.h"`
`#include "GaudiKernel/MsgStream.h"`
`#include "GaudiKernel/NTuple.h"`
`#include "HCWNTupleCnv.h"`
`#include "NTupleInfo.h"`
`#include "HbookDef.h"`

Include dependency graph for HCWNTupleCnv.cpp:

Go to the source code of this file.

## Defines
#define | HBOOKCNV_HCWNTUPLECNV_CPP
#define | ALLOW_ALL_TYPES
## Functions
template<class T>
void | analyzeItem (const char typ, const NTuple::_Data< T > *it, std::string &desc, std::string &block_name, long &size)

## Define Documentation

#define ALLOW_ALL_TYPES

Definition at line 5 of file HCWNTupleCnv.cpp.

#define HBOOKCNV_HCWNTUPLECNV_CPP

Definition at line 2 of file HCWNTupleCnv.cpp.

## Function Documentation

template<class T>

void analyzeItem | ( | const char | typ,
|  | const NTuple::_Data< T > * | it,
|  | std::string & | desc,
|  | std::string & | block_name,
|  | long & | size |
| ) |  |  |

Definition at line 35 of file HCWNTupleCnv.cpp.

References _itoa(), std::cerr, std::endl(), and HbookCnv::parseName().

Referenced by RootHistCnv::RCWNTupleCnv::book(), and HbookCnv::HCWNTupleCnv::declare().

    00039                                                    {
    00040
    00041   std::string full_name, var_name;
    00042   full_name = it->name();
    00043   HbookCnv::parseName(full_name,block_name,var_name);
    00044
    00045   long item_size = (sizeof(T) < 4) ? 4 : sizeof(T);
    00046   long dimension = it->length();
    00047   long ndim = it->ndim()-1;
    00048   char text[132];
    00049   //  desc += it->name();
    00050   desc += var_name;
    00051   if ( it->hasIndex() || it->length() > 1 )   {
    00052     desc += '(';
    00053   }
    00054   for ( int i = 0; i < ndim; i++ )   {
    00055     desc += ::_itoa(it->dim(i), text, 10);
    00056     desc += ',';
    00057   }
    00058   if ( it->hasIndex() )   {
    00059     std::string ind_blk, ind_var;
    00060     std::string ind = it->index();
    00061     HbookCnv::parseName(ind,ind_blk,ind_var);
    00062     if (ind_blk != block_name) {
    00063       std::cerr << "ERROR: Index for CWNT variable " << ind_var
    00064                 << " is in a differnt block: " << ind_blk << std::endl;
    00065     }
    00066     desc += ind_var;
    00067   }
    00068   else if ( it->dim(ndim) > 1 )   {
    00069     desc += ::_itoa(it->dim(ndim), text, 10);
    00070   }
    00071
    00072   if ( it->hasIndex() || it->length() > 1 )   {
    00073     desc += ")";
    00074   }
    00075   if ( typ != 'L' && typ != 'R' )   {
    00076     desc += '[';
    00077     desc += ::_itoa(long(it->range().lower()), text, 10);
    00078     desc += ',';
    00079     desc += ::_itoa(long(it->range().upper()), text, 10);
    00080     desc += ']';
    00081   }
    00082   desc += ':';
    00083   desc += typ;
    00084   desc += '*';
    00085   desc += ::_itoa(item_size, text, 10);
    00086   size += item_size * dimension;
    00087 }