RCWNTupleCnv.cpp File Reference
#include "GaudiKernel/xtoa.h"
#include "GaudiKernel/CnvFactory.h"
#include "GaudiKernel/INTupleSvc.h"
#include "GaudiKernel/MsgStream.h"
#include "GaudiKernel/NTuple.h"
#include <cstdio>
#include <utility>
#include <list>
#include <vector>
#include "RCWNTupleCnv.h"
#include "TTree.h"
#include "TLeafI.h"
#include "TLeafF.h"
#include "TLeafD.h"
Go to the source code of this file.
Define Documentation
| #define ROOTHISTCNV_RCWNTUPLECNV_CPP |
Function Documentation
Definition at line 34 of file RCWNTupleCnv.cpp.
00042 {
00043
00044 std::string full_name;
00045 full_name = it->name();
00046 RootHistCnv::parseName(full_name,block_name,var_name);
00047
00048 long item_size = (sizeof(T) < 4) ? 4 : sizeof(T);
00049 long dimension = it->length();
00050 long ndim = it->ndim()-1;
00051 char text[132];
00052 desc += var_name;
00053 if ( it->hasIndex() || it->length() > 1 ) {
00054 desc += "[";
00055 }
00056 if ( it->hasIndex() ) {
00057 std::string ind_blk, ind_var;
00058 std::string ind = it->index();
00059 RootHistCnv::parseName(ind,ind_blk,ind_var);
00060 if (ind_blk != block_name) {
00061 std::cerr << "ERROR: Index for CWNT variable " << ind_var
00062 << " is in a different block: " << ind_blk << std::endl;
00063 }
00064 desc += ind_var;
00065 }
00066 else if ( it->dim(ndim) > 1 ) {
00067 desc += ::_itoa(it->dim(ndim), text, 10);
00068 }
00069
00070 for ( int i = ndim-1; i>=0; i-- ){
00071 desc += "][";
00072 desc += ::_itoa(it->dim(i), text, 10);
00073 }
00074 if ( it->hasIndex() || it->length() > 1 ) {
00075 desc += "]";
00076 }
00077
00078 if (it->range().lower() != it->range().min() &&
00079 it->range().upper() != it->range().max() ) {
00080 lowerRange = (long) it->range().lower();
00081 upperRange = (long) it->range().upper();
00082 } else {
00083 lowerRange = 0;
00084 upperRange = -1;
00085 }
00086 desc += typ;
00087 size += item_size * dimension;
00088 }