Skip to content
Snippets Groups Projects
Commit d9055694 authored by Marco Clemencic's avatar Marco Clemencic
Browse files

introduce DataHandle and DataObjectHandle

See merge requests !57 !94 !95

Major components
----------------

`DataObjID`: data object identification

`DataHandle -> DataObjectHandleBase -> DataObjectHandle<T>`

`DataHandle`: base class shared between ATLAS and Gaudi
`DataObjectHandleBase`: base class for Handles in Gaudi, used for property
     manipulation and basic functionality
`DataObjectHandle<T>`: user class for handles, templated in type of object
     in store.

Usage
-----

Handles are declared in header file:

```c++
DataObjectHandle<TrackObject> m_trackHnd;
```

initialized in constructor of parent `Algorithm` / `AlgTool`:

```c++
m_trackHnd("/Event/Rec/Tracks", Gaudi::DataHandle::Reader, this),
```

declared as Property in constructor of parent `Algorithm` / `AlgTool`:

```c++
declareProperty("tracks", m_trackHnd, "the tracks");
```

after this, all dependency propagation is automatic.

`DataObjectHandles` have the following attributes that can be set at runtime via the jobOptions:
* Path : string path to location in EDS, eg "/Event/RAW/tracks"
* Mode : int matching Gaudi::DataHandle::Mode (should probably allow string too)
* Optional: bool, whether the object is optional
* AlternativePaths: string array of alternative paths in EDS

In order to maintain uniform syntax for all handle types, the "private only" constructor for ToolHandles has been reverted. Thus:

in header:
```c++
  ToolHandle<IMyTool> m_myPrivToolHandle;
  ToolHandle<IMyTool> m_myPubToolHandle;
```

in Algorithm constructor:
```c++
  m_myPrivToolHandle("MyTool/PrivToolHandle",this),
  m_myPubToolHandle("MyTool/PubToolHandle"),

  declareProperty("PrivToolHandle", m_myPrivToolHandle, "the private tool");
  declareProperty("PubToolHandle", m_myPubToolHandle, "the public tool");
```
no need for separate call for declareXXXTool

Also includes updates to GaudiHive for support of `DataObjID`.

Tests and examples have been updated for new `DataHandle` usage.
parents ce1274ce 6b9507ed
No related branches found
No related tags found
Loading
Showing
with 182 additions and 66 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment