PamCutCollection Class Reference

A class which applies a set of cuts to Pamela data. More...

#include <PamCutBase.h>

Inheritance diagram for PamCutCollection:

PamCut BlindCutCollection SmartCollection SmartBlindCollection VerboseCollection VerboseBlindCollection

List of all members.

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.
PamCutGetCut (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.
PamCutCollectionoperator= (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.


Detailed Description

A class which applies a set of cuts to Pamela data.

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.


Constructor & Destructor Documentation

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

Constructor.

Parameters:
collectionName The collection's name.


Member Function Documentation

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.

Parameters:
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().

Parameters:
event The event to analyze.
Returns:
same return values as Check().

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.

Parameters:
event The event to analyze.
Returns:
the index of the failed cut (range: [0, #cuts-1], see AddCut()); CUTOK if the event satisfies all the cuts.

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.

Parameters:
iCut The cut number, defined as the insertion order (from 0 to #cuts-1, see AddCut()).
Returns:
pointer to the iCut-th cut; NULL if the specified cut cannot be found or if no cuts are present.

unsigned int PamCutCollection::GetSize (  ) 

The number of cuts contained in the collection.

Returns:
The number of cuts

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=.

Parameters:
rightValue The RHS.
Returns:
The new value for LHS.

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.

Parameters:
events The PamLevel2 pointer to the events that will be analyzed. Unused, but required by the interface.

Reimplemented from PamCut.

Reimplemented in SmartCollection.


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

Generated on Fri Jun 5 15:09:03 2009 for PamCut by  doxygen 1.5.9