User Tools

Site Tools


gaudi:ntuple

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
gaudi:ntuple [2009/10/05 16:47] – created decianmgaudi:ntuple [2009/11/30 10:01] (current) decianm
Line 1: Line 1:
-====== How to make your GaudiAlgorithm ready for an nTuple ======+====== How to make your GaudiAlgorithm / GaudiTool ready for an nTuple ======
 ===== Problem ===== ===== Problem =====
-Unlike a DaVinci-Algorithm (DVAlgorithm), Gaudi classes (most of the time) inherit from GaudiAlgorithmwhere the possiblity to create an nTuple (in an easy way) is not implemented. +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 =====+===== Solution for GaudiAlgorithm =====
 Let your GaudiAlgorithm inherit from 'GaudiTupleAlg' instead of 'GaudiAlgorithm'. Most of the time, you have to replace the following instances: Let your GaudiAlgorithm inherit from 'GaudiTupleAlg' instead of 'GaudiAlgorithm'. Most of the time, you have to replace the following instances:
 In the .h-File: In the .h-File:
 <code> <code>
 +#include "GaudiAlg/TupleObj.h"
 +#include "GaudiAlg/Tuples.h"
 +#include "GaudiAlg/Tuple.h"
 #include "GaudiAlg/GaudiTupleAlg.h" #include "GaudiAlg/GaudiTupleAlg.h"
 class myClass : public GaudiTupleAlg class myClass : public GaudiTupleAlg
Line 15: Line 18:
 return GaudiTupleAlg::finalize() return GaudiTupleAlg::finalize()
 </code> </code>
 +
 +You should then be able to declare your tuple in the 'execute()'-Method with
 +<code>
 +Tuple tuple = nTuple("myTuple");
 +</code>
 +
 +===== 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:
 +<code>
 +#include "GaudiAlg/TupleObj.h"
 +#include "GaudiAlg/Tuples.h"
 +#include "GaudiAlg/Tuple.h"
 +#include "GaudiAlg/GaudiTupleTool.h"
 +class myClass : public GaudiTupleTool
 +</code>
 +In the .cpp-File:
 +<code>
 +myClass::myClass( const std::string& type, const std::string& name, const IInterface* parent):GaudiTupleTool(type, name, parent)
 +</code>
 +You should then be able to declare your tuple in a method with
 +<code>
 +Tuple tuple = nTuple("myTuple");
 +</code>
 +
gaudi/ntuple.1254754027.txt.gz · Last modified: by decianm