#include <PamCutBase.h>
Public Member Functions | |
PamCut (const char *cutName) | |
Constructor. | |
virtual | ~PamCut () |
Destructor. | |
virtual int | Check (PamLevel2 *event)=0 |
The basic event check. | |
virtual int | ApplyCut (PamLevel2 *event) |
Applies the cut to the current event. | |
virtual void | Process (PamLevel2 *events, ULong_t firstEvent, ULong_t lastEvent) |
Applies the cut to a range of events. | |
virtual void | OnGood (PamLevel2 *event) |
Post-selection tasks. | |
virtual void | OnBad (PamLevel2 *event, int selectionResult) |
Post-selection tasks. | |
virtual UInt_t | GetNEv () |
Returns the number of checked events. | |
virtual UInt_t | GetNGood () |
Returns the number of good events. | |
virtual void | Setup (PamLevel2 *events) |
The pre-analysis task definition. | |
virtual void | Finalize () |
The post-analysis task definition. | |
const char * | GetName () const |
Returns the cut name. | |
void | SetName (const char *newName) |
Changes the cut's name. | |
PamCut & | operator= (const PamCut &rightValue) |
The assignment operator. This operator defines how to copy a PamCut object into another. In current implementation, it only copies the cut's name of the RHS on the LHS. | |
Protected Attributes | |
UInt_t | _nEv |
The number of analyzed events. | |
UInt_t | _nGood |
The number of good events. |
This class provides a basic interface for a cut object to apply to PamLevel2 data.
int PamCut::ApplyCut | ( | PamLevel2 * | event | ) | [virtual] |
Applies the cut to the current event.
This routine applies the cut to the currently selected event, eg., it calls Check() and if the event satisfy the selection it consequently call OnGood(), otherwise it calls OnBad()(this is the only difference with Check()).
event | The event to analyze. |
Reimplemented in BlindCutCollection, SmartBlindCollection, SmartCollection, and PamCutCollection.
virtual int PamCut::Check | ( | PamLevel2 * | event | ) | [pure virtual] |
The basic event check.
This routine applies the cut to the currently selected event, eg., to the event selected by the last PamLevel2::GetEntry() call performed by the object pointed by event. Note that OnGood() is not called by this method.
event | The event to analyze. |
Implemented in CARDCut, CATCut, CaloCrossCut, CaloGeomCut, CaloIonCut, CaloNHitCut, CaloNotIntCut, CaloNucleiZCut, CaloTrackChi2Cut, CaloTrackCut, BlindCutCollection, AbsTimeCut, DataQualCut, EvRateS11Cut, GeoFieldCut, LTGeoFillCut, LTQualCut, OBTQualCut, PktQualCut, TrgConfCut, PamCutCollection, TofBetaCut, TofBetaRangeCut, TofBetaRigCut, TofDedxS1Cut, TofNucleiZCut, TofPatternCut, TofQualCut, TofTopS1Cut, RigFillCut, TrkCalQualCut, TrkChi2DeflCut, TrkChi2QualCut, TrkDedxHCut, TrkGeomCut, TrkHitQualCut, TrkIdCut, TrkIonCut, TrkNucleiZCut, TrkPhSinCut, TrkRigCut, TrkRigGeoCut, TrkRigRangeCut, TrkRunValCut, and TrkSigmaDeflCut.
virtual void PamCut::Finalize | ( | ) | [inline, virtual] |
The post-analysis task definition.
This method is automatically called by Process() after the event selection has been performed; override this in derived classes to perform post-analysis tasks like writing histograms, closing files and so on.
Reimplemented in SmartCollection, VerboseBlindCollection, VerboseCollection, and PamCutCollection.
const char * PamCut::GetName | ( | ) | const |
Returns the cut name.
virtual UInt_t PamCut::GetNEv | ( | ) | [inline, virtual] |
Returns the number of checked events.
virtual UInt_t PamCut::GetNGood | ( | ) | [inline, virtual] |
Returns the number of good events.
This counter keeps track of how many events have fulfilled the conditions specified in Check.
virtual void PamCut::OnBad | ( | PamLevel2 * | event, | |
int | selectionResult | |||
) | [inline, virtual] |
virtual void PamCut::OnGood | ( | PamLevel2 * | event | ) | [inline, virtual] |
Post-selection tasks.
Here the post-selection actions (histogram filling, parameter calculation etc.) can be defined. This routine is automatically called after a good event has been selected by ApplyCut().
event | The event which satisfy the cut. |
Reimplemented in LTGeoFillCut, and RigFillCut.
The assignment operator. This operator defines how to copy a PamCut object into another. In current implementation, it only copies the cut's name of the RHS on the LHS.
rightValue | The RHS. |
void PamCut::Process | ( | PamLevel2 * | events, | |
ULong_t | firstEvent, | |||
ULong_t | lastEvent | |||
) | [virtual] |
Applies the cut to a range of events.
This method resets the counters calling Reset() and then calls ApplyCut(PamLevel2 *event) for all the events in PamLevel2 argument inside the specified range. After checking all the events, it calls the private method _Finalize(), on which the tasks to be performed after the selection can be defined.
events | Pointer to PamLevel2 object which contains the events. | |
firstEvent | The first event to analyze. Possible values range from 0 to #events - 1. | |
lastEvent | The last event to analyze. |
void PamCut::SetName | ( | const char * | newName | ) |
Changes the cut's name.
newName | The new name. |
void PamCut::Setup | ( | PamLevel2 * | events | ) | [virtual] |
The pre-analysis task definition.
This method is automatically called by Process() before the event selection; override this in derived classes to perform pre-analysis tasks like opening files and so on. In this base class implementation it only resets the counters for examined and good events. The parameter PamLevel2 *events may serve to initialize the analysis (even if in this base class implementation it is unused), so the interface includes it.
events | The PamLevel2 pointer to the events that will be analyzed. |
Reimplemented in SmartCollection, and PamCutCollection.