1 |
pam-fi |
1.1 |
/* |
2 |
|
|
* TrackRedGeomCut.cpp |
3 |
|
|
* |
4 |
|
|
* Created on: 30-nov-2009 |
5 |
|
|
* Author: Sergio Ricciarini |
6 |
|
|
*/ |
7 |
|
|
|
8 |
|
|
/*! @file TrackRedGeomCut.cpp The TrackRedGeomCut class implementation file */ |
9 |
|
|
|
10 |
|
|
#include "TrackRedGeomCut.h" |
11 |
|
|
|
12 |
|
|
int TrackRedGeomCut::Check(PamLevel2 *event) { |
13 |
|
|
|
14 |
|
|
if ( (!(_xCaloAxis) || !(_yCaloAxis)) && !(_pamTrack) ) { // check that one of the two possible initializations has been correctly done |
15 |
|
|
return 0; |
16 |
|
|
} |
17 |
|
|
|
18 |
|
|
if (!(_pamTrack)) { // CALOAXIS track |
19 |
|
|
|
20 |
|
|
Double_t xCaloTrack; |
21 |
|
|
Double_t yCaloTrack; |
22 |
|
|
|
23 |
|
|
for (Int_t igf = 0; igf < TrkParams::nGF; igf++) { |
24 |
|
|
xCaloTrack = _xCaloAxis->par[0] + (_xCaloAxis->par[1]) * TrkParams::zGF[igf]; // cm |
25 |
|
|
if (! (- _xDim/2. < xCaloTrack && xCaloTrack < _xDim/2.) ) { |
26 |
|
|
return 0; |
27 |
|
|
} |
28 |
|
|
|
29 |
|
|
yCaloTrack = _yCaloAxis->par[0] + (_yCaloAxis->par[1]) * TrkParams::zGF[igf]; // cm |
30 |
|
|
if (! (- _yDim/2. < yCaloTrack && yCaloTrack < _yDim/2.) ) { |
31 |
|
|
return 0; |
32 |
|
|
} |
33 |
|
|
} |
34 |
|
|
|
35 |
|
|
} |
36 |
|
|
|
37 |
|
|
if (_pamTrack) { // PAMELA track |
38 |
|
|
|
39 |
|
|
TrkTrack *trkTrack = event->GetTrack(0)->GetTrkTrack(); |
40 |
|
|
|
41 |
|
|
for (int igf = 0; igf < TrkParams::nGF; igf++) { // loop on GF planes |
42 |
|
|
|
43 |
|
|
// check done for all 14 planes |
44 |
|
|
if (!(- _xDim/2. < trkTrack->xGF[igf] && trkTrack->xGF[igf] < _xDim/2.)) |
45 |
|
|
return 0; |
46 |
|
|
if (!(- _yDim/2. < trkTrack->yGF[igf] && trkTrack->yGF[igf] < _yDim/2.)) |
47 |
|
|
return 0; |
48 |
|
|
|
49 |
|
|
} // end loop on GF planes |
50 |
|
|
|
51 |
|
|
} |
52 |
|
|
|
53 |
|
|
return CUTOK; |
54 |
|
|
|
55 |
|
|
} |