Gaudi Framework, version v22r0

Home   Generated: 9 Feb 2011

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 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 }

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

Generated at Wed Feb 9 16:30:06 2011 for Gaudi Framework, version v22r0 by Doxygen version 1.6.2 written by Dimitri van Heesch, © 1997-2004