| # Gaudi Framework, version v22r2 |

Home |  | Generated: Tue May 10 2011

Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends

# RootHistCnv::RRWNTupleCnv Class Reference

Row wise NTuple converter class definition. More...

`#include <RRWNTupleCnv.h>`

Inheritance diagram for RootHistCnv::RRWNTupleCnv:
[legend]
Collaboration diagram for RootHistCnv::RRWNTupleCnv:
[legend]

List of all members.

## Public Member Functions
| RRWNTupleCnv (ISvcLocator *svc)
| Standard constructor.
virtual | ~RRWNTupleCnv ()
| Standard destructor.
## Static Public Member Functions
static const CLID & | classID ()
| Inquire class type.
## Protected Member Functions
virtual StatusCode | load (TTree *tree, INTuple *&refpObject)
| Create the transient representation of an object.
virtual StatusCode | book (const std::string &desc, INTuple *pObject, TTree *&tree)
| Book the N tuple.
virtual StatusCode | writeData (TTree *rtree, INTuple *pObject)
| Write N tuple data.
virtual StatusCode | readData (TTree *rtree, INTuple *pObject, long ievt)
| Read N tuple data.
## Friends
class | CnvFactory< RRWNTupleCnv >
| Creator needs access to constructor/destructor.

## Detailed Description

Row wise NTuple converter class definition.

Author:
  Charles Leggett

Definition at line 19 of file RRWNTupleCnv.h.

## Constructor & Destructor Documentation

RootHistCnv::RRWNTupleCnv::RRWNTupleCnv | ( | ISvcLocator * | svc ) | `[inline]`

Standard constructor.

Definition at line 31 of file RRWNTupleCnv.h.

                                          : RNTupleCnv(svc, classID())    {
        }

virtual RootHistCnv::RRWNTupleCnv::~RRWNTupleCnv | ( | ) | `[inline, virtual]`

Standard destructor.

Definition at line 34 of file RRWNTupleCnv.h.

                                  {
        }

## Member Function Documentation

StatusCode RootHistCnv::RRWNTupleCnv::book | ( | const std::string & | desc,
|  | INTuple * | pObject,
|  | TTree *& | tree
| ) |  | `[protected, virtual]`

Book the N tuple.

Implements RootHistCnv::RNTupleCnv.

Definition at line 20 of file RRWNTupleCnv.cpp.

    {
      MsgStream log(msgSvc(), "RRWNTupleCnv");
      const INTuple::ItemContainer& itms = nt->items();
      // Book the tree
      rtree = new TTree(desc.c_str(),nt->title().c_str());
      // Add the branches
      for (size_t length = itms.size(), i = 0; i < length; i++ )    {
        const char* itm = itms[i]->name().c_str();
        std::string tag = itm;
        tag += rootVarType( itms[i]->type() );
        // add the branch
        log << MSG::INFO << "ID " << desc << ": added branch: "
            << itm << " / " << tag << endmsg;
        rtree->Branch(itm,const_cast<void*>(itms[i]->buffer()),tag.c_str());
      }
      log << MSG::INFO << "Booked TTree with ID:" << desc
          << " \"" << nt->title() << "\"" << endmsg;
      return StatusCode::SUCCESS;
    }

static const CLID& RootHistCnv::RRWNTupleCnv::classID | ( | ) | `[inline, static]`

Inquire class type.

Definition at line 26 of file RRWNTupleCnv.h.

                                        {
          return CLID_RowWiseTuple;
        }

StatusCode RootHistCnv::RRWNTupleCnv::load | ( | TTree * | tree,
|  | INTuple *& | refpObject
| ) |  | `[protected, virtual]`

Create the transient representation of an object.

Implements RootHistCnv::RNTupleCnv.

Definition at line 72 of file RRWNTupleCnv.cpp.

    {
      return StatusCode::FAILURE;
    }

StatusCode RootHistCnv::RRWNTupleCnv::readData | ( | TTree * | rtree,
|  | INTuple * | pObject,
|  | long | ievt
| ) |  | `[protected, virtual]`

Read N tuple data.

Implements RootHistCnv::RNTupleCnv.

Definition at line 63 of file RRWNTupleCnv.cpp.

    {
      return StatusCode::FAILURE;
    }

StatusCode RootHistCnv::RRWNTupleCnv::writeData | ( | TTree * | rtree,
|  | INTuple * | pObject
| ) |  | `[protected, virtual]`

Write N tuple data.

Implements RootHistCnv::RNTupleCnv.

Definition at line 45 of file RRWNTupleCnv.cpp.

    {
      if ( 0 != rtree )   {
        // Fill the tree;
        rtree->Fill();
        // Reset the NTuple
        nt->reset();
        return StatusCode::SUCCESS;
      }
      MsgStream log(msgSvc(), "RRWNTupleCnv");
      log << MSG::ERROR << "Attempt to write invalid N-tuple.";
      if ( nt != 0 ) log << nt->title();
      log << endmsg;
      return StatusCode::FAILURE;
    }

## Friends And Related Function Documentation

friend class CnvFactory< RRWNTupleCnv >`[friend]`

Creator needs access to constructor/destructor.

Definition at line 22 of file RRWNTupleCnv.h.

The documentation for this class was generated from the following files:

- /afs/.cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v22r2/RootHistCnv/src/RRWNTupleCnv.h
- /afs/.cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v22r2/RootHistCnv/src/RRWNTupleCnv.cpp

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