#include <PamCutBase.h>
Public Member Functions | |
PamCutCollection (const char *collectionName) | |
Constructor. | |
~PamCutCollection () | |
Destructor. | |
void | AddCut (PamCut &cut) |
Adds a cut to the cut collection This routine adds a cut to the collection. These are stored in a vector in the same order they are inserted (the first cut would be element 0, the second cut element 1 and so on). All the references to a "cut number" or "cut index" will refer to this numbering scheme. | |
int | Check (PamLevel2 *event) |
The basic selection. | |
int | ApplyCut (PamLevel2 *event) |
Applies the cuts to the current event. | |
PamCut * | GetCut (unsigned int iCut) |
Returns a pointer to the iCut-th cut. | |
unsigned int | GetSize () |
The number of cuts contained in the collection. | |
void | Setup (PamLevel2 *events) |
The pre-analysis task definition. | |
void | Finalize () |
The post-analysis task definition. | |
PamCutCollection & | operator= (const PamCutCollection &rightValue) |
Assignment operator redefinition. The assignment operator replaces the content of the LHS with that of RHS. The net effect would be that the cuts contained in the LHS are exactly the same that are in the RHS. In particular, this means that any modification to one of the cuts will propagate both to the LHS and RHS collections. Also the cut name will be copied, since the implementation invokes PamCut::operator=. | |
Protected Attributes | |
std::vector< PamCut * > | _cuts |
A vector containing pointers to PamCut objects. |
This is a multi-cut class, which inherits from PamCut. Indeed, a multi-cut can be seen as a cut composed by various simpler cuts; hence the interface of PamCut is also functional for PamCutCollection. The ApplyCut(PamLevel2 *event) method is overridden so as all the cuts that compose the PamCutCollection are applied to the events in the same order they are added to the collection. Instead, Process(PamLevel2 *events, ULong_t firstEvent, ULong_t lastEvent) is NOT overridden, since it performs the same task as the one in the base class: it is sufficient to override Check(PamLevel2 *event) to replace the single-cut evaluation with a multi-cut evaluation.
PamCutCollection::PamCutCollection | ( | const char * | collectionName | ) | [inline] |
Constructor.
collectionName | The collection's name. |
void PamCutCollection::AddCut | ( | PamCut & | cut | ) |
Adds a cut to the cut collection This routine adds a cut to the collection. These are stored in a vector in the same order they are inserted (the first cut would be element 0, the second cut element 1 and so on). All the references to a "cut number" or "cut index" will refer to this numbering scheme.
cut | The PamCut-derived object to add to the collection. |
int PamCutCollection::ApplyCut | ( | PamLevel2 * | event | ) | [virtual] |
Applies the cuts to the current event.
This routine works pretty much like the redefinition of Check(), calling ApplyCut() (instead of Check() )for each cut. If a cut fails, it calls OnBad(), passing the index of the failed cut as the selectionResult argument. If all the cuts are successful, it calls OnGood().
event | The event to analyze. |
Reimplemented from PamCut.
Reimplemented in BlindCutCollection, SmartBlindCollection, and SmartCollection.
int PamCutCollection::Check | ( | PamLevel2 * | event | ) | [virtual] |
The basic selection.
Like in the mother class, this method performs a basic check on the current event: it calls Check() for each cut previously added with AddCut(), exiting if one of them is not satisfied.
event | The event to analyze. |
Implements PamCut.
Reimplemented in BlindCutCollection.
void PamCutCollection::Finalize | ( | ) | [virtual] |
The post-analysis task definition.
This override of the Finalize() method calls PamCut::Finalize() and then the Finalize() method of each cut contained in the collection, in the same order.
Reimplemented from PamCut.
Reimplemented in SmartCollection, VerboseBlindCollection, and VerboseCollection.
PamCut * PamCutCollection::GetCut | ( | unsigned int | iCut | ) |
Returns a pointer to the iCut-th cut.
The return value of this method is a pointer to a PamCut object; hence, to use the specific method of derived cuts it must be cast to the proper cut class.
iCut | The cut number, defined as the insertion order (from 0 to #cuts-1, see AddCut()). |
unsigned int PamCutCollection::GetSize | ( | ) |
The number of cuts contained in the collection.
PamCutCollection & PamCutCollection::operator= | ( | const PamCutCollection & | rightValue | ) |
Assignment operator redefinition. The assignment operator replaces the content of the LHS with that of RHS. The net effect would be that the cuts contained in the LHS are exactly the same that are in the RHS. In particular, this means that any modification to one of the cuts will propagate both to the LHS and RHS collections. Also the cut name will be copied, since the implementation invokes PamCut::operator=.
rightValue | The RHS. |
void PamCutCollection::Setup | ( | PamLevel2 * | events | ) | [virtual] |
The pre-analysis task definition.
This override of the Setup() method calls Setup() for the base class PamCut, and subsequently for each cut contained in the collection, in the same order the cuts were added to the collection.
events | The PamLevel2 pointer to the events that will be analyzed. Unused, but required by the interface. |
Reimplemented from PamCut.
Reimplemented in SmartCollection.