1 |
/* |
2 |
* OBTQualCut.cpp |
3 |
* |
4 |
* Created on: 10-mar-2009 |
5 |
* Author: Sergio Ricciarini, Nicola Mori |
6 |
*/ |
7 |
|
8 |
/*! @file OBTQualCut.cpp The OBTQualCut class implementation file */ |
9 |
|
10 |
#include "OBTQualCut.h" |
11 |
|
12 |
int OBTQualCut::Check(PamLevel2 *event){ |
13 |
|
14 |
// Check first event; TO BE CHANGED BACK |
15 |
if (_previousRun==numeric_limits<UInt_t>::max()) { |
16 |
_previousRun = event->GetRunInfo()->ID; |
17 |
_previousOBT = event->GetOrbitalInfo()->OBT; |
18 |
return OBT_INVALID; |
19 |
} |
20 |
|
21 |
// Check run |
22 |
if (event->GetRunInfo()->ID != _previousRun){ // overwrite info on previous run and OBT |
23 |
_previousRun = event->GetRunInfo()->ID; |
24 |
_previousOBT = event->GetOrbitalInfo()->OBT; |
25 |
// return OBT_NEWRUN; TO BE CHANGED BACK |
26 |
return CUTOK; |
27 |
} |
28 |
|
29 |
// the run is the same as the previous event: check OBT |
30 |
|
31 |
// Check OBT |
32 |
if (event->GetOrbitalInfo()->OBT <= _previousOBT){ // invalid OBT: do not overwrite info on previous run and OBT |
33 |
return OBT_INVALID; |
34 |
} |
35 |
|
36 |
// The OBT is good: overwrite info on previous OBT |
37 |
_previousOBT = event->GetOrbitalInfo()->OBT; |
38 |
return CUTOK; |
39 |
|
40 |
} |