User Tools

Site Tools


gaudi:ntuple

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
gaudi:ntuple [2009/10/05 16:48] 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:
Line 20: Line 20:
  
 You should then be able to declare your tuple in the 'execute()'-Method with 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> <code>
 Tuple tuple = nTuple("myTuple"); Tuple tuple = nTuple("myTuple");
 </code> </code>
  
gaudi/ntuple.1254754119.txt.gz · Last modified: 2009/10/05 16:48 by decianm