PamCut: PamCutBase/PamCutBase.h Source File

- Main Page
- Classes
- Files

- File List
- File Members

# PamCutBase/PamCutBase.h

Go to the documentation of this file.

    00001 /*
    00002  * PamCutBase.h
    00003  *
    00004  *  Created on: 6-feb-2009
    00005  *      Author: Nicola Mori
    00006  */
    00007
    00010 #ifndef PAMCUTBASE_H_
    00011 #define PAMCUTBASE_H_
    00012
    00013 #include <PamLevel2.h>
    00014 #include "../CommonDefs.h"
    00015
    00016 using namespace std;
    00017
    00022 class PamCut {
    00023 public:
    00024
    00026   PamCut(const char *cutName) :
    00027     _cutName(cutName), _nEv(0), _nGood(0) {
    00028   }
    00029
    00031   virtual ~PamCut() {
    00032   }
    00033
    00044   virtual int Check(PamLevel2 *event) = 0;
    00045
    00055   virtual int ApplyCut(PamLevel2 *event);
    00056
    00067   virtual void Process(PamLevel2 *events, ULong_t firstEvent, ULong_t lastEvent);
    00068
    00076   virtual void OnGood(PamLevel2 *event) {
    00077   }
    00078
    00087   virtual void OnBad(PamLevel2 *event, int selectionResult) {
    00088   }
    00089
    00094   virtual UInt_t GetNEv() {
    00095     return _nEv;
    00096   }
    00104   virtual UInt_t GetNGood() {
    00105     return _nGood;
    00106   }
    00107
    00120   virtual void Setup(PamLevel2 *events);
    00121
    00128   virtual void Finalize() {
    00129   }
    00130
    00135   const char* GetName() const;
    00136
    00141   void SetName(const char *newName);
    00142
    00150   PamCut& operator=(const PamCut &rightValue);
    00151
    00152 private:
    00153
    00154   const char *_cutName;
    00155
    00156 protected:
    00157
    00158   UInt_t _nEv;
    00159   UInt_t _nGood;
    00160 };
    00161
    00171 class PamCutCollection: public PamCut {
    00172 public:
    00173
    00178   PamCutCollection(const char *collectionName) :
    00179     PamCut(collectionName) {
    00180   }
    00181
    00183   ~PamCutCollection() {
    00184   }
    00185
    00193   void AddCut(PamCut &cut);
    00194
    00203   int Check(PamLevel2 *event);
    00204
    00214   int ApplyCut(PamLevel2 *event);
    00215
    00224   PamCut *GetCut(unsigned int iCut);
    00225
    00230   unsigned int GetSize();
    00231
    00239   void Setup(PamLevel2 *events);
    00240
    00246   void Finalize();
    00247
    00257   PamCutCollection& operator=(const PamCutCollection &rightValue);
    00258
    00259 protected:
    00261   std::vector<PamCut*> _cuts;
    00262
    00263 };
    00264
    00265 #endif /* PAMCUTBASE_H_ */