User Tools

Site Tools


gaudi:ntuple

How to make your GaudiAlgorithm / GaudiTool ready for an nTuple

Problem

Unlike a DaVinci-Algorithm (DVAlgorithm), Gaudi algorithms (most of the time) inherit from GaudiAlgorithm and tools from GaudiTools where the possiblity to create an nTuple (in an easy way) is not implemented.

Solution for GaudiAlgorithm

Let your GaudiAlgorithm inherit from 'GaudiTupleAlg' instead of 'GaudiAlgorithm'. Most of the time, you have to replace the following instances: In the .h-File:

#include "GaudiAlg/TupleObj.h"
#include "GaudiAlg/Tuples.h"
#include "GaudiAlg/Tuple.h"
#include "GaudiAlg/GaudiTupleAlg.h"
class myClass : public GaudiTupleAlg

In the .cpp-File:

myClass::myClass( const std::string& name,ISvcLocator* pSvcLocator): GaudiTupleAlg ( name , pSvcLocator )
StatusCode sc = GaudiTupleAlg::initialize()
return GaudiTupleAlg::finalize()

You should then be able to declare your tuple in the 'execute()'-Method with

Tuple tuple = nTuple("myTuple");

Solution for GaudiTool

Let your GaudiTool inherit from 'GaudiTupleTool' instead of 'GaudiTool'. Most of the time, you have to replace the following instances: In the .h-File:

#include "GaudiAlg/TupleObj.h"
#include "GaudiAlg/Tuples.h"
#include "GaudiAlg/Tuple.h"
#include "GaudiAlg/GaudiTupleTool.h"
class myClass : public GaudiTupleTool

In the .cpp-File:

myClass::myClass( const std::string& type, const std::string& name, const IInterface* parent):GaudiTupleTool(type, name, parent)

You should then be able to declare your tuple in a method with

Tuple tuple = nTuple("myTuple");
gaudi/ntuple.txt · Last modified: 2009/11/30 10:01 by decianm