PamCut: PamCutCollection Class Reference

# PamCutCollection Class Reference

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

`#include <PamCutBase.h>`

Inheritance diagram for PamCutCollection:

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

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

Definition at line 171 of file PamCutBase.h.

## Constructor & Destructor Documentation

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

Constructor.

Parameters:

  | collectionName | The collection's name.

Definition at line 178 of file PamCutBase.h.

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

Destructor.

Definition at line 183 of file PamCutBase.h.

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

Definition at line 74 of file PamCutBase.cpp.

References _cuts.

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.

Definition at line 94 of file PamCutBase.cpp.

References _cuts, PamCut::_nEv, PamCut::_nGood, CUTOK, PamCut::OnBad(), and PamCut::OnGood().

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.

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.

Definition at line 78 of file PamCutBase.cpp.

References _cuts, and CUTOK.

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 SmartBlindCollection, SmartCollection, VerboseBlindCollection, and VerboseCollection.

Definition at line 146 of file PamCutBase.cpp.

References _cuts, and GetSize().

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.

Definition at line 116 of file PamCutBase.cpp.

References _cuts.

Referenced by VerboseCollection::Finalize(), and VerboseBlindCollection::Finalize().

unsigned int PamCutCollection::GetSize | ( |  | ) |

The number of cuts contained in the collection.

Returns:
  The number of cuts

Definition at line 125 of file PamCutBase.cpp.

References _cuts.

Referenced by Finalize(), VerboseCollection::Finalize(), VerboseBlindCollection::Finalize(), and Setup().

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.

Definition at line 130 of file PamCutBase.cpp.

References _cuts.

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 SmartBlindCollection, and SmartCollection.

Definition at line 137 of file PamCutBase.cpp.

References _cuts, and GetSize().

## Member Data Documentation

std::vector<PamCut*> PamCutCollection::_cuts`[protected]`

A vector containing pointers to PamCut objects.

Definition at line 261 of file PamCutBase.h.

Referenced by AddCut(), ApplyCut(), BlindCutCollection::ApplyCut(), Check(), BlindCutCollection::Check(), Finalize(), VerboseCollection::Finalize(), VerboseBlindCollection::Finalize(), GetCut(), GetSize(), operator=(), and Setup().

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

- PamCutBase/PamCutBase.h
- PamCutBase/PamCutBase.cpp