PamCut: SaveEventsAction Class Reference

# SaveEventsAction Class Reference

An action that saves the selected events. More...

`#include <SaveEventsAction.h>`

Inheritance diagram for SaveEventsAction:

List of all members.

## Public Member Functions
| SaveEventsAction (const char *actionName, TString outFileName, TString outOptions=TString(""))
| Constructor.
| ~SaveEventsAction ()
| Destructor.
void | Setup (PamLevel2 *events)
| The setup procedure.
void | OnGood (PamLevel2 *event)
| Fills the tree with the selected event.
void | Finalize ()
| Writes the tree of saved events to the output file.
## Private Attributes
TFile * | _outTreeFile
PamLevel2 * | _events
TString | _outOptions

## Detailed Description

An action that saves the selected events.

This action saves the selected events into a ROOT file.

Definition at line 19 of file SaveEventsAction.h.

## Constructor & Destructor Documentation

SaveEventsAction::SaveEventsAction | ( | const char * | actionName,
|  | TString | outFileName,
|  | TString | outOptions = `TString("")` |
| ) |  |  |

Constructor.

outOptions is to be passed as the argument of a PamLevel2::SetWhichTrees() call, so it must be encoded in a compatible format. See the PamLevel2 documentation.

Parameters:

  | actionName | The action's name.
  | outFileName | The output file name, with path (absolute or relative).
  | outOptions | The output options.

Definition at line 12 of file SaveEventsAction.cpp.

References _outTreeFile.

SaveEventsAction::~SaveEventsAction | ( |  | ) | `[inline]`

Destructor.

Definition at line 34 of file SaveEventsAction.h.

## Member Function Documentation

void SaveEventsAction::Finalize | ( |  | ) | `[virtual]`

Writes the tree of saved events to the output file.

Implements CollectionAction.

Definition at line 43 of file SaveEventsAction.cpp.

References _events, and _outTreeFile.

void SaveEventsAction::OnGood | ( | PamLevel2 * | event | ) | `[virtual]`

Fills the tree with the selected event.

Parameters:

  | event | The selected event.

Implements CollectionAction.

Definition at line 38 of file SaveEventsAction.cpp.

void SaveEventsAction::Setup | ( | PamLevel2 * | events | ) | `[virtual]`

The setup procedure.

This routine will set the trees to be saved, by calling PamLevel2::SetWhichTrees().

Parameters:

  | events | The events pointer.

Reimplemented from CollectionAction.

Definition at line 31 of file SaveEventsAction.cpp.

References _events, _outOptions, and _outTreeFile.

## Member Data Documentation

PamLevel2* SaveEventsAction::_events`[private]`

Definition at line 57 of file SaveEventsAction.h.

Referenced by Finalize(), and Setup().

TString SaveEventsAction::_outOptions`[private]`

Definition at line 58 of file SaveEventsAction.h.

Referenced by Setup().

TFile* SaveEventsAction::_outTreeFile`[private]`

Definition at line 56 of file SaveEventsAction.h.

Referenced by Finalize(), SaveEventsAction(), and Setup().

The documentation for this class was generated from the following files:

- CollectionActions/SaveEventsAction/SaveEventsAction.h
- CollectionActions/SaveEventsAction/SaveEventsAction.cpp