1 |
/* |
2 |
* CaloIonCut.cpp |
3 |
* |
4 |
* Created on: 19-mar-2009 |
5 |
* Author: Sergio Ricciarini, Nicola Mori |
6 |
*/ |
7 |
|
8 |
/*! @file CaloIonCut.cpp The CaloCrossCut class implementation file */ |
9 |
|
10 |
#ifndef NO_CALOAXIS |
11 |
|
12 |
#include "CaloIonCut.h" |
13 |
|
14 |
int CaloIonCut::Check(PamLevel2 *event) { |
15 |
|
16 |
float q_xcaltrack_fp = 0., q_ycaltrack_fp = 0.; // Q for first plane with Q along the track larger than 0 |
17 |
|
18 |
for (unsigned int ipl=0; ipl<22; ipl++) { |
19 |
if (_xCaloAxis->GetQ(ipl) > 0) { |
20 |
q_xcaltrack_fp=_xCaloAxis->GetQ(ipl); |
21 |
break; |
22 |
} |
23 |
} |
24 |
|
25 |
for (unsigned int ipl=0; ipl<22; ipl++) { |
26 |
if (_yCaloAxis->GetQ(ipl) > 0) { |
27 |
q_ycaltrack_fp=_yCaloAxis->GetQ(ipl); |
28 |
break; |
29 |
} |
30 |
} |
31 |
|
32 |
if (! (_minRelease < q_xcaltrack_fp && q_xcaltrack_fp < _maxRelease && |
33 |
_minRelease < q_ycaltrack_fp && q_ycaltrack_fp < _maxRelease) ) { |
34 |
return 0; |
35 |
} |
36 |
|
37 |
return CUTOK; |
38 |
|
39 |
} |
40 |
|
41 |
#endif /* NO_CALOAXIS */ |