| # Gaudi Framework, version v23r0 |

Home |  | Generated: Mon Jan 30 2012

Defines | Functions

# 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
| ) |  |

Definition at line 34 of file RCWNTupleCnv.cpp.

    {

      std::string full_name = it->name();
      RootHistCnv::parseName(full_name,block_name,var_name);

      //long item_size = (sizeof(T) < 4) ? 4 : sizeof(T);
      long item_size =  sizeof(T);
      long dimension = it->length();
      long ndim = it->ndim()-1;
      std::ostringstream text;
      text << var_name;
      if ( it->hasIndex() || it->length() > 1 )   {
        text << '[';
      }
      if ( it->hasIndex() )
      {
        std::string ind_blk, ind_var;
        std::string ind = it->index();
        RootHistCnv::parseName(ind,ind_blk,ind_var);
        if (ind_blk != block_name) {
          std::cerr << "ERROR: Index for CWNT variable " << ind_var
                    << " is in a different block: " << ind_blk << std::endl;
        }
        text << ind_var;
      }
      else if ( it->dim(ndim) > 1 )   {
        text << it->dim(ndim);
      }

      for ( int i = ndim-1; i>=0; i-- ){
        text << "][" << it->dim(i);
      }
      if ( it->hasIndex() || it->length() > 1 )   {
        text << ']';
      }

      if (it->range().lower() != it->range().min() &&
          it->range().upper() != it->range().max() ) {
        lowerRange = (long) it->range().lower();
        upperRange = (long) it->range().upper();
      } else {
        lowerRange = 0;
        upperRange = -1;
      }
      text << typ;

      desc += text.str();
      size += item_size * dimension;
    }

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines