#include <SmartCollection.h>
Public Member Functions | |
SmartCollection (const char *collectionName) | |
Constructor. | |
~SmartCollection () | |
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 |
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.
SmartCollection::SmartCollection | ( | const char * | collectionName | ) | [inline] |
Constructor.
collectionName | The collection's name. |
Definition at line 34 of file SmartCollection.h.
SmartCollection::~SmartCollection | ( | ) | [inline] |
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.
iAction | The index of the desired CollectionAction, defined as the insertion order (from 0 to #actions-1, see AddAction()). |
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.
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.
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.
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.
std::vector<CollectionAction*> SmartCollection::_actions [private] |
Definition at line 93 of file SmartCollection.h.
Referenced by AddAction(), Finalize(), GetAction(), OnBad(), OnGood(), and Setup().