| # Gaudi Framework, version v21r8 |

Home |  | Generated: 17 Mar 2010

# 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"`

Include dependency graph for RCWNTupleCnv.cpp:

Go to the source code of this file.

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

## Define Documentation

#define ALLOW_ALL_TYPES

Definition at line 4 of file RCWNTupleCnv.cpp.

#define ROOTHISTCNV_RCWNTUPLECNV_CPP

Definition at line 2 of file RCWNTupleCnv.cpp.

## Function Documentation

template<class T>

void analyzeItem | ( | std::string | typ,
|  | const NTuple::_Data< T > * | it,
|  | std::string & | desc,
|  | std::string & | block_name,
|  | std::string & | var_name,
|  | long & | lowerRange,
|  | long & | upperRange,
|  | long & | size |
| ) |  |  | `[inline]`

Definition at line 32 of file RCWNTupleCnv.cpp.

    00040 {
    00041
    00042   std::string full_name;
    00043   full_name = it->name();
    00044   RootHistCnv::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 += var_name;
    00051   if ( it->hasIndex() || it->length() > 1 )   {
    00052     desc += "[";
    00053   }
    00054   if ( it->hasIndex() )   {
    00055     std::string ind_blk, ind_var;
    00056     std::string ind = it->index();
    00057     RootHistCnv::parseName(ind,ind_blk,ind_var);
    00058     if (ind_blk != block_name) {
    00059       std::cerr << "ERROR: Index for CWNT variable " << ind_var
    00060                 << " is in a differnt block: " << ind_blk << std::endl;
    00061     }
    00062     desc += ind_var;
    00063   }
    00064   else if ( it->dim(ndim) > 1 )   {
    00065     desc += ::_itoa(it->dim(ndim), text, 10);
    00066   }
    00067
    00068   for ( int i = ndim-1; i>=0; i-- ){
    00069     desc += "][";
    00070     desc += ::_itoa(it->dim(i), text, 10);
    00071   }
    00072   if ( it->hasIndex() || it->length() > 1 )   {
    00073     desc += "]";
    00074   }
    00075
    00076   if (it->range().lower() != it->range().min() &&
    00077       it->range().upper() != it->range().max() ) {
    00078     lowerRange = (long) it->range().lower();
    00079     upperRange = (long) it->range().upper();
    00080   } else {
    00081     lowerRange = 0;
    00082     upperRange = -1;
    00083   }
    00084   desc += typ;
    00085   size += item_size * dimension;
    00086 }