PamCut: SmartBlindCollection Class Reference

# SmartBlindCollection Class Reference

A blind collection class designed to use CollectionAction objects. More...

`#include <SmartBlindCollection.h>`

Inheritance diagram for SmartBlindCollection:

List of all members.

## Public Member Functions
| SmartBlindCollection (const char *collectionName)
| Constructor.
| ~SmartBlindCollection ()
| Destructor.
virtual void | AddAction (CollectionAction &action)
| Adds an action to the SmartCollection.
CollectionAction * | GetAction (unsigned int iAction)
| Returns the iAction-th action.
void | Setup (PamLevel2 *events)
| The pre-analysis task definition.
void | Finalize ()
| The post-analysis task definition.
void | OnGood (PamLevel2 *event)
| Post-selection tasks.
void | OnBad (PamLevel2 *event, int selectionResult)
| Post-selection tasks.
## Private Attributes
std::vector< CollectionAction * > | _actions

## Detailed Description

A blind collection class designed to use CollectionAction objects.

The SmartBlindCollection class is designed to handle CollectionAction objects. These defines the procedures to do when an event is selected or discarded. A SmartBlindCollection handles a vector of these objects, calling CollectionAction::OnGood() for each of them when a good event is selected and CollectionAction::OnBad() when a bad one is rejected. It will also call the CollectionAction::Setup() and CollectionAction::Finalize() methods at the beginning and at the end of the analysis, respectively. This collection differs from SmartCollection only because it-s blind, ie., it will apply all the cuts to each events, even if some of them fail. See BlindCutCollection to get more info about blind collections.

Definition at line 28 of file SmartBlindCollection.h.

## Constructor & Destructor Documentation

SmartBlindCollection::SmartBlindCollection | ( | const char * | collectionName | ) | `[inline]`

Constructor.

Parameters:

  | collectionName | The collection's name.

Definition at line 36 of file SmartBlindCollection.h.

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

Destructor.

Definition at line 41 of file SmartBlindCollection.h.

## Member Function Documentation

void SmartBlindCollection::AddAction | ( | CollectionAction & | action | ) | `[virtual]`

Adds an action to the SmartCollection.

Definition at line 12 of file SmartBlindCollection.cpp.

References _actions.

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

The post-analysis task definition.

This override of the Finalize() method calls BlindCutCollection::Finalize() and then the Finalize() method of each action contained in the SmartCollection.

Reimplemented from PamCutCollection.

Reimplemented in VerboseBlindCollection.

Definition at line 33 of file SmartBlindCollection.cpp.

References _actions.

CollectionAction * SmartBlindCollection::GetAction | ( | unsigned int | iAction | ) |

Returns the iAction-th action.

Parameters:

  | iAction | The index of the desired CollectionAction, defined as the insertion order (from 0 to #actions-1, see AddAction()).

Returns:
  pointer to the iAction-th action; NULL if the specified action cannot be found or if no actions are present.

Definition at line 16 of file SmartBlindCollection.cpp.

References _actions.

void SmartBlindCollection::OnBad | ( | PamLevel2 * | event,
|  | int | selectionResult |
| ) |  |  | `[virtual]`

Post-selection tasks.

This routine is automatically called after a bad event has been rejected by ApplyCut(). It will simply call BlindCutCollection::OnBad() and then CollectionAction::OnBad() for each action in the SmartCollection.

See also:
  OnGood

Parameters:

  | event | The event which don't satisfy the cut.
  | selectionResult | The return value of the Check() routine.

Reimplemented from PamCut.

Definition at line 49 of file SmartBlindCollection.cpp.

References _actions.

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

Post-selection tasks.

This routine is automatically called after a good event has been selected by ApplyCut(). It will simply call BlindCutCollection::OnGood() and then CollectionAction::OnGood() for each action in the SmartCollection.

Parameters:

  | event | The event which satisfy the cut.

Reimplemented from PamCut.

Definition at line 41 of file SmartBlindCollection.cpp.

References _actions.

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

The pre-analysis task definition.

This override of the Setup() method calls Setup() for the base class BlindCutCollection, and subsequently for each action contained in the SmartCollection.

Parameters:

  | events | The PamLevel2 pointer to the events that will be analyzed. Used only as parameter for CollectionAction::Setup().

Reimplemented from PamCutCollection.

Definition at line 25 of file SmartBlindCollection.cpp.

References _actions.

## Member Data Documentation

std::vector<CollectionAction*> SmartBlindCollection::_actions`[private]`

Definition at line 95 of file SmartBlindCollection.h.

Referenced by AddAction(), Finalize(), GetAction(), OnBad(), OnGood(), and Setup().

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

- Collections/SmartBlindCollection/SmartBlindCollection.h
- Collections/SmartBlindCollection/SmartBlindCollection.cpp