PamCut Class Reference

An abstract class to apply cuts to Pamela data. More...

#include <PamCutBase.h>

Inheritance diagram for PamCut:

AbsTimeCut CaloCrossCut CaloGeomCut CaloIonCut CaloNHitCut CaloNotIntCut CaloNucleiZCut CaloTrackChi2Cut CaloTrackCut CARDCut CATCut DataQualCut EvRateS11Cut GeoFieldCut LTGeoFillCut LTQualCut OBTQualCut PamCutCollection PktQualCut RigFillCut TofBetaCut TofBetaRangeCut TofBetaRigCut TofDedxS1Cut TofNucleiZCut TofPatternCut TofQualCut TofTopS1Cut TrgConfCut TrkCalQualCut TrkChi2DeflCut TrkChi2QualCut TrkDedxHCut TrkGeomCut TrkHitQualCut TrkIdCut TrkIonCut TrkNucleiZCut TrkPhSinCut TrkRigCut TrkRigGeoCut TrkRigRangeCut TrkRunValCut TrkSigmaDeflCut

List of all members.

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


Detailed Description

An abstract class to apply cuts to Pamela data.

This class provides a basic interface for a cut object to apply to PamLevel2 data.


Member Function Documentation

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

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

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.

Parameters:
event The event to analyze.
Returns:
CUTOK if the event satisfy the cut, other return values are implementation-specific.

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.

Returns:
The cut name.

virtual UInt_t PamCut::GetNEv (  )  [inline, virtual]

Returns the number of checked events.

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.

Returns:
The number of good events.

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.

See also:
OnGood
Parameters:
event The event which don't satisfy the cut.
selectionResult The return value of the Check() routine.

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

Parameters:
event The event which satisfy the cut.

Reimplemented in LTGeoFillCut, and RigFillCut.

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

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

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.

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

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

Parameters:
events The PamLevel2 pointer to the events that will be analyzed.
See also:
GetNEv(), GetNGood().

Reimplemented in SmartCollection, and PamCutCollection.


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