![]() |
|
|
Generated: 8 Jan 2009 |
#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 <climits>

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