| 1 |
/* |
| 2 |
* OBTQualCut.h |
| 3 |
* |
| 4 |
* Created on: 10-mar-2009 |
| 5 |
* Author: Nicola Mori |
| 6 |
*/ |
| 7 |
|
| 8 |
/*! @file OBTQualCut.h The OBTQualCut class definition file */ |
| 9 |
|
| 10 |
#ifndef OBTQUALCUT_H_ |
| 11 |
#define OBTQUALCUT_H_ |
| 12 |
|
| 13 |
#include "../../PamCutBase/PamCutBase.h" |
| 14 |
|
| 15 |
/*! @enum OBT_Return Return values for rejected events */ |
| 16 |
enum OBT_Return { |
| 17 |
OBT_NEWRUN, ///< Discarded because it is the first event of the run. |
| 18 |
OBT_INVALID ///< Discarded because the OBT is not valid. |
| 19 |
}; |
| 20 |
|
| 21 |
using std::numeric_limits; |
| 22 |
/*! @brief The On Board Time quality cut. |
| 23 |
* |
| 24 |
* This cut rejects events whose OBT is less than that of the previous event. |
| 25 |
* When a new run starts, the previous OBT is set to the current one and the |
| 26 |
* current event (ie., the first event of the run) is discarded. |
| 27 |
*/ |
| 28 |
class OBTQualCut: public PamCut { |
| 29 |
|
| 30 |
public: |
| 31 |
/*! @brief Constructor. */ |
| 32 |
OBTQualCut(const char *cutName) : |
| 33 |
PamCut(cutName), _previousOBT(numeric_limits<UInt_t>::max()), _previousRun(numeric_limits<UInt_t>::max()) { |
| 34 |
} |
| 35 |
/*! @brief Destructor. */ |
| 36 |
~OBTQualCut() { |
| 37 |
} |
| 38 |
|
| 39 |
/*! @brief The On Board Time quality check. |
| 40 |
* |
| 41 |
* @param event The event to analyze. |
| 42 |
* @return #CUTOK if OBT > previous OBT. |
| 43 |
* @return #OBT_NEWRUN if the event has been discarded since it is the first of the run |
| 44 |
* @return #OBT_INVALID if OBT < previous OBT |
| 45 |
*/ |
| 46 |
int Check(PamLevel2 *event); |
| 47 |
|
| 48 |
private: |
| 49 |
UInt_t _previousOBT; |
| 50 |
UInt_t _previousRun; |
| 51 |
|
| 52 |
}; |
| 53 |
|
| 54 |
#endif /* OBTQUALCUT_H_ */ |