#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. | |
Private Attributes | |
const char * | _cutName |
This class provides a basic interface for a cut object to apply to PamLevel2 data.
Definition at line 22 of file PamCutBase.h.
PamCut::PamCut | ( | const char * | cutName | ) | [inline] |
virtual PamCut::~PamCut | ( | ) | [inline, virtual] |
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, and PamCutCollection.
Definition at line 15 of file PamCutBase.cpp.
References _nEv, _nGood, Check(), CUTOK, OnBad(), and OnGood().
Referenced by Process().
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.
Referenced by ApplyCut().
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 SmartBlindCollection, SmartCollection, VerboseBlindCollection, VerboseCollection, and PamCutCollection.
Definition at line 128 of file PamCutBase.h.
Referenced by Process().
const char * PamCut::GetName | ( | ) | const |
Returns the cut name.
Definition at line 57 of file PamCutBase.cpp.
References _cutName.
Referenced by VerboseCollection::Finalize(), and VerboseBlindCollection::Finalize().
virtual UInt_t PamCut::GetNEv | ( | ) | [inline, virtual] |
Returns the number of checked events.
Definition at line 94 of file PamCutBase.h.
References _nEv.
Referenced by VerboseCollection::Finalize(), and VerboseBlindCollection::Finalize().
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.
Definition at line 104 of file PamCutBase.h.
References _nGood.
Referenced by VerboseCollection::Finalize(), and VerboseBlindCollection::Finalize().
virtual void PamCut::OnBad | ( | PamLevel2 * | event, | |
int | selectionResult | |||
) | [inline, virtual] |
Post-selection tasks.
The post-selection tasks for bad events (ie., not satisfying the cut) can be defined here.
event | The event which don't satisfy the cut. | |
selectionResult | The return value of the Check() routine. |
Reimplemented in SmartBlindCollection, and SmartCollection.
Definition at line 87 of file PamCutBase.h.
Referenced by PamCutCollection::ApplyCut(), ApplyCut(), and BlindCutCollection::ApplyCut().
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 SmartBlindCollection, SmartCollection, LTGeoFillCut, and RigFillCut.
Definition at line 76 of file PamCutBase.h.
Referenced by PamCutCollection::ApplyCut(), ApplyCut(), and BlindCutCollection::ApplyCut().
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. |
Definition at line 65 of file PamCutBase.cpp.
References _cutName.
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. |
Definition at line 30 of file PamCutBase.cpp.
References ApplyCut(), Finalize(), and Setup().
void PamCut::SetName | ( | const char * | newName | ) |
Changes the cut's name.
newName | The new name. |
Definition at line 61 of file PamCutBase.cpp.
References _cutName.
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 SmartBlindCollection, SmartCollection, and PamCutCollection.
Definition at line 53 of file PamCutBase.cpp.
Referenced by Process().
const char* PamCut::_cutName [private] |
UInt_t PamCut::_nEv [protected] |
The number of analyzed events.
Definition at line 158 of file PamCutBase.h.
Referenced by PamCutCollection::ApplyCut(), ApplyCut(), BlindCutCollection::ApplyCut(), GetNEv(), and Setup().
UInt_t PamCut::_nGood [protected] |
The number of good events.
Definition at line 159 of file PamCutBase.h.
Referenced by PamCutCollection::ApplyCut(), ApplyCut(), BlindCutCollection::ApplyCut(), GetNGood(), and Setup().