Difference between revisions of "ToolExample"

From Atlas Wiki
Jump to navigation Jump to search
 
Line 3: Line 3:
  
 
==Getting the complete answer==
 
==Getting the complete answer==
A tar file with the whole AnalysisExample package containing the result of the exercise is to be found [http://www.nikhef.nl/~zkestere/Wiki/IncludeTool.tgz here]. Compiling this package and running ATHENA should work out-of-the-box. In the section below the key lines in the package will be discussed.
+
A tar file with the whole AnalysisExample package containing the result of the exercise is to be found [http://www.nikhef.nl/~zkestere/Wiki/IncludeTool.tgz here]. Compiling this package and running ATHENA should work out-of-the-box. In the section below the key lines in the package will be discussed. To get this package working copy the .tgz file into your Tutorial directory and type:
 +
<pre>
 +
* tar xzf ToolExample.tgz ExampleAnalysis
 +
* cd ExampleAnalysis/cmt
 +
* source setup.csh
 +
* gmake
 +
</pre>
 +
Running ATHENA should show the output of EvtMax events with a dump stating that the ToolExample->useTool() method is indeed called every event.
 +
 
 +
==Retrieving the ToolExample from ToolSvc==
 +
In ExampleAlg.cxx, one can see the following lines in the initialize() method:
 +
<pre>
 +
  StatusCode sc = toolSvc()->retrieveTool("ToolExample",m_tool);
 +
  if(sc.isFailure()) {
 +
    log << MSG::ERROR << "ToolSvc could not retrieve ToolExample" << endreq;
 +
  } else log << MSG::INFO << "ToolSvc retrieved ToolExample" << endreq;
 +
</pre>

Revision as of 11:12, 25 October 2006

introduction

During the workshop only one participant managed to get this exercise working. The "ToolExample.cxx" contained bugs causing ATHENA to crash. In this section, this exercise will be explained in detail.

Getting the complete answer

A tar file with the whole AnalysisExample package containing the result of the exercise is to be found here. Compiling this package and running ATHENA should work out-of-the-box. In the section below the key lines in the package will be discussed. To get this package working copy the .tgz file into your Tutorial directory and type:

* tar xzf ToolExample.tgz ExampleAnalysis
* cd ExampleAnalysis/cmt
* source setup.csh
* gmake

Running ATHENA should show the output of EvtMax events with a dump stating that the ToolExample->useTool() method is indeed called every event.

Retrieving the ToolExample from ToolSvc

In ExampleAlg.cxx, one can see the following lines in the initialize() method:

  StatusCode sc = toolSvc()->retrieveTool("ToolExample",m_tool);
  if(sc.isFailure()) {
    log << MSG::ERROR << "ToolSvc could not retrieve ToolExample" << endreq;
  } else log << MSG::INFO << "ToolSvc retrieved ToolExample" << endreq;