| # Gaudi Framework, version v25r0 |

Home |  | Generated: Mon Feb 17 2014

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Macros | Functions
RootNTupleCnv.cpp File Reference
`#include "RootCnv/RootRefs.h"`
`#include "RootCnv/RootAddress.h"`
`#include "RootCnv/RootNTupleCnv.h"`
`#include "RootCnv/RootDataConnection.h"`
`#include "GaudiKernel/NTuple.h"`
`#include "GaudiKernel/SmartIF.h"`
`#include "GaudiKernel/SmartRef.h"`
`#include "GaudiKernel/INTupleSvc.h"`
`#include "GaudiKernel/IRegistry.h"`
`#include "GaudiKernel/ISelectStatement.h"`
`#include "GaudiKernel/ContainedObject.h"`
`#include "GaudiKernel/StreamBuffer.h"`
`#include "TROOT.h"`
`#include "TTree.h"`
`#include "TBranch.h"`
`#include <limits>`
`#include <memory>`
Include dependency graph for RootNTupleCnv.cpp:

Go to the source code of this file.

## Macros
#define | ALLOW_ALL_TYPES
#define | S_OK StatusCode::SUCCESS
#define | S_FAIL StatusCode::FAILURE

## Functions
static istream & | loadLong (istream &is)
static istream & | operator>> (istream &is, IOpaqueAddress *&)
template<class TYP >
static StatusCode | createItem (TTree *tree, INTuple *tuple, istream &is, const string &name, bool add, const TYP &null)
template<class T >
static void | putRange (ostream &os, NTuple::_Data< T > *it)
static string | _tr (const string &s)

## Macro Definition Documentation

#define ALLOW_ALL_TYPES

Definition at line 10 of file RootNTupleCnv.cpp.

#define S_FAIL StatusCode::FAILURE

Definition at line 35 of file RootNTupleCnv.cpp.

#define S_OK StatusCode::SUCCESS

Definition at line 34 of file RootNTupleCnv.cpp.

## Function Documentation

static string _tr | ( | const string & | s | ) |
| inline static

Definition at line 126 of file RootNTupleCnv.cpp.

{
string local = s;
char* p = (char*)local.c_str();
if ( strncmp(p,"<local>",7)==0 ) p += 7;
for(;*p;++p)
if ( !isalnum(*p) ) *p = '_';
return local;
}
template<class TYP >

static StatusCode createItem | ( | TTree * | tree,
|  | INTuple * | tuple,
|  | istream & | is,
|  | const string & | name,
|  | bool | add,
|  | const TYP & | null
| ) |  |
| static

Definition at line 58 of file RootNTupleCnv.cpp.

{
string idxName;
long len, ndim, dim[4], hasIdx, idxLow, idxLen;
long dim1 = 1, dim2 = 1;
INTupleItem* it = 0;
char c;
is >> len >> c
>> ndim >> c
>> hasIdx >> c;
if ( hasIdx ) {
getline(is, idxName, ';') >> idxLow >> c >> idxLen >> c;
}
for ( int i = 0; i < ndim; i++ )
is >> dim[i] >> c;
TYP low = null, high = null;
is >> low >> c >> high >> c;
is >> c;
switch( ndim )
{
case 0:
it = NTuple::_Item<TYP>::create (tuple, name, typeid(TYP), low, high, null);
break;
case 1:
dim1 = (hasIdx) ? idxLen : dim[0];
it = NTuple::_Array<TYP>::create (tuple,
name,
typeid(TYP),
idxName,
dim1,
low,
high,
null);
break;
case 2:
dim1 = (hasIdx) ? idxLen : dim[0];
dim2 = (hasIdx) ? dim[0] : dim[1];
it = NTuple::_Matrix<TYP>::create ( tuple,
name,
typeid(TYP),
idxName,
dim1,
dim2,
low,
high,
null);
break;
default:
return S_FAIL;
}
if ( add ) {
TBranch* b = tree->GetBranch(it->name().c_str());
if ( b ) {
b->SetAddress((void*)it->buffer());
}
else {
//return StatusCode::SUCCESS;
return tuple->add(it);
}
}
return tuple->add(it);
}

static istream& loadLong | ( | istream & | is | ) |
| inline static

Definition at line 40 of file RootNTupleCnv.cpp.

{
long i;
is >> i;
return is;
}

static istream& operator>> | ( | istream & | is,
|  | IOpaqueAddress *& |
| ) |  |
| inline static

Definition at line 45 of file RootNTupleCnv.cpp.

{ return loadLong(is); }
template<class T >

static void putRange | ( | ostream & | os,
|  | NTuple::_Data< T > * | it
| ) |  |
| inline static

Definition at line 121 of file RootNTupleCnv.cpp.

{
const NTuple::Range<T>& x = it->range();
os << x.lower() << ';' << x.upper() << ';';
}