SmartCollection Class Reference

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

#include <SmartCollection.h>

Inheritance diagram for SmartCollection:

PamCutCollection PamCut VerboseCollection

List of all members.

Public Member Functions

 SmartCollection (const char *collectionName)
 Constructor.
 ~SmartCollection ()
 Destructor.
virtual void AddAction (CollectionAction &action)
 Adds an action to the SmartCollection.
CollectionActionGetAction (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 collection class designed to use CollectionAction objects.

The SmartCollection class is designed to handle CollectionAction objects. These defines the procedures to do when an event is selected or discarded. A SmartCollection 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.

Definition at line 26 of file SmartCollection.h.


Constructor & Destructor Documentation

SmartCollection::SmartCollection ( const char *  collectionName  )  [inline]

Constructor.

Parameters:
collectionName The collection's name.

Definition at line 34 of file SmartCollection.h.

SmartCollection::~SmartCollection (  )  [inline]

Destructor.

Definition at line 39 of file SmartCollection.h.


Member Function Documentation

void SmartCollection::AddAction ( CollectionAction action  )  [virtual]

Adds an action to the SmartCollection.

Definition at line 12 of file SmartCollection.cpp.

References _actions.

void SmartCollection::Finalize (  )  [virtual]

The post-analysis task definition.

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

Reimplemented from PamCutCollection.

Reimplemented in VerboseCollection.

Definition at line 33 of file SmartCollection.cpp.

References _actions.

CollectionAction * SmartCollection::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 SmartCollection.cpp.

References _actions.

void SmartCollection::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 PamCutCollection::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 SmartCollection.cpp.

References _actions.

void SmartCollection::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 PamCutCollection::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 SmartCollection.cpp.

References _actions.

void SmartCollection::Setup ( PamLevel2 *  events  )  [virtual]

The pre-analysis task definition.

This override of the Setup() method calls Setup() for the base class PamCutCollection, 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 SmartCollection.cpp.

References _actions.


Member Data Documentation

Definition at line 93 of file SmartCollection.h.

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


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

Generated on Wed May 27 15:21:43 2009 for PamCut by  doxygen 1.5.9