1 |
/* |
2 |
* TofTopS1Cut.cpp |
3 |
* |
4 |
* Created on: 13-mar-2009 |
5 |
* Author: Sergio Ricciarini, Nicola Mori |
6 |
*/ |
7 |
|
8 |
/*! @file TofTopS1Cut.cpp The TofTopS1Cut class implementation file */ |
9 |
|
10 |
#include "TofTopS1Cut.h" |
11 |
|
12 |
int TofTopS1Cut::Check(PamLevel2 *event) { |
13 |
|
14 |
// Array initialization |
15 |
for (int ipl = 0; ipl < 2; ipl++) { |
16 |
_nHitPmtPl[ipl] = 0; |
17 |
} |
18 |
|
19 |
Int_t pmtId = -1; |
20 |
Int_t layerId = 10; // valid values are 0 to 5 |
21 |
|
22 |
// Compute the number of hit PMT on each plane |
23 |
for (int ih = 0; ih < event->GetToFLevel2()->npmt(); ih++) { // Int_t mandatory |
24 |
pmtId = event->GetToFLevel2()->GetToFPMT(ih)->pmt_id; |
25 |
layerId = event->GetToFLevel2()->GetPlaneIndex(pmtId); |
26 |
if (0 <= layerId && layerId < 2) |
27 |
_nHitPmtPl[layerId]++; |
28 |
} |
29 |
|
30 |
// CUT on hit PMTs |
31 |
for (int ipl = 0; ipl < 2; ipl++) { // check done only for S1 layers |
32 |
if (!(_nHitPmtPl[ipl] < 3)) |
33 |
return 0; |
34 |
} |
35 |
|
36 |
return CUTOK; |
37 |
} |