PropertiesExample

From Atlas Wiki
Revision as of 13:04, 25 October 2006 by Zkestere (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Introduction

Setting properties allows the user to steer the Algorithms with help of the jobOptions.py. The advantage of this that you don't need to recompile your algorithms/tool every time you think of a change. Properties are handy too if one wants to set cut-offs, point to different files in CASTOR, use different names for ntuples and trees, and the like.

Accessing StoreGate

To let your Algorithm point to StoreGate, one should first concider two things:

  • What kind of DataObject do I want to retrieve? (answer: a DummyTrackCollection)
  • What is the key under what StoreGate has recorded it? (answer: "DummyTrackCollection")

So the ExampleAlg should have an instance of the DummyTrackCollection (to store the DummyTracks in): declare this in the header ExampleAlg.h:

class DummyTrackCollection;
class ExampleAlg : public Algorithm{
  ...
  private :
  DummyTrackCollection* m_tracks;

In the source file, retrieve the StoregateService and retrieve the collection: