1 |
pam-fi |
1.1 |
/* |
2 |
|
|
* LTQualCut.cpp |
3 |
|
|
* |
4 |
|
|
* Created on: 10-mar-2009 |
5 |
|
|
* Authors: Sergio Ricciarini, Nicola Mori |
6 |
|
|
*/ |
7 |
|
|
|
8 |
|
|
/*! @file LTQualCut.cpp The LTQualCut class implementation file */ |
9 |
|
|
|
10 |
|
|
#include "LTQualCut.h" |
11 |
|
|
|
12 |
|
|
int LTQualCut::Check(PamLevel2 *event) { |
13 |
|
|
// NOTE: run_id is not generally increasing with time. |
14 |
|
|
|
15 |
|
|
if (event->GetRunInfo()->ID != _previousRun) { |
16 |
|
|
_previousRun = event->GetRunInfo()->ID; |
17 |
|
|
_LT = -1.; |
18 |
|
|
return LT_NEWRUN; |
19 |
|
|
} |
20 |
|
|
|
21 |
|
|
_LT = 0.16 * (float) (event->GetTrigLevel2()->dltime[0]); // this gives LT in ms |
22 |
|
|
|
23 |
|
|
if (_LT < 0. || _LT >= _timeout) { |
24 |
|
|
return LT_INVALID; |
25 |
|
|
} |
26 |
|
|
|
27 |
|
|
return CUTOK; |
28 |
|
|
} |